@burdenoff/microfe-healthybowl 2026.902.17 → 2026.902.19
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 +163 -158
- package/dist/components/assistant/AssistantChatArea.js.map +1 -1
- package/dist/components/assistant/AssistantMoreMenu.js +56 -54
- package/dist/components/assistant/AssistantMoreMenu.js.map +1 -1
- package/dist/components/assistant/AssistantReplyLanguageSelector.js +60 -0
- package/dist/components/assistant/AssistantReplyLanguageSelector.js.map +1 -0
- package/dist/components/assistant/AssistantSpeechProvider.js +135 -130
- package/dist/components/assistant/AssistantSpeechProvider.js.map +1 -1
- package/dist/components/assistant/composer/AssistantComposer.js.map +1 -1
- package/dist/config/assistantLanguagePair.js +14 -0
- package/dist/config/assistantLanguagePair.js.map +1 -0
- package/dist/store/assistantStore.js +4 -0
- package/dist/store/assistantStore.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,13 +3,14 @@ import { useTr as t } from "../../shared/hooks/useTr.js";
|
|
|
3
3
|
import { checkAssistantAiCredits as n, createAssistantSandbox as r, createAssistantSession as i, extendAssistantSandboxTTL as a, findExistingSandbox as o, getAssistantArtifacts as s, getAssistantMessages as c, getAssistantSession as l, reportAssistantAiTokenUsage as u, sendAssistantPromptAsync as d, waitForAssistantServiceReady as f, waitForSandboxReady as p } from "../../services/assistantApi.js";
|
|
4
4
|
import { gatherPageContext as m } from "../../utils/pageContext.js";
|
|
5
5
|
import { chatTurns as h, voiceMarker as g, voiceTurnsOnly as _ } from "../../utils/voiceTurnVisibility.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
6
|
+
import { resolveAssistantLanguage as v } from "../../config/assistantLanguages.js";
|
|
7
|
+
import { resolveLanguagePair as ee } from "../../config/assistantLanguagePair.js";
|
|
8
|
+
import { isTurnInFlight as te } from "../../utils/assistantTurnState.js";
|
|
9
|
+
import { parseToolActivity as y } from "./AssistantToolActivity.js";
|
|
10
|
+
import { getActorId as b, getOrganizationId as x, getWorkspaceId as S } from "../../utils/assistantContext.js";
|
|
11
|
+
import { buildPromptParts as ne, buildPromptWithAttachments as re, countInlineImageCandidates as ie, countInlinedImageParts as ae, toMessageAttachment as oe } from "../../utils/assistantAttachments.js";
|
|
12
|
+
import { AssistantMessageList as C } from "./AssistantMessageList.js";
|
|
13
|
+
import { AssistantApiCallsConsentDialog as w } from "./AssistantApiCallsConsentDialog.js";
|
|
13
14
|
import { ASSISTANT_MODES as T } from "../../types/assistant.js";
|
|
14
15
|
import { AssistantEmptyState as se } from "./AssistantEmptyState.js";
|
|
15
16
|
import { AssistantComposer as ce } from "./composer/AssistantComposer.js";
|
|
@@ -81,90 +82,94 @@ function Ne(e) {
|
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
var P = ({ visible: De = !0 }) => {
|
|
84
|
-
let M = t(), N = Te("workspace"), { getAccessToken: P, getWorkspaceToken: Pe, userId: Fe } = Ee(), { locale:
|
|
85
|
+
let M = t(), N = Te("workspace"), { getAccessToken: P, getWorkspaceToken: Pe, userId: Fe } = Ee(), { locale: Ie } = Ce(), Le = e((e) => e.assistantLanguage), Re = e((e) => e.replyLanguage), ze = O(() => ee(Le, Re, Ie), [
|
|
86
|
+
Le,
|
|
87
|
+
Re,
|
|
88
|
+
Ie
|
|
89
|
+
]), Be = ze.reply.english, Ve = ze.replyIsExplicit, He = ze.reply.code, { conversations: Ue, activeConversationId: F, mode: I, processingByConversationId: We, setMode: L, setConversationMode: R, setActiveConversation: Ge, createConversation: z, addMessage: Ke, updateMessage: qe, patchMessage: B, setConversationProcessing: V, clearConversationProcessing: Je, setBackendSessionId: Ye, clearBackendSessionId: H, setSandbox: U, clearSandbox: Xe, acknowledgeApiCalls: Ze } = e(), W = Ue.find((e) => e.id === F)?.messages ?? [], G = F ? We[F] : void 0, K = te(G?.status), Qe = K ? G?.messageId ?? null : null, $e = G?.status === "error" ? G.messageId : null, { canUseApiCalls: q, loading: et } = de(x()), tt = fe(b(), S() || null), nt = O(() => T.filter((e) => !e.requiresAdmin || q), [q]), [rt, it] = Se(null), at = k({}), J = k(xe()), ot = k(/* @__PURE__ */ new Set()), Y = O(() => T.find((e) => e.id === I), [I]);
|
|
85
90
|
D(() => {
|
|
86
|
-
|
|
91
|
+
et || (!Y || Y.requiresAdmin && !q) && I !== "assistant" && L("assistant");
|
|
87
92
|
}, [
|
|
88
|
-
|
|
89
|
-
rt,
|
|
93
|
+
I,
|
|
90
94
|
Y,
|
|
91
|
-
|
|
92
|
-
|
|
95
|
+
q,
|
|
96
|
+
et,
|
|
97
|
+
L
|
|
93
98
|
]);
|
|
94
|
-
let
|
|
95
|
-
|
|
96
|
-
}, [
|
|
99
|
+
let X = E((e, t, n, r) => {
|
|
100
|
+
V(e, n, t, null), r ? qe(e, t, r) : qe(e, t, Ne(n));
|
|
101
|
+
}, [V, qe]), st = E(async (t, n, a, s, c) => {
|
|
97
102
|
let u = e.getState().sandboxesByMode[a]?.sandboxId ?? null, d = async (e) => {
|
|
98
|
-
if (
|
|
103
|
+
if (J.current.isFresh(e)) return !0;
|
|
99
104
|
try {
|
|
100
|
-
return await p(N, e, s, c, 3e5, (e) =>
|
|
105
|
+
return await p(N, e, s, c, 3e5, (e) => X(t, n, "provisioning", e)), await f(N, e, s, c, 9e4, (e) => X(t, n, "connecting", e)), J.current.markVerified(e), !0;
|
|
101
106
|
} catch {
|
|
102
|
-
return
|
|
107
|
+
return J.current.invalidate(e), !1;
|
|
103
108
|
}
|
|
104
109
|
};
|
|
105
|
-
if (u && (
|
|
106
|
-
|
|
110
|
+
if (u && (U(a, u, "provisioning"), X(t, n, "provisioning", "Reusing assistant environment..."), await d(u) || (U(a, null, "provisioning"), u = null)), !u) {
|
|
111
|
+
X(t, n, "provisioning", "Looking for existing environment...");
|
|
107
112
|
let e = await o(N, s, a, c);
|
|
108
|
-
e && (
|
|
113
|
+
e && (U(a, e, "provisioning"), X(t, n, "provisioning", "Reusing assistant environment..."), await d(e) ? u = e : U(a, null, "provisioning"));
|
|
109
114
|
}
|
|
110
115
|
if (!u) {
|
|
111
116
|
if (a === "api-calls" && !P()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
|
|
112
|
-
|
|
117
|
+
X(t, n, "provisioning", "Starting assistant environment..."), U(a, null, "provisioning"), u = await r(N, a, s, c), U(a, u, "provisioning"), await p(N, u, s, c, 3e5, (e) => X(t, n, "provisioning", e)), await f(N, u, s, c, 9e4, (e) => X(t, n, "connecting", e));
|
|
113
118
|
}
|
|
114
|
-
|
|
119
|
+
U(a, u, "running");
|
|
115
120
|
let m = e.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null;
|
|
116
121
|
if (m) try {
|
|
117
122
|
let e = await l(N, u, s, m, c);
|
|
118
123
|
if (e.mode !== a) throw Error(`Session mode mismatch: expected ${a}, received ${e.mode}`);
|
|
119
124
|
} catch {
|
|
120
|
-
|
|
125
|
+
H(t), m = null;
|
|
121
126
|
}
|
|
122
|
-
return m || (
|
|
127
|
+
return m || (X(t, n, "connecting", "Preparing session..."), m = (await i(N, u, s, a, c)).sessionId, Ye(t, m)), {
|
|
123
128
|
sandboxId: u,
|
|
124
129
|
sessionId: m
|
|
125
130
|
};
|
|
126
131
|
}, [
|
|
127
132
|
N,
|
|
128
|
-
|
|
133
|
+
H,
|
|
129
134
|
P,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
]),
|
|
134
|
-
let o = e.getState(), l = o.activeConversationId ??
|
|
135
|
-
if (l && (
|
|
136
|
-
let f = o.mode, p =
|
|
137
|
-
if (p ? h && h.mode !== f && (h.messages.length > 0 || h.backendSessionId) ? p =
|
|
138
|
-
|
|
139
|
-
let _ =
|
|
135
|
+
Ye,
|
|
136
|
+
U,
|
|
137
|
+
X
|
|
138
|
+
]), Z = E(async (t, r = [], i = {}) => {
|
|
139
|
+
let o = e.getState(), l = o.activeConversationId ?? F;
|
|
140
|
+
if (l && (te(o.processingByConversationId[l]?.status) || ot.current.has(l))) return;
|
|
141
|
+
let f = o.mode, p = F, h = p ? e.getState().conversations.find((e) => e.id === p) : void 0;
|
|
142
|
+
if (p ? h && h.mode !== f && (h.messages.length > 0 || h.backendSessionId) ? p = z(void 0, f) : h && h.mode !== f && R(p, f) : p = z(void 0, f), !p) return;
|
|
143
|
+
at.current[p] = r;
|
|
144
|
+
let _ = S(), v = {
|
|
140
145
|
accessToken: P(),
|
|
141
146
|
workspaceToken: Pe(),
|
|
142
147
|
userId: Fe,
|
|
143
|
-
organizationId:
|
|
144
|
-
},
|
|
148
|
+
organizationId: x()
|
|
149
|
+
}, ee = {
|
|
145
150
|
id: Ae(),
|
|
146
151
|
role: "user",
|
|
147
152
|
content: t,
|
|
148
153
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
149
154
|
metadata: {
|
|
150
|
-
...r.length ? { attachments: r.map(
|
|
155
|
+
...r.length ? { attachments: r.map(oe) } : {},
|
|
151
156
|
...g(i.dictated)
|
|
152
157
|
}
|
|
153
158
|
};
|
|
154
|
-
|
|
155
|
-
let
|
|
156
|
-
|
|
157
|
-
id:
|
|
159
|
+
Ke(p, ee);
|
|
160
|
+
let y = Ae();
|
|
161
|
+
Ke(p, {
|
|
162
|
+
id: y,
|
|
158
163
|
role: "assistant",
|
|
159
164
|
content: "",
|
|
160
165
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
161
166
|
metadata: {
|
|
162
|
-
lang:
|
|
167
|
+
lang: He,
|
|
163
168
|
...g(i.dictated)
|
|
164
169
|
}
|
|
165
|
-
}),
|
|
166
|
-
let
|
|
167
|
-
|
|
170
|
+
}), V(p, "provisioning", y, null);
|
|
171
|
+
let b = (e, t, n, r, a = He) => {
|
|
172
|
+
B(p, y, {
|
|
168
173
|
content: je(e),
|
|
169
174
|
metadata: {
|
|
170
175
|
lang: a,
|
|
@@ -175,61 +180,61 @@ var P = ({ visible: De = !0 }) => {
|
|
|
175
180
|
...g(i.dictated)
|
|
176
181
|
}
|
|
177
182
|
});
|
|
178
|
-
},
|
|
183
|
+
}, C = async (e = 1) => {
|
|
179
184
|
let o = !1;
|
|
180
185
|
try {
|
|
181
186
|
await n(N, _, v);
|
|
182
187
|
} catch (e) {
|
|
183
188
|
if (pe(e)) {
|
|
184
|
-
me("ai-credits"),
|
|
189
|
+
me("ai-credits"), b("You've run out of AI credits for this billing cycle. Upgrade your plan to keep chatting.", void 0, void 0, void 0, "en"), V(p, "error", y, null);
|
|
185
190
|
return;
|
|
186
191
|
}
|
|
187
192
|
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);
|
|
188
193
|
}
|
|
189
194
|
try {
|
|
190
|
-
let { sandboxId: e, sessionId: n } = await
|
|
191
|
-
|
|
192
|
-
let h = ge(f,
|
|
193
|
-
o =
|
|
195
|
+
let { sandboxId: e, sessionId: n } = await st(p, y, f, _, v), l = (await c(N, e, _, n, v, 50).catch(() => [])).reduce((e, t) => Math.max(e, j(t)), 0);
|
|
196
|
+
X(p, y, "streaming", "Thinking...");
|
|
197
|
+
let h = ge(f, re(t, r), Be, Ve, i.dictated === !0), g = ne(h, r), ee = ae(g), te = ee > 0, x = m();
|
|
198
|
+
o = ie(r) > ee;
|
|
194
199
|
try {
|
|
195
|
-
await d(N, e, _, n, h, f,
|
|
200
|
+
await d(N, e, _, n, h, f, x, v, g);
|
|
196
201
|
} catch (t) {
|
|
197
202
|
if (!g || !_e(t)) throw t;
|
|
198
|
-
await d(N, e, _, n, h, f,
|
|
203
|
+
await d(N, e, _, n, h, f, x, v, void 0), o ||= te;
|
|
199
204
|
}
|
|
200
|
-
let
|
|
201
|
-
for (; Date.now() <
|
|
202
|
-
if (!
|
|
205
|
+
let S = Me([], l), oe = Date.now() + (Oe[f] ?? ke), C = Date.now(), w = Date.now();
|
|
206
|
+
for (; Date.now() < oe && (S = Me(await c(N, e, _, n, v, 50, l), l), B(p, y, { content: je(S.content) }), !S.done);) Date.now() - C > 3e4 && (await a(N, e, _, 600, v).catch(() => void 0), C = Date.now()), await new Promise((e) => setTimeout(e, ye(Date.now() - w)));
|
|
207
|
+
if (!S.done && f !== "vibe-plugins") throw Error("Assistant response timed out while streaming progress");
|
|
203
208
|
let T = f === "vibe-plugins" ? await s(N, e, _, n, v).catch(() => []) : void 0;
|
|
204
|
-
if (
|
|
205
|
-
...
|
|
206
|
-
content: `${
|
|
207
|
-
}), o && (
|
|
208
|
-
...
|
|
209
|
-
content: `${
|
|
210
|
-
}),
|
|
211
|
-
|
|
209
|
+
if (S.done || (S = {
|
|
210
|
+
...S,
|
|
211
|
+
content: `${S.content}\n\n_Still building in the background — any artifacts below will finish shortly. Re-open this conversation to pick up the completed plugin._`
|
|
212
|
+
}), o && (S = {
|
|
213
|
+
...S,
|
|
214
|
+
content: `${S.content}\n\n${M("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._")}`
|
|
215
|
+
}), b(S.content, T, n, e), S.tokens) {
|
|
216
|
+
B(p, y, { tokens: S.tokens });
|
|
212
217
|
try {
|
|
213
|
-
await u(N, _, n,
|
|
218
|
+
await u(N, _, n, S.tokens, v), he();
|
|
214
219
|
} catch {}
|
|
215
220
|
}
|
|
216
|
-
|
|
221
|
+
V(p, "complete", y, null);
|
|
217
222
|
} catch (t) {
|
|
218
|
-
if (e === 1 && ve(t)) return
|
|
223
|
+
if (e === 1 && ve(t)) return H(p), Xe(f), C(2);
|
|
219
224
|
throw t;
|
|
220
225
|
}
|
|
221
|
-
},
|
|
222
|
-
|
|
226
|
+
}, w = p;
|
|
227
|
+
ot.current.add(w);
|
|
223
228
|
try {
|
|
224
229
|
if (!_) throw Error("Assistant backend is unavailable without an active workspace context.");
|
|
225
|
-
await
|
|
230
|
+
await C();
|
|
226
231
|
} catch (t) {
|
|
227
|
-
if (
|
|
228
|
-
me("sandbox"),
|
|
232
|
+
if (J.current.invalidate(e.getState().sandboxesByMode[f]?.sandboxId ?? null), pe(t)) {
|
|
233
|
+
me("sandbox"), b("You've reached your sandbox limit on the current plan. Upgrade to start the AI assistant.", void 0, void 0, void 0, "en"), V(p, "error", y, null);
|
|
229
234
|
return;
|
|
230
235
|
}
|
|
231
236
|
let n = t instanceof Error ? t.message : "Something went wrong";
|
|
232
|
-
|
|
237
|
+
V(p, "error", y, n), B(p, y, {
|
|
233
238
|
content: `Sorry, an error occurred: ${n}. Please try again.`,
|
|
234
239
|
metadata: {
|
|
235
240
|
lang: "en",
|
|
@@ -237,106 +242,106 @@ var P = ({ visible: De = !0 }) => {
|
|
|
237
242
|
}
|
|
238
243
|
});
|
|
239
244
|
} finally {
|
|
240
|
-
|
|
245
|
+
ot.current.delete(w);
|
|
241
246
|
}
|
|
242
247
|
}, [
|
|
243
|
-
|
|
244
|
-
He,
|
|
245
|
-
N,
|
|
246
|
-
W,
|
|
248
|
+
F,
|
|
247
249
|
Ke,
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
250
|
+
N,
|
|
251
|
+
H,
|
|
252
|
+
Xe,
|
|
253
|
+
Ue,
|
|
254
|
+
z,
|
|
255
|
+
st,
|
|
251
256
|
P,
|
|
252
257
|
Pe,
|
|
253
|
-
H,
|
|
254
|
-
Le,
|
|
255
|
-
Re,
|
|
256
|
-
Ie,
|
|
257
|
-
Ge,
|
|
258
258
|
B,
|
|
259
|
-
|
|
259
|
+
Ve,
|
|
260
|
+
He,
|
|
261
|
+
Be,
|
|
262
|
+
Ye,
|
|
263
|
+
R,
|
|
264
|
+
V,
|
|
260
265
|
M,
|
|
261
|
-
|
|
266
|
+
X,
|
|
262
267
|
Fe
|
|
263
|
-
]),
|
|
264
|
-
|
|
265
|
-
}, [
|
|
266
|
-
let e = [...h(
|
|
267
|
-
e &&
|
|
268
|
+
]), ct = E((e) => {
|
|
269
|
+
Z(e);
|
|
270
|
+
}, [Z]), lt = E(() => {
|
|
271
|
+
let e = [...h(W)].reverse().find((e) => e.role === "user"), t = F ? at.current[F] ?? [] : [];
|
|
272
|
+
e && Z(e.content, t);
|
|
268
273
|
}, [
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
]),
|
|
274
|
+
W,
|
|
275
|
+
Z,
|
|
276
|
+
F
|
|
277
|
+
]), Q = k(Z);
|
|
273
278
|
D(() => {
|
|
274
|
-
|
|
275
|
-
}, [
|
|
276
|
-
let
|
|
277
|
-
if (
|
|
278
|
-
for (let e =
|
|
279
|
-
let t =
|
|
279
|
+
Q.current = Z;
|
|
280
|
+
}, [Z]);
|
|
281
|
+
let ut = O(() => {
|
|
282
|
+
if (K) return null;
|
|
283
|
+
for (let e = W.length - 1; e >= 0; --e) {
|
|
284
|
+
let t = W[e];
|
|
280
285
|
if (t?.role !== "assistant") continue;
|
|
281
|
-
let n =
|
|
286
|
+
let n = y(t.content).text.trim();
|
|
282
287
|
return n ? {
|
|
283
288
|
id: t.id,
|
|
284
289
|
text: n
|
|
285
290
|
} : null;
|
|
286
291
|
}
|
|
287
292
|
return null;
|
|
288
|
-
}, [
|
|
293
|
+
}, [W, K]), dt = O(() => ut ? be(ut.text) : null, [ut]), ft = O(() => h(W), [W]), pt = O(() => _(W).filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
|
|
289
294
|
id: e.id,
|
|
290
295
|
role: e.role,
|
|
291
|
-
text:
|
|
292
|
-
})).filter((e) => e.text.length > 0), [
|
|
296
|
+
text: y(e.content).text.trim()
|
|
297
|
+
})).filter((e) => e.text.length > 0), [W]), $ = ue({
|
|
293
298
|
onSubmit: E((e) => {
|
|
294
|
-
|
|
299
|
+
Q.current(e, [], { dictated: !0 });
|
|
295
300
|
}, []),
|
|
296
|
-
latestReply:
|
|
297
|
-
language:
|
|
301
|
+
latestReply: ut,
|
|
302
|
+
language: v(Le, Ie).tag
|
|
298
303
|
});
|
|
299
304
|
D(() => {
|
|
300
305
|
!De && $.active && $.end();
|
|
301
306
|
}, [De, $]), D(() => {
|
|
302
307
|
let t = e.getState().consumePendingPrompt();
|
|
303
|
-
return t &&
|
|
308
|
+
return t && Q.current(t), e.subscribe((t, n) => {
|
|
304
309
|
if (t.pendingPrompt && t.pendingPrompt !== n.pendingPrompt) {
|
|
305
310
|
let t = e.getState().consumePendingPrompt();
|
|
306
|
-
t &&
|
|
311
|
+
t && Q.current(t);
|
|
307
312
|
}
|
|
308
313
|
});
|
|
309
314
|
}, []);
|
|
310
|
-
let
|
|
311
|
-
let n =
|
|
315
|
+
let mt = E((t) => {
|
|
316
|
+
let n = F ? e.getState().conversations.find((e) => e.id === F) : void 0;
|
|
312
317
|
if (n && (n.messages.length > 0 || n.backendSessionId)) {
|
|
313
318
|
if (n.mode !== t) {
|
|
314
319
|
let n = e.getState().conversations.find((n) => n.mode === t && n.messages.length === 0 && !n.backendSessionId && !e.getState().processingByConversationId[n.id]);
|
|
315
|
-
n ?
|
|
320
|
+
n ? Ge(n.id) : z(void 0, t);
|
|
316
321
|
}
|
|
317
|
-
} else
|
|
318
|
-
|
|
322
|
+
} else F && R(F, t);
|
|
323
|
+
L(t);
|
|
319
324
|
}, [
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
]),
|
|
325
|
+
F,
|
|
326
|
+
z,
|
|
327
|
+
Ge,
|
|
328
|
+
R,
|
|
329
|
+
L
|
|
330
|
+
]), ht = E((t) => {
|
|
326
331
|
if (T.find((e) => e.id === t)?.writeCapable && !e.getState().apiCallsAcknowledged) {
|
|
327
|
-
|
|
332
|
+
it(t);
|
|
328
333
|
return;
|
|
329
334
|
}
|
|
330
|
-
|
|
331
|
-
}, [
|
|
332
|
-
let e =
|
|
333
|
-
|
|
335
|
+
mt(t);
|
|
336
|
+
}, [mt]), gt = E(() => {
|
|
337
|
+
let e = rt;
|
|
338
|
+
it(null), Ze(), e && mt(e);
|
|
334
339
|
}, [
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
]),
|
|
339
|
-
|
|
340
|
+
rt,
|
|
341
|
+
Ze,
|
|
342
|
+
mt
|
|
343
|
+
]), _t = E(() => {
|
|
344
|
+
it(null);
|
|
340
345
|
}, []);
|
|
341
346
|
return /* @__PURE__ */ we("div", {
|
|
342
347
|
className: "relative flex flex-1 flex-col overflow-hidden",
|
|
@@ -344,26 +349,26 @@ var P = ({ visible: De = !0 }) => {
|
|
|
344
349
|
/* @__PURE__ */ we("div", {
|
|
345
350
|
className: "contents",
|
|
346
351
|
inert: $.active || void 0,
|
|
347
|
-
children: [
|
|
348
|
-
mode:
|
|
349
|
-
onSuggestionClick:
|
|
352
|
+
children: [ft.length === 0 ? /* @__PURE__ */ A(se, {
|
|
353
|
+
mode: I,
|
|
354
|
+
onSuggestionClick: ct
|
|
350
355
|
}) : /* @__PURE__ */ A("div", {
|
|
351
356
|
className: "flex min-h-0 flex-1 flex-col",
|
|
352
|
-
children: /* @__PURE__ */ A(
|
|
353
|
-
messages:
|
|
354
|
-
streamingMessageId:
|
|
355
|
-
failedMessageId:
|
|
356
|
-
onRetry:
|
|
357
|
+
children: /* @__PURE__ */ A(C, {
|
|
358
|
+
messages: ft,
|
|
359
|
+
streamingMessageId: Qe,
|
|
360
|
+
failedMessageId: $e,
|
|
361
|
+
onRetry: lt
|
|
357
362
|
})
|
|
358
363
|
}), /* @__PURE__ */ A(ce, {
|
|
359
|
-
onStartVoiceSession: $.available &&
|
|
360
|
-
onSend: (e, t) => void
|
|
361
|
-
disabled:
|
|
362
|
-
placeholder:
|
|
363
|
-
mode:
|
|
364
|
-
writeAccessDenied:
|
|
365
|
-
availableModes:
|
|
366
|
-
onModeChange:
|
|
364
|
+
onStartVoiceSession: $.available && I !== "api-calls" ? $.start : void 0,
|
|
365
|
+
onSend: (e, t) => void Z(e, t),
|
|
366
|
+
disabled: K,
|
|
367
|
+
placeholder: I === "api-calls" ? M("healthybowl.assistant.chatArea.placeholderActions", "What would you like me to do?") : M("healthybowl.assistant.chatArea.placeholderGeneral", "Ask HealthyBowl anything…"),
|
|
368
|
+
mode: I,
|
|
369
|
+
writeAccessDenied: tt === "denied" && !!Y?.writeCapable,
|
|
370
|
+
availableModes: nt,
|
|
371
|
+
onModeChange: ht
|
|
367
372
|
})]
|
|
368
373
|
}),
|
|
369
374
|
$.active && /* @__PURE__ */ A(le, {
|
|
@@ -372,16 +377,16 @@ var P = ({ visible: De = !0 }) => {
|
|
|
372
377
|
capturing: $.capturing,
|
|
373
378
|
interrupting: $.interrupting,
|
|
374
379
|
awaitingEndpoint: $.awaitingEndpoint,
|
|
375
|
-
turns:
|
|
380
|
+
turns: pt,
|
|
376
381
|
onInterrupt: $.interrupt,
|
|
377
|
-
spoken:
|
|
382
|
+
spoken: dt,
|
|
378
383
|
onToggleMute: $.toggleMute,
|
|
379
384
|
onEnd: $.end
|
|
380
385
|
}),
|
|
381
|
-
/* @__PURE__ */ A(
|
|
382
|
-
open:
|
|
383
|
-
onConfirm:
|
|
384
|
-
onCancel:
|
|
386
|
+
/* @__PURE__ */ A(w, {
|
|
387
|
+
open: rt !== null,
|
|
388
|
+
onConfirm: gt,
|
|
389
|
+
onCancel: _t
|
|
385
390
|
})
|
|
386
391
|
]
|
|
387
392
|
});
|