@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.
- package/dist/components/assistant/AssistantChatArea.js +176 -174
- package/dist/components/assistant/AssistantChatArea.js.map +1 -1
- package/dist/components/assistant/composer/AssistantAttachmentButton.js +1 -2
- package/dist/components/assistant/composer/AssistantAttachmentChips.js +1 -2
- package/dist/components/assistant/composer/AssistantComposer.js +2 -187
- package/dist/components/assistant/composer/AssistantModeSelector.js +1 -2
- package/dist/components/assistant/composer/AssistantVoiceButton.js +1 -2
- package/dist/components/assistant/index.js +4 -4
- package/dist/healthybowl/HealthyBowlRoot.js +57 -56
- package/dist/healthybowl/HealthyBowlRoot.js.map +1 -1
- package/dist/healthybowl/HealthyBowlRoutes.js +48 -36
- package/dist/healthybowl/HealthyBowlRoutes.js.map +1 -1
- package/dist/healthybowl/components/CreateFarmTaskButton.js.map +1 -1
- package/dist/healthybowl/components/PageLayout.js +11 -10
- package/dist/healthybowl/components/PageLayout.js.map +1 -1
- package/dist/healthybowl/context/HealthyBowlContext.js +7 -7
- package/dist/healthybowl/context/HealthyBowlContext.js.map +1 -1
- package/dist/healthybowl/hooks/useAgronomyDecisions.js +79 -0
- package/dist/healthybowl/hooks/useAgronomyDecisions.js.map +1 -0
- package/dist/healthybowl/hooks/useAnalyticsReports.js +173 -0
- package/dist/healthybowl/hooks/useAnalyticsReports.js.map +1 -0
- package/dist/healthybowl/hooks/useComplianceExports.js +74 -0
- package/dist/healthybowl/hooks/useComplianceExports.js.map +1 -0
- package/dist/healthybowl/hooks/useConsultationPayments.js +59 -0
- package/dist/healthybowl/hooks/useConsultationPayments.js.map +1 -0
- package/dist/healthybowl/hooks/useHealthyBowlCompliance.js +157 -141
- package/dist/healthybowl/hooks/useHealthyBowlCompliance.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlData.js +18 -0
- package/dist/healthybowl/hooks/useHealthyBowlData.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlDistribution.js +52 -37
- package/dist/healthybowl/hooks/useHealthyBowlDistribution.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlLivestockDepth.js +135 -78
- package/dist/healthybowl/hooks/useHealthyBowlLivestockDepth.js.map +1 -1
- package/dist/healthybowl/hooks/useIrrigationAutomation.js +1 -1
- package/dist/healthybowl/hooks/useIrrigationAutomation.js.map +1 -1
- package/dist/healthybowl/hooks/usePlantingEstimate.js +88 -0
- package/dist/healthybowl/hooks/usePlantingEstimate.js.map +1 -0
- package/dist/healthybowl/hooks/useSuccessionPlanning.js +1 -1
- package/dist/healthybowl/hooks/useSuccessionPlanning.js.map +1 -1
- package/dist/healthybowl/hooks/useWeatherIntelligence.js +1 -1
- package/dist/healthybowl/hooks/useWeatherIntelligence.js.map +1 -1
- package/dist/healthybowl/offline/HeaderOfflinePill.js +28 -0
- package/dist/healthybowl/offline/HeaderOfflinePill.js.map +1 -0
- package/dist/healthybowl/offline/OfflineStatusPill.js +40 -21
- package/dist/healthybowl/offline/OfflineStatusPill.js.map +1 -1
- package/dist/healthybowl/offline/OfflineSyncProvider.js +149 -126
- package/dist/healthybowl/offline/OfflineSyncProvider.js.map +1 -1
- package/dist/healthybowl/offline/captureCache.js +30 -0
- package/dist/healthybowl/offline/captureCache.js.map +1 -0
- package/dist/healthybowl/offline/graphql.js.map +1 -1
- package/dist/healthybowl/offline/headerSlot.js +24 -0
- package/dist/healthybowl/offline/headerSlot.js.map +1 -0
- package/dist/healthybowl/offline/store.js +1 -1
- package/dist/healthybowl/offline/syncEngine.js +2 -1
- package/dist/healthybowl/offline/syncEngine.js.map +1 -1
- package/dist/healthybowl/offline/types.js.map +1 -1
- package/dist/healthybowl/pages/GettingStartedPage.js +1 -0
- package/dist/healthybowl/pages/GettingStartedPage.js.map +1 -1
- package/dist/healthybowl/pages/ai/AiDecisionsPage.js +287 -0
- package/dist/healthybowl/pages/ai/AiDecisionsPage.js.map +1 -0
- package/dist/healthybowl/pages/analytics/InsightsPage.js +2 -2
- package/dist/healthybowl/pages/analytics/InsightsPage.js.map +1 -1
- package/dist/healthybowl/pages/analytics/ReportsPage.js +136 -99
- package/dist/healthybowl/pages/analytics/ReportsPage.js.map +1 -1
- package/dist/healthybowl/pages/compliance/ComplianceOverviewPage.js +204 -162
- package/dist/healthybowl/pages/compliance/ComplianceOverviewPage.js.map +1 -1
- package/dist/healthybowl/pages/compliance/IcsGroupDetailPage.js +196 -178
- package/dist/healthybowl/pages/compliance/IcsGroupDetailPage.js.map +1 -1
- package/dist/healthybowl/pages/compliance/IcsGrowerDetailPage.js +142 -141
- package/dist/healthybowl/pages/compliance/IcsGrowerDetailPage.js.map +1 -1
- package/dist/healthybowl/pages/compliance/ResidueTestsPage.js +291 -0
- package/dist/healthybowl/pages/compliance/ResidueTestsPage.js.map +1 -0
- package/dist/healthybowl/pages/compliance/SubstanceRulesPage.js +300 -0
- package/dist/healthybowl/pages/compliance/SubstanceRulesPage.js.map +1 -0
- package/dist/healthybowl/pages/compliance/substanceRuleForm.js +135 -0
- package/dist/healthybowl/pages/compliance/substanceRuleForm.js.map +1 -0
- package/dist/healthybowl/pages/crops/CropFieldsPage.js +2 -0
- package/dist/healthybowl/pages/crops/CropFieldsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropHarvestPage.js +316 -272
- package/dist/healthybowl/pages/crops/CropHarvestPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropPlanningPage.js +6 -0
- package/dist/healthybowl/pages/crops/CropPlanningPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js +871 -846
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/HarvestDetailsPage.js +376 -334
- package/dist/healthybowl/pages/crops/HarvestDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/distribution/CsaPlanDetailPage.js +415 -188
- package/dist/healthybowl/pages/distribution/CsaPlanDetailPage.js.map +1 -1
- package/dist/healthybowl/pages/distribution/labels.js +10 -2
- package/dist/healthybowl/pages/distribution/labels.js.map +1 -1
- package/dist/healthybowl/pages/farm/FarmProfilePage.js +1 -0
- package/dist/healthybowl/pages/farm/FarmProfilePage.js.map +1 -1
- package/dist/healthybowl/pages/field-capture/CaptureObservationForm.js +8 -8
- package/dist/healthybowl/pages/fields/FieldMapPage.js +2 -0
- package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/FinancialReportsPage.js +92 -107
- package/dist/healthybowl/pages/financial/FinancialReportsPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js +228 -188
- package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/SchemeDetailsPage.js +261 -191
- package/dist/healthybowl/pages/government-schemes/SchemeDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/schemeApplicationTransitions.js +49 -0
- package/dist/healthybowl/pages/government-schemes/schemeApplicationTransitions.js.map +1 -0
- package/dist/healthybowl/pages/government-schemes/schemeDocumentSlots.js +48 -0
- package/dist/healthybowl/pages/government-schemes/schemeDocumentSlots.js.map +1 -0
- package/dist/healthybowl/pages/government-schemes/useSchemeApplicationTransition.js +54 -0
- package/dist/healthybowl/pages/government-schemes/useSchemeApplicationTransition.js.map +1 -0
- package/dist/healthybowl/pages/inputs-insurance/InputsInsuranceOverviewPage.js +14 -14
- package/dist/healthybowl/pages/inputs-insurance/InputsInsuranceOverviewPage.js.map +1 -1
- package/dist/healthybowl/pages/irrigation/IrrigationPage.js +338 -307
- package/dist/healthybowl/pages/irrigation/IrrigationPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/AnimalDepthFormModal.js +126 -102
- package/dist/healthybowl/pages/livestock/AnimalDepthFormModal.js.map +1 -1
- package/dist/healthybowl/pages/livestock/AnimalDepthPage.js +257 -215
- package/dist/healthybowl/pages/livestock/AnimalDepthPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/GrazingPage.js +1 -0
- package/dist/healthybowl/pages/livestock/GrazingPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/HerdDepthPage.js +4 -0
- package/dist/healthybowl/pages/livestock/HerdDepthPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/PedigreeTree.js +154 -0
- package/dist/healthybowl/pages/livestock/PedigreeTree.js.map +1 -0
- package/dist/healthybowl/pages/livestock/eidTagInput.js +39 -0
- package/dist/healthybowl/pages/livestock/eidTagInput.js.map +1 -0
- package/dist/healthybowl/pages/livestock/grazing/RecordGrazingMoveModal.js +8 -9
- package/dist/healthybowl/pages/livestock/grazing/RecordGrazingMoveModal.js.map +1 -1
- package/dist/healthybowl/pages/livestock/pedigreeLayout.js +68 -0
- package/dist/healthybowl/pages/livestock/pedigreeLayout.js.map +1 -0
- package/dist/healthybowl/pages/network/ExpertsPage.js +520 -419
- package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
- package/dist/healthybowl/pages/pest-management/AiPestDetectionPage.js +6 -6
- package/dist/healthybowl/pages/terrace/JournalEntryModal.js +1 -1
- package/dist/healthybowl/pages/weather/WeatherAlertHistoryPage.js +129 -130
- package/dist/healthybowl/pages/weather/WeatherAlertHistoryPage.js.map +1 -1
- package/dist/healthybowl/pages/weather/WeatherSettingsPage.js +285 -237
- package/dist/healthybowl/pages/weather/WeatherSettingsPage.js.map +1 -1
- package/dist/healthybowl/pages/weather/alertDelivery.js +105 -0
- package/dist/healthybowl/pages/weather/alertDelivery.js.map +1 -0
- package/dist/healthybowl/store/healthybowlStore.js +5 -5
- package/dist/healthybowl/utils/icsInspection.js +18 -0
- package/dist/healthybowl/utils/icsInspection.js.map +1 -0
- package/dist/healthybowl/utils/imageDownscale.js +2 -104
- package/dist/healthybowl/utils/plantingCapacity.js +10 -10
- package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
- package/dist/hooks/useAssistantAttachments.js +2 -244
- package/dist/node_modules/fast-equals/dist/es/index.js +74 -86
- package/dist/node_modules/fast-equals/dist/es/index.js.map +1 -1
- package/dist/services/assistantApi.js +59 -30
- package/dist/services/assistantApi.js.map +1 -1
- package/dist/utils/assistantAttachments.js +2 -2
- package/dist/utils/pageContext.js +15 -1
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +2 -2
- package/dist/components/assistant/composer/AssistantComposer.js.map +0 -1
- package/dist/components/assistant/composer/AssistantLanguageSelector.js +0 -2
- package/dist/components/assistant/voice/AssistantVoiceSessionButton.js +0 -2
- package/dist/healthybowl/utils/imageDownscale.js.map +0 -1
- package/dist/hooks/useAssistantAttachments.js.map +0 -1
- package/dist/hooks/useVoiceInput.js +0 -2
- package/dist/node_modules/fflate/esm/browser.js +0 -326
- package/dist/node_modules/fflate/esm/browser.js.map +0 -1
- package/dist/node_modules/pdfjs-dist/build/pdf.js +0 -16389
- package/dist/node_modules/pdfjs-dist/build/pdf.js.map +0 -1
- package/dist/node_modules/pdfjs-dist/build/pdf.worker.min.js +0 -52138
- package/dist/node_modules/pdfjs-dist/build/pdf.worker.min.js.map +0 -1
- package/dist/utils/documentExtract.js +0 -135
- package/dist/utils/documentExtract.js.map +0 -1
- package/dist/utils/documentText.js +0 -2
- 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
|
|
3
|
-
import { gatherPageContext as
|
|
4
|
-
import { resolveAssistantLanguage as
|
|
5
|
-
import { resolveLanguagePair as
|
|
6
|
-
import { AssistantMessageList as
|
|
7
|
-
import { AssistantApiCallsConsentDialog as
|
|
8
|
-
import { AssistantEmptyState as
|
|
9
|
-
import { AssistantSpokenTurnsNotice as
|
|
10
|
-
import { VoiceTranscriptDrawer as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
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),
|
|
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
|
-
|
|
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(() =>
|
|
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:
|
|
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
|
-
|
|
98
|
+
ht || (!G || G.requiresAdmin && !U) && N !== "assistant" && P("assistant");
|
|
97
99
|
}, [
|
|
98
100
|
N,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
G,
|
|
102
|
+
U,
|
|
103
|
+
ht,
|
|
102
104
|
P
|
|
103
105
|
]);
|
|
104
|
-
let
|
|
105
|
-
|
|
106
|
-
}, [
|
|
107
|
-
let
|
|
108
|
-
if (
|
|
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
|
|
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
|
|
114
|
+
return W.current.invalidate(e), !1;
|
|
113
115
|
}
|
|
114
116
|
};
|
|
115
|
-
if (
|
|
116
|
-
|
|
117
|
-
let e = await i(A,
|
|
118
|
-
e && (
|
|
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 (!
|
|
122
|
+
if (!f) {
|
|
121
123
|
if (o === "api-calls" && !j()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
|
|
122
|
-
|
|
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
|
-
|
|
125
|
-
let
|
|
126
|
-
if (
|
|
127
|
-
let e = await
|
|
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
|
-
|
|
132
|
+
z(r), m = null;
|
|
131
133
|
}
|
|
132
|
-
return
|
|
133
|
-
sandboxId:
|
|
134
|
-
sessionId:
|
|
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
|
-
|
|
140
|
+
z,
|
|
139
141
|
j,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
]),
|
|
144
|
-
let
|
|
145
|
-
if (
|
|
146
|
-
let
|
|
147
|
-
if (
|
|
148
|
-
|
|
149
|
-
let
|
|
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:
|
|
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(
|
|
162
|
+
...n.length ? { attachments: n.map(_e) } : {},
|
|
161
163
|
...Ae(i.voiceSessionId)
|
|
162
164
|
}
|
|
163
165
|
};
|
|
164
|
-
|
|
165
|
-
let
|
|
166
|
-
|
|
167
|
-
id:
|
|
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
|
-
}),
|
|
176
|
-
let
|
|
177
|
-
|
|
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:
|
|
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:
|
|
189
|
-
|
|
190
|
-
let
|
|
191
|
-
i =
|
|
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
|
|
195
|
+
await l(A, e, g, u, h, p, te, _, v);
|
|
194
196
|
} catch (t) {
|
|
195
|
-
if (!
|
|
196
|
-
await
|
|
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
|
|
199
|
-
for (; Date.now() <
|
|
200
|
-
if (!
|
|
201
|
-
let
|
|
202
|
-
if (
|
|
203
|
-
...
|
|
204
|
-
content: `${
|
|
205
|
-
}), i && (
|
|
206
|
-
...
|
|
207
|
-
content: `${
|
|
208
|
-
}),
|
|
209
|
-
|
|
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
|
|
213
|
+
await c(A, g, u, S.messageId, S.model, S.tokens, _), le();
|
|
212
214
|
} catch {}
|
|
213
215
|
}
|
|
214
|
-
|
|
216
|
+
R(m, "complete", y, null);
|
|
215
217
|
} catch (t) {
|
|
216
|
-
if (e === 1 && ye(t)) return
|
|
218
|
+
if (e === 1 && ye(t)) return z(m), lt(p), b(2);
|
|
217
219
|
throw t;
|
|
218
220
|
}
|
|
219
|
-
},
|
|
220
|
-
|
|
221
|
+
}, x = m;
|
|
222
|
+
Ct.current.add(x);
|
|
221
223
|
try {
|
|
222
|
-
if (!
|
|
224
|
+
if (!g) throw Error("Assistant backend is unavailable without an active workspace context.");
|
|
223
225
|
await b();
|
|
224
226
|
} catch (t) {
|
|
225
|
-
if (
|
|
226
|
-
|
|
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
|
-
|
|
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
|
-
|
|
237
|
+
Ct.current.delete(x);
|
|
236
238
|
}
|
|
237
239
|
}, [
|
|
238
240
|
M,
|
|
239
|
-
|
|
241
|
+
I,
|
|
240
242
|
A,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
+
z,
|
|
244
|
+
lt,
|
|
243
245
|
tt,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
+
F,
|
|
247
|
+
wt,
|
|
246
248
|
j,
|
|
247
249
|
Ke,
|
|
248
|
-
|
|
250
|
+
L,
|
|
249
251
|
$e,
|
|
250
252
|
et,
|
|
251
253
|
Qe,
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
254
|
+
ct,
|
|
255
|
+
rt,
|
|
256
|
+
R,
|
|
255
257
|
O,
|
|
256
|
-
|
|
258
|
+
K,
|
|
257
259
|
qe
|
|
258
|
-
]),
|
|
259
|
-
|
|
260
|
-
}, [
|
|
261
|
-
let e = [...
|
|
262
|
-
e &&
|
|
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
|
-
|
|
265
|
-
|
|
266
|
+
dt,
|
|
267
|
+
q,
|
|
266
268
|
M
|
|
267
|
-
]),
|
|
269
|
+
]), J = E(q);
|
|
268
270
|
w(() => {
|
|
269
|
-
|
|
270
|
-
}, [
|
|
271
|
-
let
|
|
272
|
-
if (
|
|
273
|
-
for (let e =
|
|
274
|
-
let t =
|
|
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 =
|
|
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
|
-
}, [
|
|
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:
|
|
288
|
+
text: x(e.content).text.trim(),
|
|
287
289
|
sessionId: je(e),
|
|
288
290
|
timestamp: e.timestamp
|
|
289
|
-
})).filter((e) => e.text.length > 0), [
|
|
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 =
|
|
302
|
+
}, [X, O]), Z = re(), Q = E(Z);
|
|
301
303
|
Q.current = Z;
|
|
302
|
-
let $ =
|
|
304
|
+
let $ = te({
|
|
303
305
|
onSubmit: C((e, t) => {
|
|
304
306
|
let n = () => {
|
|
305
|
-
let n = Q.current, r =
|
|
306
|
-
|
|
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:
|
|
317
|
-
language:
|
|
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 || (
|
|
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
|
-
}),
|
|
331
|
+
}), xt(!1), $.end());
|
|
330
332
|
}, [
|
|
331
333
|
X,
|
|
332
|
-
|
|
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 &&
|
|
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 &&
|
|
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 ?
|
|
355
|
+
n ? it(n.id) : F(void 0, t);
|
|
354
356
|
}
|
|
355
|
-
} else M &&
|
|
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
|
-
|
|
367
|
+
yt(t);
|
|
366
368
|
return;
|
|
367
369
|
}
|
|
368
370
|
jt(t);
|
|
369
371
|
}, [jt]), Nt = C(() => {
|
|
370
|
-
let e =
|
|
371
|
-
|
|
372
|
+
let e = vt;
|
|
373
|
+
yt(null), ut(), e && jt(e);
|
|
372
374
|
}, [
|
|
373
|
-
|
|
374
|
-
|
|
375
|
+
vt,
|
|
376
|
+
ut,
|
|
375
377
|
jt
|
|
376
378
|
]), Pt = C(() => {
|
|
377
|
-
|
|
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: () =>
|
|
390
|
+
onOpenTranscript: () => xt(!0)
|
|
389
391
|
}) : null,
|
|
390
|
-
Ot.length === 0 ? /* @__PURE__ */ D(
|
|
392
|
+
Ot.length === 0 ? /* @__PURE__ */ D(_, {
|
|
391
393
|
mode: N,
|
|
392
|
-
onSuggestionClick:
|
|
394
|
+
onSuggestionClick: Tt
|
|
393
395
|
}) : /* @__PURE__ */ D("div", {
|
|
394
396
|
className: "flex min-h-0 flex-1 flex-col",
|
|
395
|
-
children: /* @__PURE__ */ D(
|
|
397
|
+
children: /* @__PURE__ */ D(h, {
|
|
396
398
|
messages: Ot,
|
|
397
|
-
streamingMessageId:
|
|
398
|
-
failedMessageId:
|
|
399
|
-
onRetry:
|
|
399
|
+
streamingMessageId: pt,
|
|
400
|
+
failedMessageId: mt,
|
|
401
|
+
onRetry: Et
|
|
400
402
|
})
|
|
401
403
|
}),
|
|
402
|
-
/* @__PURE__ */ D(
|
|
404
|
+
/* @__PURE__ */ D(ee, {
|
|
403
405
|
onStartVoiceSession: $.available && N !== "api-calls" ? $.start : void 0,
|
|
404
|
-
onSend: (e, t) => void
|
|
405
|
-
disabled:
|
|
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:
|
|
409
|
-
availableModes:
|
|
410
|
+
writeAccessDenied: gt === "denied" && !!G?.writeCapable,
|
|
411
|
+
availableModes: _t,
|
|
410
412
|
onModeChange: Mt
|
|
411
413
|
})
|
|
412
414
|
]
|
|
413
415
|
}),
|
|
414
|
-
|
|
416
|
+
bt && !$.active ? /* @__PURE__ */ D(y, {
|
|
415
417
|
turns: X,
|
|
416
|
-
onClose: () =>
|
|
418
|
+
onClose: () => xt(!1),
|
|
417
419
|
onSave: kt
|
|
418
420
|
}) : null,
|
|
419
|
-
$.active && /* @__PURE__ */ D(
|
|
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(
|
|
441
|
-
open:
|
|
442
|
+
/* @__PURE__ */ D(g, {
|
|
443
|
+
open: vt !== null,
|
|
442
444
|
onConfirm: Nt,
|
|
443
445
|
onCancel: Pt
|
|
444
446
|
})
|