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