@burdenoff/microfe-healthybowl 2026.903.22 → 2026.904.1
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/AIAssistantPanel.js +25 -21
- package/dist/components/assistant/AIAssistantPanel.js.map +1 -1
- package/dist/components/assistant/AssistantApiCallsConsentDialog.js +8 -8
- package/dist/components/assistant/AssistantApiCallsConsentDialog.js.map +1 -1
- package/dist/components/assistant/AssistantAutoSpeakToggle.js +1 -1
- package/dist/components/assistant/AssistantChatArea.js +252 -251
- package/dist/components/assistant/AssistantChatArea.js.map +1 -1
- package/dist/components/assistant/AssistantConversationList.js +31 -31
- package/dist/components/assistant/AssistantConversationList.js.map +1 -1
- package/dist/components/assistant/AssistantEmptyState.js +9 -9
- package/dist/components/assistant/AssistantEmptyState.js.map +1 -1
- package/dist/components/assistant/AssistantHeader.js +17 -17
- package/dist/components/assistant/AssistantHeader.js.map +1 -1
- package/dist/components/assistant/AssistantMarkdownImage.js +14 -14
- package/dist/components/assistant/AssistantMarkdownImage.js.map +1 -1
- package/dist/components/assistant/AssistantMarkdownRenderer.js +25 -25
- package/dist/components/assistant/AssistantMarkdownRenderer.js.map +1 -1
- package/dist/components/assistant/AssistantMessageAttachments.js +29 -29
- package/dist/components/assistant/AssistantMessageAttachments.js.map +1 -1
- package/dist/components/assistant/AssistantMessageItem.js +28 -28
- package/dist/components/assistant/AssistantMessageItem.js.map +1 -1
- package/dist/components/assistant/AssistantMessageList.js +14 -14
- package/dist/components/assistant/AssistantMessageList.js.map +1 -1
- package/dist/components/assistant/AssistantMoreMenu.js +25 -25
- package/dist/components/assistant/AssistantMoreMenu.js.map +1 -1
- package/dist/components/assistant/AssistantPendingWriteCard.js +8 -8
- package/dist/components/assistant/AssistantPendingWriteCard.js.map +1 -1
- package/dist/components/assistant/AssistantReplyLanguageSelector.js +11 -11
- package/dist/components/assistant/AssistantReplyLanguageSelector.js.map +1 -1
- package/dist/components/assistant/AssistantSpeakButton.js +4 -4
- package/dist/components/assistant/AssistantSpeakButton.js.map +1 -1
- package/dist/components/assistant/AssistantSpeechProvider.js +188 -188
- package/dist/components/assistant/AssistantSpeechProvider.js.map +1 -1
- package/dist/components/assistant/AssistantSpokenTurnsNotice.js +5 -5
- package/dist/components/assistant/AssistantSpokenTurnsNotice.js.map +1 -1
- package/dist/components/assistant/AssistantToolActivity.js +16 -16
- package/dist/components/assistant/AssistantToolActivity.js.map +1 -1
- package/dist/components/assistant/composer/AssistantAttachmentButton.js +20 -20
- package/dist/components/assistant/composer/AssistantAttachmentButton.js.map +1 -1
- package/dist/components/assistant/composer/AssistantAttachmentChips.js +23 -23
- package/dist/components/assistant/composer/AssistantAttachmentChips.js.map +1 -1
- package/dist/components/assistant/composer/AssistantComposer.js +44 -44
- package/dist/components/assistant/composer/AssistantComposer.js.map +1 -1
- package/dist/components/assistant/composer/AssistantLanguageSelector.js +7 -7
- package/dist/components/assistant/composer/AssistantLanguageSelector.js.map +1 -1
- package/dist/components/assistant/composer/AssistantModeSelector.js +28 -28
- package/dist/components/assistant/composer/AssistantModeSelector.js.map +1 -1
- package/dist/components/assistant/composer/AssistantVoiceButton.js +6 -6
- package/dist/components/assistant/composer/AssistantVoiceButton.js.map +1 -1
- package/dist/components/assistant/composer/AssistantVoiceSelector.js +7 -7
- package/dist/components/assistant/composer/AssistantVoiceSelector.js.map +1 -1
- package/dist/components/assistant/voice/AssistantVoiceSession.js +77 -77
- package/dist/components/assistant/voice/AssistantVoiceSession.js.map +1 -1
- package/dist/components/assistant/voice/AssistantVoiceSessionButton.js +6 -6
- package/dist/components/assistant/voice/AssistantVoiceSessionButton.js.map +1 -1
- package/dist/components/assistant/voice/VoiceConversationView.js +11 -11
- package/dist/components/assistant/voice/VoiceConversationView.js.map +1 -1
- package/dist/components/assistant/voice/VoiceTranscriptDrawer.js +13 -13
- package/dist/components/assistant/voice/VoiceTranscriptDrawer.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/hooks/useAssistantAttachments.js +94 -94
- package/dist/hooks/useAssistantAttachments.js.map +1 -1
- package/dist/node_modules/@ungap/structured-clone/esm/deserialize.js +33 -42
- package/dist/node_modules/@ungap/structured-clone/esm/deserialize.js.map +1 -1
- package/dist/node_modules/@ungap/structured-clone/esm/serialize.js +44 -47
- package/dist/node_modules/@ungap/structured-clone/esm/serialize.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 +60 -31
- package/dist/services/assistantApi.js.map +1 -1
- package/dist/utils/attachmentSources.js +4 -4
- package/dist/utils/attachmentSources.js.map +1 -1
- package/dist/utils/pageContext.js +15 -1
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useAssistantStore as e } from "../../store/assistantStore.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useAssistantKeyboardShortcuts as t } from "../../hooks/useAssistantKeyboardShortcuts.js";
|
|
3
|
+
import { PRODUCT as n } from "../../services/assistantApi.js";
|
|
4
4
|
import { useAssistantHeartbeat as r } from "../../hooks/useAssistantHeartbeat.js";
|
|
5
5
|
import { describeCurrentPage as i } from "../../utils/pageContext.js";
|
|
6
6
|
import { AssistantSpeechProvider as a } from "./AssistantSpeechProvider.js";
|
|
@@ -8,53 +8,57 @@ import { AssistantHeader as o } from "./AssistantHeader.js";
|
|
|
8
8
|
import { AssistantChatArea as s } from "./AssistantChatArea.js";
|
|
9
9
|
import { AssistantConversationList as c } from "./AssistantConversationList.js";
|
|
10
10
|
import { useEffect as l, useRef as u, useState as d } from "react";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { AssistantI18nProvider as f, useAssistantTr as p } from "@burdenoff/fe-libs/shared/assistant";
|
|
12
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
13
|
+
import { useFilesServiceWarmup as g } from "@burdenoff/fe-libs/storage";
|
|
13
14
|
//#region src/components/assistant/AIAssistantPanel.tsx
|
|
14
|
-
var
|
|
15
|
-
let b =
|
|
16
|
-
r(D?.backendSessionId ?? null, D?.mode ?? null,
|
|
15
|
+
var _ = 1e3, v = ({ onClose: n, visible: f, docked: v, onToggleDock: y }) => {
|
|
16
|
+
let b = p(), x = u(null), { conversations: S, activeConversationId: C, conversationListOpen: w, toggleConversationList: T, createConversation: E } = e(), D = S.find((e) => e.id === C);
|
|
17
|
+
r(D?.backendSessionId ?? null, D?.mode ?? null, f ?? !0), g(f ?? !0);
|
|
17
18
|
let [O, k] = d(i);
|
|
18
19
|
return l(() => {
|
|
19
|
-
if (
|
|
20
|
+
if (f === !1) return;
|
|
20
21
|
let e = () => k((e) => {
|
|
21
22
|
let t = i();
|
|
22
23
|
return t === e ? e : t;
|
|
23
24
|
});
|
|
24
25
|
e(), window.addEventListener("popstate", e);
|
|
25
|
-
let t = window.setInterval(e,
|
|
26
|
+
let t = window.setInterval(e, _);
|
|
26
27
|
return () => {
|
|
27
28
|
window.removeEventListener("popstate", e), window.clearInterval(t);
|
|
28
29
|
};
|
|
29
|
-
}, [
|
|
30
|
+
}, [f]), t({
|
|
30
31
|
panelRef: x,
|
|
31
|
-
onClose:
|
|
32
|
-
}), /* @__PURE__ */
|
|
33
|
-
visible:
|
|
34
|
-
children: /* @__PURE__ */
|
|
32
|
+
onClose: n
|
|
33
|
+
}), /* @__PURE__ */ m(a, {
|
|
34
|
+
visible: f ?? !0,
|
|
35
|
+
children: /* @__PURE__ */ h("div", {
|
|
35
36
|
ref: x,
|
|
36
37
|
className: "relative flex h-full w-full flex-col bg-bg-surface",
|
|
37
38
|
role: "complementary",
|
|
38
|
-
"aria-label": b("
|
|
39
|
+
"aria-label": b("panel.ariaLabel", "AI Assistant"),
|
|
39
40
|
"data-testid": "ai-assistant-panel",
|
|
40
41
|
tabIndex: -1,
|
|
41
42
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ m(o, {
|
|
43
44
|
contextLabel: O,
|
|
44
45
|
onNewConversation: () => E(),
|
|
45
46
|
onOpenHistory: T,
|
|
46
47
|
historyOpen: w,
|
|
47
|
-
onClose:
|
|
48
|
+
onClose: n,
|
|
48
49
|
docked: v,
|
|
49
50
|
onToggleDock: y
|
|
50
51
|
}),
|
|
51
|
-
w && /* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */
|
|
52
|
+
w && /* @__PURE__ */ m(c, {}),
|
|
53
|
+
/* @__PURE__ */ m(s, { visible: f ?? !0 })
|
|
53
54
|
]
|
|
54
55
|
})
|
|
55
56
|
});
|
|
56
|
-
}
|
|
57
|
+
}, y = (e) => /* @__PURE__ */ m(f, {
|
|
58
|
+
namespace: n,
|
|
59
|
+
children: /* @__PURE__ */ m(v, { ...e })
|
|
60
|
+
});
|
|
57
61
|
//#endregion
|
|
58
|
-
export {
|
|
62
|
+
export { y as AIAssistantPanel };
|
|
59
63
|
|
|
60
64
|
//# sourceMappingURL=AIAssistantPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AIAssistantPanel.js","names":[],"sources":["../../../src/components/assistant/AIAssistantPanel.tsx"],"sourcesContent":["/**\n * AI Assistant Panel — top-level component for the in-page assistant.\n *\n * Layout (v2): a fixed identity header (AssistantHeader) with the brand mark,\n * an availability/context subtitle and icon actions (new conversation, history,\n * export, dock, close), an always-visible transcript, and the composer pinned\n * to the bottom. Conversation history opens as an overlay drawer over the panel\n * — never as an accordion over the transcript.\n *\n * The external prop contract ({ onClose, visible, docked, onToggleDock }) is\n * unchanged; the sandbox/session/transport logic lives in AssistantChatArea.\n */\n\nimport { useEffect, useRef, useState, type FC } from 'react';\nimport type { PanelProps } from '@burdenoff/fe-libs/shared/plugins';\nimport { useFilesServiceWarmup } from '@burdenoff/fe-libs/storage';\nimport { useAssistantStore } from '@/store/assistantStore';\nimport { useAssistantKeyboardShortcuts } from '@/hooks/useAssistantKeyboardShortcuts';\nimport { useAssistantHeartbeat } from '@/hooks/useAssistantHeartbeat';\nimport { describeCurrentPage } from '@/utils/pageContext';\n\n/**\n * How often the header re-reads the current page while the panel is open.\n *\n * Fast enough that the label is right by the time a user looks at it after\n * navigating, slow enough to be free: one `window.location` read and a string\n * compare, and no render unless the page actually changed.\n */\nconst PAGE_LABEL_POLL_MS = 1_000;\nimport { AssistantHeader } from './AssistantHeader';\nimport { AssistantChatArea } from './AssistantChatArea';\nimport { AssistantConversationList } from './AssistantConversationList';\nimport { AssistantSpeechProvider } from './AssistantSpeechProvider';\nimport {
|
|
1
|
+
{"version":3,"file":"AIAssistantPanel.js","names":[],"sources":["../../../src/components/assistant/AIAssistantPanel.tsx"],"sourcesContent":["/**\n * AI Assistant Panel — top-level component for the in-page assistant.\n *\n * Layout (v2): a fixed identity header (AssistantHeader) with the brand mark,\n * an availability/context subtitle and icon actions (new conversation, history,\n * export, dock, close), an always-visible transcript, and the composer pinned\n * to the bottom. Conversation history opens as an overlay drawer over the panel\n * — never as an accordion over the transcript.\n *\n * The external prop contract ({ onClose, visible, docked, onToggleDock }) is\n * unchanged; the sandbox/session/transport logic lives in AssistantChatArea.\n */\n\nimport { useEffect, useRef, useState, type FC } from 'react';\nimport type { PanelProps } from '@burdenoff/fe-libs/shared/plugins';\nimport { useFilesServiceWarmup } from '@burdenoff/fe-libs/storage';\nimport { useAssistantStore } from '@/store/assistantStore';\nimport { useAssistantKeyboardShortcuts } from '@/hooks/useAssistantKeyboardShortcuts';\nimport { useAssistantHeartbeat } from '@/hooks/useAssistantHeartbeat';\nimport { describeCurrentPage } from '@/utils/pageContext';\n\n/**\n * How often the header re-reads the current page while the panel is open.\n *\n * Fast enough that the label is right by the time a user looks at it after\n * navigating, slow enough to be free: one `window.location` read and a string\n * compare, and no render unless the page actually changed.\n */\nconst PAGE_LABEL_POLL_MS = 1_000;\nimport { AssistantHeader } from './AssistantHeader';\nimport { AssistantChatArea } from './AssistantChatArea';\nimport { AssistantConversationList } from './AssistantConversationList';\nimport { AssistantSpeechProvider } from './AssistantSpeechProvider';\nimport { AssistantI18nProvider, useAssistantTr } from '@burdenoff/fe-libs/shared/assistant';\nimport { PRODUCT } from '@/services/assistantApi';\n\nexport type AIAssistantPanelProps = PanelProps & {\n /** When provided, renders a dock/float toggle in the header. */\n docked?: boolean;\n onToggleDock?: () => void;\n};\n\nconst AIAssistantPanelInner: FC<AIAssistantPanelProps> = ({ onClose, visible, docked, onToggleDock }) => {\n const tr = useAssistantTr();\n const panelRef = useRef<HTMLDivElement>(null);\n\n const { conversations, activeConversationId, conversationListOpen, toggleConversationList, createConversation } =\n useAssistantStore();\n\n const activeConversation = conversations.find((c) => c.id === activeConversationId);\n const activeSessionId = activeConversation?.backendSessionId ?? null;\n\n // Keep sandbox alive while panel is open\n useAssistantHeartbeat(activeSessionId, activeConversation?.mode ?? null, visible ?? true);\n\n // Wake wspace-files-svc the moment the panel opens. It runs at minReplicas 0 and\n // needs >=51s to bind its port (prisma migrate deploy 26.0s + boot ~25.5s) against\n // the gateway's 15s budget, so the first attachment after any quiet period would\n // otherwise fail outright. Firing here means the container boots while the user is\n // still typing. Best-effort by construction: single-flighted, rate-limited, and it\n // never surfaces an error — see fe-libs `warmFilesService`.\n useFilesServiceWarmup(visible ?? true);\n\n /**\n * Which page the user is on — LIVE, not as it was when the panel first opened.\n *\n * ★ This was `useMemo(() => describeCurrentPage(), [])`. An empty dependency\n * array on a function that reads `window.location` freezes it at first mount,\n * so the header kept naming the page the user opened the assistant from while\n * they navigated the whole app. The label is the one thing on screen that\n * claims the assistant knows where they are, and it was the one thing that\n * stopped being true the moment they moved.\n *\n * (The context actually SENT to the model was always fresh — `gatherPageContext`\n * runs per turn. Only the visible promise was stale, which is the worse half:\n * the user could not tell.)\n *\n * ★ Not `useLocation()`. This panel is exported for a HOST app to mount, and a\n * consumer that mounts it outside a Router would get a thrown hook rather than\n * a stale label — a much worse failure for a caption. Polling `window.location`\n * is router-agnostic and works for pushState navigation, which `popstate`\n * alone misses entirely (it fires only on back/forward).\n *\n * Cheap by construction: only while the panel is visible, and the state is set\n * only when the string actually changes, so an unchanged page costs one string\n * comparison per tick and no render.\n */\n const [contextLabel, setContextLabel] = useState(describeCurrentPage);\n\n useEffect(() => {\n if (visible === false) return;\n const sync = () =>\n setContextLabel((current) => {\n const next = describeCurrentPage();\n return next === current ? current : next;\n });\n sync();\n window.addEventListener('popstate', sync);\n const timer = window.setInterval(sync, PAGE_LABEL_POLL_MS);\n return () => {\n window.removeEventListener('popstate', sync);\n window.clearInterval(timer);\n };\n }, [visible]);\n\n useAssistantKeyboardShortcuts({\n panelRef,\n onClose,\n });\n\n return (\n // Speech output (BOFF-6290) is provided at the panel root so that hiding the\n // panel — not only unmounting it — stops the voice, and so the header toggle\n // and every message's speak button share one playback state.\n <AssistantSpeechProvider visible={visible ?? true}>\n <div\n ref={panelRef}\n className=\"relative flex h-full w-full flex-col bg-bg-surface\"\n role=\"complementary\"\n aria-label={tr('panel.ariaLabel', 'AI Assistant')}\n data-testid=\"ai-assistant-panel\"\n tabIndex={-1}\n >\n <AssistantHeader\n contextLabel={contextLabel}\n onNewConversation={() => createConversation()}\n onOpenHistory={toggleConversationList}\n historyOpen={conversationListOpen}\n onClose={onClose}\n docked={docked}\n onToggleDock={onToggleDock}\n />\n\n {/* Conversation history overlay drawer (switch between chats) */}\n {conversationListOpen && <AssistantConversationList />}\n\n <AssistantChatArea visible={visible ?? true} />\n </div>\n </AssistantSpeechProvider>\n );\n};\n\n/**\n * The panel, with its translation namespace supplied.\n *\n * ★ The provider has to wrap from OUTSIDE rather than sit inside the returned\n * tree: the panel calls `useAssistantTr()` in its own body, so a provider nested\n * in its JSX would be below the consumer and the namespace would read as null —\n * which does not throw, it just renders English. Every string would silently\n * stop being translated while every test still passed.\n *\n * The namespace is the SAME constant the transport uses for\n * `AI_ASSISTANT_PRODUCT`, so \"which product is this?\" has exactly one answer.\n */\nexport const AIAssistantPanel: FC<AIAssistantPanelProps> = (props) => (\n <AssistantI18nProvider namespace={PRODUCT}>\n <AIAssistantPanelInner {...props} />\n </AssistantI18nProvider>\n);\n"],"mappings":";;;;;;;;;;;;;;AA4BA,IAAM,IAAqB,KAcrB,KAAoD,EAAE,YAAS,YAAS,WAAQ,sBAAmB;CACvG,IAAM,IAAK,EAAe,GACpB,IAAW,EAAuB,IAAI,GAEtC,EAAE,kBAAe,yBAAsB,yBAAsB,2BAAwB,0BACzF,EAAkB,GAEd,IAAqB,EAAc,MAAM,MAAM,EAAE,OAAO,CAAoB;CAYlF,AARA,EAHwB,GAAoB,oBAAoB,MAGzB,GAAoB,QAAQ,MAAM,KAAW,EAAI,GAQxF,EAAsB,KAAW,EAAI;CA0BrC,IAAM,CAAC,GAAc,KAAmB,EAAS,CAAmB;CAuBpE,OArBA,QAAgB;EACd,IAAI,MAAY,IAAO;EACvB,IAAM,UACJ,GAAiB,MAAY;GAC3B,IAAM,IAAO,EAAoB;GACjC,OAAO,MAAS,IAAU,IAAU;EACtC,CAAC;EAEH,AADA,EAAK,GACL,OAAO,iBAAiB,YAAY,CAAI;EACxC,IAAM,IAAQ,OAAO,YAAY,GAAM,CAAkB;EACzD,aAAa;GAEX,AADA,OAAO,oBAAoB,YAAY,CAAI,GAC3C,OAAO,cAAc,CAAK;EAC5B;CACF,GAAG,CAAC,CAAO,CAAC,GAEZ,EAA8B;EAC5B;EACA;CACF,CAAC,GAMC,kBAAC,GAAD;EAAyB,SAAS,KAAW;YAC3C,kBAAC,OAAD;GACE,KAAK;GACL,WAAU;GACV,MAAK;GACL,cAAY,EAAG,mBAAmB,cAAc;GAChD,eAAY;GACZ,UAAU;aANZ;IAQE,kBAAC,GAAD;KACgB;KACd,yBAAyB,EAAmB;KAC5C,eAAe;KACf,aAAa;KACJ;KACD;KACM;IACf,CAAA;IAGA,KAAwB,kBAAC,GAAD,CAA4B,CAAA;IAErD,kBAAC,GAAD,EAAmB,SAAS,KAAW,GAAO,CAAA;GAC3C;;CACkB,CAAA;AAE7B,GAca,KAA+C,MAC1D,kBAAC,GAAD;CAAuB,WAAW;WAChC,kBAAC,GAAD,EAAuB,GAAI,EAAQ,CAAA;AACd,CAAA"}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Modal as e } from "../../healthybowl/components/Modal.js";
|
|
2
|
+
import { useAssistantTr as t } from "@burdenoff/fe-libs/shared/assistant";
|
|
3
3
|
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
4
|
import { Button as a } from "@burdenoff/fe-libs/ui";
|
|
5
5
|
//#region src/components/assistant/AssistantApiCallsConsentDialog.tsx
|
|
6
6
|
var o = ({ open: o, onConfirm: s, onCancel: c }) => {
|
|
7
|
-
let l =
|
|
8
|
-
return /* @__PURE__ */ r(
|
|
7
|
+
let l = t();
|
|
8
|
+
return /* @__PURE__ */ r(e, {
|
|
9
9
|
open: o,
|
|
10
10
|
onClose: c,
|
|
11
11
|
size: "sm",
|
|
12
|
-
title: l("
|
|
12
|
+
title: l("apiCalls.consentTitle", "Switch to Take action mode?"),
|
|
13
13
|
footer: /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r(a, {
|
|
14
14
|
variant: "outline",
|
|
15
15
|
onClick: c,
|
|
16
16
|
"data-testid": "assistant-api-calls-consent-cancel",
|
|
17
|
-
children: l("
|
|
17
|
+
children: l("apiCalls.consentCancel", "Stay in Ask")
|
|
18
18
|
}), /* @__PURE__ */ r(a, {
|
|
19
19
|
variant: "default",
|
|
20
20
|
onClick: s,
|
|
21
21
|
"data-testid": "assistant-api-calls-consent-confirm",
|
|
22
|
-
children: l("
|
|
22
|
+
children: l("apiCalls.consentConfirm", "Enable Take action")
|
|
23
23
|
})] }),
|
|
24
24
|
children: /* @__PURE__ */ i("div", {
|
|
25
25
|
className: "space-y-2 text-sm text-text-secondary",
|
|
26
|
-
children: [/* @__PURE__ */ r("p", { children: l("
|
|
26
|
+
children: [/* @__PURE__ */ r("p", { children: l("apiCalls.consentBody", "In Take action mode the assistant can read AND change your HealthyBowl data — creating crops, logging harvests, updating records, and more, on your behalf.") }), /* @__PURE__ */ r("p", { children: l("apiCalls.consentBody2", "It will describe what it is about to do and ask you to confirm before making a change. Only continue if you want the assistant to take actions for you.") })]
|
|
27
27
|
})
|
|
28
28
|
});
|
|
29
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantApiCallsConsentDialog.js","names":[],"sources":["../../../src/components/assistant/AssistantApiCallsConsentDialog.tsx"],"sourcesContent":["/**\n * One-time consent dialog shown the first time a user switches the assistant\n * into the write-capable `api-calls` (\"Actions\") mode. This is the DEPENDABLE\n * guardrail: the in-sandbox agent executes mutations autonomously, so a host-\n * side acknowledgement (plus the soft describe-and-confirm prompt preamble) is\n * the FE's strongest lever short of an agent-side hard confirm. The ack is\n * persisted per-profile in the assistant store, so this shows once, not on\n * every switch.\n */\n\nimport type { FC } from 'react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { Modal } from '@/healthybowl/components/Modal';\nimport {
|
|
1
|
+
{"version":3,"file":"AssistantApiCallsConsentDialog.js","names":[],"sources":["../../../src/components/assistant/AssistantApiCallsConsentDialog.tsx"],"sourcesContent":["/**\n * One-time consent dialog shown the first time a user switches the assistant\n * into the write-capable `api-calls` (\"Actions\") mode. This is the DEPENDABLE\n * guardrail: the in-sandbox agent executes mutations autonomously, so a host-\n * side acknowledgement (plus the soft describe-and-confirm prompt preamble) is\n * the FE's strongest lever short of an agent-side hard confirm. The ack is\n * persisted per-profile in the assistant store, so this shows once, not on\n * every switch.\n */\n\nimport type { FC } from 'react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { Modal } from '@/healthybowl/components/Modal';\nimport { useAssistantTr } from '@burdenoff/fe-libs/shared/assistant';\n\ninterface Props {\n open: boolean;\n onConfirm: () => void;\n onCancel: () => void;\n}\n\nexport const AssistantApiCallsConsentDialog: FC<Props> = ({ open, onConfirm, onCancel }) => {\n const tr = useAssistantTr();\n\n return (\n <Modal\n open={open}\n onClose={onCancel}\n size=\"sm\"\n title={tr('apiCalls.consentTitle', 'Switch to Take action mode?')}\n footer={\n <>\n <Button variant=\"outline\" onClick={onCancel} data-testid=\"assistant-api-calls-consent-cancel\">\n {tr('apiCalls.consentCancel', 'Stay in Ask')}\n </Button>\n <Button variant=\"default\" onClick={onConfirm} data-testid=\"assistant-api-calls-consent-confirm\">\n {tr('apiCalls.consentConfirm', 'Enable Take action')}\n </Button>\n </>\n }\n >\n <div className=\"space-y-2 text-sm text-text-secondary\">\n <p>\n {tr(\n 'apiCalls.consentBody',\n 'In Take action mode the assistant can read AND change your HealthyBowl data — creating crops, logging harvests, updating records, and more, on your behalf.'\n )}\n </p>\n <p>\n {tr(\n 'apiCalls.consentBody2',\n 'It will describe what it is about to do and ask you to confirm before making a change. Only continue if you want the assistant to take actions for you.'\n )}\n </p>\n </div>\n </Modal>\n );\n};\n"],"mappings":";;;;;AAqBA,IAAa,KAA6C,EAAE,SAAM,cAAW,kBAAe;CAC1F,IAAM,IAAK,EAAe;CAE1B,OACE,kBAAC,GAAD;EACQ;EACN,SAAS;EACT,MAAK;EACL,OAAO,EAAG,yBAAyB,6BAA6B;EAChE,QACE,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;GAAQ,SAAQ;GAAU,SAAS;GAAU,eAAY;aACtD,EAAG,0BAA0B,aAAa;EACrC,CAAA,GACR,kBAAC,GAAD;GAAQ,SAAQ;GAAU,SAAS;GAAW,eAAY;aACvD,EAAG,2BAA2B,oBAAoB;EAC7C,CAAA,CACR,EAAA,CAAA;YAGJ,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,KAAD,EAAA,UACG,EACC,wBACA,6JACF,EACC,CAAA,GACH,kBAAC,KAAD,EAAA,UACG,EACC,yBACA,yJACF,EACC,CAAA,CACA;;CACA,CAAA;AAEX"}
|