@burdenoff/microfe-healthybowl 2026.727.1 → 2026.727.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 +167 -154
- package/dist/components/assistant/AssistantChatArea.js.map +1 -1
- package/dist/components/assistant/AssistantMarkdownImage.js +73 -46
- package/dist/components/assistant/AssistantMarkdownImage.js.map +1 -1
- package/dist/components/assistant/composer/AssistantAttachmentButton.js +1 -0
- package/dist/components/assistant/composer/AssistantAttachmentButton.js.map +1 -1
- package/dist/components/assistant/composer/AssistantComposer.js +2 -0
- package/dist/components/assistant/composer/AssistantComposer.js.map +1 -1
- package/dist/components/assistant/composer/AssistantModeSelector.js +26 -33
- package/dist/components/assistant/composer/AssistantModeSelector.js.map +1 -1
- package/dist/healthybowl/pages/pest-management/AiPestDetectionPage.js +289 -262
- package/dist/healthybowl/pages/pest-management/AiPestDetectionPage.js.map +1 -1
- package/dist/healthybowl/utils/imageDownscale.js +51 -34
- package/dist/healthybowl/utils/imageDownscale.js.map +1 -1
- package/dist/hooks/useAssistantAttachments.js +106 -98
- package/dist/hooks/useAssistantAttachments.js.map +1 -1
- package/dist/utils/assistantAttachments.js +78 -38
- package/dist/utils/assistantAttachments.js.map +1 -1
- package/dist/utils/assistantTransportErrors.js +32 -0
- package/dist/utils/assistantTransportErrors.js.map +1 -0
- package/dist/utils/assistantTurnState.js +8 -0
- package/dist/utils/assistantTurnState.js.map +1 -0
- package/dist/utils/gatewayLimits.js +6 -0
- package/dist/utils/gatewayLimits.js.map +1 -0
- package/package.json +1 -1
|
@@ -3,21 +3,23 @@ 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 { getOrganizationId as h, getWorkspaceId as g } from "../../utils/assistantContext.js";
|
|
6
|
-
import { buildPromptParts as ee, buildPromptWithAttachments as te, toMessageAttachment as
|
|
7
|
-
import { AssistantMessageList as
|
|
8
|
-
import { AssistantApiCallsConsentDialog as
|
|
9
|
-
import { ASSISTANT_MODES as
|
|
10
|
-
import { AssistantEmptyState as
|
|
11
|
-
import { AssistantComposer as
|
|
12
|
-
import { useAssistantApiAccess as
|
|
13
|
-
import { isQuotaExhaustedError as
|
|
14
|
-
import { dispatchAssistantQuotaExhausted as
|
|
15
|
-
import { buildPromptForMode as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
6
|
+
import { buildPromptParts as ee, buildPromptWithAttachments as te, countInlineImageCandidates as ne, countInlinedImageParts as re, toMessageAttachment as ie } from "../../utils/assistantAttachments.js";
|
|
7
|
+
import { AssistantMessageList as _ } from "./AssistantMessageList.js";
|
|
8
|
+
import { AssistantApiCallsConsentDialog as v } from "./AssistantApiCallsConsentDialog.js";
|
|
9
|
+
import { ASSISTANT_MODES as y } from "../../types/assistant.js";
|
|
10
|
+
import { AssistantEmptyState as b } from "./AssistantEmptyState.js";
|
|
11
|
+
import { AssistantComposer as x } from "./composer/AssistantComposer.js";
|
|
12
|
+
import { useAssistantApiAccess as S } from "../../hooks/useAssistantApiAccess.js";
|
|
13
|
+
import { isQuotaExhaustedError as C } from "../../utils/quotaUtils.js";
|
|
14
|
+
import { dispatchAssistantQuotaExhausted as w, notifyAiCreditsUpdated as ae } from "../../utils/aiCredits.js";
|
|
15
|
+
import { buildPromptForMode as oe } from "../../utils/assistantPrompt.js";
|
|
16
|
+
import { isMultimodalBodyRejection as se } from "../../utils/assistantTransportErrors.js";
|
|
17
|
+
import { isTurnInFlight as T } from "../../utils/assistantTurnState.js";
|
|
18
|
+
import { useCallback as E, useEffect as D, useMemo as ce, useRef as le, useState as ue } from "react";
|
|
19
|
+
import { jsx as O, jsxs as de } from "react/jsx-runtime";
|
|
18
20
|
import { useGatewayClient as fe } from "@burdenoff/fe-libs/shared/graphql";
|
|
19
21
|
import { useAuthToken as pe } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
20
|
-
import { getAssistantMedia as
|
|
22
|
+
import { getAssistantMedia as k } from "@burdenoff/fe-libs/shared/assistant";
|
|
21
23
|
//#region src/components/assistant/AssistantChatArea.tsx
|
|
22
24
|
var me = {
|
|
23
25
|
general: 18e4,
|
|
@@ -45,25 +47,25 @@ function _e(e) {
|
|
|
45
47
|
function ve(e) {
|
|
46
48
|
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]");
|
|
47
49
|
}
|
|
48
|
-
function
|
|
50
|
+
function A(e) {
|
|
49
51
|
return e.info?.time?.created ?? 0;
|
|
50
52
|
}
|
|
51
|
-
function
|
|
53
|
+
function j(e) {
|
|
52
54
|
return (e ?? []).filter((e) => e.type === "text" && typeof e.text == "string").map((e) => e.text?.trim() ?? "").filter(Boolean).join("\n");
|
|
53
55
|
}
|
|
54
|
-
function
|
|
56
|
+
function M(e) {
|
|
55
57
|
return (e ?? []).filter((e) => e.type === "tool" && e.tool).map((e) => {
|
|
56
58
|
let t = e.state?.status ?? "running", n = e.tool ?? "tool";
|
|
57
59
|
return t === "completed" ? `Completed: ${n}` : t === "failed" ? `Failed: ${n}` : `Running: ${n}`;
|
|
58
60
|
});
|
|
59
61
|
}
|
|
60
|
-
function
|
|
61
|
-
let n = e.filter((e) => e.info?.role === "assistant" &&
|
|
62
|
+
function ye(e, t) {
|
|
63
|
+
let n = e.filter((e) => e.info?.role === "assistant" && A(e) > t).sort((e, t) => A(e) - A(t));
|
|
62
64
|
if (n.length === 0) return {
|
|
63
65
|
content: "Thinking...",
|
|
64
66
|
done: !1
|
|
65
67
|
};
|
|
66
|
-
let r = n[n.length - 1], i =
|
|
68
|
+
let r = n[n.length - 1], i = j(r.parts), a = k(r.parts), o = M(r.parts);
|
|
67
69
|
return {
|
|
68
70
|
content: [
|
|
69
71
|
i,
|
|
@@ -74,7 +76,7 @@ function k(e, t) {
|
|
|
74
76
|
tokens: r.info?.tokens
|
|
75
77
|
};
|
|
76
78
|
}
|
|
77
|
-
function
|
|
79
|
+
function be(e) {
|
|
78
80
|
switch (e) {
|
|
79
81
|
case "provisioning": return "Starting assistant environment...";
|
|
80
82
|
case "connecting": return "Connecting to assistant...";
|
|
@@ -82,171 +84,182 @@ function ye(e) {
|
|
|
82
84
|
default: return "";
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
|
-
var
|
|
86
|
-
let
|
|
87
|
-
|
|
88
|
-
if (
|
|
89
|
-
let e =
|
|
90
|
-
(!e || e.requiresAdmin && !
|
|
87
|
+
var N = () => {
|
|
88
|
+
let k = t(), j = fe("workspace"), { getAccessToken: M, getWorkspaceToken: N, userId: xe } = pe(), { conversations: Se, activeConversationId: P, mode: F, processingByConversationId: Ce, setMode: I, setConversationMode: L, setActiveConversation: we, createConversation: R, addMessage: z, updateMessage: B, patchMessage: V, setConversationProcessing: H, clearConversationProcessing: Te, setBackendSessionId: U, clearBackendSessionId: W, setSandbox: G, clearSandbox: Ee, acknowledgeApiCalls: De } = e(), K = Se.find((e) => e.id === P)?.messages ?? [], q = P ? Ce[P] : void 0, Oe = T(q?.status), ke = Oe ? q?.messageId ?? null : null, Ae = q?.status === "error" ? q.messageId : null, { canUseApiCalls: J, loading: je } = S(h()), Me = ce(() => y.filter((e) => !e.requiresAdmin || J), [J]), [Ne, Pe] = ue(null), Fe = le({}), Y = le(/* @__PURE__ */ new Set());
|
|
89
|
+
D(() => {
|
|
90
|
+
if (je) return;
|
|
91
|
+
let e = y.find((e) => e.id === F);
|
|
92
|
+
(!e || e.requiresAdmin && !J) && F !== "general" && I("general");
|
|
91
93
|
}, [
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
F,
|
|
95
|
+
J,
|
|
96
|
+
je,
|
|
97
|
+
I
|
|
96
98
|
]);
|
|
97
|
-
let X =
|
|
98
|
-
|
|
99
|
-
}, [
|
|
99
|
+
let X = E((e, t, n, r) => {
|
|
100
|
+
H(e, n, t, null), r ? B(e, t, r) : B(e, t, be(n));
|
|
101
|
+
}, [H, B]), Ie = E(async (t, n, a, s, c) => {
|
|
100
102
|
let u = e.getState().sandboxesByMode[a]?.sandboxId ?? null, d = async (e) => {
|
|
101
103
|
try {
|
|
102
|
-
return await p(
|
|
104
|
+
return await p(j, e, s, c, 3e5, (e) => X(t, n, "provisioning", e)), await f(j, e, s, c, 9e4, (e) => X(t, n, "connecting", e)), !0;
|
|
103
105
|
} catch {
|
|
104
106
|
return !1;
|
|
105
107
|
}
|
|
106
108
|
};
|
|
107
|
-
if (u && (
|
|
109
|
+
if (u && (G(a, u, "provisioning"), X(t, n, "provisioning", "Reusing assistant environment..."), await d(u) || (G(a, null, "provisioning"), u = null)), !u) {
|
|
108
110
|
X(t, n, "provisioning", "Looking for existing environment...");
|
|
109
|
-
let e = await o(
|
|
110
|
-
e && (
|
|
111
|
+
let e = await o(j, s, a, c);
|
|
112
|
+
e && (G(a, e, "provisioning"), X(t, n, "provisioning", "Reusing assistant environment..."), await d(e) ? u = e : G(a, null, "provisioning"));
|
|
111
113
|
}
|
|
112
114
|
if (!u) {
|
|
113
|
-
if (a === "api-calls" && !
|
|
114
|
-
X(t, n, "provisioning", "Starting assistant environment..."),
|
|
115
|
+
if (a === "api-calls" && !M()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
|
|
116
|
+
X(t, n, "provisioning", "Starting assistant environment..."), G(a, null, "provisioning"), u = await r(j, a, s, c), G(a, u, "provisioning"), await p(j, u, s, c, 3e5, (e) => X(t, n, "provisioning", e)), await f(j, u, s, c, 9e4, (e) => X(t, n, "connecting", e));
|
|
115
117
|
}
|
|
116
|
-
|
|
118
|
+
G(a, u, "running");
|
|
117
119
|
let m = e.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null;
|
|
118
120
|
if (m) try {
|
|
119
|
-
let e = await l(
|
|
121
|
+
let e = await l(j, u, s, m, c);
|
|
120
122
|
if (e.mode !== a) throw Error(`Session mode mismatch: expected ${a}, received ${e.mode}`);
|
|
121
123
|
} catch {
|
|
122
|
-
|
|
124
|
+
W(t), m = null;
|
|
123
125
|
}
|
|
124
|
-
return m || (X(t, n, "connecting", "Preparing session..."), m = (await i(
|
|
126
|
+
return m || (X(t, n, "connecting", "Preparing session..."), m = (await i(j, u, s, a, c)).sessionId, U(t, m)), {
|
|
125
127
|
sandboxId: u,
|
|
126
128
|
sessionId: m
|
|
127
129
|
};
|
|
128
130
|
}, [
|
|
129
|
-
|
|
130
|
-
U,
|
|
131
|
-
O,
|
|
132
|
-
H,
|
|
131
|
+
j,
|
|
133
132
|
W,
|
|
133
|
+
M,
|
|
134
|
+
U,
|
|
135
|
+
G,
|
|
134
136
|
X
|
|
135
|
-
]), Z =
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
workspaceToken: A(),
|
|
146
|
-
userId: j,
|
|
137
|
+
]), Z = E(async (t, r = []) => {
|
|
138
|
+
let i = e.getState(), o = i.activeConversationId ?? P;
|
|
139
|
+
if (o && (T(i.processingByConversationId[o]?.status) || Y.current.has(o))) return;
|
|
140
|
+
let l = i.mode, f = P, p = f ? e.getState().conversations.find((e) => e.id === f) : void 0;
|
|
141
|
+
if (f ? p && p.mode !== l && (p.messages.length > 0 || p.backendSessionId) ? f = R(void 0, l) : p && p.mode !== l && L(f, l) : f = R(void 0, l), !f) return;
|
|
142
|
+
Fe.current[f] = r;
|
|
143
|
+
let _ = g(), v = {
|
|
144
|
+
accessToken: M(),
|
|
145
|
+
workspaceToken: N(),
|
|
146
|
+
userId: xe,
|
|
147
147
|
organizationId: h()
|
|
148
|
-
},
|
|
148
|
+
}, y = {
|
|
149
149
|
id: ge(),
|
|
150
150
|
role: "user",
|
|
151
151
|
content: t,
|
|
152
152
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
153
|
-
metadata: r.length ? { attachments: r.map(
|
|
153
|
+
metadata: r.length ? { attachments: r.map(ie) } : void 0
|
|
154
154
|
};
|
|
155
|
-
|
|
156
|
-
let
|
|
157
|
-
|
|
158
|
-
id:
|
|
155
|
+
z(f, y);
|
|
156
|
+
let b = ge();
|
|
157
|
+
z(f, {
|
|
158
|
+
id: b,
|
|
159
159
|
role: "assistant",
|
|
160
160
|
content: "",
|
|
161
161
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
162
|
-
});
|
|
163
|
-
let
|
|
164
|
-
|
|
162
|
+
}), H(f, "provisioning", b, null);
|
|
163
|
+
let x = (e, t, n, r) => {
|
|
164
|
+
V(f, b, {
|
|
165
165
|
content: ve(e),
|
|
166
166
|
metadata: t?.length || n || r ? {
|
|
167
167
|
artifacts: t,
|
|
168
|
-
mode:
|
|
168
|
+
mode: l,
|
|
169
169
|
sessionId: n,
|
|
170
170
|
sandboxId: r
|
|
171
171
|
} : void 0
|
|
172
172
|
});
|
|
173
|
-
},
|
|
173
|
+
}, S = async (e = 1) => {
|
|
174
|
+
let i = !1;
|
|
174
175
|
try {
|
|
175
|
-
await n(
|
|
176
|
+
await n(j, _, v);
|
|
176
177
|
} catch (e) {
|
|
177
|
-
if (
|
|
178
|
-
|
|
178
|
+
if (C(e)) {
|
|
179
|
+
w("ai-credits"), x("You've run out of AI credits for this billing cycle. Upgrade your plan to keep chatting."), H(f, "error", b, null);
|
|
179
180
|
return;
|
|
180
181
|
}
|
|
181
182
|
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);
|
|
182
183
|
}
|
|
183
184
|
try {
|
|
184
|
-
let { sandboxId: e, sessionId: n } = await
|
|
185
|
-
X(
|
|
186
|
-
let
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
185
|
+
let { sandboxId: e, sessionId: n } = await Ie(f, b, l, _, v), o = (await c(j, e, _, n, v, 50).catch(() => [])).reduce((e, t) => Math.max(e, A(t)), 0);
|
|
186
|
+
X(f, b, "streaming", "Thinking...");
|
|
187
|
+
let p = oe(l, te(t, r)), h = ee(p, r), g = re(h), ie = g > 0, y = m();
|
|
188
|
+
i = ne(r) > g;
|
|
189
|
+
try {
|
|
190
|
+
await d(j, e, _, n, p, l, y, v, h);
|
|
191
|
+
} catch (t) {
|
|
192
|
+
if (!h || !se(t)) throw t;
|
|
193
|
+
await d(j, e, _, n, p, l, y, v, void 0), i ||= ie;
|
|
194
|
+
}
|
|
195
|
+
let S = ye([], o), C = Date.now() + (me[l] ?? he), w = Date.now();
|
|
196
|
+
for (; Date.now() < C && (S = ye(await c(j, e, _, n, v, 50), o), V(f, b, { content: ve(S.content) }), !S.done);) Date.now() - w > 3e4 && (await a(j, e, _, 600, v).catch(() => void 0), w = Date.now()), await new Promise((e) => setTimeout(e, 1500));
|
|
197
|
+
if (!S.done && l !== "vibe-plugins") throw Error("Assistant response timed out while streaming progress");
|
|
198
|
+
let T = l === "vibe-plugins" ? await s(j, e, _, n, v).catch(() => []) : void 0;
|
|
199
|
+
if (S.done || (S = {
|
|
200
|
+
...S,
|
|
201
|
+
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._`
|
|
202
|
+
}), i && (S = {
|
|
203
|
+
...S,
|
|
204
|
+
content: `${S.content}\n\n${k("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._")}`
|
|
205
|
+
}), x(S.content, T, n, e), S.tokens) {
|
|
206
|
+
V(f, b, { tokens: S.tokens });
|
|
197
207
|
try {
|
|
198
|
-
await u(
|
|
208
|
+
await u(j, _, n, S.tokens, v), ae();
|
|
199
209
|
} catch {}
|
|
200
210
|
}
|
|
201
|
-
|
|
211
|
+
H(f, "complete", b, null);
|
|
202
212
|
} catch (t) {
|
|
203
|
-
if (e === 1 && _e(t)) return
|
|
213
|
+
if (e === 1 && _e(t)) return W(f), Ee(l), S(2);
|
|
204
214
|
throw t;
|
|
205
215
|
}
|
|
206
|
-
};
|
|
216
|
+
}, E = f;
|
|
217
|
+
Y.current.add(E);
|
|
207
218
|
try {
|
|
208
|
-
if (!
|
|
209
|
-
await
|
|
219
|
+
if (!_) throw Error("Assistant backend is unavailable without an active workspace context.");
|
|
220
|
+
await S();
|
|
210
221
|
} catch (e) {
|
|
211
|
-
if (
|
|
212
|
-
|
|
222
|
+
if (C(e)) {
|
|
223
|
+
w("sandbox"), x("You've reached your sandbox limit on the current plan. Upgrade to start the AI assistant."), H(f, "error", b, null);
|
|
213
224
|
return;
|
|
214
225
|
}
|
|
215
226
|
let t = e instanceof Error ? e.message : "Something went wrong";
|
|
216
|
-
|
|
227
|
+
H(f, "error", b, t), B(f, b, `Sorry, an error occurred: ${t}. Please try again.`);
|
|
228
|
+
} finally {
|
|
229
|
+
Y.current.delete(E);
|
|
217
230
|
}
|
|
218
231
|
}, [
|
|
219
|
-
|
|
232
|
+
P,
|
|
233
|
+
z,
|
|
234
|
+
j,
|
|
235
|
+
W,
|
|
236
|
+
Ee,
|
|
237
|
+
Se,
|
|
220
238
|
R,
|
|
221
|
-
|
|
239
|
+
Ie,
|
|
240
|
+
M,
|
|
241
|
+
N,
|
|
242
|
+
V,
|
|
222
243
|
U,
|
|
223
|
-
Ce,
|
|
224
|
-
be,
|
|
225
244
|
L,
|
|
226
|
-
je,
|
|
227
|
-
O,
|
|
228
|
-
A,
|
|
229
|
-
B,
|
|
230
|
-
P,
|
|
231
245
|
H,
|
|
232
|
-
|
|
233
|
-
V,
|
|
246
|
+
k,
|
|
234
247
|
X,
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
]),
|
|
248
|
+
B,
|
|
249
|
+
xe
|
|
250
|
+
]), Le = E((e) => {
|
|
238
251
|
Z(e);
|
|
239
|
-
}, [Z]),
|
|
240
|
-
let e = [...
|
|
252
|
+
}, [Z]), Re = E(() => {
|
|
253
|
+
let e = [...K].reverse().find((e) => e.role === "user"), t = P ? Fe.current[P] ?? [] : [];
|
|
241
254
|
e && Z(e.content, t);
|
|
242
255
|
}, [
|
|
243
|
-
|
|
256
|
+
K,
|
|
244
257
|
Z,
|
|
245
|
-
|
|
258
|
+
P
|
|
246
259
|
]), Q = le(Z);
|
|
247
|
-
|
|
260
|
+
D(() => {
|
|
248
261
|
Q.current = Z;
|
|
249
|
-
}, [Z]),
|
|
262
|
+
}, [Z]), D(() => {
|
|
250
263
|
let t = e.getState().consumePendingPrompt();
|
|
251
264
|
return t && Q.current(t), e.subscribe((t, n) => {
|
|
252
265
|
if (t.pendingPrompt && t.pendingPrompt !== n.pendingPrompt) {
|
|
@@ -255,69 +268,69 @@ var A = () => {
|
|
|
255
268
|
}
|
|
256
269
|
});
|
|
257
270
|
}, []);
|
|
258
|
-
let $ =
|
|
259
|
-
let n =
|
|
271
|
+
let $ = E((t) => {
|
|
272
|
+
let n = P ? e.getState().conversations.find((e) => e.id === P) : void 0;
|
|
260
273
|
if (n && (n.messages.length > 0 || n.backendSessionId)) {
|
|
261
274
|
if (n.mode !== t) {
|
|
262
275
|
let n = e.getState().conversations.find((n) => n.mode === t && n.messages.length === 0 && !n.backendSessionId && !e.getState().processingByConversationId[n.id]);
|
|
263
|
-
n ?
|
|
276
|
+
n ? we(n.id) : R(void 0, t);
|
|
264
277
|
}
|
|
265
|
-
} else
|
|
266
|
-
|
|
278
|
+
} else P && L(P, t);
|
|
279
|
+
I(t);
|
|
267
280
|
}, [
|
|
268
|
-
|
|
281
|
+
P,
|
|
282
|
+
R,
|
|
283
|
+
we,
|
|
269
284
|
L,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
if (b.find((e) => e.id === t)?.writeCapable && !e.getState().apiCallsAcknowledged) {
|
|
275
|
-
Y(t);
|
|
285
|
+
I
|
|
286
|
+
]), ze = E((t) => {
|
|
287
|
+
if (y.find((e) => e.id === t)?.writeCapable && !e.getState().apiCallsAcknowledged) {
|
|
288
|
+
Pe(t);
|
|
276
289
|
return;
|
|
277
290
|
}
|
|
278
291
|
$(t);
|
|
279
|
-
}, [$]),
|
|
280
|
-
let e =
|
|
281
|
-
|
|
292
|
+
}, [$]), Be = E(() => {
|
|
293
|
+
let e = Ne;
|
|
294
|
+
Pe(null), De(), e && $(e);
|
|
282
295
|
}, [
|
|
283
|
-
|
|
284
|
-
|
|
296
|
+
Ne,
|
|
297
|
+
De,
|
|
285
298
|
$
|
|
286
|
-
]),
|
|
287
|
-
|
|
299
|
+
]), Ve = E(() => {
|
|
300
|
+
Pe(null);
|
|
288
301
|
}, []);
|
|
289
302
|
return /* @__PURE__ */ de("div", {
|
|
290
303
|
className: "flex flex-1 flex-col overflow-hidden",
|
|
291
304
|
children: [
|
|
292
|
-
|
|
293
|
-
mode:
|
|
294
|
-
onSuggestionClick:
|
|
295
|
-
}) : /* @__PURE__ */
|
|
305
|
+
K.length === 0 ? /* @__PURE__ */ O(b, {
|
|
306
|
+
mode: F,
|
|
307
|
+
onSuggestionClick: Le
|
|
308
|
+
}) : /* @__PURE__ */ O("div", {
|
|
296
309
|
className: "flex min-h-0 flex-1 flex-col",
|
|
297
|
-
children: /* @__PURE__ */
|
|
298
|
-
messages:
|
|
299
|
-
streamingMessageId:
|
|
300
|
-
failedMessageId:
|
|
301
|
-
onRetry:
|
|
310
|
+
children: /* @__PURE__ */ O(_, {
|
|
311
|
+
messages: K,
|
|
312
|
+
streamingMessageId: ke,
|
|
313
|
+
failedMessageId: Ae,
|
|
314
|
+
onRetry: Re
|
|
302
315
|
})
|
|
303
316
|
}),
|
|
304
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ O(x, {
|
|
305
318
|
onSend: (e, t) => void Z(e, t),
|
|
306
|
-
disabled:
|
|
307
|
-
placeholder:
|
|
308
|
-
mode:
|
|
309
|
-
availableModes:
|
|
310
|
-
onModeChange:
|
|
319
|
+
disabled: Oe,
|
|
320
|
+
placeholder: F === "api-calls" ? k("healthybowl.assistant.chatArea.placeholderActions", "What would you like me to do?") : k("healthybowl.assistant.chatArea.placeholderGeneral", "Ask HealthyBowl anything…"),
|
|
321
|
+
mode: F,
|
|
322
|
+
availableModes: Me,
|
|
323
|
+
onModeChange: ze
|
|
311
324
|
}),
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
open:
|
|
314
|
-
onConfirm:
|
|
315
|
-
onCancel:
|
|
325
|
+
/* @__PURE__ */ O(v, {
|
|
326
|
+
open: Ne !== null,
|
|
327
|
+
onConfirm: Be,
|
|
328
|
+
onCancel: Ve
|
|
316
329
|
})
|
|
317
330
|
]
|
|
318
331
|
});
|
|
319
332
|
};
|
|
320
333
|
//#endregion
|
|
321
|
-
export {
|
|
334
|
+
export { N as AssistantChatArea };
|
|
322
335
|
|
|
323
336
|
//# sourceMappingURL=AssistantChatArea.js.map
|