@icanbwell/baileyai-chat-ui 1.0.22 → 1.0.24
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/baileyai-chat-ui.cjs +2 -2
- package/dist/baileyai-chat-ui.css +1 -1
- package/dist/baileyai-chat-ui.js +518 -501
- package/dist/index.d.ts +4 -0
- package/package.json +1 -1
package/dist/baileyai-chat-ui.js
CHANGED
|
@@ -6,23 +6,23 @@ import * as h from "@radix-ui/react-dropdown-menu";
|
|
|
6
6
|
import * as g from "@radix-ui/react-tooltip";
|
|
7
7
|
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
8
8
|
//#region src/utils/pseudoToolCalls.ts
|
|
9
|
-
var b = "search_tools|call_tool|function_calls|function_result",
|
|
10
|
-
function
|
|
11
|
-
let t =
|
|
9
|
+
var b = "search_tools|call_tool|function_calls|function_result", x = RegExp(`<(${b})>([\\s\\S]*?)<\\/\\1>`, "g"), S = RegExp(`<(?:${b})>[\\s\\S]*$`), C = /<name>([\s\S]*?)<\/name>/, w = /<arguments>([\s\S]*?)<\/arguments>/, T = /<invoke\s+name="([^"]*)"\s*>([\s\S]*?)<\/invoke>/g, E = /<parameter\s+name="([^"]*)"\s*>([\s\S]*?)<\/parameter>/g;
|
|
10
|
+
function D(e) {
|
|
11
|
+
let t = C.exec(e)?.[1]?.trim() || "unknown_tool", n = w.exec(e)?.[1]?.trim();
|
|
12
12
|
return n ? {
|
|
13
13
|
name: t,
|
|
14
14
|
args: n
|
|
15
15
|
} : { name: t };
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function O(e) {
|
|
18
18
|
let t = [];
|
|
19
|
-
|
|
19
|
+
T.lastIndex = 0;
|
|
20
20
|
let n;
|
|
21
|
-
for (; (n =
|
|
21
|
+
for (; (n = T.exec(e)) !== null;) {
|
|
22
22
|
let [, e, r] = n, i = {};
|
|
23
|
-
|
|
23
|
+
E.lastIndex = 0;
|
|
24
24
|
let a;
|
|
25
|
-
for (; (a =
|
|
25
|
+
for (; (a = E.exec(r)) !== null;) i[a[1]] = a[2].trim();
|
|
26
26
|
let o = e.trim() || "unknown_tool";
|
|
27
27
|
t.push(Object.keys(i).length > 0 ? {
|
|
28
28
|
name: o,
|
|
@@ -31,14 +31,14 @@ function D(e) {
|
|
|
31
31
|
}
|
|
32
32
|
return t;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
let { hideOpenBlock: n = !0 } = t, r = [], i = e.replace(
|
|
34
|
+
function k(e, t = {}) {
|
|
35
|
+
let { hideOpenBlock: n = !0 } = t, r = [], i = e.replace(x, (e, t, n) => (t === "call_tool" ? r.push(D(n)) : t === "search_tools" ? r.push({
|
|
36
36
|
name: "search_tools",
|
|
37
37
|
args: n.trim()
|
|
38
|
-
}) : t === "function_calls" ? r.push(...
|
|
38
|
+
}) : t === "function_calls" ? r.push(...O(n)) : r.push({
|
|
39
39
|
name: "function_result",
|
|
40
40
|
args: n.trim()
|
|
41
|
-
}), "")), a = n ? i.replace(
|
|
41
|
+
}), "")), a = n ? i.replace(S, "") : i;
|
|
42
42
|
return r.length === 0 && a === i ? {
|
|
43
43
|
cleanedText: i,
|
|
44
44
|
matches: r
|
|
@@ -49,7 +49,7 @@ function O(e, t = {}) {
|
|
|
49
49
|
}
|
|
50
50
|
//#endregion
|
|
51
51
|
//#region src/logic/sse.ts
|
|
52
|
-
function
|
|
52
|
+
function ee(e) {
|
|
53
53
|
if (!e.startsWith("data: ")) return e;
|
|
54
54
|
let t = "";
|
|
55
55
|
for (let n of e.split("\n")) {
|
|
@@ -63,7 +63,7 @@ function te(e) {
|
|
|
63
63
|
}
|
|
64
64
|
return t || null;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function A(e) {
|
|
67
67
|
let t = e.replace(/\r\n/g, "\n").split("\n\n"), n = t.pop() ?? "", r = [], i = !1;
|
|
68
68
|
for (let e of t) {
|
|
69
69
|
let t = e.split("\n").filter((e) => e.length > 0), n = "message", a = [];
|
|
@@ -88,7 +88,7 @@ function k(e) {
|
|
|
88
88
|
message: e
|
|
89
89
|
});
|
|
90
90
|
} else if (c?.type === "response.output_text.delta" && typeof c.delta == "string") {
|
|
91
|
-
let e =
|
|
91
|
+
let e = ee(c.delta);
|
|
92
92
|
e && r.push({
|
|
93
93
|
type: "response.output_text.delta",
|
|
94
94
|
delta: e
|
|
@@ -106,27 +106,27 @@ function k(e) {
|
|
|
106
106
|
}
|
|
107
107
|
//#endregion
|
|
108
108
|
//#region src/utils/mapTranscript.ts
|
|
109
|
-
var
|
|
109
|
+
var j = {
|
|
110
110
|
inaccurate: !0,
|
|
111
111
|
unhelpful: !0,
|
|
112
112
|
unsafe: !0,
|
|
113
113
|
too_long: !0,
|
|
114
114
|
other: !0
|
|
115
|
-
},
|
|
116
|
-
function
|
|
115
|
+
}, M = (e) => Object.hasOwn(j, e) ? e : "other";
|
|
116
|
+
function N(e) {
|
|
117
117
|
if (!e || e.rating !== "up" && e.rating !== "down") return;
|
|
118
|
-
let t = (e.reasonCodes ?? []).map(
|
|
118
|
+
let t = (e.reasonCodes ?? []).map(M);
|
|
119
119
|
return {
|
|
120
120
|
rating: e.rating,
|
|
121
121
|
...t.length > 0 ? { reasonCodes: t } : {},
|
|
122
122
|
...e.comment ? { comment: e.comment } : {}
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function P(e) {
|
|
126
126
|
let t = [];
|
|
127
127
|
return e.messages.forEach((e, n) => {
|
|
128
128
|
if (e.hidden || e.role !== "user" && e.role !== "assistant") return;
|
|
129
|
-
let r = Date.parse(e.createdAt), i = Number.isNaN(r) ? void 0 : r, a = e.messageId || `loaded-${n}-${e.role}-${i ?? 0}`, o = e.role === "assistant" ?
|
|
129
|
+
let r = Date.parse(e.createdAt), i = Number.isNaN(r) ? void 0 : r, a = e.messageId || `loaded-${n}-${e.role}-${i ?? 0}`, o = e.role === "assistant" ? N(e.feedback) : void 0;
|
|
130
130
|
t.push({
|
|
131
131
|
id: a,
|
|
132
132
|
role: e.role,
|
|
@@ -138,14 +138,14 @@ function N(e) {
|
|
|
138
138
|
});
|
|
139
139
|
}), t;
|
|
140
140
|
}
|
|
141
|
-
var
|
|
142
|
-
function
|
|
143
|
-
let t = new Set(e.current.map(
|
|
141
|
+
var F = (e) => e.serverMessageId ?? e.id;
|
|
142
|
+
function te(e) {
|
|
143
|
+
let t = new Set(e.current.map(F)), n = e.earlier.filter((e) => !t.has(F(e)));
|
|
144
144
|
return n.length === 0 ? e.current : [...n, ...e.current];
|
|
145
145
|
}
|
|
146
146
|
//#endregion
|
|
147
147
|
//#region src/logic/conversationId.ts
|
|
148
|
-
function
|
|
148
|
+
function ne(e) {
|
|
149
149
|
let t = e.sub.trim();
|
|
150
150
|
if (!t) return !1;
|
|
151
151
|
let n = `${t}:`;
|
|
@@ -153,15 +153,15 @@ function re(e) {
|
|
|
153
153
|
}
|
|
154
154
|
//#endregion
|
|
155
155
|
//#region src/logic/conversationStorage.ts
|
|
156
|
-
var
|
|
157
|
-
function
|
|
156
|
+
var re = "baileyai-chat-ui:conversation";
|
|
157
|
+
function ie() {
|
|
158
158
|
return {
|
|
159
159
|
get: (e) => window.sessionStorage.getItem(e),
|
|
160
160
|
set: (e, t) => window.sessionStorage.setItem(e, t),
|
|
161
161
|
remove: (e) => window.sessionStorage.removeItem(e)
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function I() {
|
|
165
165
|
let e = /* @__PURE__ */ new Map();
|
|
166
166
|
return {
|
|
167
167
|
get: (t) => e.get(t) ?? null,
|
|
@@ -171,12 +171,12 @@ function F() {
|
|
|
171
171
|
}
|
|
172
172
|
//#endregion
|
|
173
173
|
//#region src/logic/useBaileyChat.ts
|
|
174
|
-
var
|
|
174
|
+
var ae = 200, oe = 100, se = 15e4, L = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `bailey-${Date.now()}-${Math.random().toString(36).slice(2)}`, ce = (e, t, n) => {
|
|
175
175
|
if (e === 401 || e === 403) return "Bailey isn't reachable with your current login.";
|
|
176
176
|
let r = `Bailey request failed (status ${e ?? "network error"}).`, i = (n || t || "").trim();
|
|
177
|
-
return i ? `${r} ${i.length >
|
|
177
|
+
return i ? `${r} ${i.length > ae ? `${i.slice(0, ae)}…` : i}` : r;
|
|
178
178
|
};
|
|
179
|
-
function
|
|
179
|
+
function le(e, t, n) {
|
|
180
180
|
if (e) try {
|
|
181
181
|
return e.get(t) || void 0;
|
|
182
182
|
} catch (e) {
|
|
@@ -184,92 +184,92 @@ function R(e, t, n) {
|
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function ue(e, t) {
|
|
188
188
|
t.signal.aborted || typeof e != "string" || (t.historyStatus = e);
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function de(e, t, n, r) {
|
|
191
191
|
try {
|
|
192
192
|
e?.set(t, n);
|
|
193
193
|
} catch (e) {
|
|
194
194
|
r(e, "write");
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function fe(e, t, n) {
|
|
198
198
|
try {
|
|
199
199
|
e?.remove(t);
|
|
200
200
|
} catch (e) {
|
|
201
201
|
n(e, "remove");
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
var
|
|
205
|
-
function
|
|
204
|
+
var R = (e, t) => t ? `${e}:${t}` : e;
|
|
205
|
+
function pe(e) {
|
|
206
206
|
let { seed: t, sub: n, storage: r, key: i, report: a } = e;
|
|
207
|
-
if (!n) return t ||
|
|
208
|
-
if (t &&
|
|
207
|
+
if (!n) return t || le(r, i, a);
|
|
208
|
+
if (t && ne({
|
|
209
209
|
conversationId: t,
|
|
210
210
|
sub: n
|
|
211
211
|
})) return t;
|
|
212
|
-
let o =
|
|
212
|
+
let o = le(r, i, a);
|
|
213
213
|
if (o) {
|
|
214
|
-
if (
|
|
214
|
+
if (ne({
|
|
215
215
|
conversationId: o,
|
|
216
216
|
sub: n
|
|
217
217
|
})) return o;
|
|
218
|
-
|
|
218
|
+
fe(r, i, a);
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
var
|
|
222
|
-
let [
|
|
221
|
+
var z = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i, firstUserMessagePrefix: o, onAssistantMessageComplete: c, idleTimeoutMs: l = se, client: p, conversationId: m, sub: h, storage: g, storageKey: _ = re, sendFullTranscript: v = !1, onStorageError: y, onContextLoss: b }) => {
|
|
222
|
+
let [x, S] = f([]), [C, w] = f([]), [T, E] = f(null), [D, O] = f("idle"), [ee, j] = f(null), M = h !== void 0 && h.trim() === "", N = M ? void 0 : h?.trim() || void 0, F = u(() => ie(), []), I = M ? null : g === void 0 ? F : g || null, ae = d(y), le = d(b);
|
|
223
223
|
s(() => {
|
|
224
|
-
|
|
224
|
+
ae.current = y, le.current = b;
|
|
225
225
|
}, [y, b]);
|
|
226
|
-
let
|
|
226
|
+
let z = a((e, t) => {
|
|
227
227
|
try {
|
|
228
|
-
|
|
228
|
+
ae.current?.(e, t);
|
|
229
229
|
} catch {}
|
|
230
|
-
}, []),
|
|
230
|
+
}, []), B = (e) => pe({
|
|
231
231
|
seed: m,
|
|
232
|
-
sub:
|
|
233
|
-
storage:
|
|
234
|
-
key:
|
|
232
|
+
sub: N,
|
|
233
|
+
storage: I,
|
|
234
|
+
key: R(_, N),
|
|
235
235
|
report: e
|
|
236
|
-
}), [
|
|
236
|
+
}), [V] = f(() => {
|
|
237
237
|
let e = [];
|
|
238
238
|
return {
|
|
239
|
-
id:
|
|
239
|
+
id: B((t, n) => void e.push({
|
|
240
240
|
error: t,
|
|
241
241
|
operation: n
|
|
242
242
|
})),
|
|
243
243
|
errors: e
|
|
244
244
|
};
|
|
245
|
-
}), [
|
|
246
|
-
W(!0),
|
|
247
|
-
}, [
|
|
245
|
+
}), [H, U] = f(V.id), [me, W] = f(V.errors.length > 0), G = a((e, t) => {
|
|
246
|
+
W(!0), z(e, t);
|
|
247
|
+
}, [z]);
|
|
248
248
|
s(() => {
|
|
249
|
-
|
|
250
|
-
}, [
|
|
251
|
-
|
|
252
|
-
}, [
|
|
253
|
-
let K = d(
|
|
254
|
-
storage:
|
|
255
|
-
key:
|
|
256
|
-
sub:
|
|
249
|
+
V.errors.forEach(({ error: e, operation: t }) => z(e, t));
|
|
250
|
+
}, [V, z]), s(() => {
|
|
251
|
+
M && z(/* @__PURE__ */ Error("sub is blank"), "key");
|
|
252
|
+
}, [M, z]);
|
|
253
|
+
let K = d(H), q = d({
|
|
254
|
+
storage: I,
|
|
255
|
+
key: R(_, N),
|
|
256
|
+
sub: N,
|
|
257
257
|
sendFullTranscript: v
|
|
258
258
|
});
|
|
259
259
|
s(() => {
|
|
260
260
|
q.current = {
|
|
261
|
-
storage:
|
|
262
|
-
key:
|
|
263
|
-
sub:
|
|
261
|
+
storage: I,
|
|
262
|
+
key: R(_, N),
|
|
263
|
+
sub: N,
|
|
264
264
|
sendFullTranscript: v
|
|
265
265
|
};
|
|
266
266
|
}, [
|
|
267
|
-
|
|
267
|
+
I,
|
|
268
268
|
_,
|
|
269
|
-
|
|
269
|
+
N,
|
|
270
270
|
v
|
|
271
271
|
]);
|
|
272
|
-
let he = g === !1 ? "off" : me ||
|
|
272
|
+
let he = g === !1 ? "off" : me || M ? "degraded" : "ok", [ge, _e] = f(!1), [ve, J] = f("idle"), [ye, be] = f(!1), Y = d(0), xe = d(null), Se = d(null), X = d(!1), Z = a(() => {
|
|
273
273
|
Y.current += 1, xe.current?.abort(), xe.current = null, Se.current = null, X.current = !1, be(!1), J("idle");
|
|
274
274
|
}, []), Ce = d(p);
|
|
275
275
|
s(() => {
|
|
@@ -277,8 +277,8 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
277
277
|
}, [p]), s(() => () => xe.current?.abort(), []);
|
|
278
278
|
let we = d(null), Te = d(""), Ee = d(0), De = d([]);
|
|
279
279
|
s(() => {
|
|
280
|
-
De.current =
|
|
281
|
-
}, [
|
|
280
|
+
De.current = x;
|
|
281
|
+
}, [x]);
|
|
282
282
|
let Q = d([]), Oe = d(/* @__PURE__ */ new Map()), ke = d(/* @__PURE__ */ new Map()), Ae = d(null), je = a(() => {
|
|
283
283
|
Ae.current !== null && (clearTimeout(Ae.current), Ae.current = null);
|
|
284
284
|
}, []), Me = a((e) => {
|
|
@@ -296,13 +296,13 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
296
296
|
else return;
|
|
297
297
|
if (n.heldId || e === K.current) return;
|
|
298
298
|
let { sub: r, storage: i, key: a } = q.current;
|
|
299
|
-
r && !
|
|
299
|
+
r && !ne({
|
|
300
300
|
conversationId: e,
|
|
301
301
|
sub: r
|
|
302
|
-
}) || (K.current = e,
|
|
302
|
+
}) || (K.current = e, U(e), de(i, a, e, G));
|
|
303
303
|
}, [G]), Ne = a((e, t, n, r) => {
|
|
304
304
|
let i = (e) => {
|
|
305
|
-
n.push(e),
|
|
305
|
+
n.push(e), w((t) => [...t, e]);
|
|
306
306
|
};
|
|
307
307
|
if (t.type === "response.output_text.delta") {
|
|
308
308
|
if (!t.delta) return !1;
|
|
@@ -311,8 +311,8 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
311
311
|
emittedCount: 0
|
|
312
312
|
};
|
|
313
313
|
n.raw += t.delta;
|
|
314
|
-
let { cleanedText: r, matches: a } =
|
|
315
|
-
if (n.emittedCount = a.length, Oe.current.set(e, n), ke.current.set(e, o),
|
|
314
|
+
let { cleanedText: r, matches: a } = k(n.raw), o = r.trim(), s = a.slice(n.emittedCount);
|
|
315
|
+
if (n.emittedCount = a.length, Oe.current.set(e, n), ke.current.set(e, o), S((t) => t.map((t) => t.id === e ? {
|
|
316
316
|
...t,
|
|
317
317
|
content: o
|
|
318
318
|
} : t)), s.length > 0) {
|
|
@@ -329,7 +329,7 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
329
329
|
}
|
|
330
330
|
if (t.type === "response.output_item.added" || t.type === "response.output_item.done") {
|
|
331
331
|
let n = t.item;
|
|
332
|
-
if (n.type === "output_image") return n.image_url &&
|
|
332
|
+
if (n.type === "output_image") return n.image_url && S((t) => t.map((t) => t.id === e ? {
|
|
333
333
|
...t,
|
|
334
334
|
parts: [...t.parts ?? [], {
|
|
335
335
|
type: "image",
|
|
@@ -388,22 +388,22 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
388
388
|
reportedId: t.response?.conversation?.id,
|
|
389
389
|
source: "event",
|
|
390
390
|
turn: r
|
|
391
|
-
}),
|
|
391
|
+
}), ue(t.response?.conversation?.history_status, r), !1;
|
|
392
392
|
if (t.type === "response.completed") {
|
|
393
393
|
$({
|
|
394
394
|
reportedId: t.response?.conversation?.id,
|
|
395
395
|
source: "event",
|
|
396
396
|
turn: r
|
|
397
|
-
}),
|
|
397
|
+
}), ue(t.response?.conversation?.history_status, r);
|
|
398
398
|
let n = typeof t.message_id == "string" && t.message_id ? t.message_id : void 0;
|
|
399
|
-
n &&
|
|
399
|
+
n && S((t) => t.map((t) => t.id === e ? {
|
|
400
400
|
...t,
|
|
401
401
|
serverMessageId: n
|
|
402
402
|
} : t));
|
|
403
403
|
let i = Oe.current.get(e);
|
|
404
404
|
if (i) {
|
|
405
|
-
let { cleanedText: t } =
|
|
406
|
-
n !== ke.current.get(e) && (ke.current.set(e, n),
|
|
405
|
+
let { cleanedText: t } = k(i.raw, { hideOpenBlock: !1 }), n = t.trim();
|
|
406
|
+
n !== ke.current.get(e) && (ke.current.set(e, n), S((t) => t.map((t) => t.id === e ? {
|
|
407
407
|
...t,
|
|
408
408
|
content: n
|
|
409
409
|
} : t)));
|
|
@@ -426,7 +426,7 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
426
426
|
turnSentAt: Ee.current
|
|
427
427
|
}), !0;
|
|
428
428
|
let { html: r, title: a, csp: o, permissions: s, prefersBorder: c, displayMode: l } = t;
|
|
429
|
-
return
|
|
429
|
+
return S((t) => t.map((t) => t.id === e ? {
|
|
430
430
|
...t,
|
|
431
431
|
parts: [...t.parts ?? [], {
|
|
432
432
|
type: "mcp_app",
|
|
@@ -448,7 +448,7 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
448
448
|
turnSentAt: Ee.current
|
|
449
449
|
}), !0;
|
|
450
450
|
}, [$]), Pe = a(async (a) => {
|
|
451
|
-
|
|
451
|
+
O("streaming"), j(null), _e(!1);
|
|
452
452
|
let s = Date.now();
|
|
453
453
|
Ee.current = s;
|
|
454
454
|
let l = L(), u = {
|
|
@@ -458,7 +458,7 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
458
458
|
streaming: !0,
|
|
459
459
|
createdAt: s
|
|
460
460
|
};
|
|
461
|
-
|
|
461
|
+
S((e) => [...e, u]), Q.current = [...a, u];
|
|
462
462
|
let d = a.findIndex((e) => e.role === "user" && !e.hidden), f = a.map((e, t) => t === d && o ? {
|
|
463
463
|
role: e.role,
|
|
464
464
|
content: `${o}${e.content}`,
|
|
@@ -470,7 +470,7 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
470
470
|
hidden: e.hidden,
|
|
471
471
|
titleHint: e.titleHint
|
|
472
472
|
}), { sendFullTranscript: p } = q.current, m = p ? void 0 : K.current, h = m ? f.slice(-1) : f;
|
|
473
|
-
|
|
473
|
+
E({
|
|
474
474
|
model: t,
|
|
475
475
|
systemPrompt: n,
|
|
476
476
|
messages: h,
|
|
@@ -489,8 +489,8 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
489
489
|
let _ = {
|
|
490
490
|
signal: g.signal,
|
|
491
491
|
heldId: m
|
|
492
|
-
}, v = "", y = null, b = !1,
|
|
493
|
-
|
|
492
|
+
}, v = "", y = null, b = !1, x = !1, C = !1, T = [], D = (e, t) => {
|
|
493
|
+
O("error"), j(e);
|
|
494
494
|
let n = {
|
|
495
495
|
kind: "error",
|
|
496
496
|
message: e,
|
|
@@ -498,8 +498,8 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
498
498
|
turnSentAt: s,
|
|
499
499
|
...t
|
|
500
500
|
};
|
|
501
|
-
|
|
502
|
-
},
|
|
501
|
+
T.push(n), w((e) => [...e, n]);
|
|
502
|
+
}, k = (e, t) => {
|
|
503
503
|
e.forEach((e) => {
|
|
504
504
|
if (e.type === "error") {
|
|
505
505
|
y = e.message;
|
|
@@ -509,11 +509,11 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
509
509
|
at: Date.now(),
|
|
510
510
|
turnSentAt: s
|
|
511
511
|
};
|
|
512
|
-
|
|
512
|
+
T.push(t), w((e) => [...e, t]);
|
|
513
513
|
return;
|
|
514
514
|
}
|
|
515
|
-
e.type === "response.output_text.delta" && e.delta && (
|
|
516
|
-
}), t && (b = !0,
|
|
515
|
+
e.type === "response.output_text.delta" && e.delta && (C = !0), Ne(l, e, T, _) && (x = !0);
|
|
516
|
+
}), t && (b = !0, S((e) => e.map((e) => e.id === l ? {
|
|
517
517
|
...e,
|
|
518
518
|
streaming: !1
|
|
519
519
|
} : e)));
|
|
@@ -534,10 +534,10 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
534
534
|
signal: g.signal,
|
|
535
535
|
onChunk: (e) => {
|
|
536
536
|
Me(g), v += e;
|
|
537
|
-
let { events: t, remainder: n, done: r } =
|
|
538
|
-
v = n,
|
|
537
|
+
let { events: t, remainder: n, done: r } = A(v);
|
|
538
|
+
v = n, k(t, r);
|
|
539
539
|
let i = Date.now();
|
|
540
|
-
|
|
540
|
+
E((e) => e && e.sentAt === s ? {
|
|
541
541
|
...e,
|
|
542
542
|
streamStats: {
|
|
543
543
|
chunkCount: e.streamStats.chunkCount + 1,
|
|
@@ -547,88 +547,88 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
547
547
|
} : e);
|
|
548
548
|
},
|
|
549
549
|
onRequestId: (e) => {
|
|
550
|
-
|
|
550
|
+
E((t) => t && t.sentAt === s ? {
|
|
551
551
|
...t,
|
|
552
552
|
requestId: e
|
|
553
553
|
} : t);
|
|
554
554
|
},
|
|
555
555
|
onMessageId: (e) => {
|
|
556
|
-
typeof e == "string" && e &&
|
|
556
|
+
typeof e == "string" && e && S((t) => t.map((t) => t.id === l ? {
|
|
557
557
|
...t,
|
|
558
558
|
serverMessageId: e
|
|
559
559
|
} : t));
|
|
560
560
|
}
|
|
561
561
|
});
|
|
562
562
|
if (v.trim()) {
|
|
563
|
-
let { events: e, done: t } =
|
|
564
|
-
v = "",
|
|
563
|
+
let { events: e, done: t } = A(`${v}\n\n`);
|
|
564
|
+
v = "", k(e, t);
|
|
565
565
|
}
|
|
566
566
|
if (y) {
|
|
567
|
-
|
|
567
|
+
O("error"), j(y);
|
|
568
568
|
return;
|
|
569
569
|
}
|
|
570
570
|
if (d === "timeout" && !b) {
|
|
571
|
-
|
|
571
|
+
D(u || "The assistant took too long to respond. Please try again.", { source: "client-timeout" });
|
|
572
572
|
return;
|
|
573
573
|
}
|
|
574
574
|
if (f && !b) {
|
|
575
|
-
|
|
575
|
+
D("The connection was interrupted before the answer finished. Try again.");
|
|
576
576
|
return;
|
|
577
577
|
}
|
|
578
578
|
if (a === void 0 || a >= 400) {
|
|
579
|
-
|
|
579
|
+
D(ce(a, o, u), {
|
|
580
580
|
httpStatus: a,
|
|
581
581
|
rawBody: o || void 0
|
|
582
582
|
});
|
|
583
583
|
return;
|
|
584
584
|
}
|
|
585
|
-
let p = _.reportedId,
|
|
586
|
-
if (m && !_.signal.aborted && (
|
|
587
|
-
K.current = void 0,
|
|
585
|
+
let p = _.reportedId, w = p !== m, ee = _.historyStatus === "failed" || _.historyStatus === "empty";
|
|
586
|
+
if (m && !_.signal.aborted && (w || ee)) {
|
|
587
|
+
K.current = void 0, U(void 0), fe(q.current.storage, q.current.key, G), Z(), _e(!0);
|
|
588
588
|
try {
|
|
589
|
-
|
|
589
|
+
le.current?.({
|
|
590
590
|
sentId: m,
|
|
591
591
|
...p ? { reportedId: p } : {},
|
|
592
|
-
reason:
|
|
592
|
+
reason: w ? "id" : "history"
|
|
593
593
|
});
|
|
594
594
|
} catch {}
|
|
595
595
|
}
|
|
596
|
-
if (!
|
|
597
|
-
|
|
596
|
+
if (!x) {
|
|
597
|
+
D("Bailey returned an empty response.");
|
|
598
598
|
return;
|
|
599
599
|
}
|
|
600
|
-
if (!
|
|
601
|
-
|
|
600
|
+
if (!C) {
|
|
601
|
+
D("Bailey ran some tools but didn't return an answer. Try asking again.");
|
|
602
602
|
return;
|
|
603
603
|
}
|
|
604
|
-
|
|
605
|
-
let
|
|
606
|
-
|
|
604
|
+
O("idle");
|
|
605
|
+
let M = ke.current.get(l) ?? "";
|
|
606
|
+
E((e) => e && e.sentAt === s ? {
|
|
607
607
|
...e,
|
|
608
|
-
response: { content:
|
|
608
|
+
response: { content: M }
|
|
609
609
|
} : e), c && await c({
|
|
610
610
|
id: l,
|
|
611
611
|
role: "assistant",
|
|
612
|
-
content:
|
|
612
|
+
content: M,
|
|
613
613
|
streaming: !1
|
|
614
|
-
},
|
|
614
|
+
}, T);
|
|
615
615
|
} catch (e) {
|
|
616
616
|
let t = e;
|
|
617
617
|
if (t?.name === "TimeoutError") {
|
|
618
|
-
|
|
618
|
+
D(t.message, { source: "client-timeout" });
|
|
619
619
|
return;
|
|
620
620
|
}
|
|
621
621
|
if (t?.name === "AbortError") {
|
|
622
|
-
|
|
622
|
+
O("idle");
|
|
623
623
|
return;
|
|
624
624
|
}
|
|
625
|
-
|
|
625
|
+
D(t?.message || "Bailey request failed.");
|
|
626
626
|
} finally {
|
|
627
627
|
je();
|
|
628
628
|
let e = ke.current.get(l) ?? "";
|
|
629
629
|
Oe.current.delete(l), ke.current.delete(l);
|
|
630
|
-
let t =
|
|
631
|
-
|
|
630
|
+
let t = T.some((e) => e.kind === "tool_start" || e.kind === "tool_end");
|
|
631
|
+
S((e) => e.flatMap((e) => e.id === l ? e.content || t ? [{
|
|
632
632
|
...e,
|
|
633
633
|
streaming: !1
|
|
634
634
|
}] : [] : [e])), Q.current = Q.current.flatMap((t) => t.id === l ? e ? [{
|
|
@@ -652,7 +652,7 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
652
652
|
G,
|
|
653
653
|
Z
|
|
654
654
|
]), Fe = a((e) => {
|
|
655
|
-
De.current = e,
|
|
655
|
+
De.current = e, S(e);
|
|
656
656
|
}, []), Ie = a((e) => {
|
|
657
657
|
let t = e.trim();
|
|
658
658
|
if (!t) return;
|
|
@@ -665,7 +665,7 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
665
665
|
}, r = [...Q.current, n];
|
|
666
666
|
Q.current = r, Fe([...De.current, n]), Pe(r);
|
|
667
667
|
}, [Pe, Fe]), Le = a((e, t) => {
|
|
668
|
-
if (
|
|
668
|
+
if (D === "streaming") return;
|
|
669
669
|
let n = e.trim();
|
|
670
670
|
if (!n) return;
|
|
671
671
|
Te.current = n;
|
|
@@ -678,10 +678,10 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
678
678
|
...r ? { titleHint: r } : {}
|
|
679
679
|
}, a = [...Q.current, i];
|
|
680
680
|
Q.current = a, Pe(a);
|
|
681
|
-
}, [Pe,
|
|
681
|
+
}, [Pe, D]), Re = a(() => {
|
|
682
682
|
we.current?.abort();
|
|
683
683
|
}, []), ze = a(() => {
|
|
684
|
-
if (
|
|
684
|
+
if (D === "streaming" || !Te.current) return;
|
|
685
685
|
let e = De.current, t = e[e.length - 1], n = t && t.role === "assistant" ? e.slice(0, -1) : e;
|
|
686
686
|
Fe(n);
|
|
687
687
|
let r = Q.current, i = r[r.length - 1], a = i && i.role === "assistant" ? r.slice(0, -1) : r;
|
|
@@ -689,45 +689,45 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
689
689
|
}, [
|
|
690
690
|
Pe,
|
|
691
691
|
Fe,
|
|
692
|
-
|
|
693
|
-
]), Be = a(() =>
|
|
694
|
-
|
|
692
|
+
D
|
|
693
|
+
]), Be = a(() => w([]), []), Ve = a(() => {
|
|
694
|
+
j(null), O((e) => e === "error" ? "idle" : e);
|
|
695
695
|
}, []), He = a(() => {
|
|
696
|
-
we.current?.abort(), Z(), _e(!1), Fe([]), Q.current = [],
|
|
696
|
+
we.current?.abort(), Z(), _e(!1), Fe([]), Q.current = [], w([]), E(null), O("idle"), j(null), Te.current = "";
|
|
697
697
|
}, [Z, Fe]), Ue = a(() => {
|
|
698
|
-
He(), K.current = void 0,
|
|
699
|
-
}, [He, G]), We = d(
|
|
698
|
+
He(), K.current = void 0, U(void 0), fe(q.current.storage, q.current.key, G);
|
|
699
|
+
}, [He, G]), We = d(N);
|
|
700
700
|
s(() => {
|
|
701
701
|
let e = We.current;
|
|
702
|
-
if (e ===
|
|
703
|
-
We.current =
|
|
704
|
-
let t =
|
|
705
|
-
K.current = t,
|
|
706
|
-
}, [
|
|
702
|
+
if (e === N) return;
|
|
703
|
+
We.current = N, e !== void 0 && He();
|
|
704
|
+
let t = B(G);
|
|
705
|
+
K.current = t, U(t);
|
|
706
|
+
}, [N]);
|
|
707
707
|
let Ge = a((e) => {
|
|
708
708
|
we.current?.abort();
|
|
709
709
|
let t = e.filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
|
|
710
710
|
...e,
|
|
711
711
|
streaming: !1
|
|
712
712
|
}));
|
|
713
|
-
Fe(t.filter((e) => !e.hidden)), Q.current = t,
|
|
713
|
+
Fe(t.filter((e) => !e.hidden)), Q.current = t, w([]), E(null), O("idle"), j(null), Te.current = "";
|
|
714
714
|
}, [Fe]), Ke = a((e) => {
|
|
715
715
|
Z(), Ge(e);
|
|
716
716
|
}, [Z, Ge]), qe = a((e) => {
|
|
717
|
-
K.current = e,
|
|
717
|
+
K.current = e, U(e), de(q.current.storage, q.current.key, e, G), _e(!1);
|
|
718
718
|
}, [G]), Je = a((e) => {
|
|
719
719
|
let t = e.hasMoreBefore && e.nextBeforeAbsoluteIndex !== null;
|
|
720
720
|
Se.current = t ? e.nextBeforeAbsoluteIndex : null, be(t);
|
|
721
721
|
}, []);
|
|
722
722
|
return {
|
|
723
|
-
conversationId:
|
|
723
|
+
conversationId: H,
|
|
724
724
|
persistence: he,
|
|
725
725
|
contextLost: ge,
|
|
726
|
-
messages:
|
|
727
|
-
traceEvents:
|
|
728
|
-
lastRequest:
|
|
729
|
-
status:
|
|
730
|
-
error:
|
|
726
|
+
messages: x,
|
|
727
|
+
traceEvents: C,
|
|
728
|
+
lastRequest: T,
|
|
729
|
+
status: D,
|
|
730
|
+
error: ee,
|
|
731
731
|
send: Ie,
|
|
732
732
|
sendHidden: Le,
|
|
733
733
|
stop: Re,
|
|
@@ -737,7 +737,7 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
737
737
|
newChat: Ue,
|
|
738
738
|
loadMessages: Ke,
|
|
739
739
|
loadConversation: a(async ({ conversationId: e }) => {
|
|
740
|
-
let t = Ce.current, { sub: n } = q.current, r = !!e && (!n ||
|
|
740
|
+
let t = Ce.current, { sub: n } = q.current, r = !!e && (!n || ne({
|
|
741
741
|
conversationId: e,
|
|
742
742
|
sub: n
|
|
743
743
|
}));
|
|
@@ -748,11 +748,11 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
748
748
|
try {
|
|
749
749
|
let n = await t.getConversation({
|
|
750
750
|
conversationId: e,
|
|
751
|
-
limit:
|
|
751
|
+
limit: oe,
|
|
752
752
|
signal: a.signal
|
|
753
753
|
});
|
|
754
754
|
if (i !== Y.current) return;
|
|
755
|
-
Ge(
|
|
755
|
+
Ge(P({ messages: n.messages })), qe(e), Je(n), J("idle");
|
|
756
756
|
} catch (e) {
|
|
757
757
|
if (i !== Y.current) return;
|
|
758
758
|
throw J("error"), e;
|
|
@@ -771,17 +771,17 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
771
771
|
try {
|
|
772
772
|
let a = await e.getConversation({
|
|
773
773
|
conversationId: t,
|
|
774
|
-
limit:
|
|
774
|
+
limit: oe,
|
|
775
775
|
beforeAbsoluteIndex: n,
|
|
776
776
|
signal: i.signal
|
|
777
777
|
});
|
|
778
778
|
if (r !== Y.current) return;
|
|
779
|
-
let o =
|
|
780
|
-
Q.current =
|
|
779
|
+
let o = P({ messages: a.messages });
|
|
780
|
+
Q.current = te({
|
|
781
781
|
current: Q.current,
|
|
782
782
|
earlier: o
|
|
783
|
-
}),
|
|
784
|
-
let t =
|
|
783
|
+
}), S((e) => {
|
|
784
|
+
let t = te({
|
|
785
785
|
current: e,
|
|
786
786
|
earlier: o
|
|
787
787
|
});
|
|
@@ -797,14 +797,14 @@ var B = ({ transport: e, model: t, instructions: n, tools: r = [], toolChoice: i
|
|
|
797
797
|
hasEarlier: ye,
|
|
798
798
|
historyStatus: ve
|
|
799
799
|
};
|
|
800
|
-
},
|
|
800
|
+
}, B = class extends Error {
|
|
801
801
|
status;
|
|
802
802
|
kind;
|
|
803
803
|
constructor(e) {
|
|
804
|
-
super(e.message ??
|
|
804
|
+
super(e.message ?? V(e), e.cause === void 0 ? void 0 : { cause: e.cause }), this.name = "BaileyApiError", this.status = e.status, this.kind = e.kind;
|
|
805
805
|
}
|
|
806
806
|
};
|
|
807
|
-
function
|
|
807
|
+
function V(e) {
|
|
808
808
|
switch (e.kind) {
|
|
809
809
|
case "http": return `Bailey request failed (status ${e.status})`;
|
|
810
810
|
case "timeout": return "Bailey request timed out";
|
|
@@ -813,12 +813,12 @@ function H(e) {
|
|
|
813
813
|
default: return "Bailey request failed (network error)";
|
|
814
814
|
}
|
|
815
815
|
}
|
|
816
|
-
var
|
|
816
|
+
var H = class extends Error {
|
|
817
817
|
operation;
|
|
818
818
|
constructor(e) {
|
|
819
819
|
super(`Bailey cleanup failed (${e.operation})`), this.name = "BaileyCleanupError", this.operation = e.operation;
|
|
820
820
|
}
|
|
821
|
-
},
|
|
821
|
+
}, U = (e) => e instanceof B ? e : new B({
|
|
822
822
|
status: 0,
|
|
823
823
|
kind: "network"
|
|
824
824
|
});
|
|
@@ -845,15 +845,15 @@ function me(e) {
|
|
|
845
845
|
}), _.current = r.nextCursor, m(r.nextCursor), u(null), c("idle");
|
|
846
846
|
} catch (e) {
|
|
847
847
|
if (n.signal.aborted) return;
|
|
848
|
-
u(
|
|
848
|
+
u(U(e)), c("error");
|
|
849
849
|
}
|
|
850
850
|
}, [t]);
|
|
851
851
|
s(() => {
|
|
852
852
|
if (n) return y("replace"), () => v.current?.abort();
|
|
853
853
|
}, [n, y]);
|
|
854
|
-
let b = a(() => y("replace"), [y]),
|
|
854
|
+
let b = a(() => y("replace"), [y]), x = a(async () => {
|
|
855
855
|
_.current !== null && await y("append");
|
|
856
|
-
}, [y]),
|
|
856
|
+
}, [y]), S = a(async ({ conversationId: e }) => {
|
|
857
857
|
let t = g.current.findIndex((t) => t.conversationId === e), n = t === -1 ? void 0 : {
|
|
858
858
|
row: g.current[t],
|
|
859
859
|
index: t
|
|
@@ -877,8 +877,8 @@ function me(e) {
|
|
|
877
877
|
error: l,
|
|
878
878
|
hasMore: p !== null,
|
|
879
879
|
refresh: b,
|
|
880
|
-
loadMore:
|
|
881
|
-
remove:
|
|
880
|
+
loadMore: x,
|
|
881
|
+
remove: S
|
|
882
882
|
};
|
|
883
883
|
}
|
|
884
884
|
//#endregion
|
|
@@ -980,11 +980,11 @@ function De(e) {
|
|
|
980
980
|
};
|
|
981
981
|
}
|
|
982
982
|
function Q(e) {
|
|
983
|
-
return e.timedOut() ? new
|
|
983
|
+
return e.timedOut() ? new B({
|
|
984
984
|
status: 0,
|
|
985
985
|
kind: "timeout",
|
|
986
986
|
cause: e.signal.reason
|
|
987
|
-
}) : new
|
|
987
|
+
}) : new B({
|
|
988
988
|
status: 0,
|
|
989
989
|
kind: "aborted"
|
|
990
990
|
});
|
|
@@ -995,7 +995,7 @@ function Oe(e) {
|
|
|
995
995
|
let s = e.fetch ?? ((e, t) => globalThis.fetch(e, t));
|
|
996
996
|
function c(t) {
|
|
997
997
|
try {
|
|
998
|
-
e.onCleanupError?.(new
|
|
998
|
+
e.onCleanupError?.(new H({ operation: t }));
|
|
999
999
|
} catch {}
|
|
1000
1000
|
}
|
|
1001
1001
|
function l(e) {
|
|
@@ -1014,7 +1014,7 @@ function Oe(e) {
|
|
|
1014
1014
|
...await n()
|
|
1015
1015
|
};
|
|
1016
1016
|
} catch {
|
|
1017
|
-
throw new
|
|
1017
|
+
throw new B({
|
|
1018
1018
|
status: 0,
|
|
1019
1019
|
kind: "network"
|
|
1020
1020
|
});
|
|
@@ -1030,18 +1030,18 @@ function Oe(e) {
|
|
|
1030
1030
|
signal: t.signal
|
|
1031
1031
|
});
|
|
1032
1032
|
} catch (e) {
|
|
1033
|
-
throw t.signal.aborted ? Q(t) : new
|
|
1033
|
+
throw t.signal.aborted ? Q(t) : new B({
|
|
1034
1034
|
status: 0,
|
|
1035
1035
|
kind: "network",
|
|
1036
1036
|
cause: e
|
|
1037
1037
|
});
|
|
1038
1038
|
}
|
|
1039
|
-
if (!i.ok) throw i.body?.cancel().catch(() => c("cancel-response-body")), new
|
|
1039
|
+
if (!i.ok) throw i.body?.cancel().catch(() => c("cancel-response-body")), new B({
|
|
1040
1040
|
status: i.status,
|
|
1041
1041
|
kind: "http"
|
|
1042
1042
|
});
|
|
1043
1043
|
if (i.status === 204) {
|
|
1044
|
-
if (e.requireJsonBody) throw new
|
|
1044
|
+
if (e.requireJsonBody) throw new B({
|
|
1045
1045
|
status: 204,
|
|
1046
1046
|
kind: "invalid-response"
|
|
1047
1047
|
});
|
|
@@ -1049,22 +1049,22 @@ function Oe(e) {
|
|
|
1049
1049
|
}
|
|
1050
1050
|
try {
|
|
1051
1051
|
let t = await i.json();
|
|
1052
|
-
if (e.requireJsonBody && (typeof t != "object" || !t || Array.isArray(t))) throw new
|
|
1052
|
+
if (e.requireJsonBody && (typeof t != "object" || !t || Array.isArray(t))) throw new B({
|
|
1053
1053
|
status: i.status,
|
|
1054
1054
|
kind: "invalid-response"
|
|
1055
1055
|
});
|
|
1056
1056
|
return t;
|
|
1057
1057
|
} catch (n) {
|
|
1058
|
-
if (n instanceof
|
|
1058
|
+
if (n instanceof B) throw n;
|
|
1059
1059
|
if (t.timedOut() || t.signal.aborted) throw Q(t);
|
|
1060
|
-
if (e.requireJsonBody) throw new
|
|
1060
|
+
if (e.requireJsonBody) throw new B({
|
|
1061
1061
|
status: i.status,
|
|
1062
1062
|
kind: "invalid-response"
|
|
1063
1063
|
});
|
|
1064
1064
|
return;
|
|
1065
1065
|
}
|
|
1066
1066
|
} catch (e) {
|
|
1067
|
-
throw e instanceof
|
|
1067
|
+
throw e instanceof B && l(e), e;
|
|
1068
1068
|
} finally {
|
|
1069
1069
|
t.dispose();
|
|
1070
1070
|
}
|
|
@@ -1126,7 +1126,7 @@ function Oe(e) {
|
|
|
1126
1126
|
h && e.onRequestId?.(h);
|
|
1127
1127
|
let g = m.headers.get(Se);
|
|
1128
1128
|
if (g && e.onMessageId?.(g), !m.ok) {
|
|
1129
|
-
l(new
|
|
1129
|
+
l(new B({
|
|
1130
1130
|
status: m.status,
|
|
1131
1131
|
kind: "http"
|
|
1132
1132
|
}));
|
|
@@ -1191,7 +1191,7 @@ function Oe(e) {
|
|
|
1191
1191
|
signal: e.signal,
|
|
1192
1192
|
requireJsonBody: !0
|
|
1193
1193
|
}));
|
|
1194
|
-
if (!n.conversation || typeof n.conversation != "object") throw new
|
|
1194
|
+
if (!n.conversation || typeof n.conversation != "object") throw new B({
|
|
1195
1195
|
status: 200,
|
|
1196
1196
|
kind: "invalid-response"
|
|
1197
1197
|
});
|
|
@@ -1496,17 +1496,19 @@ function dt(e, t) {
|
|
|
1496
1496
|
callId: r.callId,
|
|
1497
1497
|
toolName: e,
|
|
1498
1498
|
label: r.displayName || e,
|
|
1499
|
-
status: "running"
|
|
1499
|
+
status: "running",
|
|
1500
|
+
startOffsetMs: r.at - t
|
|
1500
1501
|
});
|
|
1501
1502
|
} else if (r.kind === "tool_end") {
|
|
1502
|
-
let e = $(r.name, r.args).name,
|
|
1503
|
-
|
|
1503
|
+
let e = $(r.name, r.args).name, i = r.isError ? "failed" : "done", a = n.find((t) => t.status === "running" && t.callId === r.callId && t.toolName === e);
|
|
1504
|
+
a ? (a.status = i, a.runtimeSeconds = r.runtimeSeconds, a.label = r.displayName || a.label) : n.push({
|
|
1504
1505
|
key: `step-${n.length}`,
|
|
1505
1506
|
callId: r.callId,
|
|
1506
1507
|
toolName: e,
|
|
1507
1508
|
label: r.displayName || e,
|
|
1508
|
-
status:
|
|
1509
|
-
runtimeSeconds: r.runtimeSeconds
|
|
1509
|
+
status: i,
|
|
1510
|
+
runtimeSeconds: r.runtimeSeconds,
|
|
1511
|
+
startOffsetMs: r.runtimeSeconds === void 0 ? void 0 : Math.max(0, r.at - t - r.runtimeSeconds * 1e3)
|
|
1510
1512
|
});
|
|
1511
1513
|
}
|
|
1512
1514
|
}
|
|
@@ -1514,45 +1516,45 @@ function dt(e, t) {
|
|
|
1514
1516
|
}
|
|
1515
1517
|
//#endregion
|
|
1516
1518
|
//#region src/styles.css?inline
|
|
1517
|
-
var ft = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-border-style:solid;--tw-leading:initial;--tw-space-y-reverse:0;--tw-outline-style:solid}}}@layer theme{:root,:host{--font-sans:\"Inter\", -apple-system, \"Segoe UI\", Roboto, Arial, sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-green-100:oklch(96.2% .044 156.743);--color-green-700:oklch(52.7% .154 150.069);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-700:oklch(48.8% .243 264.376);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-700:oklch(49.6% .265 301.924);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-medium:500;--font-weight-semibold:600;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--color-bailey-accent:#4f46e5;--color-bailey-bubble-bg:#fff;--color-bailey-error:#d32f2f;--color-bailey-border:#e5e5e5;--color-bailey-surface:#fff;--color-bailey-surface-muted:#f9fafb;--color-bailey-text:#000;--color-bailey-text-secondary:#6b6b6b;--color-bailey-tooltip-bg:#000;--color-bailey-tooltip-text:#fff;--color-bailey-page-bg:#eceef4;--color-bailey-heart:#16a34a}}@layer utilities;.bailey-chat-panel{box-sizing:border-box;background-color:var(--color-bailey-page-bg);height:100%;padding:calc(var(--spacing) * 3);font-family:var(--font-sans);flex-direction:column;display:flex;position:relative}.bailey-chat-panel-inner{width:100%;min-height:0;max-width:var(--container-3xl);gap:calc(var(--spacing) * 2);flex-direction:column;flex:1;margin-inline:auto;display:flex;overflow-y:auto}.bailey-chat-transcript{min-height:0;padding:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 4);flex:1;overflow-y:auto}.bailey-message-row{margin-bottom:calc(var(--spacing) * 3);justify-content:flex-start;display:flex}.bailey-message-row-user{justify-content:flex-end}.bailey-user-message{flex-direction:column;align-items:flex-end;max-width:75%;display:flex}.bailey-message-meta{margin-bottom:var(--spacing);align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-message-meta-name{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-bailey-text)}.bailey-user-bubble{border-radius:var(--radius-2xl);background-color:var(--color-bailey-bubble-bg);max-width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2);white-space:pre-wrap;color:var(--color-bailey-text);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.bailey-assistant-message{width:100%;padding-inline:var(--spacing)}.bailey-tool-result-image{margin-top:calc(var(--spacing) * 2);border-radius:var(--radius-lg);max-width:100%;height:auto;display:block}.bailey-mcp-app-frame{margin-top:calc(var(--spacing) * 2);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:0;width:100%;height:480px;display:block}.bailey-thinking-hint{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary);font-style:italic}.bailey-streaming-hint{margin-top:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);font-style:italic;display:block}.bailey-message-actions{margin-top:var(--spacing);align-items:center;gap:var(--spacing);flex-wrap:wrap;display:flex}.bailey-empty-state{text-align:center;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary);justify-content:center;align-items:center;display:flex}.bailey-suggestions{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 2);flex-direction:column;display:flex}.bailey-suggestions-title{padding-inline:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-bailey-text)}.bailey-suggestion-card{cursor:pointer;appearance:none;justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 2);border-radius:var(--radius-2xl);--tw-border-style:none;background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));border-style:none;display:flex}@media (hover:hover){.bailey-suggestion-card:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.bailey-suggestion-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4);color:var(--color-bailey-text-secondary);flex-shrink:0}.bailey-privacy-note{border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 4);padding-top:calc(var(--spacing) * 3);padding-bottom:var(--spacing);text-align:center;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary)}.bailey-privacy-note a{color:var(--color-bailey-text-secondary);text-decoration-line:underline}.bailey-tool-steps-live{margin-top:calc(var(--spacing) * 2);gap:calc(var(--spacing) * 2);flex-direction:column;display:flex}.bailey-activity-line{align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-activity-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4);color:var(--color-bailey-accent);flex-shrink:0}.bailey-step-spinner{height:calc(var(--spacing) * 3);width:calc(var(--spacing) * 3);border-style:var(--tw-border-style);border-width:2px;border-color:var(--color-bailey-border);border-top-color:var(--color-bailey-accent);border-radius:2147483647px;flex-shrink:0}@media (prefers-reduced-motion:no-preference){.bailey-step-spinner{animation:var(--animate-spin)}}.bailey-tool-steps-summary{margin-bottom:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary)}.bailey-tool-steps-summary>summary{cursor:pointer;-webkit-user-select:none;user-select:none}.bailey-tool-steps-list{margin:0;margin-top:var(--spacing);gap:var(--spacing);flex-direction:column;padding:0;list-style-type:none;display:flex}.bailey-tool-step{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-tool-step-failed{color:var(--color-bailey-error)}.bailey-error-banner{margin-bottom:calc(var(--spacing) * 2);justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 2);border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-error);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);color:var(--color-bailey-error);display:flex}.bailey-retry-button{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);background-color:#0000;border-style:none;text-decoration-line:underline}.bailey-error-actions{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-dismiss-button{cursor:pointer;appearance:none;--tw-border-style:none;color:var(--color-bailey-error);background-color:#0000;border-style:none}@media (hover:hover){.bailey-dismiss-button:hover{opacity:.7}}.bailey-input-area{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-input-row{align-items:center;gap:calc(var(--spacing) * 2);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);min-width:0;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);border-radius:2147483647px;flex:1;display:flex}.bailey-input-row:focus-within{border-color:var(--color-bailey-accent)}.bailey-input{--tw-border-style:none;min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);--tw-outline-style:none;background-color:#0000;border-style:none;outline-style:none;flex:1}.bailey-input:disabled{opacity:.5}.bailey-send-button,.bailey-stop-button{cursor:pointer;appearance:none;background-color:#0000;border-radius:2147483647px;flex-shrink:0;justify-content:center;align-items:center;display:flex}:is(.bailey-send-button,.bailey-stop-button):disabled{cursor:default;opacity:.4}.bailey-send-button{height:calc(var(--spacing) * 9);width:calc(var(--spacing) * 9);--tw-border-style:none;color:var(--color-bailey-heart);border-style:none}@media (hover:hover){.bailey-send-button:hover{background-color:#16a34a1a}@supports (color:color-mix(in lab, red, red)){.bailey-send-button:hover{background-color:color-mix(in oklab, var(--color-bailey-heart) 10%, transparent)}}}.bailey-send-icon{height:calc(var(--spacing) * 5);width:calc(var(--spacing) * 5)}.bailey-stop-button{height:calc(var(--spacing) * 9);width:calc(var(--spacing) * 9);--tw-border-style:none;color:var(--color-bailey-error);border-style:none}@media (hover:hover){.bailey-stop-button:hover{background-color:#d32f2f1a}@supports (color:color-mix(in lab, red, red)){.bailey-stop-button:hover{background-color:color-mix(in oklab, var(--color-bailey-error) 10%, transparent)}}}.bailey-stop-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4)}.bailey-copy-button{height:calc(var(--spacing) * 7);width:calc(var(--spacing) * 7);cursor:pointer;appearance:none;--tw-border-style:none;color:var(--color-bailey-text-secondary);background-color:#0000;border-style:none;border-radius:2147483647px;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-copy-button:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.bailey-copy-button:hover{background-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.bailey-copy-button:hover{color:var(--color-bailey-text)}}.bailey-copy-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4)}.bailey-tooltip-content{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));background-color:var(--color-bailey-tooltip-bg,#000);color:var(--color-bailey-tooltip-text,#fff);border-radius:.25rem}.bailey-menu-button{height:calc(var(--spacing) * 13);width:calc(var(--spacing) * 13);cursor:pointer;appearance:none;border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);color:var(--color-bailey-text);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);border-radius:2147483647px;flex-shrink:0;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-menu-button:hover{background-color:var(--color-gray-50)}}.bailey-menu-icon{height:calc(var(--spacing) * 5);width:calc(var(--spacing) * 5)}.bailey-menu-content{z-index:50;min-width:calc(var(--spacing) * 44);border-radius:var(--radius-2xl);background-color:var(--color-white);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-black);--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);font-family:var(--font-sans,\"Inter\", -apple-system, \"Segoe UI\", Roboto, Arial, sans-serif)}.bailey-menu-item{cursor:pointer;align-items:center;gap:calc(var(--spacing) * 3);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2);--tw-outline-style:none;outline-style:none;display:flex}.bailey-menu-item[data-highlighted]{background-color:var(--color-gray-100)}.bailey-menu-item-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4);color:var(--color-gray-600)}.bailey-tooltip-arrow{fill:var(--color-bailey-tooltip-bg,#000)}.bailey-markdown-content table{border-collapse:collapse;width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.bailey-markdown-content th{background-color:var(--color-bailey-surface-muted);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);text-align:left;--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content td{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);vertical-align:top}.bailey-markdown-content tr:nth-child(2n){background-color:var(--color-bailey-surface-muted)}.bailey-markdown-content{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.bailey-markdown-content>:first-child{margin-top:0}.bailey-markdown-content>:last-child{margin-bottom:0}.bailey-markdown-content p{margin-block:calc(var(--spacing) * 2)}.bailey-markdown-content h1{margin-top:calc(var(--spacing) * 4);margin-bottom:calc(var(--spacing) * 2);font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content h2{margin-top:calc(var(--spacing) * 4);margin-bottom:calc(var(--spacing) * 2);font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content h3{margin-top:calc(var(--spacing) * 3);margin-bottom:calc(var(--spacing) * 1.5);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content h4,.bailey-markdown-content h5,.bailey-markdown-content h6{margin-top:calc(var(--spacing) * 3);margin-bottom:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content ul{margin-block:calc(var(--spacing) * 2);list-style-type:disc}:where(.bailey-markdown-content ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}.bailey-markdown-content ul{padding-left:calc(var(--spacing) * 5)}.bailey-markdown-content ol{margin-block:calc(var(--spacing) * 2);list-style-type:decimal}:where(.bailey-markdown-content ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}.bailey-markdown-content ol{padding-left:calc(var(--spacing) * 5)}.bailey-markdown-content a{color:var(--color-bailey-accent);text-underline-offset:2px;text-decoration-line:underline}.bailey-markdown-content code{background-color:var(--color-bailey-surface-muted);padding-inline:var(--spacing);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);border-radius:.25rem;font-size:.85em}.bailey-markdown-content pre{margin-block:calc(var(--spacing) * 2);border-radius:var(--radius-md);background-color:var(--color-bailey-surface-muted);padding:calc(var(--spacing) * 2);overflow-x:auto}.bailey-markdown-content pre code{background-color:#0000;padding:0}.bailey-markdown-content blockquote{margin-block:calc(var(--spacing) * 2);border-left-style:var(--tw-border-style);border-left-width:2px;border-color:var(--color-bailey-border);padding-left:calc(var(--spacing) * 3);color:var(--color-bailey-text-secondary);font-style:italic}.bailey-markdown-content hr{margin-block:calc(var(--spacing) * 3);border-color:var(--color-bailey-border)}.bailey-trace-panel{margin-bottom:calc(var(--spacing) * 2)}.bailey-trace-toggle-row{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-trace-toggle{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-accent);background-color:#0000;border-style:none}@media (hover:hover){.bailey-trace-toggle:hover{text-decoration-line:underline}}.bailey-trace-toggle-error{color:var(--color-bailey-error)}.bailey-trace-summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary)}.bailey-trace-summary-error{color:var(--color-bailey-error)}.bailey-trace-body{margin-top:var(--spacing);max-height:calc(var(--spacing) * 80);overflow-y:auto}.bailey-trace-actions-row{justify-content:flex-end;gap:calc(var(--spacing) * 3);display:flex}.bailey-trace-copy-button{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-accent);background-color:#0000;border-style:none;text-decoration-line:underline}@media (hover:hover){.bailey-trace-copy-button:hover{text-decoration-line:none}}.bailey-trace-request-details{margin-bottom:var(--spacing);border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding:calc(var(--spacing) * 2)}.bailey-trace-request-meta{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:block}.bailey-trace-rows{gap:var(--spacing);flex-direction:column;display:flex}.bailey-trace-row{border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.bailey-trace-row-header{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.bailey-trace-row-time{color:var(--color-bailey-text-secondary)}.bailey-trace-row-gap{color:var(--color-gray-400)}.bailey-trace-row-summary{word-break:break-all}.bailey-trace-chip{padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-semibold);font-size:.65rem;font-weight:var(--font-weight-semibold);border-radius:.25rem}.bailey-trace-chip-default{background-color:var(--color-gray-200);color:var(--color-gray-700)}.bailey-trace-chip-info{background-color:var(--color-blue-100);color:var(--color-blue-700)}.bailey-trace-chip-success{background-color:var(--color-green-100);color:var(--color-green-700)}.bailey-trace-chip-secondary{background-color:var(--color-purple-100);color:var(--color-purple-700)}.bailey-trace-chip-error{background-color:var(--color-red-100);color:var(--color-bailey-error)}.bailey-trace-disclosure{margin-top:var(--spacing)}.bailey-trace-disclosure-summary{cursor:pointer;color:var(--color-bailey-text-secondary);font-size:.7rem}.bailey-trace-disclosure-actions{margin-top:var(--spacing);justify-content:flex-end;display:flex}.bailey-trace-disclosure-content{margin-top:var(--spacing);max-height:calc(var(--spacing) * 48);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface-muted);padding:calc(var(--spacing) * 1.5);word-break:break-all;white-space:pre-wrap;border-radius:.25rem;font-size:.7rem;overflow:auto}.bailey-trace-group{border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing)}.bailey-trace-group-summary{cursor:pointer;font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.bailey-trace-group-failed{margin-left:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error)}.bailey-feedback{align-items:center;gap:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text);flex-wrap:wrap;display:flex}.bailey-message-actions>.bailey-feedback{display:contents}.bailey-feedback-thumbs{margin-left:var(--spacing);align-items:center;gap:calc(var(--spacing) * .5);border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--color-bailey-border);padding-left:calc(var(--spacing) * 2);display:flex}.bailey-feedback-thumb{height:calc(var(--spacing) * 7);width:calc(var(--spacing) * 7);cursor:pointer;appearance:none;border-radius:var(--radius-lg);--tw-border-style:none;color:var(--color-bailey-text-secondary);background-color:#0000;border-style:none;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-feedback-thumb:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.bailey-feedback-thumb:hover{background-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.bailey-feedback-thumb:hover{color:var(--color-bailey-text)}}.bailey-feedback-thumb:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-feedback-thumb:disabled{cursor:default;opacity:.5}.bailey-feedback-thumb[aria-pressed=true]{background-color:#4f46e51a}@supports (color:color-mix(in lab, red, red)){.bailey-feedback-thumb[aria-pressed=true]{background-color:color-mix(in oklab, var(--color-bailey-accent) 10%, transparent)}}.bailey-feedback-thumb[aria-pressed=true]{color:var(--color-bailey-accent)}.bailey-feedback-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4)}.bailey-feedback-status{align-items:center;gap:calc(var(--spacing) * 1.5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:inline-flex}.bailey-feedback-status:empty{display:none}.bailey-feedback-spinner{height:calc(var(--spacing) * 3);width:calc(var(--spacing) * 3);animation:var(--animate-spin);border-style:var(--tw-border-style);border-width:2px;border-color:var(--color-bailey-border);border-top-color:var(--color-bailey-accent);border-radius:2147483647px;display:inline-block}.bailey-feedback-link{cursor:pointer;appearance:none;--tw-border-style:none;padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-accent);background-color:#0000;border-style:none;text-decoration-line:underline}.bailey-feedback-link:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-feedback-error{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error)}.bailey-feedback-form{margin-top:calc(var(--spacing) * 2);box-sizing:border-box;border-radius:var(--radius-xl);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);width:100%;padding:calc(var(--spacing) * 3);flex-basis:100%}.bailey-feedback-reasons{margin:0;margin-bottom:calc(var(--spacing) * 2);--tw-border-style:none;border-style:none;min-width:0;padding:0}.bailey-feedback-legend{margin-bottom:calc(var(--spacing) * 1.5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-bailey-text);padding:0;display:block}.bailey-feedback-chips{gap:calc(var(--spacing) * 1.5);flex-wrap:wrap;display:flex}.bailey-feedback-chip{cursor:pointer;appearance:none;border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text);border-radius:2147483647px}.bailey-feedback-chip:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-feedback-chip:disabled{cursor:default;opacity:.5}.bailey-feedback-chip[aria-pressed=true]{border-color:var(--color-bailey-accent);background-color:#4f46e51a}@supports (color:color-mix(in lab, red, red)){.bailey-feedback-chip[aria-pressed=true]{background-color:color-mix(in oklab, var(--color-bailey-accent) 10%, transparent)}}.bailey-feedback-chip[aria-pressed=true]{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-bailey-accent)}.bailey-feedback-textarea{box-sizing:border-box;min-height:calc(var(--spacing) * 18);resize:vertical;border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);width:100%;padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 2);font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text);display:block}.bailey-feedback-textarea:disabled{opacity:.5}.bailey-feedback-meta{margin-top:calc(var(--spacing) * 1.5);justify-content:space-between;align-items:flex-start;gap:calc(var(--spacing) * 3);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-feedback-buttons{margin-top:calc(var(--spacing) * 2.5);justify-content:flex-end;gap:calc(var(--spacing) * 2);display:flex}.bailey-feedback-button{cursor:pointer;appearance:none;border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text)}.bailey-feedback-button:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-feedback-button:disabled{cursor:default;opacity:.5}.bailey-feedback-button-primary{border-color:var(--color-bailey-accent);background-color:var(--color-bailey-accent);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-white)}.bailey-load-earlier{align-items:center;gap:var(--spacing);padding-bottom:calc(var(--spacing) * 2);flex-direction:column;display:flex}.bailey-load-earlier-button{cursor:pointer;appearance:none;border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text)}.bailey-load-earlier-button:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-load-earlier-button:disabled{cursor:default;opacity:.5}.bailey-load-earlier-error{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error)}.bailey-history-drawer{z-index:10;background-color:var(--color-bailey-surface);font-family:var(--font-sans);color:var(--color-bailey-text);border-radius:14px;flex-direction:column;display:flex;position:absolute;inset:0;overflow:hidden;container-type:inline-size}.bailey-history-header{align-items:center;gap:calc(var(--spacing) * 2);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);display:flex}.bailey-history-heading{text-overflow:ellipsis;white-space:nowrap;--tw-font-weight:var(--font-weight-semibold);min-width:0;font-size:15px;font-weight:var(--font-weight-semibold);--tw-outline-style:none;outline-style:none;flex:1;margin:0;overflow:hidden}.bailey-history-icon-button{height:calc(var(--spacing) * 11);width:calc(var(--spacing) * 11);cursor:pointer;appearance:none;border-radius:var(--radius-lg);--tw-border-style:none;color:var(--color-bailey-text-secondary);background-color:#0000;border-style:none;flex:none;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-history-icon-button:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.bailey-history-icon-button:hover{background-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.bailey-history-icon-button:hover{color:var(--color-bailey-text)}}.bailey-history-icon-button:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-history-icon-button:disabled{cursor:default;opacity:.5}.bailey-history-icon{width:18px;height:18px}.bailey-history-icon-small{height:calc(var(--spacing) * 3.5);width:calc(var(--spacing) * 3.5);flex:none}.bailey-history-button{min-height:calc(var(--spacing) * 11);cursor:pointer;appearance:none;justify-content:center;align-items:center;gap:calc(var(--spacing) * 1.5);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 1.5);white-space:nowrap;color:var(--color-bailey-text);font-size:13px;display:inline-flex}.bailey-history-button:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-history-button:disabled{cursor:default;opacity:.5}.bailey-history-button-primary{border-color:var(--color-bailey-accent);background-color:var(--color-bailey-accent);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-white)}.bailey-history-button-danger{border-color:var(--color-bailey-error);background-color:var(--color-bailey-error);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-white)}.bailey-history-button-small{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.bailey-history-body{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);flex:1;overflow-y:auto}.bailey-history-list{margin:0;padding:0;list-style-type:none}.bailey-history-row{border-radius:10px;flex-wrap:wrap;align-items:center;display:flex;position:relative}.bailey-history-row+.bailey-history-row{margin-top:calc(var(--spacing) * .5)}.bailey-history-row:not(.bailey-history-row-active):hover{background-color:var(--color-gray-100)}.bailey-history-row-active{box-shadow:inset 3px 0 0 var(--color-bailey-accent,#4f46e5);background-color:#4f46e514}.bailey-history-select{min-height:calc(var(--spacing) * 11);cursor:pointer;appearance:none;gap:calc(var(--spacing) * .5);--tw-border-style:none;min-width:0;padding-block:calc(var(--spacing) * 2.5);padding-right:calc(var(--spacing) * 2.5);padding-left:calc(var(--spacing) * 3);text-align:left;color:var(--color-bailey-text);background-color:#0000;border-style:none;border-radius:10px;flex-direction:column;flex:1;font-family:inherit;display:flex}.bailey-history-select:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-history-select:disabled{cursor:default;opacity:.6}.bailey-history-row-title{text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);overflow:hidden}.bailey-history-meta{align-items:center;gap:calc(var(--spacing) * 1.5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-history-meta>span+.bailey-history-count:before{content:\"·\";margin-right:.375rem}.bailey-history-current{--tw-font-weight:var(--font-weight-semibold);font-size:11px;font-weight:var(--font-weight-semibold);color:var(--color-bailey-accent)}.bailey-history-delete{margin-right:var(--spacing)}.bailey-history-row-confirming{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-red-200);background-color:var(--color-red-50)}.bailey-history-confirm{align-items:center;gap:calc(var(--spacing) * 2);min-width:0;padding-block:calc(var(--spacing) * 2);padding-right:calc(var(--spacing) * 2.5);padding-left:calc(var(--spacing) * 3);flex-wrap:wrap;flex:1;display:flex}.bailey-history-confirm-question{--tw-font-weight:var(--font-weight-semibold);min-width:7.5rem;font-size:13px;font-weight:var(--font-weight-semibold);flex:1}.bailey-history-confirm-title{text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);flex-basis:100%;overflow:hidden}.bailey-history-row-failed{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-red-200);background-color:#fff7f7}.bailey-history-row-error{align-items:center;gap:calc(var(--spacing) * 2);padding-inline:calc(var(--spacing) * 3);padding-bottom:calc(var(--spacing) * 2.5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error);flex-wrap:wrap;flex-basis:100%;display:flex}.bailey-history-state{align-items:center;gap:calc(var(--spacing) * 2);padding-inline:calc(var(--spacing) * 6);padding-block:calc(var(--spacing) * 12);text-align:center;color:var(--color-bailey-text-secondary);flex-direction:column;font-size:13px;display:flex}.bailey-history-state strong{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text)}.bailey-history-state-icon{height:calc(var(--spacing) * 7);width:calc(var(--spacing) * 7);color:var(--color-gray-400)}.bailey-history-state-error .bailey-history-state-icon{color:var(--color-bailey-error)}.bailey-history-more{padding-top:calc(var(--spacing) * 2.5);padding-bottom:calc(var(--spacing) * 1.5);justify-content:center;display:flex}.bailey-history-inline-error{justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error);flex-wrap:wrap;display:flex}.bailey-history-status{min-height:calc(var(--spacing) * 9);align-items:center;gap:calc(var(--spacing) * 2);border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface-muted);padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-history-skeleton{margin-inline:var(--spacing);margin-bottom:calc(var(--spacing) * 1.5);background:linear-gradient(90deg,#f1f1f4 25%,#e6e6ec 50%,#f1f1f4 75%) 0 0/200% 100%;border-radius:10px;height:52px;animation:1.3s infinite bailey-history-shimmer}.bailey-history-spinner{height:calc(var(--spacing) * 3);width:calc(var(--spacing) * 3);border-style:var(--tw-border-style);border-width:2px;border-color:var(--color-bailey-border);border-top-color:var(--color-bailey-accent,#4f46e5);border-radius:2147483647px;animation:.8s linear infinite bailey-history-rotate;display:inline-block}@keyframes bailey-history-shimmer{to{background-position:-200% 0}}@keyframes bailey-history-rotate{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.bailey-history-skeleton,.bailey-history-spinner{animation:none}}@container (width<=340px){.bailey-history-new-chat{width:calc(var(--spacing) * 11);padding-inline:0}.bailey-history-new-chat-text,.bailey-history-count{display:none}}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-outline-style{syntax:\"*\";inherits:false;initial-value:solid}@keyframes spin{to{transform:rotate(360deg)}}", pt = r(void 0), mt = /:root\s*,\s*:host\s*\{/, ht = ".bailey-chat-panel{";
|
|
1518
|
-
function
|
|
1519
|
+
var ft = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-border-style:solid;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-leading:initial;--tw-space-y-reverse:0;--tw-outline-style:solid}}}@layer theme{:root,:host{--font-sans:\"Inter\", -apple-system, \"Segoe UI\", Roboto, Arial, sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-green-100:oklch(96.2% .044 156.743);--color-green-700:oklch(52.7% .154 150.069);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-700:oklch(48.8% .243 264.376);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-700:oklch(49.6% .265 301.924);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-medium:500;--font-weight-semibold:600;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--color-bailey-accent:#4f46e5;--color-bailey-bubble-bg:#fff;--color-bailey-error:#d32f2f;--color-bailey-border:#e5e5e5;--color-bailey-surface:#fff;--color-bailey-surface-muted:#f9fafb;--color-bailey-text:#000;--color-bailey-text-secondary:#6b6b6b;--color-bailey-tooltip-bg:#000;--color-bailey-tooltip-text:#fff;--color-bailey-page-bg:#eceef4;--color-bailey-heart:#16a34a}}@layer utilities;.bailey-chat-panel{box-sizing:border-box;background-color:var(--color-bailey-page-bg);height:100%;padding:calc(var(--spacing) * 3);font-family:var(--font-sans);flex-direction:column;display:flex;position:relative}.bailey-chat-panel-inner{width:100%;min-height:0;max-width:var(--container-3xl);gap:calc(var(--spacing) * 2);flex-direction:column;flex:1;margin-inline:auto;display:flex;overflow-y:auto}.bailey-chat-transcript{min-height:0;padding:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 4);flex:1;overflow-y:auto}.bailey-message-row{margin-bottom:calc(var(--spacing) * 3);justify-content:flex-start;display:flex}.bailey-message-row-user{justify-content:flex-end}.bailey-user-message{flex-direction:column;align-items:flex-end;max-width:75%;display:flex}.bailey-message-meta{margin-bottom:var(--spacing);align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-message-meta-name{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-bailey-text)}.bailey-user-bubble{border-radius:var(--radius-2xl);background-color:var(--color-bailey-bubble-bg);max-width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2);white-space:pre-wrap;color:var(--color-bailey-text);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.bailey-assistant-message{width:100%;padding-inline:var(--spacing)}.bailey-tool-result-image{margin-top:calc(var(--spacing) * 2);border-radius:var(--radius-lg);max-width:100%;height:auto;display:block}.bailey-mcp-app-frame{margin-top:calc(var(--spacing) * 2);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:0;width:100%;height:480px;display:block}.bailey-thinking-hint{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary);font-style:italic}.bailey-streaming-hint{margin-top:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);font-style:italic;display:block}.bailey-message-actions{margin-top:var(--spacing);align-items:center;gap:var(--spacing);flex-wrap:wrap;display:flex}.bailey-empty-state{text-align:center;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary);justify-content:center;align-items:center;display:flex}.bailey-suggestions{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 2);flex-direction:column;display:flex}.bailey-suggestions-title{padding-inline:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-bailey-text)}.bailey-suggestion-card{cursor:pointer;appearance:none;justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 2);border-radius:var(--radius-2xl);--tw-border-style:none;background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));border-style:none;display:flex}@media (hover:hover){.bailey-suggestion-card:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.bailey-suggestion-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4);color:var(--color-bailey-text-secondary);flex-shrink:0}.bailey-privacy-note{border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 4);padding-top:calc(var(--spacing) * 3);padding-bottom:var(--spacing);text-align:center;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary)}.bailey-privacy-note a{color:var(--color-bailey-text-secondary);text-decoration-line:underline}.bailey-tool-steps-live{margin-top:calc(var(--spacing) * 2);gap:calc(var(--spacing) * 2);flex-direction:column;display:flex}.bailey-activity-line{align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-activity-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4);color:var(--color-bailey-accent);flex-shrink:0}.bailey-step-spinner{height:calc(var(--spacing) * 3);width:calc(var(--spacing) * 3);border-style:var(--tw-border-style);border-width:2px;border-color:var(--color-bailey-border);border-top-color:var(--color-bailey-accent);border-radius:2147483647px;flex-shrink:0}@media (prefers-reduced-motion:no-preference){.bailey-step-spinner{animation:var(--animate-spin)}}.bailey-tool-steps-summary{margin-bottom:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary)}.bailey-tool-steps-summary>summary{cursor:pointer;-webkit-user-select:none;user-select:none}.bailey-tool-steps-list{margin:0;margin-top:var(--spacing);gap:var(--spacing);flex-direction:column;padding:0;list-style-type:none;display:flex}.bailey-tool-step{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-tool-step-start{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.bailey-tool-step-failed{color:var(--color-bailey-error)}.bailey-error-banner{margin-bottom:calc(var(--spacing) * 2);justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 2);border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-error);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);color:var(--color-bailey-error);display:flex}.bailey-retry-button{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);background-color:#0000;border-style:none;text-decoration-line:underline}.bailey-error-actions{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-dismiss-button{cursor:pointer;appearance:none;--tw-border-style:none;color:var(--color-bailey-error);background-color:#0000;border-style:none}@media (hover:hover){.bailey-dismiss-button:hover{opacity:.7}}.bailey-input-area{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-input-row{align-items:center;gap:calc(var(--spacing) * 2);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);min-width:0;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);border-radius:2147483647px;flex:1;display:flex}.bailey-input-row:focus-within{border-color:var(--color-bailey-accent)}.bailey-input{--tw-border-style:none;min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);--tw-outline-style:none;background-color:#0000;border-style:none;outline-style:none;flex:1}.bailey-input:disabled{opacity:.5}.bailey-send-button,.bailey-stop-button{cursor:pointer;appearance:none;background-color:#0000;border-radius:2147483647px;flex-shrink:0;justify-content:center;align-items:center;display:flex}:is(.bailey-send-button,.bailey-stop-button):disabled{cursor:default;opacity:.4}.bailey-send-button{height:calc(var(--spacing) * 9);width:calc(var(--spacing) * 9);--tw-border-style:none;color:var(--color-bailey-heart);border-style:none}@media (hover:hover){.bailey-send-button:hover{background-color:#16a34a1a}@supports (color:color-mix(in lab, red, red)){.bailey-send-button:hover{background-color:color-mix(in oklab, var(--color-bailey-heart) 10%, transparent)}}}.bailey-send-icon{height:calc(var(--spacing) * 5);width:calc(var(--spacing) * 5)}.bailey-stop-button{height:calc(var(--spacing) * 9);width:calc(var(--spacing) * 9);--tw-border-style:none;color:var(--color-bailey-error);border-style:none}@media (hover:hover){.bailey-stop-button:hover{background-color:#d32f2f1a}@supports (color:color-mix(in lab, red, red)){.bailey-stop-button:hover{background-color:color-mix(in oklab, var(--color-bailey-error) 10%, transparent)}}}.bailey-stop-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4)}.bailey-copy-button{height:calc(var(--spacing) * 7);width:calc(var(--spacing) * 7);cursor:pointer;appearance:none;--tw-border-style:none;color:var(--color-bailey-text-secondary);background-color:#0000;border-style:none;border-radius:2147483647px;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-copy-button:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.bailey-copy-button:hover{background-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.bailey-copy-button:hover{color:var(--color-bailey-text)}}.bailey-copy-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4)}.bailey-tooltip-content{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));background-color:var(--color-bailey-tooltip-bg,#000);color:var(--color-bailey-tooltip-text,#fff);border-radius:.25rem}.bailey-menu-button{height:calc(var(--spacing) * 13);width:calc(var(--spacing) * 13);cursor:pointer;appearance:none;border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);color:var(--color-bailey-text);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);border-radius:2147483647px;flex-shrink:0;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-menu-button:hover{background-color:var(--color-gray-50)}}.bailey-menu-icon{height:calc(var(--spacing) * 5);width:calc(var(--spacing) * 5)}.bailey-menu-content{z-index:50;min-width:calc(var(--spacing) * 44);border-radius:var(--radius-2xl);background-color:var(--color-white);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-black);--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);font-family:var(--font-sans,\"Inter\", -apple-system, \"Segoe UI\", Roboto, Arial, sans-serif)}.bailey-menu-item{cursor:pointer;align-items:center;gap:calc(var(--spacing) * 3);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2);--tw-outline-style:none;outline-style:none;display:flex}.bailey-menu-item[data-highlighted]{background-color:var(--color-gray-100)}.bailey-menu-item-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4);color:var(--color-gray-600)}.bailey-tooltip-arrow{fill:var(--color-bailey-tooltip-bg,#000)}.bailey-markdown-content table{border-collapse:collapse;width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.bailey-markdown-content th{background-color:var(--color-bailey-surface-muted);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);text-align:left;--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content td{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);vertical-align:top}.bailey-markdown-content tr:nth-child(2n){background-color:var(--color-bailey-surface-muted)}.bailey-markdown-content{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.bailey-markdown-content>:first-child{margin-top:0}.bailey-markdown-content>:last-child{margin-bottom:0}.bailey-markdown-content p{margin-block:calc(var(--spacing) * 2)}.bailey-markdown-content h1{margin-top:calc(var(--spacing) * 4);margin-bottom:calc(var(--spacing) * 2);font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content h2{margin-top:calc(var(--spacing) * 4);margin-bottom:calc(var(--spacing) * 2);font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content h3{margin-top:calc(var(--spacing) * 3);margin-bottom:calc(var(--spacing) * 1.5);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content h4,.bailey-markdown-content h5,.bailey-markdown-content h6{margin-top:calc(var(--spacing) * 3);margin-bottom:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content ul{margin-block:calc(var(--spacing) * 2);list-style-type:disc}:where(.bailey-markdown-content ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}.bailey-markdown-content ul{padding-left:calc(var(--spacing) * 5)}.bailey-markdown-content ol{margin-block:calc(var(--spacing) * 2);list-style-type:decimal}:where(.bailey-markdown-content ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}.bailey-markdown-content ol{padding-left:calc(var(--spacing) * 5)}.bailey-markdown-content a{color:var(--color-bailey-accent);text-underline-offset:2px;text-decoration-line:underline}.bailey-markdown-content code{background-color:var(--color-bailey-surface-muted);padding-inline:var(--spacing);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);border-radius:.25rem;font-size:.85em}.bailey-markdown-content pre{margin-block:calc(var(--spacing) * 2);border-radius:var(--radius-md);background-color:var(--color-bailey-surface-muted);padding:calc(var(--spacing) * 2);overflow-x:auto}.bailey-markdown-content pre code{background-color:#0000;padding:0}.bailey-markdown-content blockquote{margin-block:calc(var(--spacing) * 2);border-left-style:var(--tw-border-style);border-left-width:2px;border-color:var(--color-bailey-border);padding-left:calc(var(--spacing) * 3);color:var(--color-bailey-text-secondary);font-style:italic}.bailey-markdown-content hr{margin-block:calc(var(--spacing) * 3);border-color:var(--color-bailey-border)}.bailey-trace-panel{margin-bottom:calc(var(--spacing) * 2)}.bailey-trace-toggle-row{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-trace-toggle{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-accent);background-color:#0000;border-style:none}@media (hover:hover){.bailey-trace-toggle:hover{text-decoration-line:underline}}.bailey-trace-toggle-error{color:var(--color-bailey-error)}.bailey-trace-summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary)}.bailey-trace-summary-error{color:var(--color-bailey-error)}.bailey-trace-body{margin-top:var(--spacing);max-height:calc(var(--spacing) * 80);overflow-y:auto}.bailey-trace-actions-row{justify-content:flex-end;gap:calc(var(--spacing) * 3);display:flex}.bailey-trace-copy-button{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-accent);background-color:#0000;border-style:none;text-decoration-line:underline}@media (hover:hover){.bailey-trace-copy-button:hover{text-decoration-line:none}}.bailey-trace-request-details{margin-bottom:var(--spacing);border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding:calc(var(--spacing) * 2)}.bailey-trace-request-meta{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:block}.bailey-trace-rows{gap:var(--spacing);flex-direction:column;display:flex}.bailey-trace-row{border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.bailey-trace-row-header{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.bailey-trace-row-time{color:var(--color-bailey-text-secondary)}.bailey-trace-row-gap{color:var(--color-gray-400)}.bailey-trace-row-summary{word-break:break-all}.bailey-trace-chip{padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-semibold);font-size:.65rem;font-weight:var(--font-weight-semibold);border-radius:.25rem}.bailey-trace-chip-default{background-color:var(--color-gray-200);color:var(--color-gray-700)}.bailey-trace-chip-info{background-color:var(--color-blue-100);color:var(--color-blue-700)}.bailey-trace-chip-success{background-color:var(--color-green-100);color:var(--color-green-700)}.bailey-trace-chip-secondary{background-color:var(--color-purple-100);color:var(--color-purple-700)}.bailey-trace-chip-error{background-color:var(--color-red-100);color:var(--color-bailey-error)}.bailey-trace-disclosure{margin-top:var(--spacing)}.bailey-trace-disclosure-summary{cursor:pointer;color:var(--color-bailey-text-secondary);font-size:.7rem}.bailey-trace-disclosure-actions{margin-top:var(--spacing);justify-content:flex-end;display:flex}.bailey-trace-disclosure-content{margin-top:var(--spacing);max-height:calc(var(--spacing) * 48);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface-muted);padding:calc(var(--spacing) * 1.5);word-break:break-all;white-space:pre-wrap;border-radius:.25rem;font-size:.7rem;overflow:auto}.bailey-trace-group{border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing)}.bailey-trace-group-summary{cursor:pointer;font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.bailey-trace-group-failed{margin-left:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error)}.bailey-feedback{align-items:center;gap:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text);flex-wrap:wrap;display:flex}.bailey-message-actions>.bailey-feedback{display:contents}.bailey-feedback-thumbs{margin-left:var(--spacing);align-items:center;gap:calc(var(--spacing) * .5);border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--color-bailey-border);padding-left:calc(var(--spacing) * 2);display:flex}.bailey-feedback-thumb{height:calc(var(--spacing) * 7);width:calc(var(--spacing) * 7);cursor:pointer;appearance:none;border-radius:var(--radius-lg);--tw-border-style:none;color:var(--color-bailey-text-secondary);background-color:#0000;border-style:none;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-feedback-thumb:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.bailey-feedback-thumb:hover{background-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.bailey-feedback-thumb:hover{color:var(--color-bailey-text)}}.bailey-feedback-thumb:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-feedback-thumb:disabled{cursor:default;opacity:.5}.bailey-feedback-thumb[aria-pressed=true]{background-color:#4f46e51a}@supports (color:color-mix(in lab, red, red)){.bailey-feedback-thumb[aria-pressed=true]{background-color:color-mix(in oklab, var(--color-bailey-accent) 10%, transparent)}}.bailey-feedback-thumb[aria-pressed=true]{color:var(--color-bailey-accent)}.bailey-feedback-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4)}.bailey-feedback-status{align-items:center;gap:calc(var(--spacing) * 1.5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:inline-flex}.bailey-feedback-status:empty{display:none}.bailey-feedback-spinner{height:calc(var(--spacing) * 3);width:calc(var(--spacing) * 3);animation:var(--animate-spin);border-style:var(--tw-border-style);border-width:2px;border-color:var(--color-bailey-border);border-top-color:var(--color-bailey-accent);border-radius:2147483647px;display:inline-block}.bailey-feedback-link{cursor:pointer;appearance:none;--tw-border-style:none;padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-accent);background-color:#0000;border-style:none;text-decoration-line:underline}.bailey-feedback-link:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-feedback-error{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error)}.bailey-feedback-form{margin-top:calc(var(--spacing) * 2);box-sizing:border-box;border-radius:var(--radius-xl);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);width:100%;padding:calc(var(--spacing) * 3);flex-basis:100%}.bailey-feedback-reasons{margin:0;margin-bottom:calc(var(--spacing) * 2);--tw-border-style:none;border-style:none;min-width:0;padding:0}.bailey-feedback-legend{margin-bottom:calc(var(--spacing) * 1.5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-bailey-text);padding:0;display:block}.bailey-feedback-chips{gap:calc(var(--spacing) * 1.5);flex-wrap:wrap;display:flex}.bailey-feedback-chip{cursor:pointer;appearance:none;border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text);border-radius:2147483647px}.bailey-feedback-chip:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-feedback-chip:disabled{cursor:default;opacity:.5}.bailey-feedback-chip[aria-pressed=true]{border-color:var(--color-bailey-accent);background-color:#4f46e51a}@supports (color:color-mix(in lab, red, red)){.bailey-feedback-chip[aria-pressed=true]{background-color:color-mix(in oklab, var(--color-bailey-accent) 10%, transparent)}}.bailey-feedback-chip[aria-pressed=true]{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-bailey-accent)}.bailey-feedback-textarea{box-sizing:border-box;min-height:calc(var(--spacing) * 18);resize:vertical;border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);width:100%;padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 2);font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text);display:block}.bailey-feedback-textarea:disabled{opacity:.5}.bailey-feedback-meta{margin-top:calc(var(--spacing) * 1.5);justify-content:space-between;align-items:flex-start;gap:calc(var(--spacing) * 3);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-feedback-buttons{margin-top:calc(var(--spacing) * 2.5);justify-content:flex-end;gap:calc(var(--spacing) * 2);display:flex}.bailey-feedback-button{cursor:pointer;appearance:none;border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text)}.bailey-feedback-button:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-feedback-button:disabled{cursor:default;opacity:.5}.bailey-feedback-button-primary{border-color:var(--color-bailey-accent);background-color:var(--color-bailey-accent);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-white)}.bailey-load-earlier{align-items:center;gap:var(--spacing);padding-bottom:calc(var(--spacing) * 2);flex-direction:column;display:flex}.bailey-load-earlier-button{cursor:pointer;appearance:none;border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text)}.bailey-load-earlier-button:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-load-earlier-button:disabled{cursor:default;opacity:.5}.bailey-load-earlier-error{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error)}.bailey-history-drawer{z-index:10;background-color:var(--color-bailey-surface);font-family:var(--font-sans);color:var(--color-bailey-text);border-radius:14px;flex-direction:column;display:flex;position:absolute;inset:0;overflow:hidden;container-type:inline-size}.bailey-history-header{align-items:center;gap:calc(var(--spacing) * 2);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);display:flex}.bailey-history-heading{text-overflow:ellipsis;white-space:nowrap;--tw-font-weight:var(--font-weight-semibold);min-width:0;font-size:15px;font-weight:var(--font-weight-semibold);--tw-outline-style:none;outline-style:none;flex:1;margin:0;overflow:hidden}.bailey-history-icon-button{height:calc(var(--spacing) * 11);width:calc(var(--spacing) * 11);cursor:pointer;appearance:none;border-radius:var(--radius-lg);--tw-border-style:none;color:var(--color-bailey-text-secondary);background-color:#0000;border-style:none;flex:none;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-history-icon-button:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.bailey-history-icon-button:hover{background-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.bailey-history-icon-button:hover{color:var(--color-bailey-text)}}.bailey-history-icon-button:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-history-icon-button:disabled{cursor:default;opacity:.5}.bailey-history-icon{width:18px;height:18px}.bailey-history-icon-small{height:calc(var(--spacing) * 3.5);width:calc(var(--spacing) * 3.5);flex:none}.bailey-history-button{min-height:calc(var(--spacing) * 11);cursor:pointer;appearance:none;justify-content:center;align-items:center;gap:calc(var(--spacing) * 1.5);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 1.5);white-space:nowrap;color:var(--color-bailey-text);font-size:13px;display:inline-flex}.bailey-history-button:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-history-button:disabled{cursor:default;opacity:.5}.bailey-history-button-primary{border-color:var(--color-bailey-accent);background-color:var(--color-bailey-accent);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-white)}.bailey-history-button-danger{border-color:var(--color-bailey-error);background-color:var(--color-bailey-error);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-white)}.bailey-history-button-small{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.bailey-history-body{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);flex:1;overflow-y:auto}.bailey-history-list{margin:0;padding:0;list-style-type:none}.bailey-history-row{border-radius:10px;flex-wrap:wrap;align-items:center;display:flex;position:relative}.bailey-history-row+.bailey-history-row{margin-top:calc(var(--spacing) * .5)}.bailey-history-row:not(.bailey-history-row-active):hover{background-color:var(--color-gray-100)}.bailey-history-row-active{box-shadow:inset 3px 0 0 var(--color-bailey-accent,#4f46e5);background-color:#4f46e514}.bailey-history-select{min-height:calc(var(--spacing) * 11);cursor:pointer;appearance:none;gap:calc(var(--spacing) * .5);--tw-border-style:none;min-width:0;padding-block:calc(var(--spacing) * 2.5);padding-right:calc(var(--spacing) * 2.5);padding-left:calc(var(--spacing) * 3);text-align:left;color:var(--color-bailey-text);background-color:#0000;border-style:none;border-radius:10px;flex-direction:column;flex:1;font-family:inherit;display:flex}.bailey-history-select:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-bailey-accent)}.bailey-history-select:disabled{cursor:default;opacity:.6}.bailey-history-row-title{text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);overflow:hidden}.bailey-history-meta{align-items:center;gap:calc(var(--spacing) * 1.5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-history-meta>span+.bailey-history-count:before{content:\"·\";margin-right:.375rem}.bailey-history-current{--tw-font-weight:var(--font-weight-semibold);font-size:11px;font-weight:var(--font-weight-semibold);color:var(--color-bailey-accent)}.bailey-history-delete{margin-right:var(--spacing)}.bailey-history-row-confirming{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-red-200);background-color:var(--color-red-50)}.bailey-history-confirm{align-items:center;gap:calc(var(--spacing) * 2);min-width:0;padding-block:calc(var(--spacing) * 2);padding-right:calc(var(--spacing) * 2.5);padding-left:calc(var(--spacing) * 3);flex-wrap:wrap;flex:1;display:flex}.bailey-history-confirm-question{--tw-font-weight:var(--font-weight-semibold);min-width:7.5rem;font-size:13px;font-weight:var(--font-weight-semibold);flex:1}.bailey-history-confirm-title{text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);flex-basis:100%;overflow:hidden}.bailey-history-row-failed{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-red-200);background-color:#fff7f7}.bailey-history-row-error{align-items:center;gap:calc(var(--spacing) * 2);padding-inline:calc(var(--spacing) * 3);padding-bottom:calc(var(--spacing) * 2.5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error);flex-wrap:wrap;flex-basis:100%;display:flex}.bailey-history-state{align-items:center;gap:calc(var(--spacing) * 2);padding-inline:calc(var(--spacing) * 6);padding-block:calc(var(--spacing) * 12);text-align:center;color:var(--color-bailey-text-secondary);flex-direction:column;font-size:13px;display:flex}.bailey-history-state strong{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text)}.bailey-history-state-icon{height:calc(var(--spacing) * 7);width:calc(var(--spacing) * 7);color:var(--color-gray-400)}.bailey-history-state-error .bailey-history-state-icon{color:var(--color-bailey-error)}.bailey-history-more{padding-top:calc(var(--spacing) * 2.5);padding-bottom:calc(var(--spacing) * 1.5);justify-content:center;display:flex}.bailey-history-inline-error{justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error);flex-wrap:wrap;display:flex}.bailey-history-status{min-height:calc(var(--spacing) * 9);align-items:center;gap:calc(var(--spacing) * 2);border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface-muted);padding-inline:calc(var(--spacing) * 3.5);padding-block:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-history-skeleton{margin-inline:var(--spacing);margin-bottom:calc(var(--spacing) * 1.5);background:linear-gradient(90deg,#f1f1f4 25%,#e6e6ec 50%,#f1f1f4 75%) 0 0/200% 100%;border-radius:10px;height:52px;animation:1.3s infinite bailey-history-shimmer}.bailey-history-spinner{height:calc(var(--spacing) * 3);width:calc(var(--spacing) * 3);border-style:var(--tw-border-style);border-width:2px;border-color:var(--color-bailey-border);border-top-color:var(--color-bailey-accent,#4f46e5);border-radius:2147483647px;animation:.8s linear infinite bailey-history-rotate;display:inline-block}@keyframes bailey-history-shimmer{to{background-position:-200% 0}}@keyframes bailey-history-rotate{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.bailey-history-skeleton,.bailey-history-spinner{animation:none}}@container (width<=340px){.bailey-history-new-chat{width:calc(var(--spacing) * 11);padding-inline:0}.bailey-history-new-chat-text,.bailey-history-count{display:none}}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-ordinal{syntax:\"*\";inherits:false}@property --tw-slashed-zero{syntax:\"*\";inherits:false}@property --tw-numeric-figure{syntax:\"*\";inherits:false}@property --tw-numeric-spacing{syntax:\"*\";inherits:false}@property --tw-numeric-fraction{syntax:\"*\";inherits:false}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-outline-style{syntax:\"*\";inherits:false;initial-value:solid}@keyframes spin{to{transform:rotate(360deg)}}", pt = r(void 0), mt = /:root\s*,\s*:host\s*\{([^}]*)\}/, ht = ".bailey-chat-panel", gt = ".bailey-menu-content,.bailey-tooltip-content", _t = "--color-bailey-";
|
|
1520
|
+
function vt(e) {
|
|
1519
1521
|
let t = e.match(new RegExp(mt, "g"))?.length ?? 0;
|
|
1520
1522
|
if (t !== 1) throw Error(`Expected exactly one ":root, :host {" rule in the compiled styles.css, found ${t}. Tailwind likely changed how @theme compiles — update this rewrite (and its sibling, scripts/scope-theme-vars.js) before shipping.`);
|
|
1521
|
-
return e.replace(mt, ht);
|
|
1523
|
+
return e.replace(mt, (e, t) => `${ht}{${t}}${gt}{${t.split(";").filter((e) => e.trim() && !e.trim().startsWith(_t)).join(";")}}`);
|
|
1522
1524
|
}
|
|
1523
|
-
var
|
|
1524
|
-
function
|
|
1525
|
+
var yt = vt(ft), bt = "data-source", xt = "baileyai-chat-ui", St = /* @__PURE__ */ new WeakMap();
|
|
1526
|
+
function Ct(e) {
|
|
1525
1527
|
let t = e.getRootNode();
|
|
1526
1528
|
return t instanceof ShadowRoot ? t : document;
|
|
1527
1529
|
}
|
|
1528
|
-
function
|
|
1529
|
-
let t = e instanceof ShadowRoot ? e : document.head, n =
|
|
1530
|
-
if (n === 0 && !t.querySelector(`style[${
|
|
1530
|
+
function wt(e) {
|
|
1531
|
+
let t = e instanceof ShadowRoot ? e : document.head, n = St.get(e) ?? 0;
|
|
1532
|
+
if (n === 0 && !t.querySelector(`style[${bt}="${xt}"]`)) {
|
|
1531
1533
|
let e = document.createElement("style");
|
|
1532
|
-
e.setAttribute(
|
|
1534
|
+
e.setAttribute(bt, xt), e.textContent = yt, t.appendChild(e);
|
|
1533
1535
|
}
|
|
1534
|
-
return
|
|
1535
|
-
let n = (
|
|
1536
|
-
n <= 0 ? (
|
|
1536
|
+
return St.set(e, n + 1), () => {
|
|
1537
|
+
let n = (St.get(e) ?? 1) - 1;
|
|
1538
|
+
n <= 0 ? (St.delete(e), t.querySelector(`style[${bt}="${xt}"]`)?.remove()) : St.set(e, n);
|
|
1537
1539
|
};
|
|
1538
1540
|
}
|
|
1539
|
-
function
|
|
1541
|
+
function Tt(e, t = !1) {
|
|
1540
1542
|
let [n, r] = f(null);
|
|
1541
1543
|
return l(() => {
|
|
1542
1544
|
if (t) return;
|
|
1543
1545
|
let n = e.current;
|
|
1544
1546
|
if (!n) return;
|
|
1545
|
-
let i =
|
|
1546
|
-
return r(i),
|
|
1547
|
+
let i = Ct(n);
|
|
1548
|
+
return r(i), wt(i);
|
|
1547
1549
|
}, [t, e]), n;
|
|
1548
1550
|
}
|
|
1549
|
-
function
|
|
1550
|
-
let t = o(pt), n = t !== void 0, r =
|
|
1551
|
+
function Et(e) {
|
|
1552
|
+
let t = o(pt), n = t !== void 0, r = Tt(e, n);
|
|
1551
1553
|
return n ? t : r;
|
|
1552
1554
|
}
|
|
1553
1555
|
//#endregion
|
|
1554
1556
|
//#region src/ui/markdown.tsx
|
|
1555
|
-
function
|
|
1557
|
+
function Dt({ renderTable: t, renderChart: n } = {}) {
|
|
1556
1558
|
return {
|
|
1557
1559
|
a: ({ href: t, children: n }) => !t || !e(t) ? /* @__PURE__ */ v(_, { children: n }) : /* @__PURE__ */ v("a", {
|
|
1558
1560
|
href: t,
|
|
@@ -1583,7 +1585,7 @@ function Tt({ renderTable: t, renderChart: n } = {}) {
|
|
|
1583
1585
|
}
|
|
1584
1586
|
//#endregion
|
|
1585
1587
|
//#region src/ui/icons.tsx
|
|
1586
|
-
function
|
|
1588
|
+
function Ot({ className: e }) {
|
|
1587
1589
|
return /* @__PURE__ */ v("svg", {
|
|
1588
1590
|
viewBox: "0 0 24 24",
|
|
1589
1591
|
fill: "currentColor",
|
|
@@ -1592,7 +1594,7 @@ function Et({ className: e }) {
|
|
|
1592
1594
|
children: /* @__PURE__ */ v("path", { d: "M12 20.3s-7.6-4.7-10-9.4C.4 7.7 1.7 4 5.2 3.1c2.2-.6 4.4.4 5.5 2.2 1.2-1.8 3.4-2.8 5.6-2.2 3.5.9 4.8 4.6 3.2 7.8-2.4 4.7-10 9.4-10 9.4z" })
|
|
1593
1595
|
});
|
|
1594
1596
|
}
|
|
1595
|
-
function
|
|
1597
|
+
function kt({ className: e }) {
|
|
1596
1598
|
return /* @__PURE__ */ v("svg", {
|
|
1597
1599
|
viewBox: "0 0 24 24",
|
|
1598
1600
|
fill: "currentColor",
|
|
@@ -1607,7 +1609,7 @@ function Dt({ className: e }) {
|
|
|
1607
1609
|
})
|
|
1608
1610
|
});
|
|
1609
1611
|
}
|
|
1610
|
-
function
|
|
1612
|
+
function At({ className: e }) {
|
|
1611
1613
|
return /* @__PURE__ */ y("svg", {
|
|
1612
1614
|
viewBox: "0 0 24 24",
|
|
1613
1615
|
fill: "none",
|
|
@@ -1620,7 +1622,7 @@ function Ot({ className: e }) {
|
|
|
1620
1622
|
children: [/* @__PURE__ */ v("path", { d: "M7 17 17 7" }), /* @__PURE__ */ v("path", { d: "M9 7h8v8" })]
|
|
1621
1623
|
});
|
|
1622
1624
|
}
|
|
1623
|
-
function
|
|
1625
|
+
function jt({ className: e }) {
|
|
1624
1626
|
return /* @__PURE__ */ y("svg", {
|
|
1625
1627
|
viewBox: "0 0 24 24",
|
|
1626
1628
|
fill: "none",
|
|
@@ -1639,7 +1641,7 @@ function kt({ className: e }) {
|
|
|
1639
1641
|
}), /* @__PURE__ */ v("path", { d: "M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2" })]
|
|
1640
1642
|
});
|
|
1641
1643
|
}
|
|
1642
|
-
function
|
|
1644
|
+
function Mt({ className: e }) {
|
|
1643
1645
|
return /* @__PURE__ */ v("svg", {
|
|
1644
1646
|
viewBox: "0 0 24 24",
|
|
1645
1647
|
fill: "none",
|
|
@@ -1652,7 +1654,7 @@ function At({ className: e }) {
|
|
|
1652
1654
|
children: /* @__PURE__ */ v("path", { d: "M5 12.5 9.5 17 19 7" })
|
|
1653
1655
|
});
|
|
1654
1656
|
}
|
|
1655
|
-
function
|
|
1657
|
+
function Nt({ className: e }) {
|
|
1656
1658
|
return /* @__PURE__ */ v("svg", {
|
|
1657
1659
|
viewBox: "0 0 24 24",
|
|
1658
1660
|
fill: "none",
|
|
@@ -1665,7 +1667,7 @@ function jt({ className: e }) {
|
|
|
1665
1667
|
children: /* @__PURE__ */ v("path", { d: "m22.7 13.5-2-2-2 2M21 12a9 9 0 1 1-1.245-4.57M12 7v5l3 2" })
|
|
1666
1668
|
});
|
|
1667
1669
|
}
|
|
1668
|
-
function
|
|
1670
|
+
function Pt({ className: e }) {
|
|
1669
1671
|
return /* @__PURE__ */ y("svg", {
|
|
1670
1672
|
viewBox: "0 0 24 24",
|
|
1671
1673
|
fill: "none",
|
|
@@ -1682,7 +1684,7 @@ function Mt({ className: e }) {
|
|
|
1682
1684
|
}), /* @__PURE__ */ v("path", { d: "M8.5 12.5 11 15l4.5-5.5" })]
|
|
1683
1685
|
});
|
|
1684
1686
|
}
|
|
1685
|
-
function
|
|
1687
|
+
function Ft({ className: e }) {
|
|
1686
1688
|
return /* @__PURE__ */ y("svg", {
|
|
1687
1689
|
viewBox: "0 0 24 24",
|
|
1688
1690
|
fill: "currentColor",
|
|
@@ -1707,7 +1709,7 @@ function Nt({ className: e }) {
|
|
|
1707
1709
|
]
|
|
1708
1710
|
});
|
|
1709
1711
|
}
|
|
1710
|
-
function
|
|
1712
|
+
function It({ className: e }) {
|
|
1711
1713
|
return /* @__PURE__ */ v("svg", {
|
|
1712
1714
|
viewBox: "0 0 24 24",
|
|
1713
1715
|
fill: "none",
|
|
@@ -1720,8 +1722,8 @@ function Pt({ className: e }) {
|
|
|
1720
1722
|
children: /* @__PURE__ */ v("path", { d: "M12 5v14M5 12h14" })
|
|
1721
1723
|
});
|
|
1722
1724
|
}
|
|
1723
|
-
var
|
|
1724
|
-
function
|
|
1725
|
+
var Lt = "M7 11v9H4v-9h3zm0 0 4-8c1.7 0 2.7 1.3 2.4 3L13 9h5.5a2 2 0 0 1 2 2.4l-1.3 6.8A2 2 0 0 1 17.2 20H7", Rt = "M17 13V4h3v9h-3zm0 0-4 8c-1.7 0-2.7-1.3-2.4-3L11 15H5.5a2 2 0 0 1-2-2.4l1.3-6.8A2 2 0 0 1 6.8 4H17";
|
|
1726
|
+
function zt({ className: e, filled: t = !1 }) {
|
|
1725
1727
|
return /* @__PURE__ */ v("svg", {
|
|
1726
1728
|
viewBox: "0 0 24 24",
|
|
1727
1729
|
fill: t ? "currentColor" : "none",
|
|
@@ -1730,10 +1732,10 @@ function Lt({ className: e, filled: t = !1 }) {
|
|
|
1730
1732
|
strokeLinejoin: "round",
|
|
1731
1733
|
className: e,
|
|
1732
1734
|
"aria-hidden": "true",
|
|
1733
|
-
children: /* @__PURE__ */ v("path", { d:
|
|
1735
|
+
children: /* @__PURE__ */ v("path", { d: Lt })
|
|
1734
1736
|
});
|
|
1735
1737
|
}
|
|
1736
|
-
function
|
|
1738
|
+
function Bt({ className: e, filled: t = !1 }) {
|
|
1737
1739
|
return /* @__PURE__ */ v("svg", {
|
|
1738
1740
|
viewBox: "0 0 24 24",
|
|
1739
1741
|
fill: t ? "currentColor" : "none",
|
|
@@ -1742,10 +1744,10 @@ function Rt({ className: e, filled: t = !1 }) {
|
|
|
1742
1744
|
strokeLinejoin: "round",
|
|
1743
1745
|
className: e,
|
|
1744
1746
|
"aria-hidden": "true",
|
|
1745
|
-
children: /* @__PURE__ */ v("path", { d:
|
|
1747
|
+
children: /* @__PURE__ */ v("path", { d: Rt })
|
|
1746
1748
|
});
|
|
1747
1749
|
}
|
|
1748
|
-
function
|
|
1750
|
+
function Vt({ className: e }) {
|
|
1749
1751
|
return /* @__PURE__ */ v("svg", {
|
|
1750
1752
|
viewBox: "0 0 24 24",
|
|
1751
1753
|
fill: "none",
|
|
@@ -1758,7 +1760,7 @@ function zt({ className: e }) {
|
|
|
1758
1760
|
children: /* @__PURE__ */ v("path", { d: "M15 6l-6 6 6 6" })
|
|
1759
1761
|
});
|
|
1760
1762
|
}
|
|
1761
|
-
function
|
|
1763
|
+
function Ht({ className: e }) {
|
|
1762
1764
|
return /* @__PURE__ */ v("svg", {
|
|
1763
1765
|
viewBox: "0 0 24 24",
|
|
1764
1766
|
fill: "none",
|
|
@@ -1771,7 +1773,7 @@ function Bt({ className: e }) {
|
|
|
1771
1773
|
children: /* @__PURE__ */ v("path", { d: "M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V4h6v3" })
|
|
1772
1774
|
});
|
|
1773
1775
|
}
|
|
1774
|
-
function
|
|
1776
|
+
function Ut({ className: e }) {
|
|
1775
1777
|
return /* @__PURE__ */ y("svg", {
|
|
1776
1778
|
viewBox: "0 0 24 24",
|
|
1777
1779
|
fill: "none",
|
|
@@ -1790,9 +1792,9 @@ function Vt({ className: e }) {
|
|
|
1790
1792
|
}
|
|
1791
1793
|
//#endregion
|
|
1792
1794
|
//#region src/ui/CopyMarkdownButton.tsx
|
|
1793
|
-
var
|
|
1794
|
-
function
|
|
1795
|
-
let [a, o] = f(!1), [c, l] = f(!1), u = d(null), p = d(null), m =
|
|
1795
|
+
var Wt = 1500;
|
|
1796
|
+
function Gt({ markdown: e, className: t, ariaLabel: n = "copy response as markdown", tooltipDefaultText: r = "Copy as markdown", tooltipCopiedText: i = "Copied!" }) {
|
|
1797
|
+
let [a, o] = f(!1), [c, l] = f(!1), u = d(null), p = d(null), m = Et(p);
|
|
1796
1798
|
return s(() => () => {
|
|
1797
1799
|
u.current !== null && clearTimeout(u.current);
|
|
1798
1800
|
}, []), /* @__PURE__ */ v(g.Provider, {
|
|
@@ -1811,11 +1813,11 @@ function Ut({ markdown: e, className: t, ariaLabel: n = "copy response as markdo
|
|
|
1811
1813
|
} catch {
|
|
1812
1814
|
return;
|
|
1813
1815
|
}
|
|
1814
|
-
o(!0), u.current !== null && clearTimeout(u.current), u.current = setTimeout(() => o(!1),
|
|
1816
|
+
o(!0), u.current !== null && clearTimeout(u.current), u.current = setTimeout(() => o(!1), Wt);
|
|
1815
1817
|
},
|
|
1816
1818
|
"aria-label": n,
|
|
1817
1819
|
className: `bailey-copy-button${t ? ` ${t}` : ""}`,
|
|
1818
|
-
children: v(a ?
|
|
1820
|
+
children: v(a ? Mt : jt, { className: "bailey-copy-icon" })
|
|
1819
1821
|
})
|
|
1820
1822
|
}), /* @__PURE__ */ v(g.Portal, {
|
|
1821
1823
|
container: m instanceof ShadowRoot ? m : void 0,
|
|
@@ -1830,20 +1832,20 @@ function Ut({ markdown: e, className: t, ariaLabel: n = "copy response as markdo
|
|
|
1830
1832
|
}
|
|
1831
1833
|
//#endregion
|
|
1832
1834
|
//#region src/ui/BaileyTracePanel.tsx
|
|
1833
|
-
async function
|
|
1835
|
+
async function Kt(e) {
|
|
1834
1836
|
try {
|
|
1835
1837
|
await navigator.clipboard.writeText(e);
|
|
1836
1838
|
} catch {}
|
|
1837
1839
|
}
|
|
1838
|
-
function
|
|
1840
|
+
function qt({ text: e, label: t = "Copy" }) {
|
|
1839
1841
|
return /* @__PURE__ */ v("button", {
|
|
1840
1842
|
type: "button",
|
|
1841
|
-
onClick: () =>
|
|
1843
|
+
onClick: () => Kt(e),
|
|
1842
1844
|
className: "bailey-trace-copy-button",
|
|
1843
1845
|
children: t
|
|
1844
1846
|
});
|
|
1845
1847
|
}
|
|
1846
|
-
function
|
|
1848
|
+
function Jt(e) {
|
|
1847
1849
|
if (e.failed || e.kind === "error") return "bailey-trace-chip bailey-trace-chip-error";
|
|
1848
1850
|
switch (e.kind) {
|
|
1849
1851
|
case "tool_start":
|
|
@@ -1854,7 +1856,7 @@ function Kt(e) {
|
|
|
1854
1856
|
default: return "bailey-trace-chip bailey-trace-chip-default";
|
|
1855
1857
|
}
|
|
1856
1858
|
}
|
|
1857
|
-
function
|
|
1859
|
+
function Yt({ label: e, content: t, copyable: n }) {
|
|
1858
1860
|
return /* @__PURE__ */ y("details", {
|
|
1859
1861
|
className: "bailey-trace-disclosure",
|
|
1860
1862
|
children: [
|
|
@@ -1864,7 +1866,7 @@ function qt({ label: e, content: t, copyable: n }) {
|
|
|
1864
1866
|
}),
|
|
1865
1867
|
n && /* @__PURE__ */ v("div", {
|
|
1866
1868
|
className: "bailey-trace-disclosure-actions",
|
|
1867
|
-
children: /* @__PURE__ */ v(
|
|
1869
|
+
children: /* @__PURE__ */ v(qt, { text: t })
|
|
1868
1870
|
}),
|
|
1869
1871
|
/* @__PURE__ */ v("pre", {
|
|
1870
1872
|
className: "bailey-trace-disclosure-content",
|
|
@@ -1873,7 +1875,7 @@ function qt({ label: e, content: t, copyable: n }) {
|
|
|
1873
1875
|
]
|
|
1874
1876
|
});
|
|
1875
1877
|
}
|
|
1876
|
-
function
|
|
1878
|
+
function Xt({ row: e }) {
|
|
1877
1879
|
return /* @__PURE__ */ y("div", {
|
|
1878
1880
|
className: "bailey-trace-row",
|
|
1879
1881
|
children: [
|
|
@@ -1890,7 +1892,7 @@ function Jt({ row: e }) {
|
|
|
1890
1892
|
children: at(e.gapMs)
|
|
1891
1893
|
}),
|
|
1892
1894
|
/* @__PURE__ */ v("span", {
|
|
1893
|
-
className:
|
|
1895
|
+
className: Jt(e),
|
|
1894
1896
|
children: e.label
|
|
1895
1897
|
}),
|
|
1896
1898
|
/* @__PURE__ */ v("span", {
|
|
@@ -1899,32 +1901,32 @@ function Jt({ row: e }) {
|
|
|
1899
1901
|
})
|
|
1900
1902
|
]
|
|
1901
1903
|
}),
|
|
1902
|
-
e.argsDetail && /* @__PURE__ */ v(
|
|
1904
|
+
e.argsDetail && /* @__PURE__ */ v(Yt, {
|
|
1903
1905
|
label: e.kind === "llm_call_start" ? "request" : "args",
|
|
1904
1906
|
content: e.argsDetail
|
|
1905
1907
|
}),
|
|
1906
|
-
e.outputDetail && /* @__PURE__ */ v(
|
|
1908
|
+
e.outputDetail && /* @__PURE__ */ v(Yt, {
|
|
1907
1909
|
label: e.kind === "llm_call_end" ? "response" : "output",
|
|
1908
1910
|
content: e.outputDetail
|
|
1909
1911
|
}),
|
|
1910
|
-
e.structuredOutputDetail && /* @__PURE__ */ v(
|
|
1912
|
+
e.structuredOutputDetail && /* @__PURE__ */ v(Yt, {
|
|
1911
1913
|
label: "structured output",
|
|
1912
1914
|
content: e.structuredOutputDetail
|
|
1913
1915
|
}),
|
|
1914
|
-
e.rawDetail && /* @__PURE__ */ v(
|
|
1916
|
+
e.rawDetail && /* @__PURE__ */ v(Yt, {
|
|
1915
1917
|
label: "raw",
|
|
1916
1918
|
content: e.rawDetail
|
|
1917
1919
|
})
|
|
1918
1920
|
]
|
|
1919
1921
|
});
|
|
1920
1922
|
}
|
|
1921
|
-
function
|
|
1923
|
+
function Zt(e, t) {
|
|
1922
1924
|
if (e.chunkCount === 0) return "Streamed: no chunks received";
|
|
1923
1925
|
if (e.chunkCount === 1 || e.firstChunkAt === null) return "Streamed: 1 chunk (not incremental)";
|
|
1924
1926
|
let n = e.firstChunkAt - t, r = (e.lastChunkAt ?? e.firstChunkAt) - e.firstChunkAt;
|
|
1925
1927
|
return `Streamed: ${e.chunkCount} chunks · first chunk after ${n}ms · spread over ${(r / 1e3).toFixed(1)}s`;
|
|
1926
1928
|
}
|
|
1927
|
-
function
|
|
1929
|
+
function Qt({ request: e }) {
|
|
1928
1930
|
let t = u(() => JSON.stringify({
|
|
1929
1931
|
model: e.model,
|
|
1930
1932
|
instructions: e.systemPrompt,
|
|
@@ -1948,24 +1950,24 @@ function Xt({ request: e }) {
|
|
|
1948
1950
|
}),
|
|
1949
1951
|
/* @__PURE__ */ v("span", {
|
|
1950
1952
|
className: "bailey-trace-request-meta",
|
|
1951
|
-
children:
|
|
1953
|
+
children: Zt(e.streamStats, e.sentAt)
|
|
1952
1954
|
}),
|
|
1953
|
-
/* @__PURE__ */ v(
|
|
1955
|
+
/* @__PURE__ */ v(Yt, {
|
|
1954
1956
|
label: `System prompt (${e.systemPrompt.length.toLocaleString()} chars)`,
|
|
1955
1957
|
content: e.systemPrompt,
|
|
1956
1958
|
copyable: !0
|
|
1957
1959
|
}),
|
|
1958
|
-
/* @__PURE__ */ v(
|
|
1960
|
+
/* @__PURE__ */ v(Yt, {
|
|
1959
1961
|
label: `Messages (${e.messages.length})`,
|
|
1960
1962
|
content: JSON.stringify(e.messages, null, 2),
|
|
1961
1963
|
copyable: !0
|
|
1962
1964
|
}),
|
|
1963
|
-
e.response && /* @__PURE__ */ v(
|
|
1965
|
+
e.response && /* @__PURE__ */ v(Yt, {
|
|
1964
1966
|
label: `Response (${e.response.content.length.toLocaleString()} chars)`,
|
|
1965
1967
|
content: e.response.content,
|
|
1966
1968
|
copyable: !0
|
|
1967
1969
|
}),
|
|
1968
|
-
/* @__PURE__ */ v(
|
|
1970
|
+
/* @__PURE__ */ v(Yt, {
|
|
1969
1971
|
label: "Full payload (JSON)",
|
|
1970
1972
|
content: t,
|
|
1971
1973
|
copyable: !0
|
|
@@ -1973,14 +1975,14 @@ function Xt({ request: e }) {
|
|
|
1973
1975
|
]
|
|
1974
1976
|
});
|
|
1975
1977
|
}
|
|
1976
|
-
function
|
|
1978
|
+
function $t({ events: e, lastRequest: t, onClear: n }) {
|
|
1977
1979
|
let r = u(() => ot(e), [e]), i = u(() => ct(r), [r]), a = u(() => JSON.stringify(e, null, 2), [e]);
|
|
1978
1980
|
return /* @__PURE__ */ y("div", {
|
|
1979
1981
|
className: "bailey-trace-body",
|
|
1980
1982
|
children: [
|
|
1981
1983
|
/* @__PURE__ */ y("div", {
|
|
1982
1984
|
className: "bailey-trace-actions-row",
|
|
1983
|
-
children: [e.length > 0 && /* @__PURE__ */ v(
|
|
1985
|
+
children: [e.length > 0 && /* @__PURE__ */ v(qt, {
|
|
1984
1986
|
text: a,
|
|
1985
1987
|
label: "Copy trace as JSON"
|
|
1986
1988
|
}), /* @__PURE__ */ v("button", {
|
|
@@ -1990,15 +1992,15 @@ function Zt({ events: e, lastRequest: t, onClear: n }) {
|
|
|
1990
1992
|
children: "Clear"
|
|
1991
1993
|
})]
|
|
1992
1994
|
}),
|
|
1993
|
-
t && /* @__PURE__ */ v(
|
|
1995
|
+
t && /* @__PURE__ */ v(Qt, { request: t }),
|
|
1994
1996
|
/* @__PURE__ */ v("div", {
|
|
1995
1997
|
className: "bailey-trace-rows",
|
|
1996
1998
|
children: i.map((e, t) => {
|
|
1997
|
-
if (e.type === "single") return /* @__PURE__ */ v(
|
|
1999
|
+
if (e.type === "single") return /* @__PURE__ */ v(Xt, { row: e.row }, e.row.key);
|
|
1998
2000
|
let n = e.rows.filter((e) => e.isToolStart).length;
|
|
1999
2001
|
if (n <= 1) return /* @__PURE__ */ v("div", {
|
|
2000
2002
|
className: "bailey-trace-rows",
|
|
2001
|
-
children: e.rows.map((e) => /* @__PURE__ */ v(
|
|
2003
|
+
children: e.rows.map((e) => /* @__PURE__ */ v(Xt, { row: e }, e.key))
|
|
2002
2004
|
}, `group-${t}`);
|
|
2003
2005
|
let r = e.rows.filter((e) => e.failed).length;
|
|
2004
2006
|
return /* @__PURE__ */ y("details", {
|
|
@@ -2020,7 +2022,7 @@ function Zt({ events: e, lastRequest: t, onClear: n }) {
|
|
|
2020
2022
|
]
|
|
2021
2023
|
}), /* @__PURE__ */ v("div", {
|
|
2022
2024
|
className: "bailey-trace-rows",
|
|
2023
|
-
children: e.rows.map((e) => /* @__PURE__ */ v(
|
|
2025
|
+
children: e.rows.map((e) => /* @__PURE__ */ v(Xt, { row: e }, e.key))
|
|
2024
2026
|
})]
|
|
2025
2027
|
}, `group-${t}`);
|
|
2026
2028
|
})
|
|
@@ -2028,7 +2030,7 @@ function Zt({ events: e, lastRequest: t, onClear: n }) {
|
|
|
2028
2030
|
]
|
|
2029
2031
|
});
|
|
2030
2032
|
}
|
|
2031
|
-
function
|
|
2033
|
+
function en({ events: e, lastRequest: t, onClear: n }) {
|
|
2032
2034
|
let [r, i] = f(!1), a = u(() => lt(e), [e]), o = u(() => st(e), [e]);
|
|
2033
2035
|
return e.length === 0 && !t ? null : /* @__PURE__ */ y("div", {
|
|
2034
2036
|
className: "bailey-trace-panel",
|
|
@@ -2050,7 +2052,7 @@ function Qt({ events: e, lastRequest: t, onClear: n }) {
|
|
|
2050
2052
|
className: a ? "bailey-trace-summary bailey-trace-summary-error" : "bailey-trace-summary",
|
|
2051
2053
|
children: o
|
|
2052
2054
|
})]
|
|
2053
|
-
}), r && /* @__PURE__ */ v(
|
|
2055
|
+
}), r && /* @__PURE__ */ v($t, {
|
|
2054
2056
|
events: e,
|
|
2055
2057
|
lastRequest: t,
|
|
2056
2058
|
onClear: n
|
|
@@ -2059,7 +2061,7 @@ function Qt({ events: e, lastRequest: t, onClear: n }) {
|
|
|
2059
2061
|
}
|
|
2060
2062
|
//#endregion
|
|
2061
2063
|
//#region src/ui/ToolResultImage.tsx
|
|
2062
|
-
function
|
|
2064
|
+
function tn({ src: e, alt: n, className: r }) {
|
|
2063
2065
|
return t(e) ? /* @__PURE__ */ v("img", {
|
|
2064
2066
|
src: e,
|
|
2065
2067
|
alt: n ?? "",
|
|
@@ -2069,21 +2071,21 @@ function $t({ src: e, alt: n, className: r }) {
|
|
|
2069
2071
|
}
|
|
2070
2072
|
//#endregion
|
|
2071
2073
|
//#region src/utils/safeMcpAppResource.ts
|
|
2072
|
-
var
|
|
2074
|
+
var nn = /^ui:\/\//, rn = 2097152, an = /* @__PURE__ */ new Set([
|
|
2073
2075
|
"connectDomains",
|
|
2074
2076
|
"resourceDomains",
|
|
2075
2077
|
"frameDomains",
|
|
2076
2078
|
"baseUriDomains"
|
|
2077
|
-
]),
|
|
2079
|
+
]), on = /* @__PURE__ */ new Set([
|
|
2078
2080
|
"camera",
|
|
2079
2081
|
"microphone",
|
|
2080
2082
|
"geolocation",
|
|
2081
2083
|
"clipboardWrite"
|
|
2082
|
-
]),
|
|
2084
|
+
]), sn = (e, t) => e === void 0 ? !0 : typeof e != "object" || !e || Array.isArray(e) ? !1 : Object.keys(e).every((e) => t.has(e)), cn = (e) => !(!nn.test(e.resourceUri) || typeof e.html != "string" || e.html.length === 0 || e.html.length > rn || !sn(e.csp, an) || !sn(e.permissions, on));
|
|
2083
2085
|
//#endregion
|
|
2084
2086
|
//#region src/ui/McpAppFrame.tsx
|
|
2085
|
-
function
|
|
2086
|
-
return
|
|
2087
|
+
function ln({ html: e, title: t, resourceUri: n, csp: r, permissions: i, className: a }) {
|
|
2088
|
+
return cn({
|
|
2087
2089
|
html: e,
|
|
2088
2090
|
resourceUri: n,
|
|
2089
2091
|
csp: r,
|
|
@@ -2098,14 +2100,24 @@ function sn({ html: e, title: t, resourceUri: n, csp: r, permissions: i, classNa
|
|
|
2098
2100
|
}
|
|
2099
2101
|
//#endregion
|
|
2100
2102
|
//#region src/ui/BaileyToolSteps.tsx
|
|
2101
|
-
function
|
|
2103
|
+
function un({ toolName: e, resolveActivityIcon: t }) {
|
|
2102
2104
|
let n = t?.(e);
|
|
2103
2105
|
return n === 0 || n && n !== !0 ? /* @__PURE__ */ v("span", {
|
|
2104
2106
|
className: "bailey-activity-icon",
|
|
2105
2107
|
children: n
|
|
2106
2108
|
}) : null;
|
|
2107
2109
|
}
|
|
2108
|
-
function
|
|
2110
|
+
function dn({ offsetMs: e, labels: t }) {
|
|
2111
|
+
let n = at(e), r = t.toolStepStartedText?.replace("{offset}", n);
|
|
2112
|
+
return /* @__PURE__ */ v("span", {
|
|
2113
|
+
className: "bailey-tool-step-start",
|
|
2114
|
+
title: r,
|
|
2115
|
+
"aria-label": r,
|
|
2116
|
+
role: r ? "text" : void 0,
|
|
2117
|
+
children: n
|
|
2118
|
+
});
|
|
2119
|
+
}
|
|
2120
|
+
function fn({ steps: e, resolveActivityIcon: t }) {
|
|
2109
2121
|
let n = e.filter((e) => e.status === "running");
|
|
2110
2122
|
return n.length === 0 ? null : /* @__PURE__ */ v("div", {
|
|
2111
2123
|
className: "bailey-tool-steps-live",
|
|
@@ -2114,7 +2126,7 @@ function ln({ steps: e, resolveActivityIcon: t }) {
|
|
|
2114
2126
|
children: n.map((e) => /* @__PURE__ */ y("div", {
|
|
2115
2127
|
className: "bailey-activity-line",
|
|
2116
2128
|
children: [
|
|
2117
|
-
/* @__PURE__ */ v(
|
|
2129
|
+
/* @__PURE__ */ v(un, {
|
|
2118
2130
|
toolName: e.toolName,
|
|
2119
2131
|
resolveActivityIcon: t
|
|
2120
2132
|
}),
|
|
@@ -2127,7 +2139,7 @@ function ln({ steps: e, resolveActivityIcon: t }) {
|
|
|
2127
2139
|
}, e.key))
|
|
2128
2140
|
});
|
|
2129
2141
|
}
|
|
2130
|
-
function
|
|
2142
|
+
function pn({ steps: e, labels: t, resolveActivityIcon: n }) {
|
|
2131
2143
|
if (e.length === 0) return null;
|
|
2132
2144
|
let r = e.filter((e) => e.status === "failed").length, i = e.length === 1 ? t.toolStepsSummaryOne : t.toolStepsSummaryMany.replace("{count}", String(e.length)), a = r > 0 ? `${i}${t.toolStepsFailedSuffix.replace("{failed}", String(r))}` : i;
|
|
2133
2145
|
return /* @__PURE__ */ y("details", {
|
|
@@ -2137,11 +2149,15 @@ function un({ steps: e, labels: t, resolveActivityIcon: n }) {
|
|
|
2137
2149
|
children: e.map((e) => /* @__PURE__ */ y("li", {
|
|
2138
2150
|
className: "bailey-tool-step",
|
|
2139
2151
|
children: [
|
|
2140
|
-
/* @__PURE__ */ v(
|
|
2152
|
+
/* @__PURE__ */ v(un, {
|
|
2141
2153
|
toolName: e.toolName,
|
|
2142
2154
|
resolveActivityIcon: n
|
|
2143
2155
|
}),
|
|
2144
2156
|
/* @__PURE__ */ v("span", { children: e.label }),
|
|
2157
|
+
e.startOffsetMs !== void 0 && /* @__PURE__ */ v(dn, {
|
|
2158
|
+
offsetMs: e.startOffsetMs,
|
|
2159
|
+
labels: t
|
|
2160
|
+
}),
|
|
2145
2161
|
e.runtimeSeconds !== void 0 && /* @__PURE__ */ v("span", { children: `${e.runtimeSeconds.toFixed(1)}s` }),
|
|
2146
2162
|
e.status === "failed" && /* @__PURE__ */ v("span", {
|
|
2147
2163
|
className: "bailey-tool-step-failed",
|
|
@@ -2155,29 +2171,29 @@ function un({ steps: e, labels: t, resolveActivityIcon: n }) {
|
|
|
2155
2171
|
}
|
|
2156
2172
|
//#endregion
|
|
2157
2173
|
//#region src/utils/relativeTime.ts
|
|
2158
|
-
var
|
|
2159
|
-
function
|
|
2160
|
-
return e ? Date.parse(
|
|
2174
|
+
var mn = /(Z|[+-]\d{2}:?\d{2})$/i, hn = 60, gn = 3600, _n = 24 * gn, vn = 30 * _n * 1e3;
|
|
2175
|
+
function yn(e) {
|
|
2176
|
+
return e ? Date.parse(mn.test(e) ? e : `${e}Z`) : NaN;
|
|
2161
2177
|
}
|
|
2162
|
-
function
|
|
2163
|
-
let t =
|
|
2178
|
+
function bn(e) {
|
|
2179
|
+
let t = yn(e.iso);
|
|
2164
2180
|
if (Number.isNaN(t)) return "";
|
|
2165
2181
|
let n = e.now ?? Date.now(), r = Math.max(0, n - t);
|
|
2166
2182
|
if (typeof Intl > "u" || typeof Intl.RelativeTimeFormat != "function") return e.justNowText ?? "";
|
|
2167
|
-
if (r >=
|
|
2183
|
+
if (r >= vn) return new Intl.DateTimeFormat(e.locale, { dateStyle: "medium" }).format(t);
|
|
2168
2184
|
let i = r / 1e3, a = new Intl.RelativeTimeFormat(e.locale, { numeric: "auto" });
|
|
2169
|
-
return i <
|
|
2185
|
+
return i < hn ? a.format(0, "second") : i < gn ? a.format(-Math.floor(i / hn), "minute") : i < _n ? a.format(-Math.floor(i / gn), "hour") : a.format(-Math.floor(i / _n), "day");
|
|
2170
2186
|
}
|
|
2171
2187
|
//#endregion
|
|
2172
2188
|
//#region src/ui/BaileyHistoryDrawer.tsx
|
|
2173
|
-
function
|
|
2189
|
+
function xn({ client: e, pageSize: t, chat: n, labels: r, locale: i, onClose: o }) {
|
|
2174
2190
|
let s = me({
|
|
2175
2191
|
client: e,
|
|
2176
2192
|
pageSize: t
|
|
2177
2193
|
}), { loadConversation: c, newChat: l } = n, u = a((e) => c ? c(e) : Promise.reject(/* @__PURE__ */ Error("no loadConversation")), [c]), d = a(() => {
|
|
2178
2194
|
l(), o({ restoreFocusTo: "input" });
|
|
2179
2195
|
}, [l, o]);
|
|
2180
|
-
return /* @__PURE__ */ v(
|
|
2196
|
+
return /* @__PURE__ */ v(wn, {
|
|
2181
2197
|
conversations: s,
|
|
2182
2198
|
activeConversationId: n.conversationId,
|
|
2183
2199
|
selectStatus: n.historyStatus,
|
|
@@ -2189,19 +2205,19 @@ function vn({ client: e, pageSize: t, chat: n, labels: r, locale: i, onClose: o
|
|
|
2189
2205
|
locale: i
|
|
2190
2206
|
});
|
|
2191
2207
|
}
|
|
2192
|
-
var
|
|
2193
|
-
function
|
|
2194
|
-
let { conversations: m, status: h, error: g, hasMore: b, refresh:
|
|
2208
|
+
var Sn = (e, t) => Object.entries(t).reduce((e, [t, n]) => e.split(`{${t}}`).join(String(n)), e), Cn = (e) => !e || e.kind !== "http" ? !1 : e.status === 401 || e.status === 403;
|
|
2209
|
+
function wn({ conversations: e, activeConversationId: t, selectStatus: n, onSelect: r, onActiveDeleted: i, onNewChat: a, onClose: o, labels: l, locale: u, now: p }) {
|
|
2210
|
+
let { conversations: m, status: h, error: g, hasMore: b, refresh: x, loadMore: S, remove: C } = e, w = c(), T = c(), E = d(null), D = d(null), O = d(null), k = d(/* @__PURE__ */ new Map()), ee = d(/* @__PURE__ */ new Map()), A = d(null), j = d(null), [M, N] = f(null), [P, F] = f(null), [te, ne] = f(0), [re, ie] = f(!1), [I, ae] = f(!1), [oe, se] = f(!1), L = u ?? (typeof navigator < "u" ? navigator.language : void 0);
|
|
2195
2211
|
s(() => {
|
|
2196
|
-
|
|
2212
|
+
E.current?.focus();
|
|
2197
2213
|
}, []), s(() => {
|
|
2198
|
-
let e =
|
|
2214
|
+
let e = A.current;
|
|
2199
2215
|
if (!e) return;
|
|
2200
|
-
let t = e.kind === "select" ?
|
|
2201
|
-
t && (t.focus(),
|
|
2216
|
+
let t = e.kind === "select" ? k.current.get(e.id) : e.kind === "delete" ? ee.current.get(e.id) : e.kind === "cancel" ? O.current : D.current;
|
|
2217
|
+
t && (t.focus(), A.current = null);
|
|
2202
2218
|
}), s(() => {
|
|
2203
|
-
let e =
|
|
2204
|
-
e !== null && h !== "loading" && (
|
|
2219
|
+
let e = j.current;
|
|
2220
|
+
e !== null && h !== "loading" && (j.current = null, !b && m.length > e && (A.current = {
|
|
2205
2221
|
kind: "select",
|
|
2206
2222
|
id: m[e].conversationId
|
|
2207
2223
|
}));
|
|
@@ -2211,58 +2227,58 @@ function xn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
|
|
|
2211
2227
|
m
|
|
2212
2228
|
]);
|
|
2213
2229
|
let ce = () => {
|
|
2214
|
-
|
|
2215
|
-
},
|
|
2216
|
-
|
|
2230
|
+
j.current = m.length, S();
|
|
2231
|
+
}, le = (e) => {
|
|
2232
|
+
A.current = {
|
|
2217
2233
|
kind: "delete",
|
|
2218
2234
|
id: e
|
|
2219
|
-
},
|
|
2220
|
-
},
|
|
2235
|
+
}, N(null);
|
|
2236
|
+
}, ue = (e) => {
|
|
2221
2237
|
if (e.key === "Escape") {
|
|
2222
|
-
if (e.stopPropagation(),
|
|
2223
|
-
|
|
2238
|
+
if (e.stopPropagation(), M) {
|
|
2239
|
+
le(M);
|
|
2224
2240
|
return;
|
|
2225
2241
|
}
|
|
2226
2242
|
o({ restoreFocusTo: "menu" });
|
|
2227
2243
|
}
|
|
2228
|
-
},
|
|
2229
|
-
if (
|
|
2244
|
+
}, de = async (e) => {
|
|
2245
|
+
if (se(!1), e === t) {
|
|
2230
2246
|
o({ restoreFocusTo: "input" });
|
|
2231
2247
|
return;
|
|
2232
2248
|
}
|
|
2233
|
-
|
|
2249
|
+
ae(!0);
|
|
2234
2250
|
try {
|
|
2235
2251
|
await r({ conversationId: e });
|
|
2236
2252
|
} catch {
|
|
2237
|
-
|
|
2253
|
+
A.current = {
|
|
2238
2254
|
kind: "select",
|
|
2239
2255
|
id: e
|
|
2240
|
-
},
|
|
2256
|
+
}, se(!0), ae(!1);
|
|
2241
2257
|
return;
|
|
2242
2258
|
}
|
|
2243
|
-
|
|
2244
|
-
},
|
|
2259
|
+
ae(!1), o({ restoreFocusTo: "input" });
|
|
2260
|
+
}, fe = async (e) => {
|
|
2245
2261
|
let n = m.findIndex((t) => t.conversationId === e), r = m[n + 1] ?? m[n - 1];
|
|
2246
|
-
|
|
2262
|
+
A.current = r ? {
|
|
2247
2263
|
kind: "select",
|
|
2248
2264
|
id: r.conversationId
|
|
2249
|
-
} : { kind: "newChat" },
|
|
2265
|
+
} : { kind: "newChat" }, N(null), F(null), ie(!1), ne((e) => e + 1);
|
|
2250
2266
|
try {
|
|
2251
|
-
await
|
|
2267
|
+
await C({ conversationId: e }), ie(!0), e === t && i?.();
|
|
2252
2268
|
} catch {
|
|
2253
|
-
|
|
2269
|
+
A.current = {
|
|
2254
2270
|
kind: "delete",
|
|
2255
2271
|
id: e
|
|
2256
|
-
},
|
|
2272
|
+
}, F(e);
|
|
2257
2273
|
} finally {
|
|
2258
|
-
|
|
2274
|
+
ne((e) => e - 1);
|
|
2259
2275
|
}
|
|
2260
|
-
},
|
|
2276
|
+
}, R = h === "loading" && m.length === 0, pe = h === "error" && m.length === 0, z = h === "error" && m.length > 0 && b, B = h === "loading" && m.length > 0, V = I || n === "loading", H = R ? l.historyLoadingText : te > 0 ? l.historyDeletingText : re ? l.historyDeletedText : m.length > 0 ? Sn(m.length === 1 ? l.historyCountTextOne : l.historyCountTextMany, { count: m.length }) : "", U = R || te > 0;
|
|
2261
2277
|
return /* @__PURE__ */ y("section", {
|
|
2262
2278
|
role: "region",
|
|
2263
|
-
"aria-labelledby":
|
|
2279
|
+
"aria-labelledby": w,
|
|
2264
2280
|
className: "bailey-history-drawer",
|
|
2265
|
-
onKeyDown:
|
|
2281
|
+
onKeyDown: ue,
|
|
2266
2282
|
children: [
|
|
2267
2283
|
/* @__PURE__ */ y("div", {
|
|
2268
2284
|
className: "bailey-history-header",
|
|
@@ -2272,23 +2288,23 @@ function xn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
|
|
|
2272
2288
|
className: "bailey-history-icon-button",
|
|
2273
2289
|
"aria-label": l.historyBackAriaLabel,
|
|
2274
2290
|
onClick: () => o({ restoreFocusTo: "menu" }),
|
|
2275
|
-
children: /* @__PURE__ */ v(
|
|
2291
|
+
children: /* @__PURE__ */ v(Vt, { className: "bailey-history-icon" })
|
|
2276
2292
|
}),
|
|
2277
2293
|
/* @__PURE__ */ v("h3", {
|
|
2278
|
-
id:
|
|
2279
|
-
ref:
|
|
2294
|
+
id: w,
|
|
2295
|
+
ref: E,
|
|
2280
2296
|
tabIndex: -1,
|
|
2281
2297
|
className: "bailey-history-heading",
|
|
2282
2298
|
children: l.historyTitle
|
|
2283
2299
|
}),
|
|
2284
2300
|
/* @__PURE__ */ y("button", {
|
|
2285
|
-
ref:
|
|
2301
|
+
ref: D,
|
|
2286
2302
|
type: "button",
|
|
2287
2303
|
className: "bailey-history-button bailey-history-new-chat",
|
|
2288
2304
|
"aria-label": l.newChatButtonText,
|
|
2289
|
-
disabled:
|
|
2305
|
+
disabled: R,
|
|
2290
2306
|
onClick: a,
|
|
2291
|
-
children: [/* @__PURE__ */ v(
|
|
2307
|
+
children: [/* @__PURE__ */ v(It, { className: "bailey-history-icon-small" }), /* @__PURE__ */ v("span", {
|
|
2292
2308
|
className: "bailey-history-new-chat-text",
|
|
2293
2309
|
children: l.newChatButtonText
|
|
2294
2310
|
})]
|
|
@@ -2297,9 +2313,9 @@ function xn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
|
|
|
2297
2313
|
}),
|
|
2298
2314
|
/* @__PURE__ */ y("div", {
|
|
2299
2315
|
className: "bailey-history-body",
|
|
2300
|
-
"aria-busy":
|
|
2316
|
+
"aria-busy": R || void 0,
|
|
2301
2317
|
children: [
|
|
2302
|
-
|
|
2318
|
+
R && /* @__PURE__ */ y("div", {
|
|
2303
2319
|
"aria-hidden": "true",
|
|
2304
2320
|
children: [
|
|
2305
2321
|
/* @__PURE__ */ v("div", { className: "bailey-history-skeleton" }),
|
|
@@ -2308,25 +2324,25 @@ function xn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
|
|
|
2308
2324
|
/* @__PURE__ */ v("div", { className: "bailey-history-skeleton" })
|
|
2309
2325
|
]
|
|
2310
2326
|
}),
|
|
2311
|
-
|
|
2327
|
+
pe && /* @__PURE__ */ y("div", {
|
|
2312
2328
|
role: "alert",
|
|
2313
2329
|
className: "bailey-history-state bailey-history-state-error",
|
|
2314
2330
|
children: [
|
|
2315
|
-
/* @__PURE__ */ v(
|
|
2316
|
-
/* @__PURE__ */ v("strong", { children:
|
|
2317
|
-
/* @__PURE__ */ v("span", { children:
|
|
2331
|
+
/* @__PURE__ */ v(Ut, { className: "bailey-history-state-icon" }),
|
|
2332
|
+
/* @__PURE__ */ v("strong", { children: Cn(g) ? l.historySessionExpiredTitle : l.historyErrorTitle }),
|
|
2333
|
+
/* @__PURE__ */ v("span", { children: Cn(g) ? l.historySessionExpiredDescription : l.historyErrorDescription }),
|
|
2318
2334
|
/* @__PURE__ */ v("button", {
|
|
2319
2335
|
type: "button",
|
|
2320
2336
|
className: "bailey-history-button bailey-history-button-primary",
|
|
2321
|
-
onClick: () => void
|
|
2337
|
+
onClick: () => void x(),
|
|
2322
2338
|
children: l.retryButtonText
|
|
2323
2339
|
})
|
|
2324
2340
|
]
|
|
2325
2341
|
}),
|
|
2326
|
-
!
|
|
2342
|
+
!R && !pe && m.length === 0 && /* @__PURE__ */ y("div", {
|
|
2327
2343
|
className: "bailey-history-state",
|
|
2328
2344
|
children: [
|
|
2329
|
-
/* @__PURE__ */ v(
|
|
2345
|
+
/* @__PURE__ */ v(Nt, { className: "bailey-history-state-icon" }),
|
|
2330
2346
|
/* @__PURE__ */ v("strong", { children: l.historyEmptyTitle }),
|
|
2331
2347
|
/* @__PURE__ */ v("span", { children: l.historyEmptyDescription }),
|
|
2332
2348
|
/* @__PURE__ */ v("button", {
|
|
@@ -2341,15 +2357,15 @@ function xn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
|
|
|
2341
2357
|
className: "bailey-history-list",
|
|
2342
2358
|
children: m.map((e) => {
|
|
2343
2359
|
let n = e.conversationId, r = e.title?.trim() ? e.title : l.historyUntitledText, i = n === t;
|
|
2344
|
-
if (
|
|
2360
|
+
if (M === n) return /* @__PURE__ */ v("li", {
|
|
2345
2361
|
className: "bailey-history-row bailey-history-row-confirming",
|
|
2346
2362
|
children: /* @__PURE__ */ y("div", {
|
|
2347
2363
|
role: "group",
|
|
2348
|
-
"aria-labelledby":
|
|
2364
|
+
"aria-labelledby": T,
|
|
2349
2365
|
className: "bailey-history-confirm",
|
|
2350
2366
|
children: [
|
|
2351
2367
|
/* @__PURE__ */ v("span", {
|
|
2352
|
-
id:
|
|
2368
|
+
id: T,
|
|
2353
2369
|
className: "bailey-history-confirm-question",
|
|
2354
2370
|
children: l.historyDeleteConfirmQuestion
|
|
2355
2371
|
}),
|
|
@@ -2360,38 +2376,38 @@ function xn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
|
|
|
2360
2376
|
/* @__PURE__ */ v("button", {
|
|
2361
2377
|
type: "button",
|
|
2362
2378
|
className: "bailey-history-button bailey-history-button-danger",
|
|
2363
|
-
onClick: () => void
|
|
2379
|
+
onClick: () => void fe(n),
|
|
2364
2380
|
children: l.historyDeleteConfirmText
|
|
2365
2381
|
}),
|
|
2366
2382
|
/* @__PURE__ */ v("button", {
|
|
2367
|
-
ref:
|
|
2383
|
+
ref: O,
|
|
2368
2384
|
type: "button",
|
|
2369
2385
|
className: "bailey-history-button",
|
|
2370
|
-
onClick: () =>
|
|
2386
|
+
onClick: () => le(n),
|
|
2371
2387
|
children: l.historyDeleteCancelText
|
|
2372
2388
|
})
|
|
2373
2389
|
]
|
|
2374
2390
|
})
|
|
2375
2391
|
}, n);
|
|
2376
|
-
let a =
|
|
2392
|
+
let a = bn({
|
|
2377
2393
|
iso: e.updatedAt,
|
|
2378
2394
|
locale: L,
|
|
2379
2395
|
now: p?.(),
|
|
2380
2396
|
justNowText: l.historyJustNowText
|
|
2381
|
-
}), o =
|
|
2397
|
+
}), o = Sn(e.messageCount === 1 ? l.historyMessageCountOne : l.historyMessageCountMany, { count: e.messageCount }), s = P === n;
|
|
2382
2398
|
return /* @__PURE__ */ y("li", {
|
|
2383
2399
|
className: `bailey-history-row${i ? " bailey-history-row-active" : ""}${s ? " bailey-history-row-failed" : ""}`,
|
|
2384
2400
|
children: [
|
|
2385
2401
|
/* @__PURE__ */ y("button", {
|
|
2386
2402
|
type: "button",
|
|
2387
2403
|
ref: (e) => {
|
|
2388
|
-
e ?
|
|
2404
|
+
e ? k.current.set(n, e) : k.current.delete(n);
|
|
2389
2405
|
},
|
|
2390
2406
|
className: "bailey-history-select",
|
|
2391
2407
|
"aria-current": i ? "true" : void 0,
|
|
2392
|
-
"aria-disabled":
|
|
2408
|
+
"aria-disabled": V || void 0,
|
|
2393
2409
|
onClick: () => {
|
|
2394
|
-
|
|
2410
|
+
V || de(n);
|
|
2395
2411
|
},
|
|
2396
2412
|
children: [/* @__PURE__ */ v("span", {
|
|
2397
2413
|
className: "bailey-history-row-title",
|
|
@@ -2417,31 +2433,31 @@ function xn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
|
|
|
2417
2433
|
/* @__PURE__ */ v("button", {
|
|
2418
2434
|
type: "button",
|
|
2419
2435
|
ref: (e) => {
|
|
2420
|
-
e ?
|
|
2436
|
+
e ? ee.current.set(n, e) : ee.current.delete(n);
|
|
2421
2437
|
},
|
|
2422
2438
|
className: "bailey-history-icon-button bailey-history-delete",
|
|
2423
|
-
"aria-label":
|
|
2439
|
+
"aria-label": Sn(l.historyDeleteAriaLabel, { title: r }),
|
|
2424
2440
|
onClick: () => {
|
|
2425
|
-
|
|
2441
|
+
F(null), ie(!1), A.current = { kind: "cancel" }, N(n);
|
|
2426
2442
|
},
|
|
2427
|
-
children: /* @__PURE__ */ v(
|
|
2443
|
+
children: /* @__PURE__ */ v(Ht, { className: "bailey-history-icon" })
|
|
2428
2444
|
}),
|
|
2429
2445
|
s && /* @__PURE__ */ y("div", {
|
|
2430
2446
|
role: "alert",
|
|
2431
2447
|
className: "bailey-history-row-error",
|
|
2432
2448
|
children: [
|
|
2433
|
-
/* @__PURE__ */ v(
|
|
2449
|
+
/* @__PURE__ */ v(Ut, { className: "bailey-history-icon-small" }),
|
|
2434
2450
|
/* @__PURE__ */ v("span", { children: l.historyDeleteFailedText }),
|
|
2435
2451
|
/* @__PURE__ */ v("button", {
|
|
2436
2452
|
type: "button",
|
|
2437
2453
|
className: "bailey-history-button bailey-history-button-small",
|
|
2438
|
-
onClick: () => void
|
|
2454
|
+
onClick: () => void fe(n),
|
|
2439
2455
|
children: l.historyDeleteRetryText
|
|
2440
2456
|
}),
|
|
2441
2457
|
/* @__PURE__ */ v("button", {
|
|
2442
2458
|
type: "button",
|
|
2443
2459
|
className: "bailey-history-button bailey-history-button-small",
|
|
2444
|
-
onClick: () =>
|
|
2460
|
+
onClick: () => F(null),
|
|
2445
2461
|
children: l.historyDeleteDismissText
|
|
2446
2462
|
})
|
|
2447
2463
|
]
|
|
@@ -2450,14 +2466,14 @@ function xn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
|
|
|
2450
2466
|
}, n);
|
|
2451
2467
|
})
|
|
2452
2468
|
}),
|
|
2453
|
-
|
|
2469
|
+
oe && /* @__PURE__ */ v("div", {
|
|
2454
2470
|
role: "alert",
|
|
2455
2471
|
className: "bailey-history-inline-error",
|
|
2456
2472
|
children: l.historySelectErrorText
|
|
2457
2473
|
}),
|
|
2458
2474
|
b && m.length > 0 && /* @__PURE__ */ v("div", {
|
|
2459
2475
|
className: "bailey-history-more",
|
|
2460
|
-
children:
|
|
2476
|
+
children: z ? /* @__PURE__ */ y("div", {
|
|
2461
2477
|
role: "alert",
|
|
2462
2478
|
className: "bailey-history-inline-error",
|
|
2463
2479
|
children: [/* @__PURE__ */ v("span", { children: l.historyLoadMoreErrorText }), /* @__PURE__ */ v("button", {
|
|
@@ -2469,12 +2485,12 @@ function xn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
|
|
|
2469
2485
|
}) : /* @__PURE__ */ y("button", {
|
|
2470
2486
|
type: "button",
|
|
2471
2487
|
className: "bailey-history-button",
|
|
2472
|
-
disabled:
|
|
2488
|
+
disabled: B,
|
|
2473
2489
|
onClick: ce,
|
|
2474
|
-
children: [
|
|
2490
|
+
children: [B && /* @__PURE__ */ v("span", {
|
|
2475
2491
|
className: "bailey-history-spinner",
|
|
2476
2492
|
"aria-hidden": "true"
|
|
2477
|
-
}),
|
|
2493
|
+
}), B ? l.historyLoadingMoreText : l.historyLoadMoreText]
|
|
2478
2494
|
})
|
|
2479
2495
|
})
|
|
2480
2496
|
]
|
|
@@ -2483,17 +2499,17 @@ function xn({ conversations: e, activeConversationId: t, selectStatus: n, onSele
|
|
|
2483
2499
|
role: "status",
|
|
2484
2500
|
"aria-live": "polite",
|
|
2485
2501
|
className: "bailey-history-status",
|
|
2486
|
-
children: [
|
|
2502
|
+
children: [U && /* @__PURE__ */ v("span", {
|
|
2487
2503
|
className: "bailey-history-spinner",
|
|
2488
2504
|
"aria-hidden": "true"
|
|
2489
|
-
}),
|
|
2505
|
+
}), H]
|
|
2490
2506
|
})
|
|
2491
2507
|
]
|
|
2492
2508
|
});
|
|
2493
2509
|
}
|
|
2494
2510
|
//#endregion
|
|
2495
2511
|
//#region src/ui/historyLabels.ts
|
|
2496
|
-
var
|
|
2512
|
+
var Tn = {
|
|
2497
2513
|
newChatButtonText: "New chat",
|
|
2498
2514
|
retryButtonText: "Retry",
|
|
2499
2515
|
historyTitle: "Chat history",
|
|
@@ -2526,8 +2542,8 @@ var Sn = {
|
|
|
2526
2542
|
historyDeleteRetryText: "Try again",
|
|
2527
2543
|
historyDeleteDismissText: "Dismiss",
|
|
2528
2544
|
historyJustNowText: "just now"
|
|
2529
|
-
},
|
|
2530
|
-
...
|
|
2545
|
+
}, En = "How can bailey AI help you today?", Dn = "Reply to bailey AI", On = {
|
|
2546
|
+
...Tn,
|
|
2531
2547
|
newChatButtonText: "New chat",
|
|
2532
2548
|
newChatAriaLabel: "new chat",
|
|
2533
2549
|
historyAriaLabel: "conversation history",
|
|
@@ -2550,55 +2566,56 @@ var Sn = {
|
|
|
2550
2566
|
toolStepsFailedSuffix: ", {failed} failed",
|
|
2551
2567
|
toolStepFailedText: "failed",
|
|
2552
2568
|
toolStepStoppedText: "stopped",
|
|
2569
|
+
toolStepStartedText: "started {offset} after send",
|
|
2553
2570
|
mcpAppDefaultTitle: "MCP App",
|
|
2554
2571
|
loadEarlierButtonText: "Load earlier messages",
|
|
2555
2572
|
loadEarlierErrorText: "Couldn't load earlier messages."
|
|
2556
|
-
},
|
|
2557
|
-
...
|
|
2573
|
+
}, kn = [m], An = {
|
|
2574
|
+
...Dt(),
|
|
2558
2575
|
p: ({ children: e }) => /* @__PURE__ */ v(_, { children: e })
|
|
2559
|
-
},
|
|
2576
|
+
}, jn = i(function({ content: e, components: t }) {
|
|
2560
2577
|
return /* @__PURE__ */ v("div", {
|
|
2561
2578
|
className: "bailey-markdown-content",
|
|
2562
2579
|
children: /* @__PURE__ */ v(p, {
|
|
2563
|
-
remarkPlugins:
|
|
2580
|
+
remarkPlugins: kn,
|
|
2564
2581
|
components: t,
|
|
2565
2582
|
skipHtml: !0,
|
|
2566
2583
|
children: e
|
|
2567
2584
|
})
|
|
2568
2585
|
});
|
|
2569
2586
|
});
|
|
2570
|
-
function
|
|
2587
|
+
function Mn(e, t, n) {
|
|
2571
2588
|
if (e !== "streaming") return;
|
|
2572
2589
|
let r = t.filter((e) => e.turnSentAt === n?.sentAt);
|
|
2573
2590
|
return r[r.length - 1];
|
|
2574
2591
|
}
|
|
2575
|
-
function
|
|
2592
|
+
function Nn(e) {
|
|
2576
2593
|
if (!(!e || e.kind === "tool_end")) return rt(e);
|
|
2577
2594
|
}
|
|
2578
|
-
function
|
|
2595
|
+
function Pn(e) {
|
|
2579
2596
|
let t = new Date(e), n = t.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), r = t.toLocaleTimeString([], {
|
|
2580
2597
|
hour: "numeric",
|
|
2581
2598
|
minute: "2-digit"
|
|
2582
2599
|
});
|
|
2583
2600
|
return n ? `Today ${r}` : `${t.toLocaleDateString()} ${r}`;
|
|
2584
2601
|
}
|
|
2585
|
-
function
|
|
2586
|
-
let { messages:
|
|
2587
|
-
...
|
|
2588
|
-
...
|
|
2589
|
-
}, ce =
|
|
2590
|
-
renderTable:
|
|
2591
|
-
renderChart:
|
|
2592
|
-
}), [
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
]), q =
|
|
2602
|
+
function Fn({ chat: e, placeholder: t, replyPlaceholder: r = Dn, emptyPlaceholder: i, suggestions: o, onHistoryClick: c, history: l, locale: m, privacyNote: _, resolveActivityIcon: b, sendIcon: x, className: S, height: C, width: w, hideDeveloperDetails: T = !1, renderMessageActions: E, renderTable: D, renderChart: O, renderMcpApp: k, labels: ee, formatMessageTime: A }) {
|
|
2603
|
+
let { messages: j, traceEvents: M, lastRequest: N, status: P, error: F, send: te, stop: ne, retryLast: re, clearTrace: ie, clearError: I, newChat: ae } = e, [oe, se] = f(""), L = {
|
|
2604
|
+
...On,
|
|
2605
|
+
...ee
|
|
2606
|
+
}, ce = A ?? Pn, le = d(null), ue = d(null), de = d(null), fe = d(null), [R, pe] = f(!1), z = d(null), B = d(!1), V = !!c || !!l, H = Tt(le), U = d(null), me = d(null), W = d(!0), G = u(() => Dt({
|
|
2607
|
+
renderTable: D,
|
|
2608
|
+
renderChart: O
|
|
2609
|
+
}), [D, O]), K = u(() => Mn(P, M, N), [
|
|
2610
|
+
P,
|
|
2611
|
+
M,
|
|
2612
|
+
N
|
|
2613
|
+
]), q = Nn(K), he = K?.kind === "tool_end" ? K.at : void 0, ge = j[j.length - 1]?.content.length ?? 0, [_e, ve] = f(null), J = _e;
|
|
2597
2614
|
he !== void 0 && _e?.at !== he && (J = {
|
|
2598
2615
|
at: he,
|
|
2599
2616
|
length: ge
|
|
2600
2617
|
}, ve(J));
|
|
2601
|
-
let ye = he !== void 0 && J?.at === he && ge <= J.length, be = q ?? (ye ? L.thinkingHint : void 0), Y =
|
|
2618
|
+
let ye = he !== void 0 && J?.at === he && ge <= J.length, be = q ?? (ye ? L.thinkingHint : void 0), Y = j.length === 0, xe = t ?? (Y ? i ?? En : r);
|
|
2602
2619
|
s(() => {
|
|
2603
2620
|
let e = me.current;
|
|
2604
2621
|
if (!e) return;
|
|
@@ -2608,13 +2625,13 @@ function Mn({ chat: e, placeholder: t, replyPlaceholder: r = wn, emptyPlaceholde
|
|
|
2608
2625
|
};
|
|
2609
2626
|
return e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
|
|
2610
2627
|
}, []), s(() => {
|
|
2611
|
-
W.current &&
|
|
2612
|
-
behavior:
|
|
2628
|
+
W.current && U.current?.scrollIntoView({
|
|
2629
|
+
behavior: P === "streaming" ? "auto" : "smooth",
|
|
2613
2630
|
block: "nearest"
|
|
2614
2631
|
});
|
|
2615
|
-
}, [
|
|
2632
|
+
}, [j, P]);
|
|
2616
2633
|
let Se = (e) => {
|
|
2617
|
-
W.current = !0,
|
|
2634
|
+
W.current = !0, te(e);
|
|
2618
2635
|
}, X = d(null), Z = () => {
|
|
2619
2636
|
let t = me.current;
|
|
2620
2637
|
W.current = !1, X.current = t ? {
|
|
@@ -2627,26 +2644,26 @@ function Mn({ chat: e, placeholder: t, replyPlaceholder: r = wn, emptyPlaceholde
|
|
|
2627
2644
|
s(() => {
|
|
2628
2645
|
let e = X.current, t = me.current;
|
|
2629
2646
|
!e || !t || t.scrollHeight === e.height || (t.scrollTop = e.top + (t.scrollHeight - e.height), X.current = null);
|
|
2630
|
-
}, [
|
|
2631
|
-
|
|
2632
|
-
}, [
|
|
2633
|
-
|
|
2634
|
-
}, [
|
|
2647
|
+
}, [j]), s(() => {
|
|
2648
|
+
ue.current?.toggleAttribute("inert", R);
|
|
2649
|
+
}, [R]), s(() => {
|
|
2650
|
+
R || !z.current || ((z.current === "input" ? de.current : fe.current)?.focus(), z.current = null);
|
|
2651
|
+
}, [R]);
|
|
2635
2652
|
let Ce = a((e) => {
|
|
2636
|
-
|
|
2653
|
+
z.current = e.restoreFocusTo, pe(!1);
|
|
2637
2654
|
}, []);
|
|
2638
2655
|
return /* @__PURE__ */ v(pt.Provider, {
|
|
2639
|
-
value:
|
|
2656
|
+
value: H,
|
|
2640
2657
|
children: /* @__PURE__ */ y("div", {
|
|
2641
|
-
ref:
|
|
2642
|
-
className: `bailey-chat-panel${
|
|
2643
|
-
style:
|
|
2644
|
-
height:
|
|
2645
|
-
width:
|
|
2658
|
+
ref: le,
|
|
2659
|
+
className: `bailey-chat-panel${S ? ` ${S}` : ""}`,
|
|
2660
|
+
style: C !== void 0 || w !== void 0 ? {
|
|
2661
|
+
height: C,
|
|
2662
|
+
width: w
|
|
2646
2663
|
} : void 0,
|
|
2647
2664
|
children: [/* @__PURE__ */ y("div", {
|
|
2648
2665
|
className: "bailey-chat-panel-inner",
|
|
2649
|
-
ref:
|
|
2666
|
+
ref: ue,
|
|
2650
2667
|
children: [
|
|
2651
2668
|
/* @__PURE__ */ y("div", {
|
|
2652
2669
|
className: "bailey-chat-transcript",
|
|
@@ -2675,14 +2692,14 @@ function Mn({ chat: e, placeholder: t, replyPlaceholder: r = wn, emptyPlaceholde
|
|
|
2675
2692
|
type: "button",
|
|
2676
2693
|
onClick: () => Se(e.value ?? e.label),
|
|
2677
2694
|
className: "bailey-suggestion-card",
|
|
2678
|
-
children: [/* @__PURE__ */ v("span", { children: e.label }), /* @__PURE__ */ v(
|
|
2695
|
+
children: [/* @__PURE__ */ v("span", { children: e.label }), /* @__PURE__ */ v(At, { className: "bailey-suggestion-icon" })]
|
|
2679
2696
|
}, `${e.label}-${t}`))]
|
|
2680
2697
|
}) : /* @__PURE__ */ v("div", {
|
|
2681
2698
|
className: "bailey-empty-state",
|
|
2682
2699
|
children: L.emptyStateMessage
|
|
2683
2700
|
})),
|
|
2684
|
-
|
|
2685
|
-
let r = e.role === "assistant" && t ===
|
|
2701
|
+
j.map((e, t) => {
|
|
2702
|
+
let r = e.role === "assistant" && t === j.length - 1, i = P === "streaming" && r && e.content === "", a = e.role === "assistant" ? dt(M, e.createdAt) : [], o = a.some((e) => e.status === "running");
|
|
2686
2703
|
return /* @__PURE__ */ v("div", {
|
|
2687
2704
|
className: e.role === "user" ? "bailey-message-row bailey-message-row-user" : "bailey-message-row",
|
|
2688
2705
|
children: e.role === "user" ? /* @__PURE__ */ y("div", {
|
|
@@ -2697,7 +2714,7 @@ function Mn({ chat: e, placeholder: t, replyPlaceholder: r = wn, emptyPlaceholde
|
|
|
2697
2714
|
className: "bailey-user-bubble",
|
|
2698
2715
|
children: e.content
|
|
2699
2716
|
})]
|
|
2700
|
-
}) : i ? o ? /* @__PURE__ */ v(
|
|
2717
|
+
}) : i ? o ? /* @__PURE__ */ v(fn, {
|
|
2701
2718
|
steps: a,
|
|
2702
2719
|
resolveActivityIcon: b
|
|
2703
2720
|
}) : /* @__PURE__ */ v("div", {
|
|
@@ -2706,23 +2723,23 @@ function Mn({ chat: e, placeholder: t, replyPlaceholder: r = wn, emptyPlaceholde
|
|
|
2706
2723
|
}) : /* @__PURE__ */ y("div", {
|
|
2707
2724
|
className: "bailey-assistant-message",
|
|
2708
2725
|
children: [
|
|
2709
|
-
!e.streaming && /* @__PURE__ */ v(
|
|
2726
|
+
!e.streaming && /* @__PURE__ */ v(pn, {
|
|
2710
2727
|
steps: a,
|
|
2711
2728
|
labels: L,
|
|
2712
2729
|
resolveActivityIcon: b
|
|
2713
2730
|
}),
|
|
2714
|
-
/* @__PURE__ */ v(
|
|
2731
|
+
/* @__PURE__ */ v(jn, {
|
|
2715
2732
|
content: e.content,
|
|
2716
2733
|
components: G
|
|
2717
2734
|
}),
|
|
2718
|
-
e.parts?.map((e, t) => e.type === "image" ? /* @__PURE__ */ v(
|
|
2735
|
+
e.parts?.map((e, t) => e.type === "image" ? /* @__PURE__ */ v(tn, {
|
|
2719
2736
|
src: e.src,
|
|
2720
2737
|
alt: e.alt
|
|
2721
|
-
}, t) : e.type === "mcp_app" ? /* @__PURE__ */ v(n, { children:
|
|
2738
|
+
}, t) : e.type === "mcp_app" ? /* @__PURE__ */ v(n, { children: k ? k(e) : /* @__PURE__ */ v(ln, {
|
|
2722
2739
|
...e,
|
|
2723
2740
|
title: e.title ?? L.mcpAppDefaultTitle
|
|
2724
2741
|
}) }, t) : null),
|
|
2725
|
-
e.streaming && /* @__PURE__ */ v(
|
|
2742
|
+
e.streaming && /* @__PURE__ */ v(fn, {
|
|
2726
2743
|
steps: a,
|
|
2727
2744
|
resolveActivityIcon: b
|
|
2728
2745
|
}),
|
|
@@ -2732,73 +2749,73 @@ function Mn({ chat: e, placeholder: t, replyPlaceholder: r = wn, emptyPlaceholde
|
|
|
2732
2749
|
}),
|
|
2733
2750
|
!e.streaming && /* @__PURE__ */ y("div", {
|
|
2734
2751
|
className: "bailey-message-actions",
|
|
2735
|
-
children: [/* @__PURE__ */ v(
|
|
2752
|
+
children: [/* @__PURE__ */ v(Gt, {
|
|
2736
2753
|
markdown: e.content,
|
|
2737
2754
|
ariaLabel: L.copyButtonAriaLabel,
|
|
2738
2755
|
tooltipDefaultText: L.copyButtonTooltipDefault,
|
|
2739
2756
|
tooltipCopiedText: L.copyButtonTooltipCopied
|
|
2740
|
-
}),
|
|
2757
|
+
}), E?.(e)]
|
|
2741
2758
|
})
|
|
2742
2759
|
]
|
|
2743
2760
|
})
|
|
2744
2761
|
}, e.id);
|
|
2745
2762
|
}),
|
|
2746
|
-
/* @__PURE__ */ v("div", { ref:
|
|
2763
|
+
/* @__PURE__ */ v("div", { ref: U })
|
|
2747
2764
|
]
|
|
2748
2765
|
}),
|
|
2749
|
-
|
|
2766
|
+
F && /* @__PURE__ */ y("div", {
|
|
2750
2767
|
className: "bailey-error-banner",
|
|
2751
2768
|
role: "alert",
|
|
2752
|
-
children: [/* @__PURE__ */ v("span", { children:
|
|
2769
|
+
children: [/* @__PURE__ */ v("span", { children: F }), /* @__PURE__ */ y("div", {
|
|
2753
2770
|
className: "bailey-error-actions",
|
|
2754
2771
|
children: [/* @__PURE__ */ v("button", {
|
|
2755
2772
|
type: "button",
|
|
2756
|
-
onClick:
|
|
2773
|
+
onClick: re,
|
|
2757
2774
|
className: "bailey-retry-button",
|
|
2758
2775
|
children: L.retryButtonText
|
|
2759
2776
|
}), /* @__PURE__ */ v("button", {
|
|
2760
2777
|
type: "button",
|
|
2761
|
-
onClick:
|
|
2778
|
+
onClick: I,
|
|
2762
2779
|
"aria-label": L.dismissErrorAriaLabel,
|
|
2763
2780
|
className: "bailey-dismiss-button",
|
|
2764
2781
|
children: "✕"
|
|
2765
2782
|
})]
|
|
2766
2783
|
})]
|
|
2767
2784
|
}),
|
|
2768
|
-
!
|
|
2769
|
-
events:
|
|
2770
|
-
lastRequest:
|
|
2771
|
-
onClear:
|
|
2785
|
+
!T && /* @__PURE__ */ v(en, {
|
|
2786
|
+
events: M,
|
|
2787
|
+
lastRequest: N,
|
|
2788
|
+
onClear: ie
|
|
2772
2789
|
}),
|
|
2773
2790
|
/* @__PURE__ */ y("div", {
|
|
2774
2791
|
className: "bailey-input-area",
|
|
2775
2792
|
children: [/* @__PURE__ */ y("form", {
|
|
2776
2793
|
onSubmit: (e) => {
|
|
2777
|
-
e.preventDefault(), !(!
|
|
2794
|
+
e.preventDefault(), !(!oe.trim() || P === "streaming") && (Se(oe), se(""));
|
|
2778
2795
|
},
|
|
2779
2796
|
className: "bailey-input-row",
|
|
2780
2797
|
children: [/* @__PURE__ */ v("input", {
|
|
2781
|
-
ref:
|
|
2798
|
+
ref: de,
|
|
2782
2799
|
type: "text",
|
|
2783
2800
|
placeholder: xe,
|
|
2784
2801
|
"aria-label": xe,
|
|
2785
|
-
value:
|
|
2786
|
-
onChange: (e) =>
|
|
2787
|
-
disabled:
|
|
2802
|
+
value: oe,
|
|
2803
|
+
onChange: (e) => se(e.target.value),
|
|
2804
|
+
disabled: P === "streaming",
|
|
2788
2805
|
className: "bailey-input"
|
|
2789
|
-
}),
|
|
2806
|
+
}), P === "streaming" ? /* @__PURE__ */ v(g.Provider, {
|
|
2790
2807
|
delayDuration: 200,
|
|
2791
2808
|
children: /* @__PURE__ */ y(g.Root, { children: [/* @__PURE__ */ v(g.Trigger, {
|
|
2792
2809
|
asChild: !0,
|
|
2793
2810
|
children: /* @__PURE__ */ v("button", {
|
|
2794
2811
|
type: "button",
|
|
2795
|
-
onClick:
|
|
2812
|
+
onClick: ne,
|
|
2796
2813
|
"aria-label": L.stopAriaLabel,
|
|
2797
2814
|
className: "bailey-stop-button",
|
|
2798
|
-
children: /* @__PURE__ */ v(
|
|
2815
|
+
children: /* @__PURE__ */ v(kt, { className: "bailey-stop-icon" })
|
|
2799
2816
|
})
|
|
2800
2817
|
}), /* @__PURE__ */ v(g.Portal, {
|
|
2801
|
-
container:
|
|
2818
|
+
container: H instanceof ShadowRoot ? H : void 0,
|
|
2802
2819
|
children: /* @__PURE__ */ y(g.Content, {
|
|
2803
2820
|
side: "top",
|
|
2804
2821
|
className: "bailey-tooltip-content",
|
|
@@ -2808,43 +2825,43 @@ function Mn({ chat: e, placeholder: t, replyPlaceholder: r = wn, emptyPlaceholde
|
|
|
2808
2825
|
}) : /* @__PURE__ */ v("button", {
|
|
2809
2826
|
type: "submit",
|
|
2810
2827
|
"aria-label": L.sendAriaLabel,
|
|
2811
|
-
disabled: !
|
|
2828
|
+
disabled: !oe.trim(),
|
|
2812
2829
|
className: "bailey-send-button",
|
|
2813
|
-
children:
|
|
2830
|
+
children: x ?? /* @__PURE__ */ v(Ot, { className: "bailey-send-icon" })
|
|
2814
2831
|
})]
|
|
2815
|
-
}), (!Y ||
|
|
2832
|
+
}), (!Y || V) && /* @__PURE__ */ y(h.Root, { children: [/* @__PURE__ */ v(h.Trigger, {
|
|
2816
2833
|
asChild: !0,
|
|
2817
2834
|
children: /* @__PURE__ */ v("button", {
|
|
2818
2835
|
type: "button",
|
|
2819
|
-
ref:
|
|
2836
|
+
ref: fe,
|
|
2820
2837
|
"aria-label": L.menuAriaLabel,
|
|
2821
2838
|
className: "bailey-menu-button",
|
|
2822
|
-
children: /* @__PURE__ */ v(
|
|
2839
|
+
children: /* @__PURE__ */ v(Ft, { className: "bailey-menu-icon" })
|
|
2823
2840
|
})
|
|
2824
2841
|
}), /* @__PURE__ */ v(h.Portal, {
|
|
2825
|
-
container:
|
|
2842
|
+
container: H instanceof ShadowRoot ? H : void 0,
|
|
2826
2843
|
children: /* @__PURE__ */ y(h.Content, {
|
|
2827
2844
|
side: "top",
|
|
2828
2845
|
align: "end",
|
|
2829
2846
|
sideOffset: 8,
|
|
2830
2847
|
className: "bailey-menu-content",
|
|
2831
2848
|
onCloseAutoFocus: (e) => {
|
|
2832
|
-
|
|
2849
|
+
B.current &&= (e.preventDefault(), !1);
|
|
2833
2850
|
},
|
|
2834
2851
|
children: [!Y && /* @__PURE__ */ y(h.Item, {
|
|
2835
|
-
onSelect: () =>
|
|
2852
|
+
onSelect: () => ae(),
|
|
2836
2853
|
className: "bailey-menu-item",
|
|
2837
|
-
children: [/* @__PURE__ */ v(
|
|
2838
|
-
}),
|
|
2854
|
+
children: [/* @__PURE__ */ v(It, { className: "bailey-menu-item-icon" }), L.newChatButtonText]
|
|
2855
|
+
}), V && /* @__PURE__ */ y(h.Item, {
|
|
2839
2856
|
onSelect: () => {
|
|
2840
2857
|
if (c) {
|
|
2841
2858
|
c();
|
|
2842
2859
|
return;
|
|
2843
2860
|
}
|
|
2844
|
-
|
|
2861
|
+
B.current = !0, pe(!0);
|
|
2845
2862
|
},
|
|
2846
2863
|
className: "bailey-menu-item",
|
|
2847
|
-
children: [/* @__PURE__ */ v(
|
|
2864
|
+
children: [/* @__PURE__ */ v(Nt, { className: "bailey-menu-item-icon" }), L.historyMenuItemText]
|
|
2848
2865
|
})]
|
|
2849
2866
|
})
|
|
2850
2867
|
})] })]
|
|
@@ -2852,14 +2869,14 @@ function Mn({ chat: e, placeholder: t, replyPlaceholder: r = wn, emptyPlaceholde
|
|
|
2852
2869
|
(Y || _?.alwaysVisible) && _ && /* @__PURE__ */ v("div", {
|
|
2853
2870
|
className: "bailey-privacy-note",
|
|
2854
2871
|
children: /* @__PURE__ */ v(p, {
|
|
2855
|
-
remarkPlugins:
|
|
2856
|
-
components:
|
|
2872
|
+
remarkPlugins: kn,
|
|
2873
|
+
components: An,
|
|
2857
2874
|
skipHtml: !0,
|
|
2858
2875
|
children: _.markdown
|
|
2859
2876
|
})
|
|
2860
2877
|
})
|
|
2861
2878
|
]
|
|
2862
|
-
}),
|
|
2879
|
+
}), R && l && !c && /* @__PURE__ */ v(xn, {
|
|
2863
2880
|
client: l.client,
|
|
2864
2881
|
pageSize: l.pageSize,
|
|
2865
2882
|
chat: e,
|
|
@@ -2872,7 +2889,7 @@ function Mn({ chat: e, placeholder: t, replyPlaceholder: r = wn, emptyPlaceholde
|
|
|
2872
2889
|
}
|
|
2873
2890
|
//#endregion
|
|
2874
2891
|
//#region src/ui/BaileyFeedbackButtons.tsx
|
|
2875
|
-
var
|
|
2892
|
+
var In = {
|
|
2876
2893
|
feedbackGroupLabel: "Rate this response",
|
|
2877
2894
|
feedbackThumbsUpAriaLabel: "Good response",
|
|
2878
2895
|
feedbackThumbsDownAriaLabel: "Bad response",
|
|
@@ -2893,48 +2910,48 @@ var Nn = {
|
|
|
2893
2910
|
feedbackReasonUnsafe: "Unsafe",
|
|
2894
2911
|
feedbackReasonTooLong: "Too long",
|
|
2895
2912
|
feedbackReasonOther: "Other"
|
|
2896
|
-
},
|
|
2913
|
+
}, Ln = 2e3, Rn = [
|
|
2897
2914
|
"inaccurate",
|
|
2898
2915
|
"unhelpful",
|
|
2899
2916
|
"unsafe",
|
|
2900
2917
|
"too_long",
|
|
2901
2918
|
"other"
|
|
2902
|
-
],
|
|
2919
|
+
], zn = {
|
|
2903
2920
|
inaccurate: "feedbackReasonInaccurate",
|
|
2904
2921
|
unhelpful: "feedbackReasonUnhelpful",
|
|
2905
2922
|
unsafe: "feedbackReasonUnsafe",
|
|
2906
2923
|
too_long: "feedbackReasonTooLong",
|
|
2907
2924
|
other: "feedbackReasonOther"
|
|
2908
|
-
},
|
|
2909
|
-
function
|
|
2910
|
-
return Array.from(new Set((e ??
|
|
2925
|
+
}, Bn = (e) => Rn.includes(e) ? e : "other";
|
|
2926
|
+
function Vn(e) {
|
|
2927
|
+
return Array.from(new Set((e ?? Rn).map(Bn)));
|
|
2911
2928
|
}
|
|
2912
|
-
function
|
|
2913
|
-
return typeof e == "number" && e > 0 ? Math.min(Math.floor(e),
|
|
2929
|
+
function Hn(e) {
|
|
2930
|
+
return typeof e == "number" && e > 0 ? Math.min(Math.floor(e), Ln) : Ln;
|
|
2914
2931
|
}
|
|
2915
|
-
function
|
|
2932
|
+
function Un(e, t) {
|
|
2916
2933
|
if (e === null || t === null) return e === t;
|
|
2917
2934
|
let n = e.reasonCodes ?? [], r = t.reasonCodes ?? [];
|
|
2918
2935
|
return e.rating === t.rating && (e.comment ?? "") === (t.comment ?? "") && n.length === r.length && n.every((e, t) => e === r[t]);
|
|
2919
2936
|
}
|
|
2920
|
-
function
|
|
2921
|
-
return e.messageId ? /* @__PURE__ */ v(
|
|
2937
|
+
function Wn(e) {
|
|
2938
|
+
return e.messageId ? /* @__PURE__ */ v(Gn, { ...e }, e.messageId) : null;
|
|
2922
2939
|
}
|
|
2923
|
-
function
|
|
2940
|
+
function Gn({ messageId: e, onSubmit: t, onClear: n, initialRating: r, reasonOptions: i, maxCommentLength: a, labels: o, className: l }) {
|
|
2924
2941
|
let u = {
|
|
2925
|
-
...
|
|
2942
|
+
...In,
|
|
2926
2943
|
...o
|
|
2927
|
-
}, p =
|
|
2928
|
-
s(() => (
|
|
2929
|
-
|
|
2944
|
+
}, p = Vn(i), m = Hn(a), h = r ? { rating: r } : null, [b, x] = f(h), [S, C] = f(r ?? null), [w, T] = f(!1), [E, D] = f("down"), [O, k] = f([]), [ee, A] = f(""), [j, M] = f(!1), [N, P] = f(!1), [F, te] = f(!1), [ne, re] = f(!1), ie = d(h), I = d(null), ae = d(0), oe = d(!1), se = d(!0), L = d(null), ce = d(null), le = d(null), ue = d(null), de = d(null), fe = Et(ce), R = c(), pe = `${R}-comment`, z = `${R}-counter`, B = `${R}-privacy`;
|
|
2945
|
+
s(() => (se.current = !0, () => {
|
|
2946
|
+
se.current = !1;
|
|
2930
2947
|
}), []), s(() => {
|
|
2931
|
-
|
|
2932
|
-
}, [
|
|
2933
|
-
L.current && !
|
|
2948
|
+
w && de.current?.focus();
|
|
2949
|
+
}, [w]), s(() => {
|
|
2950
|
+
L.current && !F && !w && ((L.current === "up" ? le : ue).current?.focus(), L.current = null);
|
|
2934
2951
|
});
|
|
2935
|
-
let
|
|
2936
|
-
|
|
2937
|
-
},
|
|
2952
|
+
let V = () => {
|
|
2953
|
+
k([]), A("");
|
|
2954
|
+
}, H = async (r) => {
|
|
2938
2955
|
try {
|
|
2939
2956
|
return r.kind === "clear" ? await n({ messageId: e }) : await t({
|
|
2940
2957
|
messageId: e,
|
|
@@ -2943,71 +2960,71 @@ function Hn({ messageId: e, onSubmit: t, onClear: n, initialRating: r, reasonOpt
|
|
|
2943
2960
|
} catch {
|
|
2944
2961
|
return !1;
|
|
2945
2962
|
}
|
|
2946
|
-
},
|
|
2947
|
-
if (!
|
|
2948
|
-
|
|
2963
|
+
}, U = async () => {
|
|
2964
|
+
if (!oe.current) {
|
|
2965
|
+
oe.current = !0, P(!0);
|
|
2949
2966
|
try {
|
|
2950
|
-
for (;
|
|
2951
|
-
let e =
|
|
2952
|
-
if (!
|
|
2953
|
-
let r =
|
|
2954
|
-
!n && r || (n ? (
|
|
2967
|
+
for (; I.current && se.current;) {
|
|
2968
|
+
let e = I.current, t = e.kind === "clear" ? null : e.snapshot, n = !(e.kind === "submit" && e.formSubmit) && Un(t, ie.current) || await H(e);
|
|
2969
|
+
if (!se.current) return;
|
|
2970
|
+
let r = I.current?.version !== e.version;
|
|
2971
|
+
!n && r || (n ? (ie.current = t, x(t)) : (C(ie.current?.rating ?? null), re(!0)), r || (I.current = null, te(!1), n && e.kind === "submit" && e.formSubmit && (T(!1), M(!0), L.current = e.snapshot.rating)));
|
|
2955
2972
|
}
|
|
2956
2973
|
} finally {
|
|
2957
|
-
|
|
2974
|
+
oe.current = !1, se.current && P(!1);
|
|
2958
2975
|
}
|
|
2959
2976
|
}
|
|
2960
2977
|
}, me = (e) => {
|
|
2961
|
-
|
|
2978
|
+
ae.current += 1, I.current = {
|
|
2962
2979
|
...e,
|
|
2963
|
-
version:
|
|
2964
|
-
},
|
|
2980
|
+
version: ae.current
|
|
2981
|
+
}, re(!1), U();
|
|
2965
2982
|
}, W = () => {
|
|
2966
|
-
|
|
2983
|
+
C(null), T(!1), M(!1), V(), me({ kind: "clear" });
|
|
2967
2984
|
}, G = (e) => {
|
|
2968
|
-
if (!
|
|
2969
|
-
if (
|
|
2985
|
+
if (!F) {
|
|
2986
|
+
if (S === e) {
|
|
2970
2987
|
W();
|
|
2971
2988
|
return;
|
|
2972
2989
|
}
|
|
2973
|
-
|
|
2990
|
+
C(e), M(!1), V(), e === "down" ? (D("down"), T(!0)) : T(!1), me({
|
|
2974
2991
|
kind: "submit",
|
|
2975
2992
|
snapshot: { rating: e },
|
|
2976
2993
|
formSubmit: !1
|
|
2977
2994
|
});
|
|
2978
2995
|
}
|
|
2979
2996
|
}, K = (e) => {
|
|
2980
|
-
|
|
2997
|
+
S !== null && (D(S), k((e?.reasonCodes ?? []).map(Bn)), A(e?.comment ?? ""), re(!1), T(!0));
|
|
2981
2998
|
}, q = () => {
|
|
2982
|
-
|
|
2999
|
+
F || (T(!1), re(!1), V(), L.current = E);
|
|
2983
3000
|
}, he = () => {
|
|
2984
|
-
if (
|
|
2985
|
-
let e =
|
|
2986
|
-
rating:
|
|
3001
|
+
if (F) return;
|
|
3002
|
+
let e = ee.trim(), t = p.filter((e) => O.includes(e)), n = {
|
|
3003
|
+
rating: E,
|
|
2987
3004
|
...t.length > 0 ? { reasonCodes: t } : {},
|
|
2988
3005
|
...e ? { comment: e } : {}
|
|
2989
3006
|
};
|
|
2990
|
-
|
|
3007
|
+
te(!0), C(E), me({
|
|
2991
3008
|
kind: "submit",
|
|
2992
3009
|
snapshot: n,
|
|
2993
3010
|
formSubmit: !0
|
|
2994
3011
|
});
|
|
2995
3012
|
}, ge = (e) => {
|
|
2996
|
-
|
|
3013
|
+
k((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
2997
3014
|
}, _e = (e) => {
|
|
2998
3015
|
e.key === "Escape" && (e.stopPropagation(), q());
|
|
2999
|
-
}, ve =
|
|
3000
|
-
let t =
|
|
3016
|
+
}, ve = S !== null && b?.rating === S && !N && !w, J = !!b && (!!b.comment || (b.reasonCodes?.length ?? 0) > 0), ye = N ? u.feedbackSavingText : ve ? u.feedbackThanksText : "", be = (e) => {
|
|
3017
|
+
let t = S === e, n = e === "up" ? u.feedbackThumbsUpAriaLabel : u.feedbackThumbsDownAriaLabel, r = e === "up" ? zt : Bt;
|
|
3001
3018
|
return /* @__PURE__ */ y(g.Root, { children: [/* @__PURE__ */ v(g.Trigger, {
|
|
3002
3019
|
asChild: !0,
|
|
3003
3020
|
children: /* @__PURE__ */ v("button", {
|
|
3004
|
-
ref: e === "up" ?
|
|
3021
|
+
ref: e === "up" ? le : ue,
|
|
3005
3022
|
type: "button",
|
|
3006
3023
|
className: "bailey-feedback-thumb",
|
|
3007
3024
|
"aria-pressed": t,
|
|
3008
3025
|
"aria-label": n,
|
|
3009
|
-
"aria-busy": t &&
|
|
3010
|
-
disabled:
|
|
3026
|
+
"aria-busy": t && N ? !0 : void 0,
|
|
3027
|
+
disabled: F,
|
|
3011
3028
|
onClick: () => G(e),
|
|
3012
3029
|
children: /* @__PURE__ */ v(r, {
|
|
3013
3030
|
className: "bailey-feedback-icon",
|
|
@@ -3015,7 +3032,7 @@ function Hn({ messageId: e, onSubmit: t, onClear: n, initialRating: r, reasonOpt
|
|
|
3015
3032
|
})
|
|
3016
3033
|
})
|
|
3017
3034
|
}), /* @__PURE__ */ v(g.Portal, {
|
|
3018
|
-
container:
|
|
3035
|
+
container: fe instanceof ShadowRoot ? fe : void 0,
|
|
3019
3036
|
children: /* @__PURE__ */ y(g.Content, {
|
|
3020
3037
|
side: "top",
|
|
3021
3038
|
className: "bailey-tooltip-content",
|
|
@@ -3032,7 +3049,7 @@ function Hn({ messageId: e, onSubmit: t, onClear: n, initialRating: r, reasonOpt
|
|
|
3032
3049
|
children: /* @__PURE__ */ y("div", {
|
|
3033
3050
|
role: "group",
|
|
3034
3051
|
"aria-label": u.feedbackGroupLabel,
|
|
3035
|
-
"aria-busy":
|
|
3052
|
+
"aria-busy": N ? !0 : void 0,
|
|
3036
3053
|
className: "bailey-feedback-thumbs",
|
|
3037
3054
|
children: [be("up"), be("down")]
|
|
3038
3055
|
})
|
|
@@ -3040,7 +3057,7 @@ function Hn({ messageId: e, onSubmit: t, onClear: n, initialRating: r, reasonOpt
|
|
|
3040
3057
|
/* @__PURE__ */ y("span", {
|
|
3041
3058
|
role: "status",
|
|
3042
3059
|
className: "bailey-feedback-status",
|
|
3043
|
-
children: [
|
|
3060
|
+
children: [N && /* @__PURE__ */ v("span", {
|
|
3044
3061
|
className: "bailey-feedback-spinner",
|
|
3045
3062
|
"aria-hidden": "true"
|
|
3046
3063
|
}), ye]
|
|
@@ -3049,19 +3066,19 @@ function Hn({ messageId: e, onSubmit: t, onClear: n, initialRating: r, reasonOpt
|
|
|
3049
3066
|
type: "button",
|
|
3050
3067
|
className: "bailey-feedback-link",
|
|
3051
3068
|
onClick: () => K(b),
|
|
3052
|
-
children:
|
|
3069
|
+
children: j || J ? u.feedbackEditText : u.feedbackAddCommentText
|
|
3053
3070
|
}), /* @__PURE__ */ v("button", {
|
|
3054
3071
|
type: "button",
|
|
3055
3072
|
className: "bailey-feedback-link",
|
|
3056
3073
|
onClick: W,
|
|
3057
3074
|
children: u.feedbackUndoText
|
|
3058
3075
|
})] }),
|
|
3059
|
-
|
|
3076
|
+
ne && /* @__PURE__ */ v("span", {
|
|
3060
3077
|
role: "alert",
|
|
3061
3078
|
className: "bailey-feedback-error",
|
|
3062
3079
|
children: u.feedbackErrorText
|
|
3063
3080
|
}),
|
|
3064
|
-
|
|
3081
|
+
w && /* @__PURE__ */ y("div", {
|
|
3065
3082
|
className: "bailey-feedback-form",
|
|
3066
3083
|
onKeyDown: _e,
|
|
3067
3084
|
children: [
|
|
@@ -3074,45 +3091,45 @@ function Hn({ messageId: e, onSubmit: t, onClear: n, initialRating: r, reasonOpt
|
|
|
3074
3091
|
className: "bailey-feedback-chips",
|
|
3075
3092
|
children: p.map((e, t) => /* @__PURE__ */ v("button", {
|
|
3076
3093
|
ref: t === 0 ? (e) => {
|
|
3077
|
-
|
|
3094
|
+
de.current = e;
|
|
3078
3095
|
} : void 0,
|
|
3079
3096
|
type: "button",
|
|
3080
3097
|
className: "bailey-feedback-chip",
|
|
3081
|
-
"aria-pressed":
|
|
3082
|
-
disabled:
|
|
3098
|
+
"aria-pressed": O.includes(e),
|
|
3099
|
+
disabled: F,
|
|
3083
3100
|
onClick: () => ge(e),
|
|
3084
|
-
children: u[
|
|
3101
|
+
children: u[zn[e]]
|
|
3085
3102
|
}, e))
|
|
3086
3103
|
})]
|
|
3087
3104
|
}),
|
|
3088
3105
|
/* @__PURE__ */ v("label", {
|
|
3089
|
-
htmlFor:
|
|
3106
|
+
htmlFor: pe,
|
|
3090
3107
|
className: "bailey-feedback-legend",
|
|
3091
3108
|
children: u.feedbackCommentLabel
|
|
3092
3109
|
}),
|
|
3093
3110
|
/* @__PURE__ */ v("textarea", {
|
|
3094
|
-
id:
|
|
3111
|
+
id: pe,
|
|
3095
3112
|
ref: p.length === 0 ? (e) => {
|
|
3096
|
-
|
|
3113
|
+
de.current = e;
|
|
3097
3114
|
} : void 0,
|
|
3098
3115
|
className: "bailey-feedback-textarea",
|
|
3099
|
-
value:
|
|
3116
|
+
value: ee,
|
|
3100
3117
|
maxLength: m,
|
|
3101
3118
|
placeholder: u.feedbackCommentPlaceholder,
|
|
3102
|
-
"aria-describedby": `${
|
|
3103
|
-
disabled:
|
|
3104
|
-
onChange: (e) =>
|
|
3119
|
+
"aria-describedby": `${z} ${B}`,
|
|
3120
|
+
disabled: F,
|
|
3121
|
+
onChange: (e) => A(e.target.value.slice(0, m))
|
|
3105
3122
|
}),
|
|
3106
3123
|
/* @__PURE__ */ y("div", {
|
|
3107
3124
|
className: "bailey-feedback-meta",
|
|
3108
3125
|
children: [/* @__PURE__ */ v("span", {
|
|
3109
|
-
id:
|
|
3126
|
+
id: B,
|
|
3110
3127
|
className: "bailey-feedback-privacy",
|
|
3111
3128
|
children: u.feedbackPrivacyNote
|
|
3112
3129
|
}), /* @__PURE__ */ v("span", {
|
|
3113
|
-
id:
|
|
3130
|
+
id: z,
|
|
3114
3131
|
className: "bailey-feedback-counter",
|
|
3115
|
-
children: `${
|
|
3132
|
+
children: `${ee.length} / ${m}`
|
|
3116
3133
|
})]
|
|
3117
3134
|
}),
|
|
3118
3135
|
/* @__PURE__ */ y("div", {
|
|
@@ -3120,15 +3137,15 @@ function Hn({ messageId: e, onSubmit: t, onClear: n, initialRating: r, reasonOpt
|
|
|
3120
3137
|
children: [/* @__PURE__ */ v("button", {
|
|
3121
3138
|
type: "button",
|
|
3122
3139
|
className: "bailey-feedback-button",
|
|
3123
|
-
disabled:
|
|
3140
|
+
disabled: F,
|
|
3124
3141
|
onClick: q,
|
|
3125
3142
|
children: u.feedbackCancelText
|
|
3126
3143
|
}), /* @__PURE__ */ v("button", {
|
|
3127
3144
|
type: "button",
|
|
3128
3145
|
className: "bailey-feedback-button bailey-feedback-button-primary",
|
|
3129
|
-
disabled:
|
|
3146
|
+
disabled: F,
|
|
3130
3147
|
onClick: he,
|
|
3131
|
-
children:
|
|
3148
|
+
children: F ? u.feedbackSavingText : u.feedbackSubmitText
|
|
3132
3149
|
})]
|
|
3133
3150
|
})
|
|
3134
3151
|
]
|
|
@@ -3138,6 +3155,6 @@ function Hn({ messageId: e, onSubmit: t, onClear: n, initialRating: r, reasonOpt
|
|
|
3138
3155
|
}
|
|
3139
3156
|
//#endregion
|
|
3140
3157
|
//#region src/index.ts
|
|
3141
|
-
var
|
|
3158
|
+
var Kn = "0.3.1-pre.2";
|
|
3142
3159
|
//#endregion
|
|
3143
|
-
export {
|
|
3160
|
+
export { Pt as ActivityIcon, At as ArrowUpRightIcon, Kn as BAILEYAI_CHAT_UI_VERSION, Ve as BAILEY_CHART_PROMPT_FRAGMENT, Ne as BAILEY_TABLE_GRID_ROW_THRESHOLD, B as BaileyApiError, Fn as BaileyChatPanel, H as BaileyCleanupError, Wn as BaileyFeedbackButtons, xn as BaileyHistoryDrawer, en as BaileyTracePanel, Gt as CopyMarkdownButton, re as DEFAULT_CONVERSATION_STORAGE_KEY, Ot as HeartIcon, Ye as TRACE_KIND_LABEL, Bt as ThumbDownIcon, zt as ThumbUpIcon, Oe as createBaileyClient, ke as createBaileyFeedbackHandlers, Dt as createBaileyMarkdownComponents, I as createMemoryConversationStorage, ie as createSessionConversationStorage, k as extractPseudoToolCalls, ze as extractTableData, bn as formatRelativeTime, at as formatTraceGap, it as formatTraceTime, lt as hasTraceFailure, ne as isConversationIdForSub, e as isSafeMarkdownUrl, Ae as joinInstructions, P as mapTranscript, te as mergeEarlierPage, Je as parseBaileyChartSpec, A as parseSseFrames, $ as resolveToolCall, Be as shouldUseGrid, ut as toActivityLines, dt as toToolSteps, ot as toTraceRows, ct as toTraceSegments, $e as traceEventArgsDetail, rt as traceEventHint, et as traceEventOutputDetail, nt as traceEventRawDetail, Qe as traceEventSummary, Ze as traceEventToolName, st as traceSummaryLine, z as useBaileyChat, me as useBaileyConversations };
|