@burdenoff/microfe-healthybowl 2026.831.8 → 2026.831.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/assistant/AssistantChatArea.js +113 -112
- package/dist/components/assistant/AssistantChatArea.js.map +1 -1
- package/dist/hooks/useVoiceSession.js +38 -36
- package/dist/hooks/useVoiceSession.js.map +1 -1
- package/dist/utils/assistantPollSchedule.js +8 -0
- package/dist/utils/assistantPollSchedule.js.map +1 -0
- package/dist/utils/speakableText.js +8 -1
- package/dist/utils/speakableText.js.map +1 -1
- package/dist/utils/voiceSession.js +11 -10
- package/dist/utils/voiceSession.js.map +1 -1
- package/package.json +2 -2
|
@@ -19,44 +19,45 @@ import { isQuotaExhaustedError as ue } from "../../utils/quotaUtils.js";
|
|
|
19
19
|
import { dispatchAssistantQuotaExhausted as de, notifyAiCreditsUpdated as fe } from "../../utils/aiCredits.js";
|
|
20
20
|
import { buildPromptForMode as pe } from "../../utils/assistantPrompt.js";
|
|
21
21
|
import { isMultimodalBodyRejection as me, isRecoverableAssistantError as he } from "../../utils/assistantTransportErrors.js";
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
22
|
+
import { pollDelayMs as ge } from "../../utils/assistantPollSchedule.js";
|
|
23
|
+
import { useCallback as w, useEffect as T, useMemo as E, useRef as _e, useState as ve } from "react";
|
|
24
|
+
import { useI18n as ye } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
25
|
+
import { jsx as D, jsxs as be } from "react/jsx-runtime";
|
|
26
|
+
import { useGatewayClient as xe } from "@burdenoff/fe-libs/shared/graphql";
|
|
27
|
+
import { useAuthToken as Se } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
28
|
+
import { getAssistantMedia as O } from "@burdenoff/fe-libs/shared/assistant";
|
|
28
29
|
//#region src/components/assistant/AssistantChatArea.tsx
|
|
29
|
-
var
|
|
30
|
+
var Ce = {
|
|
30
31
|
general: 18e4,
|
|
31
32
|
assistant: 18e4,
|
|
32
33
|
"api-calls": 18e4,
|
|
33
34
|
"vibe-plugins": 6e5
|
|
34
|
-
},
|
|
35
|
-
function
|
|
35
|
+
}, we = 18e4;
|
|
36
|
+
function Te() {
|
|
36
37
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
+
function Ee(e) {
|
|
39
40
|
return e.replace(/(Authorization\s*:\s*Bearer\s+)[^\s\n]+/gi, "$1[REDACTED]").replace(/(X-Workspace-Authorization\s*:\s*Bearer\s+)[^\s\n]+/gi, "$1[REDACTED]").replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9._-]+\.[A-Za-z0-9._-]+\b/g, "[REDACTED_JWT]").replace(/\bsk-ant-[A-Za-z0-9-]+\b/g, "[REDACTED_API_KEY]");
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
+
function k(e) {
|
|
42
43
|
return e.info?.time?.created ?? 0;
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
+
function A(e) {
|
|
45
46
|
return (e ?? []).filter((e) => e.type === "text" && typeof e.text == "string").map((e) => e.text?.trim() ?? "").filter(Boolean).join("\n");
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
+
function j(e) {
|
|
48
49
|
return (e ?? []).filter((e) => e.type === "tool" && e.tool).map((e) => {
|
|
49
50
|
let t = e.state?.status ?? "running", n = e.tool ?? "tool";
|
|
50
51
|
return t === "completed" ? `Completed: ${n}` : t === "failed" ? `Failed: ${n}` : `Running: ${n}`;
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
-
let n = e.filter((e) => e.info?.role === "assistant" &&
|
|
54
|
+
function De(e, t) {
|
|
55
|
+
let n = e.filter((e) => e.info?.role === "assistant" && k(e) > t).sort((e, t) => k(e) - k(t));
|
|
55
56
|
if (n.length === 0) return {
|
|
56
57
|
content: "Thinking...",
|
|
57
58
|
done: !1
|
|
58
59
|
};
|
|
59
|
-
let r = n[n.length - 1], i =
|
|
60
|
+
let r = n[n.length - 1], i = A(r.parts), a = O(r.parts), o = j(r.parts);
|
|
60
61
|
return {
|
|
61
62
|
content: [
|
|
62
63
|
i,
|
|
@@ -67,7 +68,7 @@ function Te(e, t) {
|
|
|
67
68
|
tokens: r.info?.tokens
|
|
68
69
|
};
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
+
function Oe(e) {
|
|
71
72
|
switch (e) {
|
|
72
73
|
case "provisioning": return "Starting assistant environment...";
|
|
73
74
|
case "connecting": return "Connecting to assistant...";
|
|
@@ -75,86 +76,86 @@ function Ee(e) {
|
|
|
75
76
|
default: return "";
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
|
-
var
|
|
79
|
-
let
|
|
79
|
+
var M = ({ visible: O = !0 }) => {
|
|
80
|
+
let A = t(), j = xe("workspace"), { getAccessToken: M, getWorkspaceToken: ke, userId: Ae } = Se(), { locale: N } = ye(), P = e((e) => e.assistantLanguage), je = E(() => g(P, N).english, [P, N]), Me = h(P) !== null, F = E(() => g(P, N).code, [P, N]), { conversations: Ne, activeConversationId: I, mode: L, processingByConversationId: Pe, setMode: R, setConversationMode: z, setActiveConversation: Fe, createConversation: B, addMessage: Ie, updateMessage: Le, patchMessage: V, setConversationProcessing: H, clearConversationProcessing: Re, setBackendSessionId: ze, clearBackendSessionId: U, setSandbox: W, clearSandbox: Be, acknowledgeApiCalls: Ve } = e(), G = Ne.find((e) => e.id === I)?.messages ?? [], K = I ? Pe[I] : void 0, q = _(K?.status), He = q ? K?.messageId ?? null : null, Ue = K?.status === "error" ? K.messageId : null, { canUseApiCalls: J, loading: We } = le(ee()), Ge = E(() => S.filter((e) => !e.requiresAdmin || J), [J]), [Ke, qe] = ve(null), Je = _e({}), Ye = _e(/* @__PURE__ */ new Set());
|
|
80
81
|
T(() => {
|
|
81
|
-
if (
|
|
82
|
+
if (We) return;
|
|
82
83
|
let e = S.find((e) => e.id === L);
|
|
83
84
|
(!e || e.requiresAdmin && !J) && L !== "assistant" && R("assistant");
|
|
84
85
|
}, [
|
|
85
86
|
L,
|
|
86
87
|
J,
|
|
87
|
-
|
|
88
|
+
We,
|
|
88
89
|
R
|
|
89
90
|
]);
|
|
90
91
|
let Y = w((e, t, n, r) => {
|
|
91
|
-
H(e, n, t, null), r ?
|
|
92
|
-
}, [H,
|
|
92
|
+
H(e, n, t, null), r ? Le(e, t, r) : Le(e, t, Oe(n));
|
|
93
|
+
}, [H, Le]), Xe = w(async (t, n, a, s, c) => {
|
|
93
94
|
let u = e.getState().sandboxesByMode[a]?.sandboxId ?? null, d = async (e) => {
|
|
94
95
|
try {
|
|
95
|
-
return await p(
|
|
96
|
+
return await p(j, e, s, c, 3e5, (e) => Y(t, n, "provisioning", e)), await f(j, e, s, c, 9e4, (e) => Y(t, n, "connecting", e)), !0;
|
|
96
97
|
} catch {
|
|
97
98
|
return !1;
|
|
98
99
|
}
|
|
99
100
|
};
|
|
100
101
|
if (u && (W(a, u, "provisioning"), Y(t, n, "provisioning", "Reusing assistant environment..."), await d(u) || (W(a, null, "provisioning"), u = null)), !u) {
|
|
101
102
|
Y(t, n, "provisioning", "Looking for existing environment...");
|
|
102
|
-
let e = await o(
|
|
103
|
+
let e = await o(j, s, a, c);
|
|
103
104
|
e && (W(a, e, "provisioning"), Y(t, n, "provisioning", "Reusing assistant environment..."), await d(e) ? u = e : W(a, null, "provisioning"));
|
|
104
105
|
}
|
|
105
106
|
if (!u) {
|
|
106
|
-
if (a === "api-calls" && !
|
|
107
|
-
Y(t, n, "provisioning", "Starting assistant environment..."), W(a, null, "provisioning"), u = await r(
|
|
107
|
+
if (a === "api-calls" && !M()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
|
|
108
|
+
Y(t, n, "provisioning", "Starting assistant environment..."), W(a, null, "provisioning"), u = await r(j, a, s, c), W(a, u, "provisioning"), await p(j, u, s, c, 3e5, (e) => Y(t, n, "provisioning", e)), await f(j, u, s, c, 9e4, (e) => Y(t, n, "connecting", e));
|
|
108
109
|
}
|
|
109
110
|
W(a, u, "running");
|
|
110
111
|
let m = e.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null;
|
|
111
112
|
if (m) try {
|
|
112
|
-
let e = await l(
|
|
113
|
+
let e = await l(j, u, s, m, c);
|
|
113
114
|
if (e.mode !== a) throw Error(`Session mode mismatch: expected ${a}, received ${e.mode}`);
|
|
114
115
|
} catch {
|
|
115
116
|
U(t), m = null;
|
|
116
117
|
}
|
|
117
|
-
return m || (Y(t, n, "connecting", "Preparing session..."), m = (await i(
|
|
118
|
+
return m || (Y(t, n, "connecting", "Preparing session..."), m = (await i(j, u, s, a, c)).sessionId, ze(t, m)), {
|
|
118
119
|
sandboxId: u,
|
|
119
120
|
sessionId: m
|
|
120
121
|
};
|
|
121
122
|
}, [
|
|
122
|
-
|
|
123
|
+
j,
|
|
123
124
|
U,
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
M,
|
|
126
|
+
ze,
|
|
126
127
|
W,
|
|
127
128
|
Y
|
|
128
129
|
]), X = w(async (t, r = []) => {
|
|
129
130
|
let i = e.getState(), o = i.activeConversationId ?? I;
|
|
130
|
-
if (o && (_(i.processingByConversationId[o]?.status) ||
|
|
131
|
+
if (o && (_(i.processingByConversationId[o]?.status) || Ye.current.has(o))) return;
|
|
131
132
|
let l = i.mode, f = I, p = f ? e.getState().conversations.find((e) => e.id === f) : void 0;
|
|
132
133
|
if (f ? p && p.mode !== l && (p.messages.length > 0 || p.backendSessionId) ? f = B(void 0, l) : p && p.mode !== l && z(f, l) : f = B(void 0, l), !f) return;
|
|
133
|
-
|
|
134
|
+
Je.current[f] = r;
|
|
134
135
|
let h = te(), g = {
|
|
135
|
-
accessToken:
|
|
136
|
-
workspaceToken:
|
|
137
|
-
userId:
|
|
136
|
+
accessToken: M(),
|
|
137
|
+
workspaceToken: ke(),
|
|
138
|
+
userId: Ae,
|
|
138
139
|
organizationId: ee()
|
|
139
140
|
}, v = {
|
|
140
|
-
id:
|
|
141
|
+
id: Te(),
|
|
141
142
|
role: "user",
|
|
142
143
|
content: t,
|
|
143
144
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
144
145
|
metadata: r.length ? { attachments: r.map(y) } : void 0
|
|
145
146
|
};
|
|
146
|
-
|
|
147
|
-
let b =
|
|
148
|
-
|
|
147
|
+
Ie(f, v);
|
|
148
|
+
let b = Te();
|
|
149
|
+
Ie(f, {
|
|
149
150
|
id: b,
|
|
150
151
|
role: "assistant",
|
|
151
152
|
content: "",
|
|
152
153
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
153
|
-
metadata: { lang:
|
|
154
|
+
metadata: { lang: F }
|
|
154
155
|
}), H(f, "provisioning", b, null);
|
|
155
|
-
let x = (e, t, n, r, i =
|
|
156
|
+
let x = (e, t, n, r, i = F) => {
|
|
156
157
|
V(f, b, {
|
|
157
|
-
content:
|
|
158
|
+
content: Ee(e),
|
|
158
159
|
metadata: {
|
|
159
160
|
lang: i,
|
|
160
161
|
...t?.length ? { artifacts: t } : {},
|
|
@@ -166,7 +167,7 @@ var N = ({ visible: k = !0 }) => {
|
|
|
166
167
|
}, S = async (e = 1) => {
|
|
167
168
|
let i = !1;
|
|
168
169
|
try {
|
|
169
|
-
await n(
|
|
170
|
+
await n(j, h, g);
|
|
170
171
|
} catch (e) {
|
|
171
172
|
if (ue(e)) {
|
|
172
173
|
de("ai-credits"), x("You've run out of AI credits for this billing cycle. Upgrade your plan to keep chatting.", void 0, void 0, void 0, "en"), H(f, "error", b, null);
|
|
@@ -175,39 +176,39 @@ var N = ({ visible: k = !0 }) => {
|
|
|
175
176
|
console.warn("[assistant] AI-credit pre-flight check failed with a non-quota error; proceeding — gateway @usage(checkQuota) still enforces the real budget downstream", e);
|
|
176
177
|
}
|
|
177
178
|
try {
|
|
178
|
-
let { sandboxId: e, sessionId: n } = await
|
|
179
|
+
let { sandboxId: e, sessionId: n } = await Xe(f, b, l, h, g), o = (await c(j, e, h, n, g, 50).catch(() => [])).reduce((e, t) => Math.max(e, k(t)), 0);
|
|
179
180
|
Y(f, b, "streaming", "Thinking...");
|
|
180
|
-
let p = pe(l, re(t, r),
|
|
181
|
+
let p = pe(l, re(t, r), je, Me), _ = ne(p, r), v = ae(_), ee = v > 0, te = m();
|
|
181
182
|
i = ie(r) > v;
|
|
182
183
|
try {
|
|
183
|
-
await d(
|
|
184
|
+
await d(j, e, h, n, p, l, te, g, _);
|
|
184
185
|
} catch (t) {
|
|
185
186
|
if (!_ || !me(t)) throw t;
|
|
186
|
-
await d(
|
|
187
|
+
await d(j, e, h, n, p, l, te, g, void 0), i ||= ee;
|
|
187
188
|
}
|
|
188
|
-
let y =
|
|
189
|
-
for (; Date.now() < S && (y =
|
|
189
|
+
let y = De([], o), S = Date.now() + (Ce[l] ?? we), C = Date.now(), oe = Date.now();
|
|
190
|
+
for (; Date.now() < S && (y = De(await c(j, e, h, n, g, 50), o), V(f, b, { content: Ee(y.content) }), !y.done);) Date.now() - C > 3e4 && (await a(j, e, h, 600, g).catch(() => void 0), C = Date.now()), await new Promise((e) => setTimeout(e, ge(Date.now() - oe)));
|
|
190
191
|
if (!y.done && l !== "vibe-plugins") throw Error("Assistant response timed out while streaming progress");
|
|
191
|
-
let
|
|
192
|
+
let se = l === "vibe-plugins" ? await s(j, e, h, n, g).catch(() => []) : void 0;
|
|
192
193
|
if (y.done || (y = {
|
|
193
194
|
...y,
|
|
194
195
|
content: `${y.content}\n\n_Still building in the background — any artifacts below will finish shortly. Re-open this conversation to pick up the completed plugin._`
|
|
195
196
|
}), i && (y = {
|
|
196
197
|
...y,
|
|
197
|
-
content: `${y.content}\n\n${
|
|
198
|
-
}), x(y.content,
|
|
198
|
+
content: `${y.content}\n\n${A("healthybowl.assistant.attachments.imagesNotSent", "_Your photo was too large to include with this message, so the answer above is from the text and the file link only. Try a smaller or more tightly cropped photo._")}`
|
|
199
|
+
}), x(y.content, se, n, e), y.tokens) {
|
|
199
200
|
V(f, b, { tokens: y.tokens });
|
|
200
201
|
try {
|
|
201
|
-
await u(
|
|
202
|
+
await u(j, h, n, y.tokens, g), fe();
|
|
202
203
|
} catch {}
|
|
203
204
|
}
|
|
204
205
|
H(f, "complete", b, null);
|
|
205
206
|
} catch (t) {
|
|
206
|
-
if (e === 1 && he(t)) return U(f),
|
|
207
|
+
if (e === 1 && he(t)) return U(f), Be(l), S(2);
|
|
207
208
|
throw t;
|
|
208
209
|
}
|
|
209
210
|
}, C = f;
|
|
210
|
-
|
|
211
|
+
Ye.current.add(C);
|
|
211
212
|
try {
|
|
212
213
|
if (!h) throw Error("Assistant backend is unavailable without an active workspace context.");
|
|
213
214
|
await S();
|
|
@@ -222,43 +223,43 @@ var N = ({ visible: k = !0 }) => {
|
|
|
222
223
|
metadata: { lang: "en" }
|
|
223
224
|
});
|
|
224
225
|
} finally {
|
|
225
|
-
|
|
226
|
+
Ye.current.delete(C);
|
|
226
227
|
}
|
|
227
228
|
}, [
|
|
228
229
|
I,
|
|
229
|
-
|
|
230
|
-
|
|
230
|
+
Ie,
|
|
231
|
+
j,
|
|
231
232
|
U,
|
|
232
|
-
|
|
233
|
-
|
|
233
|
+
Be,
|
|
234
|
+
Ne,
|
|
234
235
|
B,
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
236
|
+
Xe,
|
|
237
|
+
M,
|
|
238
|
+
ke,
|
|
238
239
|
V,
|
|
239
|
-
|
|
240
|
+
Me,
|
|
241
|
+
F,
|
|
240
242
|
je,
|
|
241
|
-
|
|
242
|
-
Re,
|
|
243
|
+
ze,
|
|
243
244
|
z,
|
|
244
245
|
H,
|
|
245
|
-
|
|
246
|
+
A,
|
|
246
247
|
Y,
|
|
247
|
-
|
|
248
|
-
]),
|
|
248
|
+
Ae
|
|
249
|
+
]), Ze = w((e) => {
|
|
249
250
|
X(e);
|
|
250
|
-
}, [X]),
|
|
251
|
-
let e = [...G].reverse().find((e) => e.role === "user"), t = I ?
|
|
251
|
+
}, [X]), Qe = w(() => {
|
|
252
|
+
let e = [...G].reverse().find((e) => e.role === "user"), t = I ? Je.current[I] ?? [] : [];
|
|
252
253
|
e && X(e.content, t);
|
|
253
254
|
}, [
|
|
254
255
|
G,
|
|
255
256
|
X,
|
|
256
257
|
I
|
|
257
|
-
]), Z =
|
|
258
|
+
]), Z = _e(X);
|
|
258
259
|
T(() => {
|
|
259
260
|
Z.current = X;
|
|
260
261
|
}, [X]);
|
|
261
|
-
let
|
|
262
|
+
let $e = E(() => {
|
|
262
263
|
if (q) return null;
|
|
263
264
|
for (let e = G.length - 1; e >= 0; --e) {
|
|
264
265
|
let t = G[e];
|
|
@@ -270,7 +271,7 @@ var N = ({ visible: k = !0 }) => {
|
|
|
270
271
|
} : null;
|
|
271
272
|
}
|
|
272
273
|
return null;
|
|
273
|
-
}, [G, q]),
|
|
274
|
+
}, [G, q]), et = E(() => G.filter((e) => e.role === "user" || e.role === "assistant").slice(-6).map((e) => ({
|
|
274
275
|
id: e.id,
|
|
275
276
|
role: e.role,
|
|
276
277
|
text: v(e.content).text.trim()
|
|
@@ -278,12 +279,12 @@ var N = ({ visible: k = !0 }) => {
|
|
|
278
279
|
onSubmit: w((e) => {
|
|
279
280
|
Z.current(e);
|
|
280
281
|
}, []),
|
|
281
|
-
latestReply:
|
|
282
|
-
language: g(
|
|
282
|
+
latestReply: $e,
|
|
283
|
+
language: g(P, N).tag
|
|
283
284
|
});
|
|
284
285
|
T(() => {
|
|
285
|
-
!
|
|
286
|
-
}, [
|
|
286
|
+
!O && Q.active && Q.end();
|
|
287
|
+
}, [O, Q]), T(() => {
|
|
287
288
|
let t = e.getState().consumePendingPrompt();
|
|
288
289
|
return t && Z.current(t), e.subscribe((t, n) => {
|
|
289
290
|
if (t.pendingPrompt && t.pendingPrompt !== n.pendingPrompt) {
|
|
@@ -297,77 +298,77 @@ var N = ({ visible: k = !0 }) => {
|
|
|
297
298
|
if (n && (n.messages.length > 0 || n.backendSessionId)) {
|
|
298
299
|
if (n.mode !== t) {
|
|
299
300
|
let n = e.getState().conversations.find((n) => n.mode === t && n.messages.length === 0 && !n.backendSessionId && !e.getState().processingByConversationId[n.id]);
|
|
300
|
-
n ?
|
|
301
|
+
n ? Fe(n.id) : B(void 0, t);
|
|
301
302
|
}
|
|
302
303
|
} else I && z(I, t);
|
|
303
304
|
R(t);
|
|
304
305
|
}, [
|
|
305
306
|
I,
|
|
306
307
|
B,
|
|
307
|
-
|
|
308
|
+
Fe,
|
|
308
309
|
z,
|
|
309
310
|
R
|
|
310
|
-
]),
|
|
311
|
+
]), tt = w((t) => {
|
|
311
312
|
if (S.find((e) => e.id === t)?.writeCapable && !e.getState().apiCallsAcknowledged) {
|
|
312
|
-
|
|
313
|
+
qe(t);
|
|
313
314
|
return;
|
|
314
315
|
}
|
|
315
316
|
$(t);
|
|
316
|
-
}, [$]),
|
|
317
|
-
let e =
|
|
318
|
-
|
|
317
|
+
}, [$]), nt = w(() => {
|
|
318
|
+
let e = Ke;
|
|
319
|
+
qe(null), Ve(), e && $(e);
|
|
319
320
|
}, [
|
|
320
|
-
|
|
321
|
-
|
|
321
|
+
Ke,
|
|
322
|
+
Ve,
|
|
322
323
|
$
|
|
323
|
-
]),
|
|
324
|
-
|
|
324
|
+
]), rt = w(() => {
|
|
325
|
+
qe(null);
|
|
325
326
|
}, []);
|
|
326
|
-
return /* @__PURE__ */
|
|
327
|
+
return /* @__PURE__ */ be("div", {
|
|
327
328
|
className: "relative flex flex-1 flex-col overflow-hidden",
|
|
328
329
|
children: [
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ be("div", {
|
|
330
331
|
className: "contents",
|
|
331
332
|
inert: Q.active || void 0,
|
|
332
|
-
children: [G.length === 0 ? /* @__PURE__ */
|
|
333
|
+
children: [G.length === 0 ? /* @__PURE__ */ D(C, {
|
|
333
334
|
mode: L,
|
|
334
|
-
onSuggestionClick:
|
|
335
|
-
}) : /* @__PURE__ */
|
|
335
|
+
onSuggestionClick: Ze
|
|
336
|
+
}) : /* @__PURE__ */ D("div", {
|
|
336
337
|
className: "flex min-h-0 flex-1 flex-col",
|
|
337
|
-
children: /* @__PURE__ */
|
|
338
|
+
children: /* @__PURE__ */ D(b, {
|
|
338
339
|
messages: G,
|
|
339
|
-
streamingMessageId:
|
|
340
|
-
failedMessageId:
|
|
341
|
-
onRetry:
|
|
340
|
+
streamingMessageId: He,
|
|
341
|
+
failedMessageId: Ue,
|
|
342
|
+
onRetry: Qe
|
|
342
343
|
})
|
|
343
|
-
}), /* @__PURE__ */
|
|
344
|
+
}), /* @__PURE__ */ D(oe, {
|
|
344
345
|
onStartVoiceSession: Q.available && L !== "api-calls" ? Q.start : void 0,
|
|
345
346
|
onSend: (e, t) => void X(e, t),
|
|
346
347
|
disabled: q,
|
|
347
|
-
placeholder: L === "api-calls" ?
|
|
348
|
+
placeholder: L === "api-calls" ? A("healthybowl.assistant.chatArea.placeholderActions", "What would you like me to do?") : A("healthybowl.assistant.chatArea.placeholderGeneral", "Ask HealthyBowl anything…"),
|
|
348
349
|
mode: L,
|
|
349
|
-
availableModes:
|
|
350
|
-
onModeChange:
|
|
350
|
+
availableModes: Ge,
|
|
351
|
+
onModeChange: tt
|
|
351
352
|
})]
|
|
352
353
|
}),
|
|
353
|
-
Q.active && /* @__PURE__ */
|
|
354
|
+
Q.active && /* @__PURE__ */ D(se, {
|
|
354
355
|
session: Q.session,
|
|
355
356
|
notice: Q.notice,
|
|
356
|
-
turns:
|
|
357
|
+
turns: et,
|
|
357
358
|
onInterrupt: Q.interrupt,
|
|
358
|
-
spoken:
|
|
359
|
+
spoken: $e?.text ?? null,
|
|
359
360
|
onToggleMute: Q.toggleMute,
|
|
360
361
|
onEnd: Q.end
|
|
361
362
|
}),
|
|
362
|
-
/* @__PURE__ */
|
|
363
|
-
open:
|
|
364
|
-
onConfirm:
|
|
365
|
-
onCancel:
|
|
363
|
+
/* @__PURE__ */ D(x, {
|
|
364
|
+
open: Ke !== null,
|
|
365
|
+
onConfirm: nt,
|
|
366
|
+
onCancel: rt
|
|
366
367
|
})
|
|
367
368
|
]
|
|
368
369
|
});
|
|
369
370
|
};
|
|
370
371
|
//#endregion
|
|
371
|
-
export {
|
|
372
|
+
export { M as AssistantChatArea };
|
|
372
373
|
|
|
373
374
|
//# sourceMappingURL=AssistantChatArea.js.map
|