@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.
- package/dist/components/assistant/AssistantChatArea.js +245 -252
- package/dist/components/assistant/AssistantChatArea.js.map +1 -1
- 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 +153 -130
- 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/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/utils/icsInspection.js +18 -0
- package/dist/healthybowl/utils/icsInspection.js.map +1 -0
- package/dist/healthybowl/utils/plantingCapacity.js +10 -10
- package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
- 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 -33
- package/dist/services/assistantApi.js.map +1 -1
- package/dist/utils/assistantContext.js +2 -38
- package/dist/utils/pageContext.js +15 -1
- package/dist/utils/pageContext.js.map +1 -1
- package/dist/utils/sandboxReadiness.js +2 -24
- package/package.json +1 -1
- package/dist/utils/assistantContext.js.map +0 -1
- package/dist/utils/sandboxReadiness.js.map +0 -1
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
import { useAssistantStore as e } from "../../store/assistantStore.js";
|
|
2
|
-
import {
|
|
3
|
-
import { gatherPageContext as
|
|
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
|
|
10
|
-
import { VoiceTranscriptDrawer as
|
|
11
|
-
import { getActorId as
|
|
12
|
-
import { buildPromptParts as
|
|
13
|
-
import { useAssistantAttachments as
|
|
14
|
-
import { AssistantComposer as
|
|
15
|
-
import { AssistantVoiceSession as
|
|
16
|
-
import { parseToolActivity as
|
|
17
|
-
import { useVoiceSession as
|
|
18
|
-
import { useAssistantApiAccess as
|
|
19
|
-
import { useWorkspaceWriteAccess as
|
|
20
|
-
import { isVoiceTurn as
|
|
21
|
-
import { useConversationTurns as
|
|
22
|
-
import { isQuotaExhaustedError as
|
|
23
|
-
import { dispatchAssistantQuotaExhausted as
|
|
24
|
-
import { buildPromptForMode as
|
|
25
|
-
import { isMultimodalBodyRejection as
|
|
26
|
-
import { isTurnInFlight as
|
|
27
|
-
import { ASSISTANT_MODES as
|
|
28
|
-
import { pollDelayMs as
|
|
29
|
-
import { findPendingWrite as
|
|
30
|
-
import { toCaptionText as
|
|
31
|
-
import { buildContinuedFromVoiceNote as
|
|
32
|
-
import { downloadFile as
|
|
33
|
-
import { createReadinessTracker as
|
|
34
|
-
import { useCallback as C, useEffect as w, useMemo as T, useRef as E, useState as
|
|
35
|
-
import { useI18n as
|
|
36
|
-
import { jsx as D, jsxs as
|
|
37
|
-
import { useGatewayClient as
|
|
38
|
-
import { useAuthToken as
|
|
39
|
-
import { getAssistantMedia as O, useAssistantTr as
|
|
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
|
|
41
|
+
var ze = {
|
|
42
42
|
general: 18e4,
|
|
43
43
|
assistant: 18e4,
|
|
44
44
|
"api-calls": 18e4,
|
|
45
45
|
"vibe-plugins": 6e5
|
|
46
|
-
},
|
|
47
|
-
function
|
|
46
|
+
}, Be = 18e4, Ve = 2e4;
|
|
47
|
+
function He() {
|
|
48
48
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
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
|
|
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),
|
|
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
|
-
|
|
80
|
+
messageId: r.info?.id,
|
|
81
|
+
...c && l ? { model: `${c}/${l}` } : {},
|
|
82
|
+
...ee ? { pendingWrite: ee } : {}
|
|
81
83
|
};
|
|
82
84
|
}
|
|
83
|
-
function
|
|
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
|
|
92
|
-
let O =
|
|
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
|
-
|
|
95
|
-
|
|
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
|
-
|
|
100
|
+
ft || (!xt || xt.requiresAdmin && !K) && N !== "assistant" && P("assistant");
|
|
99
101
|
}, [
|
|
100
102
|
N,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
xt,
|
|
104
|
+
K,
|
|
105
|
+
ft,
|
|
104
106
|
P
|
|
105
107
|
]);
|
|
106
|
-
let
|
|
107
|
-
z(e, n, t, null), r ?
|
|
108
|
-
}, [z,
|
|
109
|
-
let
|
|
110
|
-
if (
|
|
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
|
|
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
|
|
116
|
+
return q.current.invalidate(e), !1;
|
|
115
117
|
}
|
|
116
118
|
};
|
|
117
|
-
if (
|
|
118
|
-
|
|
119
|
-
let e = await
|
|
120
|
-
e && (V(o, e, "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 (!
|
|
124
|
+
if (!d) {
|
|
123
125
|
if (o === "api-calls" && !j()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
|
|
124
|
-
|
|
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,
|
|
127
|
-
let
|
|
128
|
-
if (
|
|
129
|
-
let e = await ee(A,
|
|
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(
|
|
134
|
+
B(r), p = null;
|
|
133
135
|
}
|
|
134
|
-
return
|
|
135
|
-
sandboxId:
|
|
136
|
-
sessionId:
|
|
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
|
-
|
|
144
|
+
st,
|
|
143
145
|
V,
|
|
144
|
-
|
|
145
|
-
]),
|
|
146
|
-
let ee =
|
|
147
|
-
if (
|
|
148
|
-
let f =
|
|
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
|
-
|
|
151
|
-
let h =
|
|
152
|
+
yt.current[p] = n;
|
|
153
|
+
let h = ne(), g = {
|
|
152
154
|
accessToken: j(),
|
|
153
|
-
workspaceToken:
|
|
154
|
-
userId:
|
|
155
|
-
organizationId:
|
|
156
|
-
},
|
|
157
|
-
id:
|
|
155
|
+
workspaceToken: Ke(),
|
|
156
|
+
userId: qe,
|
|
157
|
+
organizationId: y()
|
|
158
|
+
}, _ = {
|
|
159
|
+
id: He(),
|
|
158
160
|
role: "user",
|
|
159
|
-
content:
|
|
161
|
+
content: t,
|
|
160
162
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
161
163
|
metadata: {
|
|
162
|
-
...
|
|
163
|
-
...
|
|
164
|
+
...n.length ? { attachments: n.map(x) } : {},
|
|
165
|
+
...me(i.voiceSessionId)
|
|
164
166
|
}
|
|
165
167
|
};
|
|
166
|
-
L(p,
|
|
167
|
-
let
|
|
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:
|
|
175
|
-
...
|
|
176
|
+
lang: et,
|
|
177
|
+
...me(i.voiceSessionId)
|
|
176
178
|
}
|
|
177
|
-
}), z(p, "provisioning",
|
|
178
|
-
let
|
|
179
|
-
R(p,
|
|
180
|
-
lang:
|
|
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
|
-
...
|
|
187
|
+
...me(i.voiceSessionId)
|
|
186
188
|
});
|
|
187
189
|
}, b = async (e = 1) => {
|
|
188
|
-
let
|
|
190
|
+
let i = !1;
|
|
189
191
|
try {
|
|
190
|
-
await
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
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
|
|
205
|
-
} catch (
|
|
206
|
-
if (!
|
|
207
|
-
await
|
|
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
|
|
210
|
-
for (; Date.now() <
|
|
211
|
-
if (!
|
|
212
|
-
let
|
|
213
|
-
if (
|
|
214
|
-
...
|
|
215
|
-
content: `${
|
|
216
|
-
}),
|
|
217
|
-
...
|
|
218
|
-
content: `${
|
|
219
|
-
}),
|
|
220
|
-
R(p,
|
|
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
|
|
215
|
+
await s(A, h, l, x.messageId, x.model, x.tokens, g), ye();
|
|
223
216
|
} catch {}
|
|
224
217
|
}
|
|
225
|
-
z(p, "complete",
|
|
218
|
+
z(p, "complete", v, null);
|
|
226
219
|
} catch (t) {
|
|
227
|
-
if (e === 1 &&
|
|
220
|
+
if (e === 1 && Se(t)) return B(p), ct(f), b(2);
|
|
228
221
|
throw t;
|
|
229
222
|
}
|
|
230
|
-
},
|
|
231
|
-
|
|
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 (
|
|
237
|
-
|
|
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",
|
|
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
|
-
...
|
|
236
|
+
...me(i.voiceSessionId)
|
|
244
237
|
});
|
|
245
238
|
} finally {
|
|
246
|
-
|
|
239
|
+
bt.current.delete(S);
|
|
247
240
|
}
|
|
248
241
|
}, [
|
|
249
242
|
M,
|
|
250
243
|
L,
|
|
251
244
|
A,
|
|
252
245
|
B,
|
|
253
|
-
|
|
254
|
-
|
|
246
|
+
ct,
|
|
247
|
+
tt,
|
|
255
248
|
I,
|
|
256
|
-
|
|
249
|
+
St,
|
|
257
250
|
j,
|
|
258
|
-
|
|
251
|
+
Ke,
|
|
259
252
|
R,
|
|
260
|
-
et,
|
|
261
|
-
tt,
|
|
262
253
|
$e,
|
|
263
|
-
|
|
254
|
+
et,
|
|
255
|
+
Qe,
|
|
256
|
+
st,
|
|
264
257
|
F,
|
|
265
258
|
z,
|
|
266
259
|
O,
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
]),
|
|
270
|
-
|
|
271
|
-
}, [
|
|
272
|
-
let e = [...H.chat].reverse().find((e) => e.role === "user"), t = M ?
|
|
273
|
-
e &&
|
|
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
|
-
|
|
269
|
+
Y,
|
|
277
270
|
M
|
|
278
|
-
]),
|
|
271
|
+
]), Tt = E(Y);
|
|
279
272
|
w(() => {
|
|
280
|
-
|
|
281
|
-
}, [
|
|
282
|
-
let
|
|
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" || !
|
|
287
|
-
let n =
|
|
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]),
|
|
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:
|
|
298
|
-
sessionId:
|
|
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]),
|
|
301
|
-
if (
|
|
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
|
-
|
|
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),
|
|
311
|
-
}, [
|
|
312
|
-
|
|
313
|
-
let
|
|
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 =
|
|
317
|
-
|
|
309
|
+
let n = Q.current, r = b(n.attachments);
|
|
310
|
+
Tt.current(e, r, { voiceSessionId: t }), n.clear();
|
|
318
311
|
};
|
|
319
|
-
if (!
|
|
312
|
+
if (!Q.current.isBusy) {
|
|
320
313
|
n();
|
|
321
314
|
return;
|
|
322
315
|
}
|
|
323
316
|
let r = Date.now(), i = window.setInterval(() => {
|
|
324
|
-
|
|
317
|
+
Q.current.isBusy && Date.now() - r < Ve || (window.clearInterval(i), n());
|
|
325
318
|
}, 200);
|
|
326
319
|
}, []),
|
|
327
|
-
latestReply:
|
|
328
|
-
language: f(
|
|
329
|
-
}),
|
|
320
|
+
latestReply: Et,
|
|
321
|
+
language: f(Ye, Je).tag
|
|
322
|
+
}), At = C(() => {
|
|
330
323
|
let t = e.getState().activeConversationId;
|
|
331
|
-
!t ||
|
|
332
|
-
id:
|
|
324
|
+
!t || X.length === 0 || (L(t, {
|
|
325
|
+
id: He(),
|
|
333
326
|
role: "system",
|
|
334
|
-
content:
|
|
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
|
-
}),
|
|
333
|
+
}), vt(!1), $.end());
|
|
341
334
|
}, [
|
|
342
|
-
|
|
335
|
+
X,
|
|
343
336
|
L,
|
|
344
337
|
O
|
|
345
338
|
]);
|
|
346
339
|
w(() => {
|
|
347
|
-
!
|
|
348
|
-
}, [
|
|
349
|
-
|
|
350
|
-
}, [
|
|
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 &&
|
|
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 &&
|
|
348
|
+
t && Tt.current(t);
|
|
356
349
|
}
|
|
357
350
|
});
|
|
358
351
|
}, []);
|
|
359
|
-
let
|
|
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 ?
|
|
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
|
-
|
|
364
|
+
rt,
|
|
372
365
|
F,
|
|
373
366
|
P
|
|
374
|
-
]),
|
|
375
|
-
if (
|
|
376
|
-
|
|
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
|
-
|
|
380
|
-
}, [
|
|
381
|
-
let e =
|
|
382
|
-
|
|
372
|
+
jt(t);
|
|
373
|
+
}, [jt]), Nt = C(() => {
|
|
374
|
+
let e = ht;
|
|
375
|
+
gt(null), lt(), e && jt(e);
|
|
383
376
|
}, [
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
]),
|
|
388
|
-
|
|
377
|
+
ht,
|
|
378
|
+
lt,
|
|
379
|
+
jt
|
|
380
|
+
]), Pt = C(() => {
|
|
381
|
+
gt(null);
|
|
389
382
|
}, []);
|
|
390
|
-
return /* @__PURE__ */
|
|
383
|
+
return /* @__PURE__ */ Fe("div", {
|
|
391
384
|
className: "relative flex flex-1 flex-col overflow-hidden",
|
|
392
385
|
children: [
|
|
393
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ Fe("div", {
|
|
394
387
|
className: "contents",
|
|
395
|
-
inert:
|
|
388
|
+
inert: $.active || void 0,
|
|
396
389
|
children: [
|
|
397
|
-
|
|
398
|
-
count:
|
|
399
|
-
onOpenTranscript: () =>
|
|
390
|
+
X.length > 0 && !$.active ? /* @__PURE__ */ D(_, {
|
|
391
|
+
count: X.length,
|
|
392
|
+
onOpenTranscript: () => vt(!0)
|
|
400
393
|
}) : null,
|
|
401
|
-
|
|
394
|
+
Ot.length === 0 ? /* @__PURE__ */ D(g, {
|
|
402
395
|
mode: N,
|
|
403
|
-
onSuggestionClick:
|
|
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:
|
|
408
|
-
streamingMessageId:
|
|
409
|
-
failedMessageId:
|
|
410
|
-
onRetry:
|
|
400
|
+
messages: Ot,
|
|
401
|
+
streamingMessageId: ut,
|
|
402
|
+
failedMessageId: dt,
|
|
403
|
+
onRetry: wt
|
|
411
404
|
})
|
|
412
405
|
}),
|
|
413
|
-
/* @__PURE__ */ D(
|
|
414
|
-
onStartVoiceSession:
|
|
415
|
-
onSend: (e, t) => void
|
|
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:
|
|
420
|
-
availableModes:
|
|
421
|
-
onModeChange:
|
|
412
|
+
writeAccessDenied: pt === "denied" && !!xt?.writeCapable,
|
|
413
|
+
availableModes: mt,
|
|
414
|
+
onModeChange: Mt
|
|
422
415
|
})
|
|
423
416
|
]
|
|
424
417
|
}),
|
|
425
|
-
|
|
426
|
-
turns:
|
|
427
|
-
onClose: () =>
|
|
428
|
-
onSave:
|
|
418
|
+
_t && !$.active ? /* @__PURE__ */ D(v, {
|
|
419
|
+
turns: X,
|
|
420
|
+
onClose: () => vt(!1),
|
|
421
|
+
onSave: kt
|
|
429
422
|
}) : null,
|
|
430
|
-
|
|
431
|
-
session:
|
|
432
|
-
notice:
|
|
433
|
-
capturing:
|
|
434
|
-
interrupting:
|
|
435
|
-
awaitingEndpoint:
|
|
436
|
-
turns:
|
|
437
|
-
spokenChunks:
|
|
438
|
-
attachments:
|
|
439
|
-
onAttachFiles:
|
|
440
|
-
onRemoveAttachment:
|
|
441
|
-
onRetryAttachment:
|
|
442
|
-
canAttachMore:
|
|
443
|
-
preparingAttachments:
|
|
444
|
-
onSaveTranscript:
|
|
445
|
-
onContinueInChat:
|
|
446
|
-
onInterrupt:
|
|
447
|
-
spoken:
|
|
448
|
-
onToggleMute:
|
|
449
|
-
onEnd:
|
|
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:
|
|
453
|
-
onConfirm:
|
|
454
|
-
onCancel:
|
|
445
|
+
open: ht !== null,
|
|
446
|
+
onConfirm: Nt,
|
|
447
|
+
onCancel: Pt
|
|
455
448
|
})
|
|
456
449
|
]
|
|
457
450
|
});
|
|
458
451
|
};
|
|
459
452
|
//#endregion
|
|
460
|
-
export {
|
|
453
|
+
export { Ke as AssistantChatArea };
|
|
461
454
|
|
|
462
455
|
//# sourceMappingURL=AssistantChatArea.js.map
|