@burdenoff/microfe-healthybowl 2026.902.2 → 2026.902.4
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 +116 -116
- package/dist/components/assistant/AssistantChatArea.js.map +1 -1
- package/dist/components/assistant/AssistantConversationList.js +3 -3
- package/dist/components/assistant/composer/AssistantComposer.js +5 -1
- package/dist/components/assistant/composer/AssistantComposer.js.map +1 -1
- package/dist/components/assistant/voice/AssistantVoiceOrb.js +9 -9
- package/dist/components/assistant/voice/AssistantVoiceOrb.js.map +1 -1
- package/dist/components/assistant/voice/AssistantVoiceSession.js +1 -0
- package/dist/components/assistant/voice/AssistantVoiceSession.js.map +1 -1
- package/dist/components/assistant/voice/VoiceConversationView.js +1 -1
- package/dist/components/assistant/voice/VoiceConversationView.js.map +1 -1
- package/dist/components/assistant/voice/VoiceMiniController.js +1 -1
- package/dist/components/assistant/voice/VoiceMiniController.js.map +1 -1
- package/dist/healthybowl/HealthyBowlRoot.js +34 -26
- package/dist/healthybowl/HealthyBowlRoot.js.map +1 -1
- package/dist/healthybowl/HealthyBowlRoutes.js +105 -97
- package/dist/healthybowl/HealthyBowlRoutes.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlLabour.js +297 -0
- package/dist/healthybowl/hooks/useHealthyBowlLabour.js.map +1 -0
- package/dist/healthybowl/pages/labour/CrewTimesheetPage.js +174 -0
- package/dist/healthybowl/pages/labour/CrewTimesheetPage.js.map +1 -0
- package/dist/healthybowl/pages/labour/LabourRosterPage.js +654 -0
- package/dist/healthybowl/pages/labour/LabourRosterPage.js.map +1 -0
- package/dist/hooks/useVoiceInput.js +34 -33
- package/dist/hooks/useVoiceInput.js.map +1 -1
- package/dist/hooks/useVoiceSession.js.map +1 -1
- package/dist/services/assistantExportService.js +29 -23
- package/dist/services/assistantExportService.js.map +1 -1
- package/dist/utils/voiceSession.js.map +1 -1
- package/dist/utils/voiceTurnVisibility.js +1 -1
- package/package.json +1 -1
|
@@ -2,47 +2,47 @@ import { useAssistantStore as e } from "../../store/assistantStore.js";
|
|
|
2
2
|
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
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { chatTurns as h, voiceMarker as g, voiceTurnsOnly as _ } from "../../utils/voiceTurnVisibility.js";
|
|
6
|
+
import { findAssistantLanguage as v, resolveAssistantLanguage as y } from "../../config/assistantLanguages.js";
|
|
7
|
+
import { isTurnInFlight as ee } from "../../utils/assistantTurnState.js";
|
|
8
|
+
import { parseToolActivity as b } from "./AssistantToolActivity.js";
|
|
9
|
+
import { getOrganizationId as x, getWorkspaceId as S } from "../../utils/assistantContext.js";
|
|
9
10
|
import { buildPromptParts as te, buildPromptWithAttachments as ne, countInlineImageCandidates as re, countInlinedImageParts as ie, toMessageAttachment as ae } from "../../utils/assistantAttachments.js";
|
|
10
|
-
import { AssistantMessageList as
|
|
11
|
-
import { AssistantApiCallsConsentDialog as
|
|
12
|
-
import { ASSISTANT_MODES as
|
|
11
|
+
import { AssistantMessageList as C } from "./AssistantMessageList.js";
|
|
12
|
+
import { AssistantApiCallsConsentDialog as w } from "./AssistantApiCallsConsentDialog.js";
|
|
13
|
+
import { ASSISTANT_MODES as T } from "../../types/assistant.js";
|
|
13
14
|
import { AssistantEmptyState as oe } from "./AssistantEmptyState.js";
|
|
14
|
-
import { AssistantComposer as
|
|
15
|
-
import { AssistantVoiceSession as
|
|
16
|
-
import { useVoiceSession as
|
|
17
|
-
import { useAssistantApiAccess as
|
|
18
|
-
import { isQuotaExhaustedError as
|
|
19
|
-
import { dispatchAssistantQuotaExhausted as
|
|
20
|
-
import { buildPromptForMode as
|
|
21
|
-
import { isMultimodalBodyRejection as
|
|
22
|
-
import { pollDelayMs as
|
|
23
|
-
import { toCaptionText as
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import { getAssistantMedia as Ee } from "@burdenoff/fe-libs/shared/assistant";
|
|
15
|
+
import { AssistantComposer as se } from "./composer/AssistantComposer.js";
|
|
16
|
+
import { AssistantVoiceSession as ce } from "./voice/AssistantVoiceSession.js";
|
|
17
|
+
import { useVoiceSession as le } from "../../hooks/useVoiceSession.js";
|
|
18
|
+
import { useAssistantApiAccess as ue } from "../../hooks/useAssistantApiAccess.js";
|
|
19
|
+
import { isQuotaExhaustedError as de } from "../../utils/quotaUtils.js";
|
|
20
|
+
import { dispatchAssistantQuotaExhausted as fe, notifyAiCreditsUpdated as pe } from "../../utils/aiCredits.js";
|
|
21
|
+
import { buildPromptForMode as me } from "../../utils/assistantPrompt.js";
|
|
22
|
+
import { isMultimodalBodyRejection as he, isRecoverableAssistantError as ge } from "../../utils/assistantTransportErrors.js";
|
|
23
|
+
import { pollDelayMs as _e } from "../../utils/assistantPollSchedule.js";
|
|
24
|
+
import { toCaptionText as ve } from "../../utils/captionText.js";
|
|
25
|
+
import { createReadinessTracker as ye } from "../../utils/sandboxReadiness.js";
|
|
26
|
+
import { useCallback as E, useEffect as D, useMemo as O, useRef as k, useState as be } from "react";
|
|
27
|
+
import { useI18n as xe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
28
|
+
import { jsx as A, jsxs as Se } from "react/jsx-runtime";
|
|
29
|
+
import { useGatewayClient as Ce } from "@burdenoff/fe-libs/shared/graphql";
|
|
30
|
+
import { useAuthToken as we } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
31
|
+
import { getAssistantMedia as Te } from "@burdenoff/fe-libs/shared/assistant";
|
|
32
32
|
//#region src/components/assistant/AssistantChatArea.tsx
|
|
33
|
-
var
|
|
33
|
+
var Ee = {
|
|
34
34
|
general: 18e4,
|
|
35
35
|
assistant: 18e4,
|
|
36
36
|
"api-calls": 18e4,
|
|
37
37
|
"vibe-plugins": 6e5
|
|
38
|
-
},
|
|
39
|
-
function
|
|
38
|
+
}, De = 18e4;
|
|
39
|
+
function Oe() {
|
|
40
40
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function ke(e) {
|
|
43
43
|
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]");
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Ae(e) {
|
|
46
46
|
return e.info?.time?.created ?? 0;
|
|
47
47
|
}
|
|
48
48
|
function j(e) {
|
|
@@ -55,12 +55,12 @@ function M(e) {
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
function je(e, t) {
|
|
58
|
-
let n = e.filter((e) => e.info?.role === "assistant" &&
|
|
58
|
+
let n = e.filter((e) => e.info?.role === "assistant" && Ae(e) > t).sort((e, t) => Ae(e) - Ae(t));
|
|
59
59
|
if (n.length === 0) return {
|
|
60
60
|
content: "Thinking...",
|
|
61
61
|
done: !1
|
|
62
62
|
};
|
|
63
|
-
let r = n[n.length - 1], i = j(r.parts), a =
|
|
63
|
+
let r = n[n.length - 1], i = j(r.parts), a = Te(r.parts), o = M(r.parts);
|
|
64
64
|
return {
|
|
65
65
|
content: [
|
|
66
66
|
i,
|
|
@@ -79,11 +79,11 @@ function Me(e) {
|
|
|
79
79
|
default: return "";
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
var N = ({ visible:
|
|
83
|
-
let j = t(), M =
|
|
84
|
-
|
|
82
|
+
var N = ({ visible: Te = !0 }) => {
|
|
83
|
+
let j = t(), M = Ce("workspace"), { getAccessToken: N, getWorkspaceToken: Ne, userId: Pe } = we(), { locale: P } = xe(), F = e((e) => e.assistantLanguage), Fe = O(() => y(F, P).english, [F, P]), Ie = v(F) !== null, Le = O(() => y(F, P).code, [F, P]), { conversations: Re, activeConversationId: I, mode: L, processingByConversationId: ze, setMode: R, setConversationMode: z, setActiveConversation: Be, createConversation: B, addMessage: Ve, updateMessage: He, patchMessage: V, setConversationProcessing: H, clearConversationProcessing: Ue, setBackendSessionId: We, clearBackendSessionId: U, setSandbox: W, clearSandbox: Ge, acknowledgeApiCalls: Ke } = e(), G = Re.find((e) => e.id === I)?.messages ?? [], K = I ? ze[I] : void 0, q = ee(K?.status), qe = q ? K?.messageId ?? null : null, Je = K?.status === "error" ? K.messageId : null, { canUseApiCalls: J, loading: Ye } = ue(x()), Xe = O(() => T.filter((e) => !e.requiresAdmin || J), [J]), [Ze, Qe] = be(null), $e = k({}), Y = k(ye()), et = k(/* @__PURE__ */ new Set());
|
|
84
|
+
D(() => {
|
|
85
85
|
if (Ye) return;
|
|
86
|
-
let e =
|
|
86
|
+
let e = T.find((e) => e.id === L);
|
|
87
87
|
(!e || e.requiresAdmin && !J) && L !== "assistant" && R("assistant");
|
|
88
88
|
}, [
|
|
89
89
|
L,
|
|
@@ -91,9 +91,9 @@ var N = ({ visible: Ee = !0 }) => {
|
|
|
91
91
|
Ye,
|
|
92
92
|
R
|
|
93
93
|
]);
|
|
94
|
-
let X =
|
|
94
|
+
let X = E((e, t, n, r) => {
|
|
95
95
|
H(e, n, t, null), r ? He(e, t, r) : He(e, t, Me(n));
|
|
96
|
-
}, [H, He]), tt =
|
|
96
|
+
}, [H, He]), tt = E(async (t, n, a, s, c) => {
|
|
97
97
|
let u = e.getState().sandboxesByMode[a]?.sandboxId ?? null, d = async (e) => {
|
|
98
98
|
if (Y.current.isFresh(e)) return !0;
|
|
99
99
|
try {
|
|
@@ -130,114 +130,114 @@ var N = ({ visible: Ee = !0 }) => {
|
|
|
130
130
|
We,
|
|
131
131
|
W,
|
|
132
132
|
X
|
|
133
|
-
]), Z =
|
|
133
|
+
]), Z = E(async (t, r = [], i = {}) => {
|
|
134
134
|
let o = e.getState(), l = o.activeConversationId ?? I;
|
|
135
|
-
if (l && (
|
|
135
|
+
if (l && (ee(o.processingByConversationId[l]?.status) || et.current.has(l))) return;
|
|
136
136
|
let f = o.mode, p = I, h = p ? e.getState().conversations.find((e) => e.id === p) : void 0;
|
|
137
137
|
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;
|
|
138
138
|
$e.current[p] = r;
|
|
139
|
-
let
|
|
139
|
+
let _ = S(), v = {
|
|
140
140
|
accessToken: N(),
|
|
141
141
|
workspaceToken: Ne(),
|
|
142
142
|
userId: Pe,
|
|
143
|
-
organizationId:
|
|
144
|
-
},
|
|
145
|
-
id:
|
|
143
|
+
organizationId: x()
|
|
144
|
+
}, y = {
|
|
145
|
+
id: Oe(),
|
|
146
146
|
role: "user",
|
|
147
147
|
content: t,
|
|
148
148
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
149
149
|
metadata: {
|
|
150
150
|
...r.length ? { attachments: r.map(ae) } : {},
|
|
151
|
-
...
|
|
151
|
+
...g(i.dictated)
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
|
-
Ve(p,
|
|
155
|
-
let
|
|
154
|
+
Ve(p, y);
|
|
155
|
+
let b = Oe();
|
|
156
156
|
Ve(p, {
|
|
157
|
-
id:
|
|
157
|
+
id: b,
|
|
158
158
|
role: "assistant",
|
|
159
159
|
content: "",
|
|
160
160
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
161
161
|
metadata: {
|
|
162
162
|
lang: Le,
|
|
163
|
-
...
|
|
163
|
+
...g(i.dictated)
|
|
164
164
|
}
|
|
165
|
-
}), H(p, "provisioning",
|
|
166
|
-
let
|
|
167
|
-
V(p,
|
|
168
|
-
content:
|
|
165
|
+
}), H(p, "provisioning", b, null);
|
|
166
|
+
let C = (e, t, n, r, a = Le) => {
|
|
167
|
+
V(p, b, {
|
|
168
|
+
content: ke(e),
|
|
169
169
|
metadata: {
|
|
170
170
|
lang: a,
|
|
171
171
|
...t?.length ? { artifacts: t } : {},
|
|
172
172
|
...t?.length || n || r ? { mode: f } : {},
|
|
173
173
|
...n ? { sessionId: n } : {},
|
|
174
174
|
...r ? { sandboxId: r } : {},
|
|
175
|
-
...
|
|
175
|
+
...g(i.dictated)
|
|
176
176
|
}
|
|
177
177
|
});
|
|
178
|
-
},
|
|
178
|
+
}, w = async (e = 1) => {
|
|
179
179
|
let o = !1;
|
|
180
180
|
try {
|
|
181
|
-
await n(M,
|
|
181
|
+
await n(M, _, v);
|
|
182
182
|
} catch (e) {
|
|
183
|
-
if (
|
|
184
|
-
|
|
183
|
+
if (de(e)) {
|
|
184
|
+
fe("ai-credits"), C("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", b, null);
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
187
187
|
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
188
|
}
|
|
189
189
|
try {
|
|
190
|
-
let { sandboxId: e, sessionId: n } = await tt(p,
|
|
191
|
-
X(p,
|
|
192
|
-
let h =
|
|
190
|
+
let { sandboxId: e, sessionId: n } = await tt(p, b, f, _, v), l = (await c(M, e, _, n, v, 50).catch(() => [])).reduce((e, t) => Math.max(e, Ae(t)), 0);
|
|
191
|
+
X(p, b, "streaming", "Thinking...");
|
|
192
|
+
let h = me(f, ne(t, r), Fe, Ie, i.dictated === !0), g = te(h, r), y = ie(g), ee = y > 0, x = m();
|
|
193
193
|
o = re(r) > y;
|
|
194
194
|
try {
|
|
195
|
-
await d(M, e,
|
|
195
|
+
await d(M, e, _, n, h, f, x, v, g);
|
|
196
196
|
} catch (t) {
|
|
197
|
-
if (!
|
|
198
|
-
await d(M, e,
|
|
197
|
+
if (!g || !he(t)) throw t;
|
|
198
|
+
await d(M, e, _, n, h, f, x, v, void 0), o ||= ee;
|
|
199
199
|
}
|
|
200
|
-
let
|
|
201
|
-
for (; Date.now() <
|
|
202
|
-
if (!
|
|
203
|
-
let
|
|
204
|
-
if (
|
|
205
|
-
...
|
|
206
|
-
content: `${
|
|
207
|
-
}), o && (
|
|
208
|
-
...
|
|
209
|
-
content: `${
|
|
210
|
-
}), S
|
|
211
|
-
V(p,
|
|
200
|
+
let S = je([], l), ae = Date.now() + (Ee[f] ?? De), w = Date.now(), T = Date.now();
|
|
201
|
+
for (; Date.now() < ae && (S = je(await c(M, e, _, n, v, 50, l), l), V(p, b, { content: ke(S.content) }), !S.done);) Date.now() - w > 3e4 && (await a(M, e, _, 600, v).catch(() => void 0), w = Date.now()), await new Promise((e) => setTimeout(e, _e(Date.now() - T)));
|
|
202
|
+
if (!S.done && f !== "vibe-plugins") throw Error("Assistant response timed out while streaming progress");
|
|
203
|
+
let oe = f === "vibe-plugins" ? await s(M, e, _, n, v).catch(() => []) : void 0;
|
|
204
|
+
if (S.done || (S = {
|
|
205
|
+
...S,
|
|
206
|
+
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._`
|
|
207
|
+
}), o && (S = {
|
|
208
|
+
...S,
|
|
209
|
+
content: `${S.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._")}`
|
|
210
|
+
}), C(S.content, oe, n, e), S.tokens) {
|
|
211
|
+
V(p, b, { tokens: S.tokens });
|
|
212
212
|
try {
|
|
213
|
-
await u(M,
|
|
213
|
+
await u(M, _, n, S.tokens, v), pe();
|
|
214
214
|
} catch {}
|
|
215
215
|
}
|
|
216
|
-
H(p, "complete",
|
|
216
|
+
H(p, "complete", b, null);
|
|
217
217
|
} catch (t) {
|
|
218
|
-
if (e === 1 &&
|
|
218
|
+
if (e === 1 && ge(t)) return U(p), Ge(f), w(2);
|
|
219
219
|
throw t;
|
|
220
220
|
}
|
|
221
|
-
},
|
|
222
|
-
et.current.add(
|
|
221
|
+
}, T = p;
|
|
222
|
+
et.current.add(T);
|
|
223
223
|
try {
|
|
224
|
-
if (!
|
|
225
|
-
await
|
|
224
|
+
if (!_) throw Error("Assistant backend is unavailable without an active workspace context.");
|
|
225
|
+
await w();
|
|
226
226
|
} catch (t) {
|
|
227
|
-
if (Y.current.invalidate(e.getState().sandboxesByMode[f]?.sandboxId ?? null),
|
|
228
|
-
|
|
227
|
+
if (Y.current.invalidate(e.getState().sandboxesByMode[f]?.sandboxId ?? null), de(t)) {
|
|
228
|
+
fe("sandbox"), C("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", b, null);
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
231
|
let n = t instanceof Error ? t.message : "Something went wrong";
|
|
232
|
-
H(p, "error",
|
|
232
|
+
H(p, "error", b, n), V(p, b, {
|
|
233
233
|
content: `Sorry, an error occurred: ${n}. Please try again.`,
|
|
234
234
|
metadata: {
|
|
235
235
|
lang: "en",
|
|
236
|
-
...
|
|
236
|
+
...g(i.dictated)
|
|
237
237
|
}
|
|
238
238
|
});
|
|
239
239
|
} finally {
|
|
240
|
-
et.current.delete(
|
|
240
|
+
et.current.delete(T);
|
|
241
241
|
}
|
|
242
242
|
}, [
|
|
243
243
|
I,
|
|
@@ -260,45 +260,45 @@ var N = ({ visible: Ee = !0 }) => {
|
|
|
260
260
|
j,
|
|
261
261
|
X,
|
|
262
262
|
Pe
|
|
263
|
-
]), nt =
|
|
263
|
+
]), nt = E((e) => {
|
|
264
264
|
Z(e);
|
|
265
|
-
}, [Z]), rt =
|
|
266
|
-
let e = [...G].reverse().find((e) => e.role === "user"), t = I ? $e.current[I] ?? [] : [];
|
|
265
|
+
}, [Z]), rt = E(() => {
|
|
266
|
+
let e = [...h(G)].reverse().find((e) => e.role === "user"), t = I ? $e.current[I] ?? [] : [];
|
|
267
267
|
e && Z(e.content, t);
|
|
268
268
|
}, [
|
|
269
269
|
G,
|
|
270
270
|
Z,
|
|
271
271
|
I
|
|
272
|
-
]), it =
|
|
273
|
-
|
|
272
|
+
]), it = k(Z);
|
|
273
|
+
D(() => {
|
|
274
274
|
it.current = Z;
|
|
275
275
|
}, [Z]);
|
|
276
|
-
let Q =
|
|
276
|
+
let Q = O(() => {
|
|
277
277
|
if (q) return null;
|
|
278
278
|
for (let e = G.length - 1; e >= 0; --e) {
|
|
279
279
|
let t = G[e];
|
|
280
280
|
if (t?.role !== "assistant") continue;
|
|
281
|
-
let n =
|
|
281
|
+
let n = b(t.content).text.trim();
|
|
282
282
|
return n ? {
|
|
283
283
|
id: t.id,
|
|
284
284
|
text: n
|
|
285
285
|
} : null;
|
|
286
286
|
}
|
|
287
287
|
return null;
|
|
288
|
-
}, [G, q]), at =
|
|
288
|
+
}, [G, q]), at = O(() => Q ? ve(Q.text) : null, [Q]), ot = O(() => h(G), [G]), st = O(() => _(G).filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
|
|
289
289
|
id: e.id,
|
|
290
290
|
role: e.role,
|
|
291
|
-
text:
|
|
292
|
-
})).filter((e) => e.text.length > 0), [G]), $ =
|
|
293
|
-
onSubmit:
|
|
291
|
+
text: b(e.content).text.trim()
|
|
292
|
+
})).filter((e) => e.text.length > 0), [G]), $ = le({
|
|
293
|
+
onSubmit: E((e) => {
|
|
294
294
|
it.current(e, [], { dictated: !0 });
|
|
295
295
|
}, []),
|
|
296
296
|
latestReply: Q,
|
|
297
|
-
language:
|
|
297
|
+
language: y(F, P).tag
|
|
298
298
|
});
|
|
299
|
-
|
|
300
|
-
!
|
|
301
|
-
}, [
|
|
299
|
+
D(() => {
|
|
300
|
+
!Te && $.active && $.end();
|
|
301
|
+
}, [Te, $]), D(() => {
|
|
302
302
|
let t = e.getState().consumePendingPrompt();
|
|
303
303
|
return t && it.current(t), e.subscribe((t, n) => {
|
|
304
304
|
if (t.pendingPrompt && t.pendingPrompt !== n.pendingPrompt) {
|
|
@@ -307,7 +307,7 @@ var N = ({ visible: Ee = !0 }) => {
|
|
|
307
307
|
}
|
|
308
308
|
});
|
|
309
309
|
}, []);
|
|
310
|
-
let ct =
|
|
310
|
+
let ct = E((t) => {
|
|
311
311
|
let n = I ? e.getState().conversations.find((e) => e.id === I) : void 0;
|
|
312
312
|
if (n && (n.messages.length > 0 || n.backendSessionId)) {
|
|
313
313
|
if (n.mode !== t) {
|
|
@@ -322,40 +322,40 @@ var N = ({ visible: Ee = !0 }) => {
|
|
|
322
322
|
Be,
|
|
323
323
|
z,
|
|
324
324
|
R
|
|
325
|
-
]), lt =
|
|
326
|
-
if (
|
|
325
|
+
]), lt = E((t) => {
|
|
326
|
+
if (T.find((e) => e.id === t)?.writeCapable && !e.getState().apiCallsAcknowledged) {
|
|
327
327
|
Qe(t);
|
|
328
328
|
return;
|
|
329
329
|
}
|
|
330
330
|
ct(t);
|
|
331
|
-
}, [ct]), ut =
|
|
331
|
+
}, [ct]), ut = E(() => {
|
|
332
332
|
let e = Ze;
|
|
333
333
|
Qe(null), Ke(), e && ct(e);
|
|
334
334
|
}, [
|
|
335
335
|
Ze,
|
|
336
336
|
Ke,
|
|
337
337
|
ct
|
|
338
|
-
]), dt =
|
|
338
|
+
]), dt = E(() => {
|
|
339
339
|
Qe(null);
|
|
340
340
|
}, []);
|
|
341
|
-
return /* @__PURE__ */
|
|
341
|
+
return /* @__PURE__ */ Se("div", {
|
|
342
342
|
className: "relative flex flex-1 flex-col overflow-hidden",
|
|
343
343
|
children: [
|
|
344
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ Se("div", {
|
|
345
345
|
className: "contents",
|
|
346
346
|
inert: $.active || void 0,
|
|
347
|
-
children: [ot.length === 0 ? /* @__PURE__ */
|
|
347
|
+
children: [ot.length === 0 ? /* @__PURE__ */ A(oe, {
|
|
348
348
|
mode: L,
|
|
349
349
|
onSuggestionClick: nt
|
|
350
|
-
}) : /* @__PURE__ */
|
|
350
|
+
}) : /* @__PURE__ */ A("div", {
|
|
351
351
|
className: "flex min-h-0 flex-1 flex-col",
|
|
352
|
-
children: /* @__PURE__ */
|
|
352
|
+
children: /* @__PURE__ */ A(C, {
|
|
353
353
|
messages: ot,
|
|
354
354
|
streamingMessageId: qe,
|
|
355
355
|
failedMessageId: Je,
|
|
356
356
|
onRetry: rt
|
|
357
357
|
})
|
|
358
|
-
}), /* @__PURE__ */
|
|
358
|
+
}), /* @__PURE__ */ A(se, {
|
|
359
359
|
onStartVoiceSession: $.available && L !== "api-calls" ? $.start : void 0,
|
|
360
360
|
onSend: (e, t) => void Z(e, t),
|
|
361
361
|
disabled: q,
|
|
@@ -365,7 +365,7 @@ var N = ({ visible: Ee = !0 }) => {
|
|
|
365
365
|
onModeChange: lt
|
|
366
366
|
})]
|
|
367
367
|
}),
|
|
368
|
-
$.active && /* @__PURE__ */
|
|
368
|
+
$.active && /* @__PURE__ */ A(ce, {
|
|
369
369
|
session: $.session,
|
|
370
370
|
notice: $.notice,
|
|
371
371
|
capturing: $.capturing,
|
|
@@ -377,7 +377,7 @@ var N = ({ visible: Ee = !0 }) => {
|
|
|
377
377
|
onToggleMute: $.toggleMute,
|
|
378
378
|
onEnd: $.end
|
|
379
379
|
}),
|
|
380
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ A(w, {
|
|
381
381
|
open: Ze !== null,
|
|
382
382
|
onConfirm: ut,
|
|
383
383
|
onCancel: dt
|