@burdenoff/microfe-healthybowl 2026.904.16 → 2026.904.17

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 (144) hide show
  1. package/dist/components/assistant/AssistantChatArea.js +245 -252
  2. package/dist/components/assistant/AssistantChatArea.js.map +1 -1
  3. package/dist/healthybowl/HealthyBowlRoot.js +57 -56
  4. package/dist/healthybowl/HealthyBowlRoot.js.map +1 -1
  5. package/dist/healthybowl/HealthyBowlRoutes.js +48 -36
  6. package/dist/healthybowl/HealthyBowlRoutes.js.map +1 -1
  7. package/dist/healthybowl/components/CreateFarmTaskButton.js.map +1 -1
  8. package/dist/healthybowl/components/PageLayout.js +11 -10
  9. package/dist/healthybowl/components/PageLayout.js.map +1 -1
  10. package/dist/healthybowl/context/HealthyBowlContext.js +7 -7
  11. package/dist/healthybowl/context/HealthyBowlContext.js.map +1 -1
  12. package/dist/healthybowl/hooks/useAgronomyDecisions.js +79 -0
  13. package/dist/healthybowl/hooks/useAgronomyDecisions.js.map +1 -0
  14. package/dist/healthybowl/hooks/useAnalyticsReports.js +173 -0
  15. package/dist/healthybowl/hooks/useAnalyticsReports.js.map +1 -0
  16. package/dist/healthybowl/hooks/useComplianceExports.js +74 -0
  17. package/dist/healthybowl/hooks/useComplianceExports.js.map +1 -0
  18. package/dist/healthybowl/hooks/useConsultationPayments.js +59 -0
  19. package/dist/healthybowl/hooks/useConsultationPayments.js.map +1 -0
  20. package/dist/healthybowl/hooks/useHealthyBowlCompliance.js +157 -141
  21. package/dist/healthybowl/hooks/useHealthyBowlCompliance.js.map +1 -1
  22. package/dist/healthybowl/hooks/useHealthyBowlData.js +18 -0
  23. package/dist/healthybowl/hooks/useHealthyBowlData.js.map +1 -1
  24. package/dist/healthybowl/hooks/useHealthyBowlDistribution.js +52 -37
  25. package/dist/healthybowl/hooks/useHealthyBowlDistribution.js.map +1 -1
  26. package/dist/healthybowl/hooks/useHealthyBowlLivestockDepth.js +135 -78
  27. package/dist/healthybowl/hooks/useHealthyBowlLivestockDepth.js.map +1 -1
  28. package/dist/healthybowl/hooks/useIrrigationAutomation.js +1 -1
  29. package/dist/healthybowl/hooks/useIrrigationAutomation.js.map +1 -1
  30. package/dist/healthybowl/hooks/usePlantingEstimate.js +88 -0
  31. package/dist/healthybowl/hooks/usePlantingEstimate.js.map +1 -0
  32. package/dist/healthybowl/hooks/useSuccessionPlanning.js +1 -1
  33. package/dist/healthybowl/hooks/useSuccessionPlanning.js.map +1 -1
  34. package/dist/healthybowl/hooks/useWeatherIntelligence.js +1 -1
  35. package/dist/healthybowl/hooks/useWeatherIntelligence.js.map +1 -1
  36. package/dist/healthybowl/offline/HeaderOfflinePill.js +28 -0
  37. package/dist/healthybowl/offline/HeaderOfflinePill.js.map +1 -0
  38. package/dist/healthybowl/offline/OfflineStatusPill.js +40 -21
  39. package/dist/healthybowl/offline/OfflineStatusPill.js.map +1 -1
  40. package/dist/healthybowl/offline/OfflineSyncProvider.js +153 -130
  41. package/dist/healthybowl/offline/OfflineSyncProvider.js.map +1 -1
  42. package/dist/healthybowl/offline/captureCache.js +30 -0
  43. package/dist/healthybowl/offline/captureCache.js.map +1 -0
  44. package/dist/healthybowl/offline/graphql.js.map +1 -1
  45. package/dist/healthybowl/offline/headerSlot.js +24 -0
  46. package/dist/healthybowl/offline/headerSlot.js.map +1 -0
  47. package/dist/healthybowl/offline/store.js +1 -1
  48. package/dist/healthybowl/offline/syncEngine.js +2 -1
  49. package/dist/healthybowl/offline/syncEngine.js.map +1 -1
  50. package/dist/healthybowl/offline/types.js.map +1 -1
  51. package/dist/healthybowl/pages/GettingStartedPage.js +1 -0
  52. package/dist/healthybowl/pages/GettingStartedPage.js.map +1 -1
  53. package/dist/healthybowl/pages/ai/AiDecisionsPage.js +287 -0
  54. package/dist/healthybowl/pages/ai/AiDecisionsPage.js.map +1 -0
  55. package/dist/healthybowl/pages/analytics/InsightsPage.js +2 -2
  56. package/dist/healthybowl/pages/analytics/InsightsPage.js.map +1 -1
  57. package/dist/healthybowl/pages/analytics/ReportsPage.js +136 -99
  58. package/dist/healthybowl/pages/analytics/ReportsPage.js.map +1 -1
  59. package/dist/healthybowl/pages/compliance/ComplianceOverviewPage.js +204 -162
  60. package/dist/healthybowl/pages/compliance/ComplianceOverviewPage.js.map +1 -1
  61. package/dist/healthybowl/pages/compliance/IcsGroupDetailPage.js +196 -178
  62. package/dist/healthybowl/pages/compliance/IcsGroupDetailPage.js.map +1 -1
  63. package/dist/healthybowl/pages/compliance/IcsGrowerDetailPage.js +142 -141
  64. package/dist/healthybowl/pages/compliance/IcsGrowerDetailPage.js.map +1 -1
  65. package/dist/healthybowl/pages/compliance/ResidueTestsPage.js +291 -0
  66. package/dist/healthybowl/pages/compliance/ResidueTestsPage.js.map +1 -0
  67. package/dist/healthybowl/pages/compliance/SubstanceRulesPage.js +300 -0
  68. package/dist/healthybowl/pages/compliance/SubstanceRulesPage.js.map +1 -0
  69. package/dist/healthybowl/pages/compliance/substanceRuleForm.js +135 -0
  70. package/dist/healthybowl/pages/compliance/substanceRuleForm.js.map +1 -0
  71. package/dist/healthybowl/pages/crops/CropFieldsPage.js +2 -0
  72. package/dist/healthybowl/pages/crops/CropFieldsPage.js.map +1 -1
  73. package/dist/healthybowl/pages/crops/CropHarvestPage.js +316 -272
  74. package/dist/healthybowl/pages/crops/CropHarvestPage.js.map +1 -1
  75. package/dist/healthybowl/pages/crops/CropPlanningPage.js +6 -0
  76. package/dist/healthybowl/pages/crops/CropPlanningPage.js.map +1 -1
  77. package/dist/healthybowl/pages/crops/FieldDetailsPage.js +871 -846
  78. package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
  79. package/dist/healthybowl/pages/crops/HarvestDetailsPage.js +376 -334
  80. package/dist/healthybowl/pages/crops/HarvestDetailsPage.js.map +1 -1
  81. package/dist/healthybowl/pages/distribution/CsaPlanDetailPage.js +415 -188
  82. package/dist/healthybowl/pages/distribution/CsaPlanDetailPage.js.map +1 -1
  83. package/dist/healthybowl/pages/distribution/labels.js +10 -2
  84. package/dist/healthybowl/pages/distribution/labels.js.map +1 -1
  85. package/dist/healthybowl/pages/farm/FarmProfilePage.js +1 -0
  86. package/dist/healthybowl/pages/farm/FarmProfilePage.js.map +1 -1
  87. package/dist/healthybowl/pages/field-capture/CaptureObservationForm.js +8 -8
  88. package/dist/healthybowl/pages/fields/FieldMapPage.js +2 -0
  89. package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
  90. package/dist/healthybowl/pages/financial/FinancialReportsPage.js +92 -107
  91. package/dist/healthybowl/pages/financial/FinancialReportsPage.js.map +1 -1
  92. package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js +228 -188
  93. package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js.map +1 -1
  94. package/dist/healthybowl/pages/government-schemes/SchemeDetailsPage.js +261 -191
  95. package/dist/healthybowl/pages/government-schemes/SchemeDetailsPage.js.map +1 -1
  96. package/dist/healthybowl/pages/government-schemes/schemeApplicationTransitions.js +49 -0
  97. package/dist/healthybowl/pages/government-schemes/schemeApplicationTransitions.js.map +1 -0
  98. package/dist/healthybowl/pages/government-schemes/schemeDocumentSlots.js +48 -0
  99. package/dist/healthybowl/pages/government-schemes/schemeDocumentSlots.js.map +1 -0
  100. package/dist/healthybowl/pages/government-schemes/useSchemeApplicationTransition.js +54 -0
  101. package/dist/healthybowl/pages/government-schemes/useSchemeApplicationTransition.js.map +1 -0
  102. package/dist/healthybowl/pages/inputs-insurance/InputsInsuranceOverviewPage.js +14 -14
  103. package/dist/healthybowl/pages/inputs-insurance/InputsInsuranceOverviewPage.js.map +1 -1
  104. package/dist/healthybowl/pages/irrigation/IrrigationPage.js +338 -307
  105. package/dist/healthybowl/pages/irrigation/IrrigationPage.js.map +1 -1
  106. package/dist/healthybowl/pages/livestock/AnimalDepthFormModal.js +126 -102
  107. package/dist/healthybowl/pages/livestock/AnimalDepthFormModal.js.map +1 -1
  108. package/dist/healthybowl/pages/livestock/AnimalDepthPage.js +257 -215
  109. package/dist/healthybowl/pages/livestock/AnimalDepthPage.js.map +1 -1
  110. package/dist/healthybowl/pages/livestock/GrazingPage.js +1 -0
  111. package/dist/healthybowl/pages/livestock/GrazingPage.js.map +1 -1
  112. package/dist/healthybowl/pages/livestock/HerdDepthPage.js +4 -0
  113. package/dist/healthybowl/pages/livestock/HerdDepthPage.js.map +1 -1
  114. package/dist/healthybowl/pages/livestock/PedigreeTree.js +154 -0
  115. package/dist/healthybowl/pages/livestock/PedigreeTree.js.map +1 -0
  116. package/dist/healthybowl/pages/livestock/eidTagInput.js +39 -0
  117. package/dist/healthybowl/pages/livestock/eidTagInput.js.map +1 -0
  118. package/dist/healthybowl/pages/livestock/grazing/RecordGrazingMoveModal.js +8 -9
  119. package/dist/healthybowl/pages/livestock/grazing/RecordGrazingMoveModal.js.map +1 -1
  120. package/dist/healthybowl/pages/livestock/pedigreeLayout.js +68 -0
  121. package/dist/healthybowl/pages/livestock/pedigreeLayout.js.map +1 -0
  122. package/dist/healthybowl/pages/network/ExpertsPage.js +520 -419
  123. package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
  124. package/dist/healthybowl/pages/weather/WeatherAlertHistoryPage.js +129 -130
  125. package/dist/healthybowl/pages/weather/WeatherAlertHistoryPage.js.map +1 -1
  126. package/dist/healthybowl/pages/weather/WeatherSettingsPage.js +285 -237
  127. package/dist/healthybowl/pages/weather/WeatherSettingsPage.js.map +1 -1
  128. package/dist/healthybowl/pages/weather/alertDelivery.js +105 -0
  129. package/dist/healthybowl/pages/weather/alertDelivery.js.map +1 -0
  130. package/dist/healthybowl/utils/icsInspection.js +18 -0
  131. package/dist/healthybowl/utils/icsInspection.js.map +1 -0
  132. package/dist/healthybowl/utils/plantingCapacity.js +10 -10
  133. package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
  134. package/dist/node_modules/fast-equals/dist/es/index.js +74 -86
  135. package/dist/node_modules/fast-equals/dist/es/index.js.map +1 -1
  136. package/dist/services/assistantApi.js +59 -33
  137. package/dist/services/assistantApi.js.map +1 -1
  138. package/dist/utils/assistantContext.js +2 -38
  139. package/dist/utils/pageContext.js +15 -1
  140. package/dist/utils/pageContext.js.map +1 -1
  141. package/dist/utils/sandboxReadiness.js +2 -24
  142. package/package.json +1 -1
  143. package/dist/utils/assistantContext.js.map +0 -1
  144. package/dist/utils/sandboxReadiness.js.map +0 -1
@@ -1,53 +1,53 @@
1
1
  import { useAssistantStore as e } from "../../store/assistantStore.js";
2
- import { checkAssistantAiCredits as t, createAssistantSandbox as n, createAssistantSession as r, extendAssistantSandboxTTL as i, findExistingSandbox as a, getAssistantArtifacts as o, getAssistantMessages as s, getAssistantSession as ee, reportAssistantAiTokenUsage as c, sendAssistantPromptAsync as l, waitForAssistantServiceReady as u, waitForSandboxReady as d } from "../../services/assistantApi.js";
3
- import { gatherPageContext as te } from "../../utils/pageContext.js";
2
+ import { createAssistantSandbox as t, createAssistantSession as n, extendAssistantSandboxTTL as r, findExistingSandbox as i, getAssistantArtifacts as a, getAssistantMessages as o, getAssistantSession as ee, reportAssistantAiTokenUsage as s, sendAssistantPromptAsync as c, waitForAssistantServiceReady as l, waitForSandboxReady as u } from "../../services/assistantApi.js";
3
+ import { gatherPageContext as d } from "../../utils/pageContext.js";
4
4
  import { resolveAssistantLanguage as f } from "../../config/assistantLanguages.js";
5
5
  import { resolveLanguagePair as p } from "../../config/assistantLanguagePair.js";
6
6
  import { AssistantMessageList as m } from "./AssistantMessageList.js";
7
7
  import { AssistantApiCallsConsentDialog as h } from "./AssistantApiCallsConsentDialog.js";
8
8
  import { AssistantEmptyState as g } from "./AssistantEmptyState.js";
9
- import { AssistantSpokenTurnsNotice as ne } from "./AssistantSpokenTurnsNotice.js";
10
- import { VoiceTranscriptDrawer as _ } from "./voice/VoiceTranscriptDrawer.js";
11
- import { getActorId as v, getOrganizationId as re, getWorkspaceId as y } from "../../utils/assistantContext.js";
12
- import { buildPromptParts as ie, buildPromptWithAttachments as ae, countInlineImageCandidates as oe, countInlinedImageParts as se, getSendableAttachments as b, toMessageAttachment as ce } from "../../utils/assistantAttachments.js";
13
- import { useAssistantAttachments as x } from "../../hooks/useAssistantAttachments.js";
14
- import { AssistantComposer as le } from "./composer/AssistantComposer.js";
15
- import { AssistantVoiceSession as ue } from "./voice/AssistantVoiceSession.js";
16
- import { parseToolActivity as de } from "./AssistantToolActivity.js";
17
- import { useVoiceSession as fe } from "../../hooks/useVoiceSession.js";
18
- import { useAssistantApiAccess as pe } from "../../hooks/useAssistantApiAccess.js";
19
- import { useWorkspaceWriteAccess as me } from "../../hooks/useWorkspaceWriteAccess.js";
20
- import { isVoiceTurn as he, voiceMarker as S, voiceSessionIdOf as ge } from "../../utils/voiceTurnVisibility.js";
21
- import { useConversationTurns as _e } from "../../hooks/useConversationTurns.js";
22
- import { isQuotaExhaustedError as ve } from "../../utils/quotaUtils.js";
23
- import { dispatchAssistantQuotaExhausted as ye, notifyAiCreditsUpdated as be } from "../../utils/aiCredits.js";
24
- import { buildPromptForMode as xe } from "../../utils/assistantPrompt.js";
25
- import { isMultimodalBodyRejection as Se, isRecoverableAssistantError as Ce } from "../../utils/assistantTransportErrors.js";
26
- import { isTurnInFlight as we } from "../../utils/assistantTurnState.js";
27
- import { ASSISTANT_MODES as Te } from "../../types/assistant.js";
28
- import { pollDelayMs as Ee } from "../../utils/assistantPollSchedule.js";
29
- import { findPendingWrite as De } from "../../utils/pendingWrite.js";
30
- import { toCaptionText as Oe } from "../../utils/captionText.js";
31
- import { buildContinuedFromVoiceNote as ke, buildVoiceTranscriptMarkdown as Ae, voiceTranscriptFilename as je } from "../../utils/voiceTranscript.js";
32
- import { downloadFile as Me } from "../../services/assistantExportService.js";
33
- import { createReadinessTracker as Ne } from "../../utils/sandboxReadiness.js";
34
- import { useCallback as C, useEffect as w, useMemo as T, useRef as E, useState as Pe } from "react";
35
- import { useI18n as Fe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
36
- import { jsx as D, jsxs as Ie } from "react/jsx-runtime";
37
- import { useGatewayClient as Le } from "@burdenoff/fe-libs/shared/graphql";
38
- import { useAuthToken as Re } from "@burdenoff/fe-libs/shared/providers/shell";
39
- import { getAssistantMedia as O, useAssistantTr as ze } from "@burdenoff/fe-libs/shared/assistant";
9
+ import { AssistantSpokenTurnsNotice as _ } from "./AssistantSpokenTurnsNotice.js";
10
+ import { VoiceTranscriptDrawer as v } from "./voice/VoiceTranscriptDrawer.js";
11
+ import { getActorId as te, getOrganizationId as y, getWorkspaceId as ne } from "../../utils/assistantContext.js";
12
+ import { buildPromptParts as re, buildPromptWithAttachments as ie, countInlineImageCandidates as ae, countInlinedImageParts as oe, getSendableAttachments as b, toMessageAttachment as x } from "../../utils/assistantAttachments.js";
13
+ import { useAssistantAttachments as S } from "../../hooks/useAssistantAttachments.js";
14
+ import { AssistantComposer as se } from "./composer/AssistantComposer.js";
15
+ import { AssistantVoiceSession as ce } from "./voice/AssistantVoiceSession.js";
16
+ import { parseToolActivity as le } from "./AssistantToolActivity.js";
17
+ import { useVoiceSession as ue } from "../../hooks/useVoiceSession.js";
18
+ import { useAssistantApiAccess as de } from "../../hooks/useAssistantApiAccess.js";
19
+ import { useWorkspaceWriteAccess as fe } from "../../hooks/useWorkspaceWriteAccess.js";
20
+ import { isVoiceTurn as pe, voiceMarker as me, voiceSessionIdOf as he } from "../../utils/voiceTurnVisibility.js";
21
+ import { useConversationTurns as ge } from "../../hooks/useConversationTurns.js";
22
+ import { isQuotaExhaustedError as _e } from "../../utils/quotaUtils.js";
23
+ import { dispatchAssistantQuotaExhausted as ve, notifyAiCreditsUpdated as ye } from "../../utils/aiCredits.js";
24
+ import { buildPromptForMode as be } from "../../utils/assistantPrompt.js";
25
+ import { isMultimodalBodyRejection as xe, isRecoverableAssistantError as Se } from "../../utils/assistantTransportErrors.js";
26
+ import { isTurnInFlight as Ce } from "../../utils/assistantTurnState.js";
27
+ import { ASSISTANT_MODES as we } from "../../types/assistant.js";
28
+ import { pollDelayMs as Te } from "../../utils/assistantPollSchedule.js";
29
+ import { findPendingWrite as Ee } from "../../utils/pendingWrite.js";
30
+ import { toCaptionText as De } from "../../utils/captionText.js";
31
+ import { buildContinuedFromVoiceNote as Oe, buildVoiceTranscriptMarkdown as ke, voiceTranscriptFilename as Ae } from "../../utils/voiceTranscript.js";
32
+ import { downloadFile as je } from "../../services/assistantExportService.js";
33
+ import { createReadinessTracker as Me } from "../../utils/sandboxReadiness.js";
34
+ import { useCallback as C, useEffect as w, useMemo as T, useRef as E, useState as Ne } from "react";
35
+ import { useI18n as Pe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
36
+ import { jsx as D, jsxs as Fe } from "react/jsx-runtime";
37
+ import { useGatewayClient as Ie } from "@burdenoff/fe-libs/shared/graphql";
38
+ import { useAuthToken as Le } from "@burdenoff/fe-libs/shared/providers/shell";
39
+ import { getAssistantMedia as O, useAssistantTr as Re } from "@burdenoff/fe-libs/shared/assistant";
40
40
  //#region src/components/assistant/AssistantChatArea.tsx
41
- var Be = {
41
+ var ze = {
42
42
  general: 18e4,
43
43
  assistant: 18e4,
44
44
  "api-calls": 18e4,
45
45
  "vibe-plugins": 6e5
46
- }, Ve = 18e4, He = 2e4;
47
- function Ue() {
46
+ }, Be = 18e4, Ve = 2e4;
47
+ function He() {
48
48
  return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
49
49
  }
50
- function We(e) {
50
+ function Ue(e) {
51
51
  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]");
52
52
  }
53
53
  function k(e) {
@@ -62,25 +62,27 @@ function j(e) {
62
62
  return t === "completed" ? `Completed: ${n}` : t === "failed" ? `Failed: ${n}` : `Running: ${n}`;
63
63
  });
64
64
  }
65
- function Ge(e, t) {
65
+ function We(e, t) {
66
66
  let n = e.filter((e) => e.info?.role === "assistant" && k(e) > t).sort((e, t) => k(e) - k(t));
67
67
  if (n.length === 0) return {
68
68
  content: "Thinking...",
69
69
  done: !1
70
70
  };
71
- let r = n[n.length - 1], i = A(r.parts), a = O(r.parts), o = j(r.parts), s = De(r.parts);
71
+ let r = n[n.length - 1], i = A(r.parts), a = O(r.parts), o = j(r.parts), ee = Ee(r.parts), s = [
72
+ i,
73
+ ...a,
74
+ ...o
75
+ ].filter(Boolean).join("\n\n") || "Thinking...", c = r.info?.providerID, l = r.info?.modelID;
72
76
  return {
73
- content: [
74
- i,
75
- ...a,
76
- ...o
77
- ].filter(Boolean).join("\n\n") || "Thinking...",
77
+ content: s,
78
78
  done: !!r.info?.time?.completed && (!!i || a.length > 0 || o.length > 0),
79
79
  tokens: r.info?.tokens,
80
- ...s ? { pendingWrite: s } : {}
80
+ messageId: r.info?.id,
81
+ ...c && l ? { model: `${c}/${l}` } : {},
82
+ ...ee ? { pendingWrite: ee } : {}
81
83
  };
82
84
  }
83
- function Ke(e) {
85
+ function Ge(e) {
84
86
  switch (e) {
85
87
  case "provisioning": return "Starting assistant environment...";
86
88
  case "connecting": return "Connecting to assistant...";
@@ -88,375 +90,366 @@ function Ke(e) {
88
90
  default: return "";
89
91
  }
90
92
  }
91
- var qe = ({ visible: De = !0 }) => {
92
- let O = ze(), A = Le("workspace"), { getAccessToken: j, getWorkspaceToken: qe, userId: Je } = Re(), { locale: Ye } = Fe(), Xe = e((e) => e.assistantLanguage), Ze = e((e) => e.replyLanguage), Qe = T(() => p(Xe, Ze, Ye), [
93
+ var Ke = ({ visible: Ee = !0 }) => {
94
+ let O = Re(), A = Ie("workspace"), { getAccessToken: j, getWorkspaceToken: Ke, userId: qe } = Le(), { locale: Je } = Pe(), Ye = e((e) => e.assistantLanguage), Xe = e((e) => e.replyLanguage), Ze = T(() => p(Ye, Xe, Je), [
95
+ Ye,
93
96
  Xe,
94
- Ze,
95
- Ye
96
- ]), $e = Qe.reply.english, et = Qe.replyIsExplicit, tt = Qe.reply.code, { conversations: nt, activeConversationId: M, mode: N, processingByConversationId: rt, setMode: P, setConversationMode: F, setActiveConversation: it, createConversation: I, addMessage: L, updateMessage: at, patchMessage: R, mergeMessageMetadata: ot, setConversationProcessing: z, clearConversationProcessing: st, setBackendSessionId: ct, clearBackendSessionId: B, setSandbox: V, clearSandbox: lt, acknowledgeApiCalls: ut } = e(), H = _e(nt.find((e) => e.id === M)), U = H.all, W = M ? rt[M] : void 0, G = we(W?.status), dt = G ? W?.messageId ?? null : null, ft = W?.status === "error" ? W.messageId : null, { canUseApiCalls: pt, loading: mt } = pe(re()), ht = me(v(), y() || null), gt = T(() => Te.filter((e) => !e.requiresAdmin || pt), [pt]), [_t, vt] = Pe(null), [yt, bt] = Pe(!1), xt = E({}), St = E(Ne()), Ct = E(/* @__PURE__ */ new Set()), wt = T(() => Te.find((e) => e.id === N), [N]);
97
+ Je
98
+ ]), Qe = Ze.reply.english, $e = Ze.replyIsExplicit, et = Ze.reply.code, { conversations: tt, activeConversationId: M, mode: N, processingByConversationId: nt, setMode: P, setConversationMode: F, setActiveConversation: rt, createConversation: I, addMessage: L, updateMessage: it, patchMessage: R, mergeMessageMetadata: at, setConversationProcessing: z, clearConversationProcessing: ot, setBackendSessionId: st, clearBackendSessionId: B, setSandbox: V, clearSandbox: ct, acknowledgeApiCalls: lt } = e(), H = ge(tt.find((e) => e.id === M)), U = H.all, W = M ? nt[M] : void 0, G = Ce(W?.status), ut = G ? W?.messageId ?? null : null, dt = W?.status === "error" ? W.messageId : null, { canUseApiCalls: K, loading: ft } = de(y()), pt = fe(te(), ne() || null), mt = T(() => we.filter((e) => !e.requiresAdmin || K), [K]), [ht, gt] = Ne(null), [_t, vt] = Ne(!1), yt = E({}), q = E(Me()), bt = E(/* @__PURE__ */ new Set()), xt = T(() => we.find((e) => e.id === N), [N]);
97
99
  w(() => {
98
- mt || (!wt || wt.requiresAdmin && !pt) && N !== "assistant" && P("assistant");
100
+ ft || (!xt || xt.requiresAdmin && !K) && N !== "assistant" && P("assistant");
99
101
  }, [
100
102
  N,
101
- wt,
102
- pt,
103
- mt,
103
+ xt,
104
+ K,
105
+ ft,
104
106
  P
105
107
  ]);
106
- let K = C((e, t, n, r) => {
107
- z(e, n, t, null), r ? at(e, t, r) : at(e, t, Ke(n));
108
- }, [z, at]), Tt = C(async (t, i, o, s, c) => {
109
- let l = e.getState().sandboxesByMode[o]?.sandboxId ?? null, te = async (e) => {
110
- if (St.current.isFresh(e)) return !0;
108
+ let J = C((e, t, n, r) => {
109
+ z(e, n, t, null), r ? it(e, t, r) : it(e, t, Ge(n));
110
+ }, [z, it]), St = C(async (r, a, o, s, c) => {
111
+ let d = e.getState().sandboxesByMode[o]?.sandboxId ?? null, f = async (e) => {
112
+ if (q.current.isFresh(e)) return !0;
111
113
  try {
112
- return await d(A, e, s, c, 3e5, (e) => K(t, i, "provisioning", e)), await u(A, e, s, c, 9e4, (e) => K(t, i, "connecting", e)), St.current.markVerified(e), !0;
114
+ return await u(A, e, s, c, 3e5, (e) => J(r, a, "provisioning", e)), await l(A, e, s, c, 9e4, (e) => J(r, a, "connecting", e)), q.current.markVerified(e), !0;
113
115
  } catch {
114
- return St.current.invalidate(e), !1;
116
+ return q.current.invalidate(e), !1;
115
117
  }
116
118
  };
117
- if (l && (V(o, l, "provisioning"), K(t, i, "provisioning", "Reusing assistant environment..."), await te(l) || (V(o, null, "provisioning"), l = null)), !l) {
118
- K(t, i, "provisioning", "Looking for existing environment...");
119
- let e = await a(A, s, o, c);
120
- e && (V(o, e, "provisioning"), K(t, i, "provisioning", "Reusing assistant environment..."), await te(e) ? l = e : V(o, null, "provisioning"));
119
+ if (d && (V(o, d, "provisioning"), J(r, a, "provisioning", "Reusing assistant environment..."), await f(d) || (V(o, null, "provisioning"), d = null)), !d) {
120
+ J(r, a, "provisioning", "Looking for existing environment...");
121
+ let e = await i(A, s, o, c);
122
+ e && (V(o, e, "provisioning"), J(r, a, "provisioning", "Reusing assistant environment..."), await f(e) ? d = e : V(o, null, "provisioning"));
121
123
  }
122
- if (!l) {
124
+ if (!d) {
123
125
  if (o === "api-calls" && !j()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
124
- K(t, i, "provisioning", "Starting assistant environment..."), V(o, null, "provisioning"), l = await n(A, o, s, c), V(o, l, "provisioning"), await d(A, l, s, c, 3e5, (e) => K(t, i, "provisioning", e)), await u(A, l, s, c, 9e4, (e) => K(t, i, "connecting", e));
126
+ J(r, a, "provisioning", "Starting assistant environment..."), V(o, null, "provisioning"), d = await t(A, o, s, c), V(o, d, "provisioning"), await u(A, d, s, c, 3e5, (e) => J(r, a, "provisioning", e)), await l(A, d, s, c, 9e4, (e) => J(r, a, "connecting", e));
125
127
  }
126
- V(o, l, "running");
127
- let f = e.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null;
128
- if (f) try {
129
- let e = await ee(A, l, s, f, c);
128
+ V(o, d, "running");
129
+ let p = e.getState().conversations.find((e) => e.id === r)?.backendSessionId ?? null;
130
+ if (p) try {
131
+ let e = await ee(A, d, s, p, c);
130
132
  if (e.mode !== o) throw Error(`Session mode mismatch: expected ${o}, received ${e.mode}`);
131
133
  } catch {
132
- B(t), f = null;
134
+ B(r), p = null;
133
135
  }
134
- return f || (K(t, i, "connecting", "Preparing session..."), f = (await r(A, l, s, o, c)).sessionId, ct(t, f)), {
135
- sandboxId: l,
136
- sessionId: f
136
+ return p || (J(r, a, "connecting", "Preparing session..."), p = (await n(A, d, s, o, c)).sessionId, st(r, p)), {
137
+ sandboxId: d,
138
+ sessionId: p
137
139
  };
138
140
  }, [
139
141
  A,
140
142
  B,
141
143
  j,
142
- ct,
144
+ st,
143
145
  V,
144
- K
145
- ]), q = C(async (n, r = [], a = {}) => {
146
- let ee = a.voiceSessionId !== void 0, u = e.getState(), d = u.activeConversationId ?? M;
147
- if (d && (we(u.processingByConversationId[d]?.status) || Ct.current.has(d))) return;
148
- let f = u.mode, p = M, m = p ? e.getState().conversations.find((e) => e.id === p) : void 0;
146
+ J
147
+ ]), Y = C(async (t, n = [], i = {}) => {
148
+ let ee = i.voiceSessionId !== void 0, l = e.getState(), u = l.activeConversationId ?? M;
149
+ if (u && (Ce(l.processingByConversationId[u]?.status) || bt.current.has(u))) return;
150
+ let f = l.mode, p = M, m = p ? e.getState().conversations.find((e) => e.id === p) : void 0;
149
151
  if (p ? m && m.mode !== f && (m.messages.length > 0 || m.backendSessionId) ? p = I(void 0, f) : m && m.mode !== f && F(p, f) : p = I(void 0, f), !p) return;
150
- xt.current[p] = r;
151
- let h = y(), g = {
152
+ yt.current[p] = n;
153
+ let h = ne(), g = {
152
154
  accessToken: j(),
153
- workspaceToken: qe(),
154
- userId: Je,
155
- organizationId: re()
156
- }, ne = {
157
- id: Ue(),
155
+ workspaceToken: Ke(),
156
+ userId: qe,
157
+ organizationId: y()
158
+ }, _ = {
159
+ id: He(),
158
160
  role: "user",
159
- content: n,
161
+ content: t,
160
162
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
161
163
  metadata: {
162
- ...r.length ? { attachments: r.map(ce) } : {},
163
- ...S(a.voiceSessionId)
164
+ ...n.length ? { attachments: n.map(x) } : {},
165
+ ...me(i.voiceSessionId)
164
166
  }
165
167
  };
166
- L(p, ne);
167
- let _ = Ue();
168
+ L(p, _);
169
+ let v = He();
168
170
  L(p, {
169
- id: _,
171
+ id: v,
170
172
  role: "assistant",
171
173
  content: "",
172
174
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
173
175
  metadata: {
174
- lang: tt,
175
- ...S(a.voiceSessionId)
176
+ lang: et,
177
+ ...me(i.voiceSessionId)
176
178
  }
177
- }), z(p, "provisioning", _, null);
178
- let v = (e, t, n, r, i = tt) => {
179
- R(p, _, { content: We(e) }), ot(p, _, {
180
- lang: i,
179
+ }), z(p, "provisioning", v, null);
180
+ let te = (e, t, n, r, a = et) => {
181
+ R(p, v, { content: Ue(e) }), at(p, v, {
182
+ lang: a,
181
183
  ...t?.length ? { artifacts: t } : {},
182
184
  ...t?.length || n || r ? { mode: f } : {},
183
185
  ...n ? { sessionId: n } : {},
184
186
  ...r ? { sandboxId: r } : {},
185
- ...S(a.voiceSessionId)
187
+ ...me(i.voiceSessionId)
186
188
  });
187
189
  }, b = async (e = 1) => {
188
- let a = !1;
190
+ let i = !1;
189
191
  try {
190
- await t(A, h, g);
191
- } catch (e) {
192
- if (ve(e)) {
193
- ye("ai-credits"), v("You've run out of AI credits for this billing cycle. Upgrade your plan to keep chatting.", void 0, void 0, void 0, "en"), z(p, "error", _, null);
194
- return;
195
- }
196
- 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);
197
- }
198
- try {
199
- let { sandboxId: e, sessionId: t } = await Tt(p, _, f, h, g), u = (await s(A, e, h, t, g, 50).catch(() => [])).reduce((e, t) => Math.max(e, k(t)), 0);
200
- K(p, _, "streaming", "Thinking...");
201
- let d = xe(f, ae(n, r), $e, et, ee), m = ie(d, r), ne = se(m), re = ne > 0, y = te();
202
- a = oe(r) > ne;
192
+ let { sandboxId: e, sessionId: l } = await St(p, v, f, h, g), u = (await o(A, e, h, l, g, 50).catch(() => [])).reduce((e, t) => Math.max(e, k(t)), 0);
193
+ J(p, v, "streaming", "Thinking...");
194
+ let m = be(f, ie(t, n), Qe, $e, ee), _ = re(m, n), y = oe(_), ne = y > 0, b = d();
195
+ i = ae(n) > y;
203
196
  try {
204
- await l(A, e, h, t, d, f, y, g, m);
205
- } catch (n) {
206
- if (!m || !Se(n)) throw n;
207
- await l(A, e, h, t, d, f, y, g, void 0), a ||= re;
197
+ await c(A, e, h, l, m, f, b, g, _);
198
+ } catch (t) {
199
+ if (!_ || !xe(t)) throw t;
200
+ await c(A, e, h, l, m, f, b, g, void 0), i ||= ne;
208
201
  }
209
- let b = Ge([], u), ce = Date.now() + (Be[f] ?? Ve), x = Date.now(), le = Date.now();
210
- for (; Date.now() < ce && (b = Ge(await s(A, e, h, t, g, 50, u), u), R(p, _, { content: We(b.content) }), b.pendingWrite && ot(p, _, { pendingWrite: b.pendingWrite }), !b.done);) Date.now() - x > 3e4 && (await i(A, e, h, 600, g).catch(() => void 0), x = Date.now()), await new Promise((e) => setTimeout(e, Ee(Date.now() - le)));
211
- if (!b.done && f !== "vibe-plugins") throw Error("Assistant response timed out while streaming progress");
212
- let ue = f === "vibe-plugins" ? await o(A, e, h, t, g).catch(() => []) : void 0;
213
- if (b.done || (b = {
214
- ...b,
215
- 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._`
216
- }), a && (b = {
217
- ...b,
218
- content: `${b.content}\n\n${O("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._")}`
219
- }), v(b.content, ue, t, e), b.tokens) {
220
- R(p, _, { tokens: b.tokens });
202
+ let x = We([], u), S = Date.now() + (ze[f] ?? Be), se = Date.now(), ce = Date.now();
203
+ for (; Date.now() < S && (x = We(await o(A, e, h, l, g, 50, u), u), R(p, v, { content: Ue(x.content) }), x.pendingWrite && at(p, v, { pendingWrite: x.pendingWrite }), !x.done);) Date.now() - se > 3e4 && (await r(A, e, h, 600, g).catch(() => void 0), se = Date.now()), await new Promise((e) => setTimeout(e, Te(Date.now() - ce)));
204
+ if (!x.done && f !== "vibe-plugins") throw Error("Assistant response timed out while streaming progress");
205
+ let le = f === "vibe-plugins" ? await a(A, e, h, l, g).catch(() => []) : void 0;
206
+ if (x.done || (x = {
207
+ ...x,
208
+ content: `${x.content}\n\n_Still building in the background — any artifacts below will finish shortly. Re-open this conversation to pick up the completed plugin._`
209
+ }), i && (x = {
210
+ ...x,
211
+ content: `${x.content}\n\n${O("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._")}`
212
+ }), te(x.content, le, l, e), x.tokens) {
213
+ R(p, v, { tokens: x.tokens });
221
214
  try {
222
- await c(A, h, t, b.tokens, g), be();
215
+ await s(A, h, l, x.messageId, x.model, x.tokens, g), ye();
223
216
  } catch {}
224
217
  }
225
- z(p, "complete", _, null);
218
+ z(p, "complete", v, null);
226
219
  } catch (t) {
227
- if (e === 1 && Ce(t)) return B(p), lt(f), b(2);
220
+ if (e === 1 && Se(t)) return B(p), ct(f), b(2);
228
221
  throw t;
229
222
  }
230
- }, x = p;
231
- Ct.current.add(x);
223
+ }, S = p;
224
+ bt.current.add(S);
232
225
  try {
233
226
  if (!h) throw Error("Assistant backend is unavailable without an active workspace context.");
234
227
  await b();
235
228
  } catch (t) {
236
- if (St.current.invalidate(e.getState().sandboxesByMode[f]?.sandboxId ?? null), ve(t)) {
237
- ye("sandbox"), v("You've reached your sandbox limit on the current plan. Upgrade to start the AI assistant.", void 0, void 0, void 0, "en"), z(p, "error", _, null);
229
+ if (q.current.invalidate(e.getState().sandboxesByMode[f]?.sandboxId ?? null), _e(t)) {
230
+ ve("sandbox"), te("You've reached your sandbox limit on the current plan. Upgrade to start the AI assistant.", void 0, void 0, void 0, "en"), z(p, "error", v, null);
238
231
  return;
239
232
  }
240
233
  let n = t instanceof Error ? t.message : "Something went wrong";
241
- z(p, "error", _, n), R(p, _, { content: `Sorry, an error occurred: ${n}. Please try again.` }), ot(p, _, {
234
+ z(p, "error", v, n), R(p, v, { content: `Sorry, an error occurred: ${n}. Please try again.` }), at(p, v, {
242
235
  lang: "en",
243
- ...S(a.voiceSessionId)
236
+ ...me(i.voiceSessionId)
244
237
  });
245
238
  } finally {
246
- Ct.current.delete(x);
239
+ bt.current.delete(S);
247
240
  }
248
241
  }, [
249
242
  M,
250
243
  L,
251
244
  A,
252
245
  B,
253
- lt,
254
- nt,
246
+ ct,
247
+ tt,
255
248
  I,
256
- Tt,
249
+ St,
257
250
  j,
258
- qe,
251
+ Ke,
259
252
  R,
260
- et,
261
- tt,
262
253
  $e,
263
- ct,
254
+ et,
255
+ Qe,
256
+ st,
264
257
  F,
265
258
  z,
266
259
  O,
267
- K,
268
- Je
269
- ]), Et = C((e) => {
270
- q(e);
271
- }, [q]), Dt = C(() => {
272
- let e = [...H.chat].reverse().find((e) => e.role === "user"), t = M ? xt.current[M] ?? [] : [];
273
- e && q(e.content, t);
260
+ J,
261
+ qe
262
+ ]), Ct = C((e) => {
263
+ Y(e);
264
+ }, [Y]), wt = C(() => {
265
+ let e = [...H.chat].reverse().find((e) => e.role === "user"), t = M ? yt.current[M] ?? [] : [];
266
+ e && Y(e.content, t);
274
267
  }, [
275
268
  U,
276
- q,
269
+ Y,
277
270
  M
278
- ]), Ot = E(q);
271
+ ]), Tt = E(Y);
279
272
  w(() => {
280
- Ot.current = q;
281
- }, [q]);
282
- let J = T(() => {
273
+ Tt.current = Y;
274
+ }, [Y]);
275
+ let Et = T(() => {
283
276
  if (G) return null;
284
277
  for (let e = U.length - 1; e >= 0; --e) {
285
278
  let t = U[e];
286
- if (t?.role !== "assistant" || !he(t)) continue;
287
- let n = de(t.content).text.trim();
279
+ if (t?.role !== "assistant" || !pe(t)) continue;
280
+ let n = le(t.content).text.trim();
288
281
  return n ? {
289
282
  id: t.id,
290
283
  text: n
291
284
  } : null;
292
285
  }
293
286
  return null;
294
- }, [U, G]), kt = T(() => J ? Oe(J.text) : null, [J]), At = H.chat, Y = T(() => H.voice.filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
287
+ }, [U, G]), Dt = T(() => Et ? De(Et.text) : null, [Et]), Ot = H.chat, X = T(() => H.voice.filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
295
288
  id: e.id,
296
289
  role: e.role,
297
- text: de(e.content).text.trim(),
298
- sessionId: ge(e),
290
+ text: le(e.content).text.trim(),
291
+ sessionId: he(e),
299
292
  timestamp: e.timestamp
300
- })).filter((e) => e.text.length > 0), [H.voice]), jt = C(() => {
301
- if (Y.length === 0) return;
293
+ })).filter((e) => e.text.length > 0), [H.voice]), kt = C(() => {
294
+ if (X.length === 0) return;
302
295
  let e = /* @__PURE__ */ new Date();
303
- Me(Ae(Y, {
296
+ je(ke(X, {
304
297
  title: O("voiceSession.transcript", "Voice conversation"),
305
298
  savedAt: O("voiceSession.savedAt", "Saved"),
306
299
  session: O("voiceSession.sessionLabel", "Session"),
307
300
  earlier: O("voiceSession.earlierLabel", "Earlier"),
308
301
  you: O("voiceSession.speakerYou", "You"),
309
302
  assistant: O("voiceSession.speakerAssistant", "Assistant")
310
- }, e), je(e), "text/markdown");
311
- }, [Y, O]), X = x(), Z = E(X);
312
- Z.current = X;
313
- let Q = fe({
303
+ }, e), Ae(e), "text/markdown");
304
+ }, [X, O]), Z = S(), Q = E(Z);
305
+ Q.current = Z;
306
+ let $ = ue({
314
307
  onSubmit: C((e, t) => {
315
308
  let n = () => {
316
- let n = Z.current, r = b(n.attachments);
317
- Ot.current(e, r, { voiceSessionId: t }), n.clear();
309
+ let n = Q.current, r = b(n.attachments);
310
+ Tt.current(e, r, { voiceSessionId: t }), n.clear();
318
311
  };
319
- if (!Z.current.isBusy) {
312
+ if (!Q.current.isBusy) {
320
313
  n();
321
314
  return;
322
315
  }
323
316
  let r = Date.now(), i = window.setInterval(() => {
324
- Z.current.isBusy && Date.now() - r < He || (window.clearInterval(i), n());
317
+ Q.current.isBusy && Date.now() - r < Ve || (window.clearInterval(i), n());
325
318
  }, 200);
326
319
  }, []),
327
- latestReply: J,
328
- language: f(Xe, Ye).tag
329
- }), Mt = C(() => {
320
+ latestReply: Et,
321
+ language: f(Ye, Je).tag
322
+ }), At = C(() => {
330
323
  let t = e.getState().activeConversationId;
331
- !t || Y.length === 0 || (L(t, {
332
- id: Ue(),
324
+ !t || X.length === 0 || (L(t, {
325
+ id: He(),
333
326
  role: "system",
334
- content: ke(Y, {
327
+ content: Oe(X, {
335
328
  intro: O("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
336
329
  nothing: O("voiceSession.continuedNothing", "Continued from a voice conversation."),
337
330
  more: (e) => O("voiceSession.continuedMore", "…and {{count}} more", { count: e })
338
331
  }),
339
332
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
340
- }), bt(!1), Q.end());
333
+ }), vt(!1), $.end());
341
334
  }, [
342
- Y,
335
+ X,
343
336
  L,
344
337
  O
345
338
  ]);
346
339
  w(() => {
347
- !De && Q.active && Q.end();
348
- }, [De, Q]), w(() => {
349
- Q.active || Z.current.clear();
350
- }, [Q.active]), w(() => {
340
+ !Ee && $.active && $.end();
341
+ }, [Ee, $]), w(() => {
342
+ $.active || Q.current.clear();
343
+ }, [$.active]), w(() => {
351
344
  let t = e.getState().consumePendingPrompt();
352
- return t && Ot.current(t), e.subscribe((t, n) => {
345
+ return t && Tt.current(t), e.subscribe((t, n) => {
353
346
  if (t.pendingPrompt && t.pendingPrompt !== n.pendingPrompt) {
354
347
  let t = e.getState().consumePendingPrompt();
355
- t && Ot.current(t);
348
+ t && Tt.current(t);
356
349
  }
357
350
  });
358
351
  }, []);
359
- let $ = C((t) => {
352
+ let jt = C((t) => {
360
353
  let n = M ? e.getState().conversations.find((e) => e.id === M) : void 0;
361
354
  if (n && (n.messages.length > 0 || n.backendSessionId)) {
362
355
  if (n.mode !== t) {
363
356
  let n = e.getState().conversations.find((n) => n.mode === t && n.messages.length === 0 && !n.backendSessionId && !e.getState().processingByConversationId[n.id]);
364
- n ? it(n.id) : I(void 0, t);
357
+ n ? rt(n.id) : I(void 0, t);
365
358
  }
366
359
  } else M && F(M, t);
367
360
  P(t);
368
361
  }, [
369
362
  M,
370
363
  I,
371
- it,
364
+ rt,
372
365
  F,
373
366
  P
374
- ]), Nt = C((t) => {
375
- if (Te.find((e) => e.id === t)?.writeCapable && !e.getState().apiCallsAcknowledged) {
376
- vt(t);
367
+ ]), Mt = C((t) => {
368
+ if (we.find((e) => e.id === t)?.writeCapable && !e.getState().apiCallsAcknowledged) {
369
+ gt(t);
377
370
  return;
378
371
  }
379
- $(t);
380
- }, [$]), Pt = C(() => {
381
- let e = _t;
382
- vt(null), ut(), e && $(e);
372
+ jt(t);
373
+ }, [jt]), Nt = C(() => {
374
+ let e = ht;
375
+ gt(null), lt(), e && jt(e);
383
376
  }, [
384
- _t,
385
- ut,
386
- $
387
- ]), Ft = C(() => {
388
- vt(null);
377
+ ht,
378
+ lt,
379
+ jt
380
+ ]), Pt = C(() => {
381
+ gt(null);
389
382
  }, []);
390
- return /* @__PURE__ */ Ie("div", {
383
+ return /* @__PURE__ */ Fe("div", {
391
384
  className: "relative flex flex-1 flex-col overflow-hidden",
392
385
  children: [
393
- /* @__PURE__ */ Ie("div", {
386
+ /* @__PURE__ */ Fe("div", {
394
387
  className: "contents",
395
- inert: Q.active || void 0,
388
+ inert: $.active || void 0,
396
389
  children: [
397
- Y.length > 0 && !Q.active ? /* @__PURE__ */ D(ne, {
398
- count: Y.length,
399
- onOpenTranscript: () => bt(!0)
390
+ X.length > 0 && !$.active ? /* @__PURE__ */ D(_, {
391
+ count: X.length,
392
+ onOpenTranscript: () => vt(!0)
400
393
  }) : null,
401
- At.length === 0 ? /* @__PURE__ */ D(g, {
394
+ Ot.length === 0 ? /* @__PURE__ */ D(g, {
402
395
  mode: N,
403
- onSuggestionClick: Et
396
+ onSuggestionClick: Ct
404
397
  }) : /* @__PURE__ */ D("div", {
405
398
  className: "flex min-h-0 flex-1 flex-col",
406
399
  children: /* @__PURE__ */ D(m, {
407
- messages: At,
408
- streamingMessageId: dt,
409
- failedMessageId: ft,
410
- onRetry: Dt
400
+ messages: Ot,
401
+ streamingMessageId: ut,
402
+ failedMessageId: dt,
403
+ onRetry: wt
411
404
  })
412
405
  }),
413
- /* @__PURE__ */ D(le, {
414
- onStartVoiceSession: Q.available && N !== "api-calls" ? Q.start : void 0,
415
- onSend: (e, t) => void q(e, t),
406
+ /* @__PURE__ */ D(se, {
407
+ onStartVoiceSession: $.available && N !== "api-calls" ? $.start : void 0,
408
+ onSend: (e, t) => void Y(e, t),
416
409
  disabled: G,
417
410
  placeholder: N === "api-calls" ? O("chatArea.placeholderActions", "What would you like me to do?") : O("chatArea.placeholderGeneral", "Ask HealthyBowl anything…"),
418
411
  mode: N,
419
- writeAccessDenied: ht === "denied" && !!wt?.writeCapable,
420
- availableModes: gt,
421
- onModeChange: Nt
412
+ writeAccessDenied: pt === "denied" && !!xt?.writeCapable,
413
+ availableModes: mt,
414
+ onModeChange: Mt
422
415
  })
423
416
  ]
424
417
  }),
425
- yt && !Q.active ? /* @__PURE__ */ D(_, {
426
- turns: Y,
427
- onClose: () => bt(!1),
428
- onSave: jt
418
+ _t && !$.active ? /* @__PURE__ */ D(v, {
419
+ turns: X,
420
+ onClose: () => vt(!1),
421
+ onSave: kt
429
422
  }) : null,
430
- Q.active && /* @__PURE__ */ D(ue, {
431
- session: Q.session,
432
- notice: Q.notice,
433
- capturing: Q.capturing,
434
- interrupting: Q.interrupting,
435
- awaitingEndpoint: Q.awaitingEndpoint,
436
- turns: Y,
437
- spokenChunks: Q.spokenChunks,
438
- attachments: X.attachments,
439
- onAttachFiles: X.addFiles,
440
- onRemoveAttachment: X.remove,
441
- onRetryAttachment: X.retry,
442
- canAttachMore: X.canAddMore,
443
- preparingAttachments: X.preparingCount,
444
- onSaveTranscript: jt,
445
- onContinueInChat: Mt,
446
- onInterrupt: Q.interrupt,
447
- spoken: kt,
448
- onToggleMute: Q.toggleMute,
449
- onEnd: Q.end
423
+ $.active && /* @__PURE__ */ D(ce, {
424
+ session: $.session,
425
+ notice: $.notice,
426
+ capturing: $.capturing,
427
+ interrupting: $.interrupting,
428
+ awaitingEndpoint: $.awaitingEndpoint,
429
+ turns: X,
430
+ spokenChunks: $.spokenChunks,
431
+ attachments: Z.attachments,
432
+ onAttachFiles: Z.addFiles,
433
+ onRemoveAttachment: Z.remove,
434
+ onRetryAttachment: Z.retry,
435
+ canAttachMore: Z.canAddMore,
436
+ preparingAttachments: Z.preparingCount,
437
+ onSaveTranscript: kt,
438
+ onContinueInChat: At,
439
+ onInterrupt: $.interrupt,
440
+ spoken: Dt,
441
+ onToggleMute: $.toggleMute,
442
+ onEnd: $.end
450
443
  }),
451
444
  /* @__PURE__ */ D(h, {
452
- open: _t !== null,
453
- onConfirm: Pt,
454
- onCancel: Ft
445
+ open: ht !== null,
446
+ onConfirm: Nt,
447
+ onCancel: Pt
455
448
  })
456
449
  ]
457
450
  });
458
451
  };
459
452
  //#endregion
460
- export { qe as AssistantChatArea };
453
+ export { Ke as AssistantChatArea };
461
454
 
462
455
  //# sourceMappingURL=AssistantChatArea.js.map