@burdenoff/microfe-healthybowl 2026.904.24 → 2026.904.25

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