@burdenoff/microfe-healthybowl 2026.630.3 → 2026.703.1
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 +152 -154
- package/dist/components/assistant/AssistantChatArea.js.map +1 -1
- package/dist/healthybowl/HealthyBowlRoot.js +81 -73
- package/dist/healthybowl/HealthyBowlRoot.js.map +1 -1
- package/dist/healthybowl/HealthyBowlRoutes.js +196 -192
- package/dist/healthybowl/HealthyBowlRoutes.js.map +1 -1
- package/dist/healthybowl/pages/tasks/TasksPage.js +50 -0
- package/dist/healthybowl/pages/tasks/TasksPage.js.map +1 -0
- package/dist/healthybowl/pages/tasks/useDefaultTaskProject.js +79 -0
- package/dist/healthybowl/pages/tasks/useDefaultTaskProject.js.map +1 -0
- package/dist/node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js +1094 -0
- package/dist/node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js.map +1 -0
- package/dist/node_modules/class-variance-authority/dist/index.js +35 -0
- package/dist/node_modules/class-variance-authority/dist/index.js.map +1 -0
- package/package.json +2 -1
|
@@ -5,28 +5,28 @@ import { AssistantChatInput as m } from "./AssistantChatInput.js";
|
|
|
5
5
|
import { AssistantMessageList as h } from "./AssistantMessageList.js";
|
|
6
6
|
import { ASSISTANT_MODES as g } from "../../types/assistant.js";
|
|
7
7
|
import { AssistantModeSelector as _ } from "./AssistantModeSelector.js";
|
|
8
|
-
import { AssistantApiCallsConsentDialog as
|
|
9
|
-
import { AssistantWelcome as
|
|
10
|
-
import { useAssistantApiAccess as
|
|
11
|
-
import { gatherPageContext as
|
|
12
|
-
import { isQuotaExhaustedError as
|
|
13
|
-
import { dispatchAssistantQuotaExhausted as
|
|
14
|
-
import { buildPromptForMode as
|
|
15
|
-
import { useCallback as
|
|
16
|
-
import { Plus as
|
|
17
|
-
import { Fragment as
|
|
18
|
-
import { useGatewayClient as
|
|
19
|
-
import { useAuthToken as
|
|
8
|
+
import { AssistantApiCallsConsentDialog as v } from "./AssistantApiCallsConsentDialog.js";
|
|
9
|
+
import { AssistantWelcome as ee } from "./AssistantWelcome.js";
|
|
10
|
+
import { useAssistantApiAccess as te } from "../../hooks/useAssistantApiAccess.js";
|
|
11
|
+
import { gatherPageContext as ne } from "../../utils/pageContext.js";
|
|
12
|
+
import { isQuotaExhaustedError as re } from "../../utils/quotaUtils.js";
|
|
13
|
+
import { dispatchAssistantQuotaExhausted as ie, notifyAiCreditsUpdated as ae } from "../../utils/aiCredits.js";
|
|
14
|
+
import { buildPromptForMode as oe } from "../../utils/assistantPrompt.js";
|
|
15
|
+
import { useCallback as y, useEffect as b, useMemo as se, useRef as ce, useState as le } from "react";
|
|
16
|
+
import { Plus as ue } from "lucide-react";
|
|
17
|
+
import { Fragment as de, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
18
|
+
import { useGatewayClient as fe } from "@burdenoff/fe-libs/shared/graphql";
|
|
19
|
+
import { useAuthToken as pe } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
20
20
|
//#region src/components/assistant/AssistantChatArea.tsx
|
|
21
|
-
var
|
|
21
|
+
var me = {
|
|
22
22
|
general: 18e4,
|
|
23
23
|
"api-calls": 18e4,
|
|
24
24
|
"vibe-plugins": 6e5
|
|
25
|
-
},
|
|
26
|
-
function
|
|
25
|
+
}, he = 18e4;
|
|
26
|
+
function ge() {
|
|
27
27
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function C(e) {
|
|
30
30
|
try {
|
|
31
31
|
let t = e === "workspaceId" ? "burdenoff-active-context-workspace" : "burdenoff-active-context-organization", n = localStorage.getItem(t);
|
|
32
32
|
if (n) return n;
|
|
@@ -38,13 +38,13 @@ function T(e) {
|
|
|
38
38
|
return "";
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return new URLSearchParams(window.location.search).get("workspace") ??
|
|
41
|
+
function _e() {
|
|
42
|
+
return new URLSearchParams(window.location.search).get("workspace") ?? C("workspaceId");
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
return new URLSearchParams(window.location.search).get("org") ??
|
|
44
|
+
function ve() {
|
|
45
|
+
return new URLSearchParams(window.location.search).get("org") ?? C("organizationId");
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function ye(e) {
|
|
48
48
|
let t = e instanceof Error ? e.message.toLowerCase() : String(e).toLowerCase();
|
|
49
49
|
return t.includes("rate limit exceeded") || t.includes("unauthorized") || t.includes("k8s api error 401") ? !1 : [
|
|
50
50
|
"sandbox not found",
|
|
@@ -59,35 +59,35 @@ function _e(e) {
|
|
|
59
59
|
"session mode mismatch"
|
|
60
60
|
].some((e) => t.includes(e));
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function be(e) {
|
|
63
63
|
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]");
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function w(e) {
|
|
66
66
|
return e.info?.time?.created ?? 0;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function T(e) {
|
|
69
69
|
return (e ?? []).filter((e) => e.type === "text" && typeof e.text == "string").map((e) => e.text?.trim() ?? "").filter(Boolean).join("\n");
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function E(e) {
|
|
72
72
|
return (e ?? []).filter((e) => e.type === "tool" && e.tool).map((e) => {
|
|
73
73
|
let t = e.state?.status ?? "running", n = e.tool ?? "tool";
|
|
74
74
|
return t === "completed" ? `Completed: ${n}` : t === "failed" ? `Failed: ${n}` : `Running: ${n}`;
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
let n = e.filter((e) => e.info?.role === "assistant" &&
|
|
77
|
+
function xe(e, t) {
|
|
78
|
+
let n = e.filter((e) => e.info?.role === "assistant" && w(e) > t).sort((e, t) => w(e) - w(t));
|
|
79
79
|
if (n.length === 0) return {
|
|
80
80
|
content: "Thinking...",
|
|
81
81
|
done: !1
|
|
82
82
|
};
|
|
83
|
-
let r = n[n.length - 1], i =
|
|
83
|
+
let r = n[n.length - 1], i = T(r.parts), a = E(r.parts);
|
|
84
84
|
return {
|
|
85
85
|
content: [i, ...a].filter(Boolean).join("\n\n") || "Thinking...",
|
|
86
86
|
done: !!r.info?.time?.completed && (!!i || a.length > 0),
|
|
87
87
|
tokens: r.info?.tokens
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function Se(e) {
|
|
91
91
|
switch (e) {
|
|
92
92
|
case "provisioning": return "Starting assistant environment...";
|
|
93
93
|
case "connecting": return "Connecting to assistant...";
|
|
@@ -95,78 +95,78 @@ function be(e) {
|
|
|
95
95
|
default: return "";
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
var
|
|
99
|
-
let
|
|
100
|
-
|
|
101
|
-
if (
|
|
102
|
-
let e = g.find((e) => e.id ===
|
|
103
|
-
(!e || e.requiresAdmin && !
|
|
98
|
+
var D = ({ messagesExpanded: C = !1 }) => {
|
|
99
|
+
let T = t(), E = fe("workspace"), { getAccessToken: D, getWorkspaceToken: O, userId: k } = pe(), { conversations: A, activeConversationId: j, mode: M, processingByConversationId: N, setMode: P, setConversationMode: F, setActiveConversation: I, createConversation: L, addMessage: R, updateMessage: z, patchMessage: B, setConversationProcessing: V, clearConversationProcessing: Ce, setBackendSessionId: H, clearBackendSessionId: U, setSandbox: W, clearSandbox: we, acknowledgeApiCalls: Te } = e(), Ee = A.find((e) => e.id === j)?.messages ?? [], G = j ? N[j] : void 0, De = G?.messageId ?? null, Oe = G?.status === "provisioning" || G?.status === "connecting" || G?.status === "streaming", { canUseApiCalls: K, loading: ke } = te(ve()), Ae = se(() => g.filter((e) => !e.requiresAdmin || K), [K]), [q, J] = le(null);
|
|
100
|
+
b(() => {
|
|
101
|
+
if (ke) return;
|
|
102
|
+
let e = g.find((e) => e.id === M);
|
|
103
|
+
(!e || e.requiresAdmin && !K) && M !== "general" && P("general");
|
|
104
104
|
}, [
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
M,
|
|
106
|
+
K,
|
|
107
|
+
ke,
|
|
108
|
+
P
|
|
109
109
|
]);
|
|
110
|
-
let
|
|
111
|
-
|
|
112
|
-
}, [
|
|
110
|
+
let Y = y((e, t, n, r) => {
|
|
111
|
+
V(e, n, t, null), r ? z(e, t, r) : z(e, t, Se(n));
|
|
112
|
+
}, [V, z]), X = y(async (t, n, a, s, c) => {
|
|
113
113
|
let u = e.getState().sandboxesByMode[a]?.sandboxId ?? null;
|
|
114
114
|
if (!u) {
|
|
115
|
-
|
|
116
|
-
let e = await o(
|
|
117
|
-
if (e) u = e,
|
|
115
|
+
Y(t, n, "provisioning", "Looking for existing environment...");
|
|
116
|
+
let e = await o(E, s, a, c);
|
|
117
|
+
if (e) u = e, W(a, u, "provisioning"), Y(t, n, "provisioning", "Reusing assistant environment..."), await p(E, u, s, c, 3e5, (e) => Y(t, n, "provisioning", e)), await f(E, u, s, c, 9e4, (e) => Y(t, n, "connecting", e)), W(a, u, "running");
|
|
118
118
|
else {
|
|
119
|
-
if (a === "api-calls" && !
|
|
120
|
-
|
|
119
|
+
if (a === "api-calls" && !D()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
|
|
120
|
+
Y(t, n, "provisioning", "Starting assistant environment..."), W(a, null, "provisioning"), u = await r(E, a, s, c), W(a, u, "provisioning"), await p(E, u, s, c, 3e5, (e) => Y(t, n, "provisioning", e)), await f(E, u, s, c, 9e4, (e) => Y(t, n, "connecting", e)), W(a, u, "running");
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
let d = e.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null;
|
|
124
124
|
if (d) try {
|
|
125
|
-
let e = await l(
|
|
125
|
+
let e = await l(E, u, s, d, c);
|
|
126
126
|
if (e.mode !== a) throw Error(`Session mode mismatch: expected ${a}, received ${e.mode}`);
|
|
127
127
|
} catch {
|
|
128
|
-
|
|
128
|
+
U(t), d = null;
|
|
129
129
|
}
|
|
130
|
-
return d || (
|
|
130
|
+
return d || (Y(t, n, "connecting", "Preparing session..."), d = (await i(E, u, s, a, c)).sessionId, H(t, d)), {
|
|
131
131
|
sandboxId: u,
|
|
132
132
|
sessionId: d
|
|
133
133
|
};
|
|
134
134
|
}, [
|
|
135
|
+
E,
|
|
136
|
+
U,
|
|
135
137
|
D,
|
|
138
|
+
H,
|
|
136
139
|
W,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
]), Z = b(async (t) => {
|
|
142
|
-
if (M) {
|
|
143
|
-
let e = P[M]?.status;
|
|
140
|
+
Y
|
|
141
|
+
]), Z = y(async (t) => {
|
|
142
|
+
if (j) {
|
|
143
|
+
let e = N[j]?.status;
|
|
144
144
|
if (e === "provisioning" || e === "connecting" || e === "streaming") return;
|
|
145
145
|
}
|
|
146
|
-
let r = e.getState().mode, i =
|
|
147
|
-
if (i ? o && o.mode !== r && (o.messages.length > 0 || o.backendSessionId) ? i =
|
|
148
|
-
let l =
|
|
149
|
-
accessToken:
|
|
150
|
-
workspaceToken:
|
|
151
|
-
userId:
|
|
152
|
-
organizationId:
|
|
146
|
+
let r = e.getState().mode, i = j, o = i ? e.getState().conversations.find((e) => e.id === i) : void 0;
|
|
147
|
+
if (i ? o && o.mode !== r && (o.messages.length > 0 || o.backendSessionId) ? i = L(void 0, r) : o && o.mode !== r && F(i, r) : i = L(void 0, r), !i) return;
|
|
148
|
+
let l = _e(), f = {
|
|
149
|
+
accessToken: D(),
|
|
150
|
+
workspaceToken: O(),
|
|
151
|
+
userId: k,
|
|
152
|
+
organizationId: ve()
|
|
153
153
|
}, p = {
|
|
154
|
-
id:
|
|
154
|
+
id: ge(),
|
|
155
155
|
role: "user",
|
|
156
156
|
content: t,
|
|
157
157
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
158
158
|
};
|
|
159
|
-
|
|
160
|
-
let m =
|
|
161
|
-
|
|
159
|
+
R(i, p);
|
|
160
|
+
let m = ge();
|
|
161
|
+
R(i, {
|
|
162
162
|
id: m,
|
|
163
163
|
role: "assistant",
|
|
164
164
|
content: "",
|
|
165
165
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
166
166
|
});
|
|
167
167
|
let h = (e, t, n, a) => {
|
|
168
|
-
|
|
169
|
-
content:
|
|
168
|
+
B(i, m, {
|
|
169
|
+
content: be(e),
|
|
170
170
|
metadata: t?.length || n || a ? {
|
|
171
171
|
artifacts: t,
|
|
172
172
|
mode: r,
|
|
@@ -176,35 +176,33 @@ var k = ({ messagesExpanded: T = !1 }) => {
|
|
|
176
176
|
});
|
|
177
177
|
}, g = async (e = 1) => {
|
|
178
178
|
try {
|
|
179
|
-
await n(
|
|
179
|
+
await n(E, l, f);
|
|
180
180
|
} catch (e) {
|
|
181
|
-
if (
|
|
182
|
-
|
|
181
|
+
if (re(e)) {
|
|
182
|
+
ie("ai-credits"), h("You've run out of AI credits for this billing cycle. Upgrade your plan to keep chatting."), V(i, "error", m, null);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
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);
|
|
186
186
|
}
|
|
187
187
|
try {
|
|
188
|
-
let { sandboxId: e, sessionId: n } = await
|
|
189
|
-
|
|
190
|
-
let o = Date.now();
|
|
191
|
-
await
|
|
192
|
-
let p = ye([], o), g = Date.now() + (pe[r] ?? me), _ = Date.now();
|
|
193
|
-
for (; Date.now() < g && (p = ye(await c(D, e, l, n, f, 50), o), V(i, m, { content: ve(p.content) }), !p.done);) Date.now() - _ > 3e4 && (await a(D, e, l, 600, f).catch(() => void 0), _ = Date.now()), await new Promise((e) => setTimeout(e, 1500));
|
|
188
|
+
let { sandboxId: e, sessionId: n } = await X(i, m, r, l, f), o = (await c(E, e, l, n, f, 50).catch(() => [])).reduce((e, t) => Math.max(e, w(t)), 0);
|
|
189
|
+
Y(i, m, "streaming", "Thinking..."), await d(E, e, l, n, oe(r, t), r, ne(), f);
|
|
190
|
+
let p = xe([], o), g = Date.now() + (me[r] ?? he), _ = Date.now();
|
|
191
|
+
for (; Date.now() < g && (p = xe(await c(E, e, l, n, f, 50), o), B(i, m, { content: be(p.content) }), !p.done);) Date.now() - _ > 3e4 && (await a(E, e, l, 600, f).catch(() => void 0), _ = Date.now()), await new Promise((e) => setTimeout(e, 1500));
|
|
194
192
|
if (!p.done && r !== "vibe-plugins") throw Error("Assistant response timed out while streaming progress");
|
|
195
|
-
let
|
|
193
|
+
let v = r === "vibe-plugins" ? await s(E, e, l, n, f).catch(() => []) : void 0;
|
|
196
194
|
if (p.done || (p = {
|
|
197
195
|
...p,
|
|
198
196
|
content: `${p.content}\n\n_Still building in the background — any artifacts below will finish shortly. Re-open this conversation to pick up the completed plugin._`
|
|
199
|
-
}), h(p.content,
|
|
200
|
-
|
|
197
|
+
}), h(p.content, v, n, e), p.tokens) {
|
|
198
|
+
B(i, m, { tokens: p.tokens });
|
|
201
199
|
try {
|
|
202
|
-
await u(
|
|
200
|
+
await u(E, l, n, p.tokens, f), ae();
|
|
203
201
|
} catch {}
|
|
204
202
|
}
|
|
205
|
-
|
|
203
|
+
V(i, "complete", m, null);
|
|
206
204
|
} catch (t) {
|
|
207
|
-
if (e === 1 &&
|
|
205
|
+
if (e === 1 && ye(t)) return U(i), we(r), g(2);
|
|
208
206
|
throw t;
|
|
209
207
|
}
|
|
210
208
|
};
|
|
@@ -212,38 +210,38 @@ var k = ({ messagesExpanded: T = !1 }) => {
|
|
|
212
210
|
if (!l) throw Error("Assistant backend is unavailable without an active workspace context.");
|
|
213
211
|
await g();
|
|
214
212
|
} catch (e) {
|
|
215
|
-
if (
|
|
216
|
-
|
|
213
|
+
if (re(e)) {
|
|
214
|
+
ie("sandbox"), h("You've reached your sandbox limit on the current plan. Upgrade to start the AI assistant."), V(i, "error", m, null);
|
|
217
215
|
return;
|
|
218
216
|
}
|
|
219
217
|
let t = e instanceof Error ? e.message : "Something went wrong";
|
|
220
|
-
|
|
218
|
+
V(i, "error", m, t), z(i, m, `Sorry, an error occurred: ${t}. Please try again.`);
|
|
221
219
|
}
|
|
222
220
|
}, [
|
|
223
|
-
M,
|
|
224
|
-
z,
|
|
225
|
-
D,
|
|
226
|
-
W,
|
|
227
|
-
Se,
|
|
228
221
|
j,
|
|
229
222
|
R,
|
|
230
|
-
|
|
231
|
-
O,
|
|
232
|
-
k,
|
|
233
|
-
V,
|
|
234
|
-
P,
|
|
223
|
+
E,
|
|
235
224
|
U,
|
|
236
|
-
|
|
237
|
-
|
|
225
|
+
we,
|
|
226
|
+
A,
|
|
227
|
+
L,
|
|
238
228
|
X,
|
|
229
|
+
D,
|
|
230
|
+
O,
|
|
239
231
|
B,
|
|
240
|
-
|
|
241
|
-
|
|
232
|
+
N,
|
|
233
|
+
H,
|
|
234
|
+
F,
|
|
235
|
+
V,
|
|
236
|
+
Y,
|
|
237
|
+
z,
|
|
238
|
+
k
|
|
239
|
+
]), je = y((e) => {
|
|
242
240
|
Z(e);
|
|
243
|
-
}, [Z]), Q =
|
|
244
|
-
|
|
241
|
+
}, [Z]), Q = ce(Z);
|
|
242
|
+
b(() => {
|
|
245
243
|
Q.current = Z;
|
|
246
|
-
}, [Z]),
|
|
244
|
+
}, [Z]), b(() => {
|
|
247
245
|
let t = e.getState().consumePendingPrompt();
|
|
248
246
|
return t && Q.current(t), e.subscribe((t, n) => {
|
|
249
247
|
if (t.pendingPrompt && t.pendingPrompt !== n.pendingPrompt) {
|
|
@@ -252,86 +250,86 @@ var k = ({ messagesExpanded: T = !1 }) => {
|
|
|
252
250
|
}
|
|
253
251
|
});
|
|
254
252
|
}, []);
|
|
255
|
-
let $ =
|
|
256
|
-
let n =
|
|
253
|
+
let $ = y((t) => {
|
|
254
|
+
let n = j ? e.getState().conversations.find((e) => e.id === j) : void 0;
|
|
257
255
|
if (n && (n.messages.length > 0 || n.backendSessionId)) {
|
|
258
256
|
if (n.mode !== t) {
|
|
259
257
|
let n = e.getState().conversations.find((n) => n.mode === t && n.messages.length === 0 && !n.backendSessionId && !e.getState().processingByConversationId[n.id]);
|
|
260
|
-
n ?
|
|
258
|
+
n ? I(n.id) : L(void 0, t);
|
|
261
259
|
}
|
|
262
|
-
} else
|
|
263
|
-
|
|
260
|
+
} else j && F(j, t);
|
|
261
|
+
P(t);
|
|
264
262
|
}, [
|
|
265
|
-
|
|
266
|
-
R,
|
|
263
|
+
j,
|
|
267
264
|
L,
|
|
268
265
|
I,
|
|
269
|
-
F
|
|
270
|
-
|
|
266
|
+
F,
|
|
267
|
+
P
|
|
268
|
+
]), Me = y((t) => {
|
|
271
269
|
if (g.find((e) => e.id === t)?.writeCapable && !e.getState().apiCallsAcknowledged) {
|
|
272
|
-
|
|
270
|
+
J(t);
|
|
273
271
|
return;
|
|
274
272
|
}
|
|
275
273
|
$(t);
|
|
276
|
-
}, [$]),
|
|
277
|
-
let e =
|
|
278
|
-
|
|
274
|
+
}, [$]), Ne = y(() => {
|
|
275
|
+
let e = q;
|
|
276
|
+
J(null), Te(), e && $(e);
|
|
279
277
|
}, [
|
|
280
|
-
|
|
281
|
-
|
|
278
|
+
q,
|
|
279
|
+
Te,
|
|
282
280
|
$
|
|
283
|
-
]),
|
|
284
|
-
|
|
281
|
+
]), Pe = y(() => {
|
|
282
|
+
J(null);
|
|
285
283
|
}, []);
|
|
286
|
-
return /* @__PURE__ */
|
|
284
|
+
return /* @__PURE__ */ S("div", {
|
|
287
285
|
className: "flex flex-col flex-1 overflow-hidden",
|
|
288
286
|
children: [
|
|
289
|
-
|
|
290
|
-
mode:
|
|
291
|
-
onSuggestionClick:
|
|
292
|
-
}) : /* @__PURE__ */
|
|
293
|
-
className: `grid min-h-0 transition-[grid-template-rows] duration-300 ease-out ${
|
|
294
|
-
style: { gridTemplateRows:
|
|
295
|
-
inert: !
|
|
287
|
+
Ee.length === 0 ? /* @__PURE__ */ x(ee, {
|
|
288
|
+
mode: M,
|
|
289
|
+
onSuggestionClick: je
|
|
290
|
+
}) : /* @__PURE__ */ S(de, { children: [/* @__PURE__ */ x("div", {
|
|
291
|
+
className: `grid min-h-0 transition-[grid-template-rows] duration-300 ease-out ${C ? "flex-1" : "flex-shrink-0"}`,
|
|
292
|
+
style: { gridTemplateRows: C ? "1fr" : "0fr" },
|
|
293
|
+
inert: !C || void 0,
|
|
296
294
|
"data-testid": "message-transcript",
|
|
297
|
-
children: /* @__PURE__ */
|
|
298
|
-
className: `min-h-0 overflow-hidden transition-opacity duration-300 ${
|
|
299
|
-
children: /* @__PURE__ */
|
|
295
|
+
children: /* @__PURE__ */ x("div", {
|
|
296
|
+
className: `min-h-0 overflow-hidden transition-opacity duration-300 ${C ? "opacity-100" : "opacity-0"}`,
|
|
297
|
+
children: /* @__PURE__ */ x("div", {
|
|
300
298
|
className: "flex h-full flex-col",
|
|
301
|
-
children: /* @__PURE__ */
|
|
302
|
-
messages:
|
|
303
|
-
streamingMessageId:
|
|
304
|
-
expanded:
|
|
299
|
+
children: /* @__PURE__ */ x(h, {
|
|
300
|
+
messages: Ee,
|
|
301
|
+
streamingMessageId: De,
|
|
302
|
+
expanded: C
|
|
305
303
|
})
|
|
306
304
|
})
|
|
307
305
|
})
|
|
308
|
-
}), !
|
|
309
|
-
/* @__PURE__ */
|
|
306
|
+
}), !C && /* @__PURE__ */ x("div", { className: "flex-1" })] }),
|
|
307
|
+
/* @__PURE__ */ x(m, {
|
|
310
308
|
onSend: (e) => void Z(e),
|
|
311
|
-
disabled:
|
|
312
|
-
placeholder:
|
|
313
|
-
toolbarStart: /* @__PURE__ */
|
|
309
|
+
disabled: Oe,
|
|
310
|
+
placeholder: M === "api-calls" ? T("healthybowl.assistant.chatArea.placeholderActions", "What would you like to change or create?") : T("healthybowl.assistant.chatArea.placeholderGeneral", "Ask anything about your farm…"),
|
|
311
|
+
toolbarStart: /* @__PURE__ */ S(de, { children: [/* @__PURE__ */ x("button", {
|
|
314
312
|
type: "button",
|
|
315
|
-
onClick: () =>
|
|
313
|
+
onClick: () => L(),
|
|
316
314
|
className: "flex size-7 flex-shrink-0 items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-bg-elevated hover:text-text-primary",
|
|
317
|
-
"aria-label":
|
|
315
|
+
"aria-label": T("healthybowl.assistant.chatArea.newConversation", "New conversation"),
|
|
318
316
|
"data-testid": "composer-new-conversation",
|
|
319
|
-
children: /* @__PURE__ */
|
|
320
|
-
}), /* @__PURE__ */
|
|
321
|
-
mode:
|
|
322
|
-
availableModes:
|
|
323
|
-
onModeChange:
|
|
317
|
+
children: /* @__PURE__ */ x(ue, { className: "size-4" })
|
|
318
|
+
}), /* @__PURE__ */ x(_, {
|
|
319
|
+
mode: M,
|
|
320
|
+
availableModes: Ae,
|
|
321
|
+
onModeChange: Me
|
|
324
322
|
})] })
|
|
325
323
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
327
|
-
open:
|
|
328
|
-
onConfirm:
|
|
329
|
-
onCancel:
|
|
324
|
+
/* @__PURE__ */ x(v, {
|
|
325
|
+
open: q !== null,
|
|
326
|
+
onConfirm: Ne,
|
|
327
|
+
onCancel: Pe
|
|
330
328
|
})
|
|
331
329
|
]
|
|
332
330
|
});
|
|
333
331
|
};
|
|
334
332
|
//#endregion
|
|
335
|
-
export {
|
|
333
|
+
export { D as AssistantChatArea };
|
|
336
334
|
|
|
337
335
|
//# sourceMappingURL=AssistantChatArea.js.map
|