@burdenoff/microfe-healthybowl 2026.812.20 → 2026.812.22

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.
Files changed (42) hide show
  1. package/dist/components/assistant/AIAssistantPanel.js +36 -32
  2. package/dist/components/assistant/AIAssistantPanel.js.map +1 -1
  3. package/dist/components/assistant/AssistantAutoSpeakToggle.js +27 -0
  4. package/dist/components/assistant/AssistantAutoSpeakToggle.js.map +1 -0
  5. package/dist/components/assistant/AssistantChatArea.js +161 -161
  6. package/dist/components/assistant/AssistantChatArea.js.map +1 -1
  7. package/dist/components/assistant/AssistantHeader.js +39 -37
  8. package/dist/components/assistant/AssistantHeader.js.map +1 -1
  9. package/dist/components/assistant/AssistantMessageItem.js +89 -78
  10. package/dist/components/assistant/AssistantMessageItem.js.map +1 -1
  11. package/dist/components/assistant/AssistantSpeakButton.js +22 -0
  12. package/dist/components/assistant/AssistantSpeakButton.js.map +1 -0
  13. package/dist/components/assistant/AssistantSpeechProvider.js +179 -0
  14. package/dist/components/assistant/AssistantSpeechProvider.js.map +1 -0
  15. package/dist/components/assistant/composer/AssistantAttachmentButton.js +19 -19
  16. package/dist/components/assistant/composer/AssistantAttachmentButton.js.map +1 -1
  17. package/dist/components/assistant/index.js +4 -1
  18. package/dist/hooks/useAssistantAttachments.js +82 -63
  19. package/dist/hooks/useAssistantAttachments.js.map +1 -1
  20. package/dist/node_modules/fflate/esm/browser.js +326 -0
  21. package/dist/node_modules/fflate/esm/browser.js.map +1 -0
  22. package/dist/node_modules/pdfjs-dist/build/pdf.js +16384 -0
  23. package/dist/node_modules/pdfjs-dist/build/pdf.js.map +1 -0
  24. package/dist/node_modules/pdfjs-dist/build/pdf.worker.min.js +52129 -0
  25. package/dist/node_modules/pdfjs-dist/build/pdf.worker.min.js.map +1 -0
  26. package/dist/services/speech/browserSpeechEngine.js +89 -0
  27. package/dist/services/speech/browserSpeechEngine.js.map +1 -0
  28. package/dist/store/assistantStore.js +7 -3
  29. package/dist/store/assistantStore.js.map +1 -1
  30. package/dist/utils/assistantAttachments.js +243 -61
  31. package/dist/utils/assistantAttachments.js.map +1 -1
  32. package/dist/utils/documentExtract.js +135 -0
  33. package/dist/utils/documentExtract.js.map +1 -0
  34. package/dist/utils/documentText.js +237 -0
  35. package/dist/utils/documentText.js.map +1 -0
  36. package/dist/utils/speakableText.js +302 -0
  37. package/dist/utils/speakableText.js.map +1 -0
  38. package/dist/utils/speechPlayback.js +27 -0
  39. package/dist/utils/speechPlayback.js.map +1 -0
  40. package/dist/utils/speechVoices.js +43 -0
  41. package/dist/utils/speechVoices.js.map +1 -0
  42. package/package.json +3 -1
@@ -3,42 +3,46 @@ import { useTr as t } from "../../shared/hooks/useTr.js";
3
3
  import { useAssistantKeyboardShortcuts as n } from "../../hooks/useAssistantKeyboardShortcuts.js";
4
4
  import { useAssistantHeartbeat as r } from "../../hooks/useAssistantHeartbeat.js";
5
5
  import { describeCurrentPage as i } from "../../utils/pageContext.js";
6
- import { AssistantHeader as a } from "./AssistantHeader.js";
7
- import { AssistantChatArea as o } from "./AssistantChatArea.js";
8
- import { AssistantConversationList as s } from "./AssistantConversationList.js";
9
- import { useMemo as c, useRef as l } from "react";
10
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
6
+ import { AssistantSpeechProvider as a } from "./AssistantSpeechProvider.js";
7
+ import { AssistantHeader as o } from "./AssistantHeader.js";
8
+ import { AssistantChatArea as s } from "./AssistantChatArea.js";
9
+ import { AssistantConversationList as c } from "./AssistantConversationList.js";
10
+ import { useMemo as l, useRef as u } from "react";
11
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
11
12
  //#region src/components/assistant/AIAssistantPanel.tsx
12
- var f = ({ onClose: f, visible: p, docked: m, onToggleDock: h }) => {
13
- let g = t(), _ = l(null), { conversations: v, activeConversationId: y, conversationListOpen: b, toggleConversationList: x, createConversation: S } = e(), C = v.find((e) => e.id === y);
14
- r(C?.backendSessionId ?? null, C?.mode ?? null, p ?? !0);
15
- let w = c(() => i(), []);
13
+ var p = ({ onClose: p, visible: m, docked: h, onToggleDock: g }) => {
14
+ let _ = t(), v = u(null), { conversations: y, activeConversationId: b, conversationListOpen: x, toggleConversationList: S, createConversation: C } = e(), w = y.find((e) => e.id === b);
15
+ r(w?.backendSessionId ?? null, w?.mode ?? null, m ?? !0);
16
+ let T = l(() => i(), []);
16
17
  return n({
17
- panelRef: _,
18
- onClose: f
19
- }), /* @__PURE__ */ d("div", {
20
- ref: _,
21
- className: "relative flex h-full w-full flex-col bg-bg-surface",
22
- role: "complementary",
23
- "aria-label": g("healthybowl.assistant.panel.ariaLabel", "AI Assistant"),
24
- "data-testid": "ai-assistant-panel",
25
- tabIndex: -1,
26
- children: [
27
- /* @__PURE__ */ u(a, {
28
- contextLabel: w,
29
- onNewConversation: () => S(),
30
- onOpenHistory: x,
31
- historyOpen: b,
32
- onClose: f,
33
- docked: m,
34
- onToggleDock: h
35
- }),
36
- b && /* @__PURE__ */ u(s, {}),
37
- /* @__PURE__ */ u(o, {})
38
- ]
18
+ panelRef: v,
19
+ onClose: p
20
+ }), /* @__PURE__ */ d(a, {
21
+ visible: m ?? !0,
22
+ children: /* @__PURE__ */ f("div", {
23
+ ref: v,
24
+ className: "relative flex h-full w-full flex-col bg-bg-surface",
25
+ role: "complementary",
26
+ "aria-label": _("healthybowl.assistant.panel.ariaLabel", "AI Assistant"),
27
+ "data-testid": "ai-assistant-panel",
28
+ tabIndex: -1,
29
+ children: [
30
+ /* @__PURE__ */ d(o, {
31
+ contextLabel: T,
32
+ onNewConversation: () => C(),
33
+ onOpenHistory: S,
34
+ historyOpen: x,
35
+ onClose: p,
36
+ docked: h,
37
+ onToggleDock: g
38
+ }),
39
+ x && /* @__PURE__ */ d(c, {}),
40
+ /* @__PURE__ */ d(s, {})
41
+ ]
42
+ })
39
43
  });
40
44
  };
41
45
  //#endregion
42
- export { f as AIAssistantPanel };
46
+ export { p as AIAssistantPanel };
43
47
 
44
48
  //# sourceMappingURL=AIAssistantPanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AIAssistantPanel.js","names":[],"sources":["../../../src/components/assistant/AIAssistantPanel.tsx"],"sourcesContent":["/**\n * AI Assistant Panel — top-level component for the in-page assistant.\n *\n * Layout (v2): a fixed identity header (AssistantHeader) with the brand mark,\n * an availability/context subtitle and icon actions (new conversation, history,\n * export, dock, close), an always-visible transcript, and the composer pinned\n * to the bottom. Conversation history opens as an overlay drawer over the panel\n * — never as an accordion over the transcript.\n *\n * The external prop contract ({ onClose, visible, docked, onToggleDock }) is\n * unchanged; the sandbox/session/transport logic lives in AssistantChatArea.\n */\n\nimport { useMemo, useRef, type FC } from 'react';\nimport type { PanelProps } from '@burdenoff/fe-libs/shared/plugins';\nimport { useAssistantStore } from '@/store/assistantStore';\nimport { useAssistantKeyboardShortcuts } from '@/hooks/useAssistantKeyboardShortcuts';\nimport { useAssistantHeartbeat } from '@/hooks/useAssistantHeartbeat';\nimport { describeCurrentPage } from '@/utils/pageContext';\nimport { AssistantHeader } from './AssistantHeader';\nimport { AssistantChatArea } from './AssistantChatArea';\nimport { AssistantConversationList } from './AssistantConversationList';\nimport { useTr } from '../../shared/hooks/useTr';\n\nexport type AIAssistantPanelProps = PanelProps & {\n /** When provided, renders a dock/float toggle in the header. */\n docked?: boolean;\n onToggleDock?: () => void;\n};\n\nexport const AIAssistantPanel: FC<AIAssistantPanelProps> = ({ onClose, visible, docked, onToggleDock }) => {\n const tr = useTr();\n const panelRef = useRef<HTMLDivElement>(null);\n\n const { conversations, activeConversationId, conversationListOpen, toggleConversationList, createConversation } =\n useAssistantStore();\n\n const activeConversation = conversations.find((c) => c.id === activeConversationId);\n const activeSessionId = activeConversation?.backendSessionId ?? null;\n\n // Keep sandbox alive while panel is open\n useAssistantHeartbeat(activeSessionId, activeConversation?.mode ?? null, visible ?? true);\n\n const contextLabel = useMemo(() => describeCurrentPage(), []);\n\n useAssistantKeyboardShortcuts({\n panelRef,\n onClose,\n });\n\n return (\n <div\n ref={panelRef}\n className=\"relative flex h-full w-full flex-col bg-bg-surface\"\n role=\"complementary\"\n aria-label={tr('healthybowl.assistant.panel.ariaLabel', 'AI Assistant')}\n data-testid=\"ai-assistant-panel\"\n tabIndex={-1}\n >\n <AssistantHeader\n contextLabel={contextLabel}\n onNewConversation={() => createConversation()}\n onOpenHistory={toggleConversationList}\n historyOpen={conversationListOpen}\n onClose={onClose}\n docked={docked}\n onToggleDock={onToggleDock}\n />\n\n {/* Conversation history overlay drawer (switch between chats) */}\n {conversationListOpen && <AssistantConversationList />}\n\n <AssistantChatArea />\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;AA8BA,IAAa,KAA+C,EAAE,YAAS,YAAS,WAAQ,sBAAmB;CACzG,IAAM,IAAK,GAAO,EACZ,IAAW,EAAuB,KAAK,EAEvC,EAAE,kBAAe,yBAAsB,yBAAsB,2BAAwB,0BACzF,GAAmB,EAEf,IAAqB,EAAc,MAAM,MAAM,EAAE,OAAO,EAAqB;AAInF,GAHwB,GAAoB,oBAAoB,MAGzB,GAAoB,QAAQ,MAAM,KAAW,GAAK;CAEzF,IAAM,IAAe,QAAc,GAAqB,EAAE,EAAE,CAAC;AAO7D,QALA,EAA8B;EAC5B;EACA;EACD,CAAC,EAGA,kBAAC,OAAD;EACE,KAAK;EACL,WAAU;EACV,MAAK;EACL,cAAY,EAAG,yCAAyC,eAAe;EACvE,eAAY;EACZ,UAAU;YANZ;GAQE,kBAAC,GAAD;IACgB;IACd,yBAAyB,GAAoB;IAC7C,eAAe;IACf,aAAa;IACJ;IACD;IACM;IACd,CAAA;GAGD,KAAwB,kBAAC,GAAD,EAA6B,CAAA;GAEtD,kBAAC,GAAD,EAAqB,CAAA;GACjB"}
1
+ {"version":3,"file":"AIAssistantPanel.js","names":[],"sources":["../../../src/components/assistant/AIAssistantPanel.tsx"],"sourcesContent":["/**\n * AI Assistant Panel — top-level component for the in-page assistant.\n *\n * Layout (v2): a fixed identity header (AssistantHeader) with the brand mark,\n * an availability/context subtitle and icon actions (new conversation, history,\n * export, dock, close), an always-visible transcript, and the composer pinned\n * to the bottom. Conversation history opens as an overlay drawer over the panel\n * — never as an accordion over the transcript.\n *\n * The external prop contract ({ onClose, visible, docked, onToggleDock }) is\n * unchanged; the sandbox/session/transport logic lives in AssistantChatArea.\n */\n\nimport { useMemo, useRef, type FC } from 'react';\nimport type { PanelProps } from '@burdenoff/fe-libs/shared/plugins';\nimport { useAssistantStore } from '@/store/assistantStore';\nimport { useAssistantKeyboardShortcuts } from '@/hooks/useAssistantKeyboardShortcuts';\nimport { useAssistantHeartbeat } from '@/hooks/useAssistantHeartbeat';\nimport { describeCurrentPage } from '@/utils/pageContext';\nimport { AssistantHeader } from './AssistantHeader';\nimport { AssistantChatArea } from './AssistantChatArea';\nimport { AssistantConversationList } from './AssistantConversationList';\nimport { AssistantSpeechProvider } from './AssistantSpeechProvider';\nimport { useTr } from '../../shared/hooks/useTr';\n\nexport type AIAssistantPanelProps = PanelProps & {\n /** When provided, renders a dock/float toggle in the header. */\n docked?: boolean;\n onToggleDock?: () => void;\n};\n\nexport const AIAssistantPanel: FC<AIAssistantPanelProps> = ({ onClose, visible, docked, onToggleDock }) => {\n const tr = useTr();\n const panelRef = useRef<HTMLDivElement>(null);\n\n const { conversations, activeConversationId, conversationListOpen, toggleConversationList, createConversation } =\n useAssistantStore();\n\n const activeConversation = conversations.find((c) => c.id === activeConversationId);\n const activeSessionId = activeConversation?.backendSessionId ?? null;\n\n // Keep sandbox alive while panel is open\n useAssistantHeartbeat(activeSessionId, activeConversation?.mode ?? null, visible ?? true);\n\n const contextLabel = useMemo(() => describeCurrentPage(), []);\n\n useAssistantKeyboardShortcuts({\n panelRef,\n onClose,\n });\n\n return (\n // Speech output (BOFF-6290) is provided at the panel root so that hiding the\n // panel — not only unmounting it — stops the voice, and so the header toggle\n // and every message's speak button share one playback state.\n <AssistantSpeechProvider visible={visible ?? true}>\n <div\n ref={panelRef}\n className=\"relative flex h-full w-full flex-col bg-bg-surface\"\n role=\"complementary\"\n aria-label={tr('healthybowl.assistant.panel.ariaLabel', 'AI Assistant')}\n data-testid=\"ai-assistant-panel\"\n tabIndex={-1}\n >\n <AssistantHeader\n contextLabel={contextLabel}\n onNewConversation={() => createConversation()}\n onOpenHistory={toggleConversationList}\n historyOpen={conversationListOpen}\n onClose={onClose}\n docked={docked}\n onToggleDock={onToggleDock}\n />\n\n {/* Conversation history overlay drawer (switch between chats) */}\n {conversationListOpen && <AssistantConversationList />}\n\n <AssistantChatArea />\n </div>\n </AssistantSpeechProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;AA+BA,IAAa,KAA+C,EAAE,YAAS,YAAS,WAAQ,sBAAmB;CACzG,IAAM,IAAK,GAAO,EACZ,IAAW,EAAuB,KAAK,EAEvC,EAAE,kBAAe,yBAAsB,yBAAsB,2BAAwB,0BACzF,GAAmB,EAEf,IAAqB,EAAc,MAAM,MAAM,EAAE,OAAO,EAAqB;AAInF,GAHwB,GAAoB,oBAAoB,MAGzB,GAAoB,QAAQ,MAAM,KAAW,GAAK;CAEzF,IAAM,IAAe,QAAc,GAAqB,EAAE,EAAE,CAAC;AAO7D,QALA,EAA8B;EAC5B;EACA;EACD,CAAC,EAMA,kBAAC,GAAD;EAAyB,SAAS,KAAW;YAC3C,kBAAC,OAAD;GACE,KAAK;GACL,WAAU;GACV,MAAK;GACL,cAAY,EAAG,yCAAyC,eAAe;GACvE,eAAY;GACZ,UAAU;aANZ;IAQE,kBAAC,GAAD;KACgB;KACd,yBAAyB,GAAoB;KAC7C,eAAe;KACf,aAAa;KACJ;KACD;KACM;KACd,CAAA;IAGD,KAAwB,kBAAC,GAAD,EAA6B,CAAA;IAEtD,kBAAC,GAAD,EAAqB,CAAA;IACjB;;EACkB,CAAA"}
@@ -0,0 +1,27 @@
1
+ import { useTr as e } from "../../shared/hooks/useTr.js";
2
+ import { useAssistantSpeech as t } from "./AssistantSpeechProvider.js";
3
+ import { Volume2 as n, VolumeX as r } from "lucide-react";
4
+ import { jsx as i } from "react/jsx-runtime";
5
+ //#region src/components/assistant/AssistantAutoSpeakToggle.tsx
6
+ var a = () => {
7
+ let a = e(), { isSupported: o, isBlocked: s, disabledReason: c, autoSpeakEnabled: l, setAutoSpeak: u, stop: d } = t();
8
+ if (!o) return null;
9
+ let f = s && !l, p = l ? a("healthybowl.assistant.header.autoSpeakOff", "Stop reading replies aloud") : a("healthybowl.assistant.header.autoSpeakOn", "Read replies aloud automatically");
10
+ return /* @__PURE__ */ i("button", {
11
+ type: "button",
12
+ onClick: () => {
13
+ l && d(), u(!l);
14
+ },
15
+ disabled: f,
16
+ className: `rounded-lg p-1.5 transition-colors disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent ${l ? "bg-action-primary-bg/15 text-action-primary-bg" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"}`,
17
+ title: f ? c ?? p : p,
18
+ "aria-label": p,
19
+ "aria-pressed": l,
20
+ "data-testid": "assistant-auto-speak",
21
+ children: i(l ? n : r, { className: "size-4" })
22
+ });
23
+ };
24
+ //#endregion
25
+ export { a as AssistantAutoSpeakToggle };
26
+
27
+ //# sourceMappingURL=AssistantAutoSpeakToggle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssistantAutoSpeakToggle.js","names":[],"sources":["../../../src/components/assistant/AssistantAutoSpeakToggle.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Volume2, VolumeX } from 'lucide-react';\nimport { useAssistantSpeech } from './AssistantSpeechProvider';\nimport { useTr } from '../../shared/hooks/useTr';\n\n/**\n * Header toggle for \"read every reply aloud\" (BOFF-6290).\n *\n * Opt-in, persisted per profile, and **off by default** — the assistant must\n * never start talking on its own until someone has said they want that. Turning\n * it on affects the NEXT reply only; it does not start reading the transcript.\n *\n * Renders nothing when the platform has no speech output, so browsers without\n * `speechSynthesis` see no dead switch.\n *\n * Availability is checked here for the same reason the per-message button\n * checks it: with no installed voice for the app language, switching this on\n * would hand every reply to whatever voice the engine defaults to — a Tamil\n * answer read in English. So it is disabled, with the reason as its tooltip,\n * exactly like the Listen button. It stays operable while it is ON, because a\n * switch you cannot turn off is worse than one you cannot turn on.\n */\nexport const AssistantAutoSpeakToggle: FC = () => {\n const tr = useTr();\n const { isSupported, isBlocked, disabledReason, autoSpeakEnabled, setAutoSpeak, stop } = useAssistantSpeech();\n\n if (!isSupported) return null;\n\n const disabled = isBlocked && !autoSpeakEnabled;\n const label = autoSpeakEnabled\n ? tr('healthybowl.assistant.header.autoSpeakOff', 'Stop reading replies aloud')\n : tr('healthybowl.assistant.header.autoSpeakOn', 'Read replies aloud automatically');\n\n return (\n <button\n type=\"button\"\n onClick={() => {\n // Turning it off also silences whatever is talking right now.\n if (autoSpeakEnabled) stop();\n setAutoSpeak(!autoSpeakEnabled);\n }}\n disabled={disabled}\n className={`rounded-lg p-1.5 transition-colors disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent ${\n autoSpeakEnabled\n ? 'bg-action-primary-bg/15 text-action-primary-bg'\n : 'text-text-secondary hover:bg-bg-sunken hover:text-text-primary'\n }`}\n title={disabled ? (disabledReason ?? label) : label}\n aria-label={label}\n aria-pressed={autoSpeakEnabled}\n data-testid=\"assistant-auto-speak\"\n >\n {autoSpeakEnabled ? <Volume2 className=\"size-4\" /> : <VolumeX className=\"size-4\" />}\n </button>\n );\n};\n"],"mappings":";;;;;AAsBA,IAAa,UAAqC;CAChD,IAAM,IAAK,GAAO,EACZ,EAAE,gBAAa,cAAW,mBAAgB,qBAAkB,iBAAc,YAAS,GAAoB;AAE7G,KAAI,CAAC,EAAa,QAAO;CAEzB,IAAM,IAAW,KAAa,CAAC,GACzB,IAAQ,IACV,EAAG,6CAA6C,6BAA6B,GAC7E,EAAG,4CAA4C,mCAAmC;AAEtF,QACE,kBAAC,UAAD;EACE,MAAK;EACL,eAAe;AAGb,GADI,KAAkB,GAAM,EAC5B,EAAa,CAAC,EAAiB;;EAEvB;EACV,WAAW,oHACT,IACI,mDACA;EAEN,OAAO,IAAY,KAAkB,IAAS;EAC9C,cAAY;EACZ,gBAAc;EACd,eAAY;YAEQ,EAAnB,IAAoB,IAAiC,GAAlC,EAAS,WAAU,UAAW,CAAiC;EAC5E,CAAA"}
@@ -2,56 +2,56 @@ 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 { getOrganizationId as h, getWorkspaceId as g } from "../../utils/assistantContext.js";
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";
5
+ import { isTurnInFlight as h } from "../../utils/assistantTurnState.js";
6
+ import { getOrganizationId as g, getWorkspaceId as ee } from "../../utils/assistantContext.js";
7
+ import { buildPromptParts as te, buildPromptWithAttachments as ne, countInlineImageCandidates as re, countInlinedImageParts as ie, toMessageAttachment as _ } from "../../utils/assistantAttachments.js";
8
+ import { AssistantMessageList as v } from "./AssistantMessageList.js";
9
+ import { AssistantApiCallsConsentDialog as y } from "./AssistantApiCallsConsentDialog.js";
10
+ import { ASSISTANT_MODES as b } from "../../types/assistant.js";
11
+ import { AssistantEmptyState as x } from "./AssistantEmptyState.js";
12
+ import { AssistantComposer as S } from "./composer/AssistantComposer.js";
13
+ import { useAssistantApiAccess as C } from "../../hooks/useAssistantApiAccess.js";
14
+ import { isQuotaExhaustedError as w } from "../../utils/quotaUtils.js";
15
+ import { dispatchAssistantQuotaExhausted as T, notifyAiCreditsUpdated as ae } from "../../utils/aiCredits.js";
15
16
  import { buildPromptForMode as oe } from "../../utils/assistantPrompt.js";
16
17
  import { isMultimodalBodyRejection as se, isRecoverableAssistantError as ce } from "../../utils/assistantTransportErrors.js";
17
- import { isTurnInFlight as le } from "../../utils/assistantTurnState.js";
18
- import { useCallback as T, useEffect as E, useMemo as ue, useRef as D, useState as de } from "react";
19
- import { jsx as O, jsxs as fe } from "react/jsx-runtime";
20
- import { useGatewayClient as pe } from "@burdenoff/fe-libs/shared/graphql";
21
- import { useAuthToken as me } from "@burdenoff/fe-libs/shared/providers/shell";
22
- import { getAssistantMedia as k } from "@burdenoff/fe-libs/shared/assistant";
18
+ import { useCallback as E, useEffect as D, useMemo as le, useRef as O, useState as ue } from "react";
19
+ import { jsx as k, jsxs as de } from "react/jsx-runtime";
20
+ import { useGatewayClient as fe } from "@burdenoff/fe-libs/shared/graphql";
21
+ import { useAuthToken as pe } from "@burdenoff/fe-libs/shared/providers/shell";
22
+ import { getAssistantMedia as A } from "@burdenoff/fe-libs/shared/assistant";
23
23
  //#region src/components/assistant/AssistantChatArea.tsx
24
- var he = {
24
+ var me = {
25
25
  general: 18e4,
26
26
  assistant: 18e4,
27
27
  "api-calls": 18e4,
28
28
  "vibe-plugins": 6e5
29
- }, ge = 18e4;
30
- function _e() {
29
+ }, he = 18e4;
30
+ function ge() {
31
31
  return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
32
32
  }
33
- function ve(e) {
33
+ function _e(e) {
34
34
  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]");
35
35
  }
36
- function A(e) {
36
+ function j(e) {
37
37
  return e.info?.time?.created ?? 0;
38
38
  }
39
- function j(e) {
39
+ function M(e) {
40
40
  return (e ?? []).filter((e) => e.type === "text" && typeof e.text == "string").map((e) => e.text?.trim() ?? "").filter(Boolean).join("\n");
41
41
  }
42
- function M(e) {
42
+ function N(e) {
43
43
  return (e ?? []).filter((e) => e.type === "tool" && e.tool).map((e) => {
44
44
  let t = e.state?.status ?? "running", n = e.tool ?? "tool";
45
45
  return t === "completed" ? `Completed: ${n}` : t === "failed" ? `Failed: ${n}` : `Running: ${n}`;
46
46
  });
47
47
  }
48
- function ye(e, t) {
49
- let n = e.filter((e) => e.info?.role === "assistant" && A(e) > t).sort((e, t) => A(e) - A(t));
48
+ function ve(e, t) {
49
+ let n = e.filter((e) => e.info?.role === "assistant" && j(e) > t).sort((e, t) => j(e) - j(t));
50
50
  if (n.length === 0) return {
51
51
  content: "Thinking...",
52
52
  done: !1
53
53
  };
54
- let r = n[n.length - 1], i = j(r.parts), a = k(r.parts), o = M(r.parts);
54
+ let r = n[n.length - 1], i = M(r.parts), a = A(r.parts), o = N(r.parts);
55
55
  return {
56
56
  content: [
57
57
  i,
@@ -62,7 +62,7 @@ function ye(e, t) {
62
62
  tokens: r.info?.tokens
63
63
  };
64
64
  }
65
- function be(e) {
65
+ function ye(e) {
66
66
  switch (e) {
67
67
  case "provisioning": return "Starting assistant environment...";
68
68
  case "connecting": return "Connecting to assistant...";
@@ -70,85 +70,85 @@ function be(e) {
70
70
  default: return "";
71
71
  }
72
72
  }
73
- var N = () => {
74
- let k = t(), j = pe("workspace"), { getAccessToken: M, getWorkspaceToken: N, userId: xe } = me(), { 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 = le(q?.status), ke = Oe ? q?.messageId ?? null : null, Ae = q?.status === "error" ? q.messageId : null, { canUseApiCalls: J, loading: je } = S(h()), Me = ue(() => y.filter((e) => !e.requiresAdmin || J), [J]), [Y, Ne] = de(null), Pe = D({}), Fe = D(/* @__PURE__ */ new Set());
75
- E(() => {
76
- if (je) return;
77
- let e = y.find((e) => e.id === F);
78
- (!e || e.requiresAdmin && !J) && F !== "assistant" && I("assistant");
73
+ var P = () => {
74
+ let A = t(), M = fe("workspace"), { getAccessToken: N, getWorkspaceToken: P, userId: be } = pe(), { conversations: xe, activeConversationId: F, mode: I, processingByConversationId: Se, setMode: L, setConversationMode: R, setActiveConversation: Ce, createConversation: z, addMessage: B, updateMessage: V, patchMessage: H, setConversationProcessing: U, clearConversationProcessing: we, setBackendSessionId: W, clearBackendSessionId: G, setSandbox: K, clearSandbox: Te, acknowledgeApiCalls: Ee } = e(), q = xe.find((e) => e.id === F)?.messages ?? [], J = F ? Se[F] : void 0, De = h(J?.status), Oe = De ? J?.messageId ?? null : null, ke = J?.status === "error" ? J.messageId : null, { canUseApiCalls: Y, loading: Ae } = C(g()), je = le(() => b.filter((e) => !e.requiresAdmin || Y), [Y]), [Me, Ne] = ue(null), Pe = O({}), Fe = O(/* @__PURE__ */ new Set());
75
+ D(() => {
76
+ if (Ae) return;
77
+ let e = b.find((e) => e.id === I);
78
+ (!e || e.requiresAdmin && !Y) && I !== "assistant" && L("assistant");
79
79
  }, [
80
- F,
81
- J,
82
- je,
83
- I
80
+ I,
81
+ Y,
82
+ Ae,
83
+ L
84
84
  ]);
85
- let X = T((e, t, n, r) => {
86
- H(e, n, t, null), r ? B(e, t, r) : B(e, t, be(n));
87
- }, [H, B]), Ie = T(async (t, n, a, s, c) => {
85
+ let X = E((e, t, n, r) => {
86
+ U(e, n, t, null), r ? V(e, t, r) : V(e, t, ye(n));
87
+ }, [U, V]), Ie = E(async (t, n, a, s, c) => {
88
88
  let u = e.getState().sandboxesByMode[a]?.sandboxId ?? null, d = async (e) => {
89
89
  try {
90
- 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;
90
+ 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)), !0;
91
91
  } catch {
92
92
  return !1;
93
93
  }
94
94
  };
95
- if (u && (G(a, u, "provisioning"), X(t, n, "provisioning", "Reusing assistant environment..."), await d(u) || (G(a, null, "provisioning"), u = null)), !u) {
95
+ if (u && (K(a, u, "provisioning"), X(t, n, "provisioning", "Reusing assistant environment..."), await d(u) || (K(a, null, "provisioning"), u = null)), !u) {
96
96
  X(t, n, "provisioning", "Looking for existing environment...");
97
- let e = await o(j, s, a, c);
98
- e && (G(a, e, "provisioning"), X(t, n, "provisioning", "Reusing assistant environment..."), await d(e) ? u = e : G(a, null, "provisioning"));
97
+ let e = await o(M, s, a, c);
98
+ e && (K(a, e, "provisioning"), X(t, n, "provisioning", "Reusing assistant environment..."), await d(e) ? u = e : K(a, null, "provisioning"));
99
99
  }
100
100
  if (!u) {
101
- if (a === "api-calls" && !M()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
102
- 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));
101
+ if (a === "api-calls" && !N()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
102
+ X(t, n, "provisioning", "Starting assistant environment..."), K(a, null, "provisioning"), u = await r(M, a, s, c), K(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));
103
103
  }
104
- G(a, u, "running");
104
+ K(a, u, "running");
105
105
  let m = e.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null;
106
106
  if (m) try {
107
- let e = await l(j, u, s, m, c);
107
+ let e = await l(M, u, s, m, c);
108
108
  if (e.mode !== a) throw Error(`Session mode mismatch: expected ${a}, received ${e.mode}`);
109
109
  } catch {
110
- W(t), m = null;
110
+ G(t), m = null;
111
111
  }
112
- return m || (X(t, n, "connecting", "Preparing session..."), m = (await i(j, u, s, a, c)).sessionId, U(t, m)), {
112
+ return m || (X(t, n, "connecting", "Preparing session..."), m = (await i(M, u, s, a, c)).sessionId, W(t, m)), {
113
113
  sandboxId: u,
114
114
  sessionId: m
115
115
  };
116
116
  }, [
117
- j,
118
- W,
119
117
  M,
120
- U,
121
118
  G,
119
+ N,
120
+ W,
121
+ K,
122
122
  X
123
- ]), Z = T(async (t, r = []) => {
124
- let i = e.getState(), o = i.activeConversationId ?? P;
125
- if (o && (le(i.processingByConversationId[o]?.status) || Fe.current.has(o))) return;
126
- let l = i.mode, f = P, p = f ? e.getState().conversations.find((e) => e.id === f) : void 0;
127
- 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;
123
+ ]), Z = E(async (t, r = []) => {
124
+ let i = e.getState(), o = i.activeConversationId ?? F;
125
+ if (o && (h(i.processingByConversationId[o]?.status) || Fe.current.has(o))) return;
126
+ let l = i.mode, f = F, p = f ? e.getState().conversations.find((e) => e.id === f) : void 0;
127
+ if (f ? p && p.mode !== l && (p.messages.length > 0 || p.backendSessionId) ? f = z(void 0, l) : p && p.mode !== l && R(f, l) : f = z(void 0, l), !f) return;
128
128
  Pe.current[f] = r;
129
- let _ = g(), v = {
130
- accessToken: M(),
131
- workspaceToken: N(),
132
- userId: xe,
133
- organizationId: h()
134
- }, y = {
135
- id: _e(),
129
+ let v = ee(), y = {
130
+ accessToken: N(),
131
+ workspaceToken: P(),
132
+ userId: be,
133
+ organizationId: g()
134
+ }, b = {
135
+ id: ge(),
136
136
  role: "user",
137
137
  content: t,
138
138
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
139
- metadata: r.length ? { attachments: r.map(ie) } : void 0
139
+ metadata: r.length ? { attachments: r.map(_) } : void 0
140
140
  };
141
- z(f, y);
142
- let b = _e();
143
- z(f, {
144
- id: b,
141
+ B(f, b);
142
+ let x = ge();
143
+ B(f, {
144
+ id: x,
145
145
  role: "assistant",
146
146
  content: "",
147
147
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
148
- }), H(f, "provisioning", b, null);
149
- let x = (e, t, n, r) => {
150
- V(f, b, {
151
- content: ve(e),
148
+ }), U(f, "provisioning", x, null);
149
+ let S = (e, t, n, r) => {
150
+ H(f, x, {
151
+ content: _e(e),
152
152
  metadata: t?.length || n || r ? {
153
153
  artifacts: t,
154
154
  mode: l,
@@ -156,96 +156,96 @@ var N = () => {
156
156
  sandboxId: r
157
157
  } : void 0
158
158
  });
159
- }, S = async (e = 1) => {
159
+ }, C = async (e = 1) => {
160
160
  let i = !1;
161
161
  try {
162
- await n(j, _, v);
162
+ await n(M, v, y);
163
163
  } catch (e) {
164
- if (C(e)) {
165
- 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);
164
+ if (w(e)) {
165
+ T("ai-credits"), S("You've run out of AI credits for this billing cycle. Upgrade your plan to keep chatting."), U(f, "error", x, null);
166
166
  return;
167
167
  }
168
168
  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);
169
169
  }
170
170
  try {
171
- 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);
172
- X(f, b, "streaming", "Thinking...");
173
- let p = oe(l, te(t, r)), h = ee(p, r), g = re(h), ie = g > 0, y = m();
174
- i = ne(r) > g;
171
+ let { sandboxId: e, sessionId: n } = await Ie(f, x, l, v, y), o = (await c(M, e, v, n, y, 50).catch(() => [])).reduce((e, t) => Math.max(e, j(t)), 0);
172
+ X(f, x, "streaming", "Thinking...");
173
+ let p = oe(l, ne(t, r)), h = te(p, r), g = ie(h), ee = g > 0, _ = m();
174
+ i = re(r) > g;
175
175
  try {
176
- await d(j, e, _, n, p, l, y, v, h);
176
+ await d(M, e, v, n, p, l, _, y, h);
177
177
  } catch (t) {
178
178
  if (!h || !se(t)) throw t;
179
- await d(j, e, _, n, p, l, y, v, void 0), i ||= ie;
179
+ await d(M, e, v, n, p, l, _, y, void 0), i ||= ee;
180
180
  }
181
- let S = ye([], o), C = Date.now() + (he[l] ?? ge), w = Date.now();
182
- 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));
183
- if (!S.done && l !== "vibe-plugins") throw Error("Assistant response timed out while streaming progress");
184
- let ce = l === "vibe-plugins" ? await s(j, e, _, n, v).catch(() => []) : void 0;
185
- if (S.done || (S = {
186
- ...S,
187
- 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._`
188
- }), i && (S = {
189
- ...S,
190
- 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._")}`
191
- }), x(S.content, ce, n, e), S.tokens) {
192
- V(f, b, { tokens: S.tokens });
181
+ let b = ve([], o), C = Date.now() + (me[l] ?? he), w = Date.now();
182
+ for (; Date.now() < C && (b = ve(await c(M, e, v, n, y, 50), o), H(f, x, { content: _e(b.content) }), !b.done);) Date.now() - w > 3e4 && (await a(M, e, v, 600, y).catch(() => void 0), w = Date.now()), await new Promise((e) => setTimeout(e, 1500));
183
+ if (!b.done && l !== "vibe-plugins") throw Error("Assistant response timed out while streaming progress");
184
+ let T = l === "vibe-plugins" ? await s(M, e, v, n, y).catch(() => []) : void 0;
185
+ if (b.done || (b = {
186
+ ...b,
187
+ 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._`
188
+ }), i && (b = {
189
+ ...b,
190
+ content: `${b.content}\n\n${A("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._")}`
191
+ }), S(b.content, T, n, e), b.tokens) {
192
+ H(f, x, { tokens: b.tokens });
193
193
  try {
194
- await u(j, _, n, S.tokens, v), ae();
194
+ await u(M, v, n, b.tokens, y), ae();
195
195
  } catch {}
196
196
  }
197
- H(f, "complete", b, null);
197
+ U(f, "complete", x, null);
198
198
  } catch (t) {
199
- if (e === 1 && ce(t)) return W(f), Ee(l), S(2);
199
+ if (e === 1 && ce(t)) return G(f), Te(l), C(2);
200
200
  throw t;
201
201
  }
202
- }, T = f;
203
- Fe.current.add(T);
202
+ }, E = f;
203
+ Fe.current.add(E);
204
204
  try {
205
- if (!_) throw Error("Assistant backend is unavailable without an active workspace context.");
206
- await S();
205
+ if (!v) throw Error("Assistant backend is unavailable without an active workspace context.");
206
+ await C();
207
207
  } catch (e) {
208
- if (C(e)) {
209
- w("sandbox"), x("You've reached your sandbox limit on the current plan. Upgrade to start the AI assistant."), H(f, "error", b, null);
208
+ if (w(e)) {
209
+ T("sandbox"), S("You've reached your sandbox limit on the current plan. Upgrade to start the AI assistant."), U(f, "error", x, null);
210
210
  return;
211
211
  }
212
212
  let t = e instanceof Error ? e.message : "Something went wrong";
213
- H(f, "error", b, t), B(f, b, `Sorry, an error occurred: ${t}. Please try again.`);
213
+ U(f, "error", x, t), V(f, x, `Sorry, an error occurred: ${t}. Please try again.`);
214
214
  } finally {
215
- Fe.current.delete(T);
215
+ Fe.current.delete(E);
216
216
  }
217
217
  }, [
218
- P,
218
+ F,
219
+ B,
220
+ M,
221
+ G,
222
+ Te,
223
+ xe,
219
224
  z,
220
- j,
221
- W,
222
- Ee,
223
- Se,
224
- R,
225
225
  Ie,
226
- M,
227
226
  N,
228
- V,
229
- U,
230
- L,
227
+ P,
231
228
  H,
232
- k,
229
+ W,
230
+ R,
231
+ U,
232
+ A,
233
233
  X,
234
- B,
235
- xe
236
- ]), Le = T((e) => {
234
+ V,
235
+ be
236
+ ]), Le = E((e) => {
237
237
  Z(e);
238
- }, [Z]), Re = T(() => {
239
- let e = [...K].reverse().find((e) => e.role === "user"), t = P ? Pe.current[P] ?? [] : [];
238
+ }, [Z]), Re = E(() => {
239
+ let e = [...q].reverse().find((e) => e.role === "user"), t = F ? Pe.current[F] ?? [] : [];
240
240
  e && Z(e.content, t);
241
241
  }, [
242
- K,
242
+ q,
243
243
  Z,
244
- P
245
- ]), Q = D(Z);
246
- E(() => {
244
+ F
245
+ ]), Q = O(Z);
246
+ D(() => {
247
247
  Q.current = Z;
248
- }, [Z]), E(() => {
248
+ }, [Z]), D(() => {
249
249
  let t = e.getState().consumePendingPrompt();
250
250
  return t && Q.current(t), e.subscribe((t, n) => {
251
251
  if (t.pendingPrompt && t.pendingPrompt !== n.pendingPrompt) {
@@ -254,62 +254,62 @@ var N = () => {
254
254
  }
255
255
  });
256
256
  }, []);
257
- let $ = T((t) => {
258
- let n = P ? e.getState().conversations.find((e) => e.id === P) : void 0;
257
+ let $ = E((t) => {
258
+ let n = F ? e.getState().conversations.find((e) => e.id === F) : void 0;
259
259
  if (n && (n.messages.length > 0 || n.backendSessionId)) {
260
260
  if (n.mode !== t) {
261
261
  let n = e.getState().conversations.find((n) => n.mode === t && n.messages.length === 0 && !n.backendSessionId && !e.getState().processingByConversationId[n.id]);
262
- n ? we(n.id) : R(void 0, t);
262
+ n ? Ce(n.id) : z(void 0, t);
263
263
  }
264
- } else P && L(P, t);
265
- I(t);
264
+ } else F && R(F, t);
265
+ L(t);
266
266
  }, [
267
- P,
267
+ F,
268
+ z,
269
+ Ce,
268
270
  R,
269
- we,
270
- L,
271
- I
272
- ]), ze = T((t) => {
273
- if (y.find((e) => e.id === t)?.writeCapable && !e.getState().apiCallsAcknowledged) {
271
+ L
272
+ ]), ze = E((t) => {
273
+ if (b.find((e) => e.id === t)?.writeCapable && !e.getState().apiCallsAcknowledged) {
274
274
  Ne(t);
275
275
  return;
276
276
  }
277
277
  $(t);
278
- }, [$]), Be = T(() => {
279
- let e = Y;
280
- Ne(null), De(), e && $(e);
278
+ }, [$]), Be = E(() => {
279
+ let e = Me;
280
+ Ne(null), Ee(), e && $(e);
281
281
  }, [
282
- Y,
283
- De,
282
+ Me,
283
+ Ee,
284
284
  $
285
- ]), Ve = T(() => {
285
+ ]), Ve = E(() => {
286
286
  Ne(null);
287
287
  }, []);
288
- return /* @__PURE__ */ fe("div", {
288
+ return /* @__PURE__ */ de("div", {
289
289
  className: "flex flex-1 flex-col overflow-hidden",
290
290
  children: [
291
- K.length === 0 ? /* @__PURE__ */ O(b, {
292
- mode: F,
291
+ q.length === 0 ? /* @__PURE__ */ k(x, {
292
+ mode: I,
293
293
  onSuggestionClick: Le
294
- }) : /* @__PURE__ */ O("div", {
294
+ }) : /* @__PURE__ */ k("div", {
295
295
  className: "flex min-h-0 flex-1 flex-col",
296
- children: /* @__PURE__ */ O(_, {
297
- messages: K,
298
- streamingMessageId: ke,
299
- failedMessageId: Ae,
296
+ children: /* @__PURE__ */ k(v, {
297
+ messages: q,
298
+ streamingMessageId: Oe,
299
+ failedMessageId: ke,
300
300
  onRetry: Re
301
301
  })
302
302
  }),
303
- /* @__PURE__ */ O(x, {
303
+ /* @__PURE__ */ k(S, {
304
304
  onSend: (e, t) => void Z(e, t),
305
- disabled: Oe,
306
- placeholder: F === "api-calls" ? k("healthybowl.assistant.chatArea.placeholderActions", "What would you like me to do?") : k("healthybowl.assistant.chatArea.placeholderGeneral", "Ask HealthyBowl anything…"),
307
- mode: F,
308
- availableModes: Me,
305
+ disabled: De,
306
+ placeholder: I === "api-calls" ? A("healthybowl.assistant.chatArea.placeholderActions", "What would you like me to do?") : A("healthybowl.assistant.chatArea.placeholderGeneral", "Ask HealthyBowl anything…"),
307
+ mode: I,
308
+ availableModes: je,
309
309
  onModeChange: ze
310
310
  }),
311
- /* @__PURE__ */ O(v, {
312
- open: Y !== null,
311
+ /* @__PURE__ */ k(y, {
312
+ open: Me !== null,
313
313
  onConfirm: Be,
314
314
  onCancel: Ve
315
315
  })
@@ -317,6 +317,6 @@ var N = () => {
317
317
  });
318
318
  };
319
319
  //#endregion
320
- export { N as AssistantChatArea };
320
+ export { P as AssistantChatArea };
321
321
 
322
322
  //# sourceMappingURL=AssistantChatArea.js.map