@burdenoff/microfe-subscriberbot 2026.1107.8 → 2026.1110.2
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/generated/global-operations.d.ts +4 -2
- package/dist/generated/global-types.d.ts +2 -22
- package/dist/generated/wspace-operations.d.ts +4 -2
- package/dist/generated/wspace-types.d.ts +4 -24
- package/dist/index.d.ts +0 -1
- package/dist/node_modules/clsx/dist/clsx.js +8 -7
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +134 -151
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/stories/Accessibility.stories.d.ts +2 -4
- package/dist/stories/EmptyState.stories.d.ts +0 -2
- package/dist/stories/MetricsCard.stories.d.ts +0 -2
- package/dist/stories/StatusBadge.stories.d.ts +0 -2
- package/dist/stories/pages/AgentDetailPage.stories.d.ts +0 -2
- package/dist/stories/pages/AgentNewPage.stories.d.ts +0 -2
- package/dist/stories/pages/AgentsListPage.stories.d.ts +0 -2
- package/dist/stories/pages/AssetVaultPage.stories.d.ts +0 -2
- package/dist/stories/pages/BankConnectionsPage.stories.d.ts +0 -2
- package/dist/stories/pages/DashboardPage.stories.d.ts +0 -2
- package/dist/stories/pages/DecisionDetailPage.stories.d.ts +0 -2
- package/dist/stories/pages/DecisionsPage.stories.d.ts +0 -2
- package/dist/stories/pages/EnterpriseSpendPage.stories.d.ts +0 -2
- package/dist/stories/pages/InboxPage.stories.d.ts +0 -2
- package/dist/stories/pages/InboxReadState.stories.d.ts +1 -3
- package/dist/stories/pages/InsightsPage.stories.d.ts +0 -2
- package/dist/stories/pages/InvoicesPage.stories.d.ts +0 -2
- package/dist/stories/pages/NegotiationDetailPage.stories.d.ts +0 -2
- package/dist/stories/pages/NegotiationNewPage.stories.d.ts +0 -2
- package/dist/stories/pages/NegotiationsPage.stories.d.ts +0 -2
- package/dist/stories/pages/ProcurementDetailPage.stories.d.ts +0 -2
- package/dist/stories/pages/ProcurementNewPage.stories.d.ts +0 -2
- package/dist/stories/pages/ProcurementPage.stories.d.ts +0 -2
- package/dist/stories/pages/ProviderDetailPage.stories.d.ts +0 -2
- package/dist/stories/pages/ProviderNewPage.stories.d.ts +0 -2
- package/dist/stories/pages/ProvidersListPage.stories.d.ts +0 -2
- package/dist/stories/pages/RelationshipDetailPage.stories.d.ts +0 -2
- package/dist/stories/pages/RelationshipNewPage.stories.d.ts +0 -2
- package/dist/stories/pages/RelationshipsListPage.stories.d.ts +0 -2
- package/dist/stories/pages/RenewalsPage.stories.d.ts +0 -2
- package/dist/stories/pages/SavingsPage.stories.d.ts +0 -2
- package/dist/stories/pages/WorkflowBuilderPage.stories.d.ts +0 -2
- package/dist/stories/pages/WorkflowsPage.stories.d.ts +0 -2
- package/dist/stories/support/PageHarness.d.ts +0 -2
- package/dist/stories/support/bankingFixtures.d.ts +0 -2
- package/dist/stories/support/fixtures.d.ts +0 -2
- package/dist/stories/support/graphqlMock.d.ts +0 -2
- package/dist/stories/support/handlers.d.ts +0 -2
- package/dist/stories/support/negotiationFixtures.d.ts +0 -2
- package/dist/stories/support/phoneViewport.d.ts +0 -2
- package/dist/stories/support/play.d.ts +0 -2
- package/dist/stories/support/procurementFixtures.d.ts +0 -2
- package/dist/subscriberbot/SubscriberBotRoot.d.ts +0 -2
- package/dist/subscriberbot/SubscriberBotRoot.js +10 -7
- package/dist/subscriberbot/SubscriberBotRoot.js.map +1 -1
- package/dist/subscriberbot/SubscriberBotRoutes.d.ts +0 -2
- package/dist/subscriberbot/SubscriberBotRoutes.js +1 -2
- package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.d.ts +0 -2
- package/dist/subscriberbot/admin/AdminDashboardPage.js +9 -10
- package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
- package/dist/subscriberbot/admin/AdminRoot.d.ts +0 -2
- package/dist/subscriberbot/admin/AdminRoot.js +2 -3
- package/dist/subscriberbot/admin/AdminRoot.js.map +1 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts +0 -2
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js +56 -57
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts +0 -2
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js +107 -108
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/index.d.ts +0 -1
- package/dist/subscriberbot/admin/index.js +1 -1
- package/dist/subscriberbot/components/EmptyState.d.ts +0 -2
- package/dist/subscriberbot/components/EmptyState.js +1 -2
- package/dist/subscriberbot/components/EmptyState.js.map +1 -1
- package/dist/subscriberbot/components/MetricsCard.d.ts +0 -2
- package/dist/subscriberbot/components/MetricsCard.js +1 -2
- package/dist/subscriberbot/components/MetricsCard.js.map +1 -1
- package/dist/subscriberbot/components/Modal.d.ts +0 -2
- package/dist/subscriberbot/components/Modal.js +2 -3
- package/dist/subscriberbot/components/Modal.js.map +1 -1
- package/dist/subscriberbot/components/PageLayout.d.ts +0 -2
- package/dist/subscriberbot/components/PageLayout.js +1 -2
- package/dist/subscriberbot/components/PageLayout.js.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.d.ts +1 -3
- package/dist/subscriberbot/components/PostureOptions.js +7 -8
- package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
- package/dist/subscriberbot/components/StateViews.d.ts +0 -2
- package/dist/subscriberbot/components/StateViews.js +1 -2
- package/dist/subscriberbot/components/StateViews.js.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.d.ts +0 -2
- package/dist/subscriberbot/components/StatusBadge.js +2 -3
- package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionBanners.d.ts +0 -2
- package/dist/subscriberbot/components/decisions/DecisionBanners.js +7 -8
- package/dist/subscriberbot/components/decisions/DecisionBanners.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionCard.d.ts +0 -2
- package/dist/subscriberbot/components/decisions/DecisionCard.js +65 -66
- package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
- package/dist/subscriberbot/components/decisions/decisionModel.d.ts +0 -2
- package/dist/subscriberbot/components/decisions/decisionModel.js +2 -3
- package/dist/subscriberbot/components/decisions/decisionModel.js.map +1 -1
- package/dist/subscriberbot/components/decisions/index.d.ts +0 -1
- package/dist/subscriberbot/components/decisions/index.js +4 -3
- package/dist/subscriberbot/components/index.d.ts +0 -1
- package/dist/subscriberbot/components/index.js +8 -7
- package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts +0 -2
- package/dist/subscriberbot/components/mobile/MobileDashboard.js +23 -24
- package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts +0 -2
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +40 -49
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.d.ts +0 -2
- package/dist/subscriberbot/components/mobile/MobileScreen.js +1 -2
- package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.d.ts +0 -2
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js +1 -2
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js.map +1 -1
- package/dist/subscriberbot/components/mobile/index.d.ts +0 -1
- package/dist/subscriberbot/components/mobile/index.js +4 -3
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.d.ts +0 -2
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +1 -2
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts +0 -2
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +4 -5
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts +0 -2
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js +4 -5
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/index.d.ts +0 -1
- package/dist/subscriberbot/components/negotiations/index.js +5 -4
- package/dist/subscriberbot/components/negotiations/labels.d.ts +0 -2
- package/dist/subscriberbot/components/negotiations/labels.js +1 -2
- package/dist/subscriberbot/components/negotiations/labels.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts +0 -2
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +4 -5
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.d.ts +0 -2
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +1 -2
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts +0 -2
- package/dist/subscriberbot/components/procurement/ProcurementThread.js +4 -5
- package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
- package/dist/subscriberbot/components/procurement/index.d.ts +0 -1
- package/dist/subscriberbot/components/procurement/index.js +5 -4
- package/dist/subscriberbot/components/procurement/labels.d.ts +0 -2
- package/dist/subscriberbot/components/procurement/labels.js +1 -2
- package/dist/subscriberbot/components/procurement/labels.js.map +1 -1
- package/dist/subscriberbot/components/savings/SavingsCards.d.ts +0 -2
- package/dist/subscriberbot/components/savings/SavingsCards.js +90 -91
- package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
- package/dist/subscriberbot/components/savings/index.d.ts +0 -1
- package/dist/subscriberbot/components/savings/index.js +3 -2
- package/dist/subscriberbot/components/savings/savingsModel.d.ts +0 -2
- package/dist/subscriberbot/components/savings/savingsModel.js +2 -3
- package/dist/subscriberbot/components/savings/savingsModel.js.map +1 -1
- package/dist/subscriberbot/components/viz.d.ts +0 -2
- package/dist/subscriberbot/components/viz.js +2 -3
- package/dist/subscriberbot/components/viz.js.map +1 -1
- package/dist/subscriberbot/config/assistantUsecases.d.ts +0 -1
- package/dist/subscriberbot/context/SubscriberBotContext.d.ts +0 -2
- package/dist/subscriberbot/context/SubscriberBotContext.js +3 -3
- package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
- package/dist/subscriberbot/context/index.d.ts +0 -1
- package/dist/subscriberbot/context/index.js +1 -1
- package/dist/subscriberbot/hooks/index.d.ts +0 -1
- package/dist/subscriberbot/hooks/index.js +2 -2
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts +0 -2
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js +2 -3
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js.map +1 -1
- package/dist/subscriberbot/hooks/useBankingApi.d.ts +0 -2
- package/dist/subscriberbot/hooks/useBankingApi.js +2 -3
- package/dist/subscriberbot/hooks/useBankingApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useCompactViewport.d.ts +0 -1
- package/dist/subscriberbot/hooks/useCompactViewport.js +1 -2
- package/dist/subscriberbot/hooks/useCompactViewport.js.map +1 -1
- package/dist/subscriberbot/hooks/useFormError.d.ts +0 -1
- package/dist/subscriberbot/hooks/useFormError.js +1 -2
- package/dist/subscriberbot/hooks/useFormError.js.map +1 -1
- package/dist/subscriberbot/hooks/useFormatters.d.ts +0 -1
- package/dist/subscriberbot/hooks/useFormatters.js +1 -2
- package/dist/subscriberbot/hooks/useFormatters.js.map +1 -1
- package/dist/subscriberbot/hooks/useNegotiationApi.d.ts +0 -2
- package/dist/subscriberbot/hooks/useNegotiationApi.js +2 -3
- package/dist/subscriberbot/hooks/useNegotiationApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useProcurementApi.d.ts +0 -2
- package/dist/subscriberbot/hooks/useProcurementApi.js +2 -3
- package/dist/subscriberbot/hooks/useProcurementApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useRouteSelection.d.ts +0 -1
- package/dist/subscriberbot/hooks/useRouteSelection.js +3 -3
- package/dist/subscriberbot/hooks/useRouteSelection.js.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts +0 -2
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +1 -2
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useTr.d.ts +0 -1
- package/dist/subscriberbot/hooks/useTr.js +1 -2
- package/dist/subscriberbot/hooks/useTr.js.map +1 -1
- package/dist/subscriberbot/index.d.ts +0 -1
- package/dist/subscriberbot/index.js +9 -8
- package/dist/subscriberbot/pages/AssetVaultPage.d.ts +0 -2
- package/dist/subscriberbot/pages/AssetVaultPage.js +34 -35
- package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.d.ts +1 -2
- package/dist/subscriberbot/pages/DashboardPage.js +86 -87
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.d.ts +1 -2
- package/dist/subscriberbot/pages/InboxPage.js +194 -199
- package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.d.ts +0 -2
- package/dist/subscriberbot/pages/InsightsPage.js +28 -29
- package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.d.ts +1 -2
- package/dist/subscriberbot/pages/InvoicesPage.js +179 -188
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
- package/dist/subscriberbot/pages/RenewalsPage.d.ts +0 -2
- package/dist/subscriberbot/pages/RenewalsPage.js +293 -298
- package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
- package/dist/subscriberbot/pages/SavingsPage.d.ts +0 -2
- package/dist/subscriberbot/pages/SavingsPage.js +25 -26
- package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts +1 -2
- package/dist/subscriberbot/pages/WorkflowsPage.js +67 -68
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts +1 -2
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +126 -127
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts +1 -2
- package/dist/subscriberbot/pages/agents/AgentNewPage.js +10 -11
- package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts +1 -2
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +23 -24
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts +1 -2
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +337 -359
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/ConnectBankModal.d.ts +1 -3
- package/dist/subscriberbot/pages/banking/ConnectBankModal.js +22 -27
- package/dist/subscriberbot/pages/banking/ConnectBankModal.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts +1 -2
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +25 -26
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts +1 -2
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js +34 -35
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts +1 -2
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +125 -130
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts +1 -2
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +94 -95
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts +1 -2
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +15 -16
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts +1 -2
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +20 -21
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts +1 -2
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +86 -87
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts +1 -2
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +164 -165
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts +1 -2
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js +20 -21
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts +1 -2
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +350 -351
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderInsights.d.ts +2 -3
- package/dist/subscriberbot/pages/providers/ProviderInsights.js +95 -96
- package/dist/subscriberbot/pages/providers/ProviderInsights.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts +1 -2
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +11 -12
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts +1 -2
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +62 -63
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts +1 -2
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +166 -172
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts +1 -2
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +12 -13
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts +1 -2
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +21 -22
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts +1 -3
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +242 -255
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts +0 -2
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +2 -3
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
- package/dist/subscriberbot/services/createSandboxAssistantTransport.d.ts +0 -1
- package/dist/subscriberbot/services/createSandboxAssistantTransport.js +1 -2
- package/dist/subscriberbot/services/createSandboxAssistantTransport.js.map +1 -1
- package/dist/subscriberbot/store/index.d.ts +0 -1
- package/dist/subscriberbot/store/index.js +1 -1
- package/dist/subscriberbot/store/subscriberbotStore.d.ts +1 -3
- package/dist/subscriberbot/store/subscriberbotStore.js +1 -2
- package/dist/subscriberbot/store/subscriberbotStore.js.map +1 -1
- package/dist/subscriberbot/types/assistant.d.ts +0 -2
- package/dist/subscriberbot/types/banking.d.ts +0 -2
- package/dist/subscriberbot/types/index.d.ts +0 -2
- package/dist/subscriberbot/types/negotiation.d.ts +0 -2
- package/dist/subscriberbot/types/procurement.d.ts +0 -1
- package/dist/subscriberbot/utils/bankRedirectLink.d.ts +0 -2
- package/dist/subscriberbot/utils/bankRedirectLink.js +18 -19
- package/dist/subscriberbot/utils/bankRedirectLink.js.map +1 -1
- package/dist/subscriberbot/utils/chartScale.d.ts +0 -1
- package/dist/subscriberbot/utils/chartScale.js +1 -2
- package/dist/subscriberbot/utils/chartScale.js.map +1 -1
- package/dist/subscriberbot/utils/cn.d.ts +0 -2
- package/dist/subscriberbot/utils/cn.js +2 -3
- package/dist/subscriberbot/utils/cn.js.map +1 -1
- package/dist/subscriberbot/utils/formatters.d.ts +0 -1
- package/dist/subscriberbot/utils/formatters.js +4 -5
- package/dist/subscriberbot/utils/formatters.js.map +1 -1
- package/dist/subscriberbot/utils/index.d.ts +0 -1
- package/dist/subscriberbot/utils/navigation.d.ts +0 -1
- package/dist/subscriberbot/utils/navigation.js +1 -2
- package/dist/subscriberbot/utils/navigation.js.map +1 -1
- package/dist/subscriberbot/utils/pageContext.d.ts +0 -1
- package/dist/subscriberbot/utils/pageContext.js +3 -4
- package/dist/subscriberbot/utils/pageContext.js.map +1 -1
- package/dist/subscriberbot/utils/plaidLink.d.ts +0 -1
- package/dist/subscriberbot/utils/plaidLink.js +21 -22
- package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
- package/dist/subscriberbot/utils/portfolio.d.ts +0 -2
- package/dist/subscriberbot/utils/portfolio.js +5 -6
- package/dist/subscriberbot/utils/portfolio.js.map +1 -1
- package/dist/subscriberbot/utils/renewals.d.ts +0 -2
- package/dist/subscriberbot/utils/renewals.js +1 -2
- package/dist/subscriberbot/utils/renewals.js.map +1 -1
- package/package.json +73 -56
- package/dist/generated/global-operations.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/stories/Accessibility.stories.d.ts.map +0 -1
- package/dist/stories/EmptyState.stories.d.ts.map +0 -1
- package/dist/stories/MetricsCard.stories.d.ts.map +0 -1
- package/dist/stories/StatusBadge.stories.d.ts.map +0 -1
- package/dist/stories/pages/AgentDetailPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/AgentNewPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/AgentsListPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/AssetVaultPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/BankConnectionsPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/DashboardPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/DecisionDetailPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/DecisionsPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/EnterpriseSpendPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/InboxPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/InboxReadState.stories.d.ts.map +0 -1
- package/dist/stories/pages/InsightsPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/InvoicesPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/NegotiationDetailPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/NegotiationNewPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/NegotiationsPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/ProcurementDetailPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/ProcurementNewPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/ProcurementPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/ProviderDetailPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/ProviderNewPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/ProvidersListPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/RelationshipDetailPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/RelationshipNewPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/RelationshipsListPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/RenewalsPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/SavingsPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/WorkflowBuilderPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/WorkflowsPage.stories.d.ts.map +0 -1
- package/dist/stories/support/PageHarness.d.ts.map +0 -1
- package/dist/stories/support/bankingFixtures.d.ts.map +0 -1
- package/dist/stories/support/fixtures.d.ts.map +0 -1
- package/dist/stories/support/graphqlMock.d.ts.map +0 -1
- package/dist/stories/support/handlers.d.ts.map +0 -1
- package/dist/stories/support/negotiationFixtures.d.ts.map +0 -1
- package/dist/stories/support/phoneViewport.d.ts.map +0 -1
- package/dist/stories/support/play.d.ts.map +0 -1
- package/dist/stories/support/procurementFixtures.d.ts.map +0 -1
- package/dist/subscriberbot/SubscriberBotRoot.d.ts.map +0 -1
- package/dist/subscriberbot/SubscriberBotRoutes.d.ts.map +0 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.d.ts.map +0 -1
- package/dist/subscriberbot/admin/AdminRoot.d.ts.map +0 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts.map +0 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts.map +0 -1
- package/dist/subscriberbot/admin/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/EmptyState.d.ts.map +0 -1
- package/dist/subscriberbot/components/MetricsCard.d.ts.map +0 -1
- package/dist/subscriberbot/components/Modal.d.ts.map +0 -1
- package/dist/subscriberbot/components/PageLayout.d.ts.map +0 -1
- package/dist/subscriberbot/components/PostureOptions.d.ts.map +0 -1
- package/dist/subscriberbot/components/StateViews.d.ts.map +0 -1
- package/dist/subscriberbot/components/StatusBadge.d.ts.map +0 -1
- package/dist/subscriberbot/components/decisions/DecisionBanners.d.ts.map +0 -1
- package/dist/subscriberbot/components/decisions/DecisionCard.d.ts.map +0 -1
- package/dist/subscriberbot/components/decisions/decisionModel.d.ts.map +0 -1
- package/dist/subscriberbot/components/decisions/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +0 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +0 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.d.ts.map +0 -1
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.d.ts.map +0 -1
- package/dist/subscriberbot/components/mobile/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.d.ts.map +0 -1
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts.map +0 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts.map +0 -1
- package/dist/subscriberbot/components/negotiations/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/negotiations/labels.d.ts.map +0 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts.map +0 -1
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.d.ts.map +0 -1
- package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts.map +0 -1
- package/dist/subscriberbot/components/procurement/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/procurement/labels.d.ts.map +0 -1
- package/dist/subscriberbot/components/savings/SavingsCards.d.ts.map +0 -1
- package/dist/subscriberbot/components/savings/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/savings/savingsModel.d.ts.map +0 -1
- package/dist/subscriberbot/components/viz.d.ts.map +0 -1
- package/dist/subscriberbot/config/assistantUsecases.d.ts.map +0 -1
- package/dist/subscriberbot/context/SubscriberBotContext.d.ts.map +0 -1
- package/dist/subscriberbot/context/index.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/index.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useBankingApi.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useCompactViewport.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useFormError.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useFormatters.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useNegotiationApi.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useProcurementApi.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useRouteSelection.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useTr.d.ts.map +0 -1
- package/dist/subscriberbot/index.d.ts.map +0 -1
- package/dist/subscriberbot/pages/AssetVaultPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/DashboardPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/InboxPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/InsightsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/InvoicesPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/RenewalsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/SavingsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/banking/ConnectBankModal.d.ts.map +0 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/providers/ProviderInsights.d.ts.map +0 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts.map +0 -1
- package/dist/subscriberbot/services/createSandboxAssistantTransport.d.ts.map +0 -1
- package/dist/subscriberbot/store/index.d.ts.map +0 -1
- package/dist/subscriberbot/store/subscriberbotStore.d.ts.map +0 -1
- package/dist/subscriberbot/types/assistant.d.ts.map +0 -1
- package/dist/subscriberbot/types/banking.d.ts.map +0 -1
- package/dist/subscriberbot/types/index.d.ts.map +0 -1
- package/dist/subscriberbot/types/negotiation.d.ts.map +0 -1
- package/dist/subscriberbot/types/procurement.d.ts.map +0 -1
- package/dist/subscriberbot/utils/bankRedirectLink.d.ts.map +0 -1
- package/dist/subscriberbot/utils/chartScale.d.ts.map +0 -1
- package/dist/subscriberbot/utils/cn.d.ts.map +0 -1
- package/dist/subscriberbot/utils/formatters.d.ts.map +0 -1
- package/dist/subscriberbot/utils/index.d.ts.map +0 -1
- package/dist/subscriberbot/utils/navigation.d.ts.map +0 -1
- package/dist/subscriberbot/utils/pageContext.d.ts.map +0 -1
- package/dist/subscriberbot/utils/plaidLink.d.ts.map +0 -1
- package/dist/subscriberbot/utils/portfolio.d.ts.map +0 -1
- package/dist/subscriberbot/utils/renewals.d.ts.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
|
|
3
2
|
export declare const AiDisclaimer: FC<{
|
|
4
3
|
className?: string;
|
|
5
4
|
}>;
|
|
@@ -8,4 +7,3 @@ export declare const DecisionsUnavailableBanner: FC<{
|
|
|
8
7
|
onRetry?: () => void;
|
|
9
8
|
className?: string;
|
|
10
9
|
}>;
|
|
11
|
-
//# sourceMappingURL=DecisionBanners.d.ts.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useTr as e } from "../../hooks/useTr.js";
|
|
2
|
+
import { useSubscriberBot as t } from "../../context/SubscriberBotContext.js";
|
|
3
3
|
import { cn as n } from "../../utils/cn.js";
|
|
4
4
|
import { AlertTriangle as r, Info as i } from "lucide-react";
|
|
5
5
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
|
-
var s = ({ className:
|
|
8
|
-
let r =
|
|
6
|
+
// src/subscriberbot/components/decisions/DecisionBanners.tsx
|
|
7
|
+
var s = ({ className: t }) => {
|
|
8
|
+
let r = e();
|
|
9
9
|
return /* @__PURE__ */ o("div", {
|
|
10
10
|
role: "note",
|
|
11
11
|
"data-testid": "ai-disclaimer",
|
|
12
|
-
className: n("flex items-start gap-2.5 rounded-lg border border-border-subtle bg-bg-sunken px-4 py-2.5 text-xs text-text-secondary",
|
|
12
|
+
className: n("flex items-start gap-2.5 rounded-lg border border-border-subtle bg-bg-sunken px-4 py-2.5 text-xs text-text-secondary", t),
|
|
13
13
|
children: [/* @__PURE__ */ a(i, {
|
|
14
14
|
className: "mt-0.5 h-4 w-4 shrink-0 text-text-secondary",
|
|
15
15
|
"aria-hidden": !0
|
|
@@ -23,7 +23,7 @@ var s = ({ className: e }) => {
|
|
|
23
23
|
] })]
|
|
24
24
|
});
|
|
25
25
|
}, c = ({ message: i, onRetry: s, className: c }) => {
|
|
26
|
-
let l =
|
|
26
|
+
let l = e(), { navigateTo: u } = t();
|
|
27
27
|
return /* @__PURE__ */ o("div", {
|
|
28
28
|
role: "status",
|
|
29
29
|
"data-testid": "decisions-unavailable",
|
|
@@ -56,7 +56,6 @@ var s = ({ className: e }) => {
|
|
|
56
56
|
})]
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
|
-
//#endregion
|
|
60
59
|
export { s as AiDisclaimer, c as DecisionsUnavailableBanner };
|
|
61
60
|
|
|
62
61
|
//# sourceMappingURL=DecisionBanners.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecisionBanners.js","names":[],"sources":["../../../../src/subscriberbot/components/decisions/DecisionBanners.tsx"],"sourcesContent":["/**\n * Decision surface banners\n * @module subscriberbot/components/decisions\n *\n * - {@link AiDisclaimer}: the persistent, non-dismissable notice that every\n * recommendation is machine-generated and may be wrong. It has no close\n * control on purpose and must render on every surface that shows decisions.\n * - {@link DecisionsUnavailableBanner}: shown in place of the decision feed\n * when the decision engine cannot be reached, so the rest of the page (agent\n * and policy management, relationships) keeps working.\n */\n\nimport type { FC } from 'react';\nimport { AlertTriangle, Info } from 'lucide-react';\nimport { useTr } from '../../hooks/useTr';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { cn } from '../../utils/cn';\n\nexport const AiDisclaimer: FC<{ className?: string }> = ({ className }) => {\n const tr = useTr();\n return (\n <div\n role=\"note\"\n data-testid=\"ai-disclaimer\"\n className={cn(\n 'flex items-start gap-2.5 rounded-lg border border-border-subtle bg-bg-sunken px-4 py-2.5 text-xs text-text-secondary',\n className\n )}\n >\n <Info className=\"mt-0.5 h-4 w-4 shrink-0 text-text-secondary\" aria-hidden />\n <p>\n <span className=\"font-medium text-text-primary\">\n {tr('decisions.disclaimer.title', 'AI-generated recommendations.')}\n </span>{' '}\n {tr(\n 'decisions.disclaimer.body',\n 'They are produced automatically from your subscription data and may be wrong. Check the linked source records before you apply one. Nothing changes until you apply it.'\n )}\n </p>\n </div>\n );\n};\n\nexport const DecisionsUnavailableBanner: FC<{\n message?: string;\n onRetry?: () => void;\n className?: string;\n}> = ({ message, onRetry, className }) => {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n return (\n <div\n role=\"status\"\n data-testid=\"decisions-unavailable\"\n className={cn(\n 'flex flex-col gap-3 rounded-lg border border-status-warning-text/30 bg-status-warning-bg-subtle px-4 py-3 text-sm text-status-warning-text sm:flex-row sm:items-center sm:justify-between',\n className\n )}\n >\n <div className=\"flex items-start gap-2.5\">\n <AlertTriangle className=\"mt-0.5 h-4 w-4 shrink-0\" aria-hidden />\n <div>\n <p className=\"font-medium\">\n {tr('decisions.unavailable.title', 'AI recommendations are unavailable right now.')}\n </p>\n <p className=\"mt-0.5 text-xs\">\n {tr(\n 'decisions.unavailable.body',\n 'Agents and policies still work, and every change can be made by hand from the relationship page.'\n )}\n {message ? ` (${message})` : ''}\n </p>\n </div>\n </div>\n <div className=\"flex shrink-0 gap-2\">\n {onRetry && (\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"rounded-lg border border-border-subtle bg-bg-surface px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken\"\n >\n {tr('decisions.unavailable.retry', 'Retry')}\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships')}\n className=\"rounded-lg border border-border-subtle bg-bg-surface px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken\"\n >\n {tr('decisions.unavailable.manual', 'Manage relationships')}\n </button>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;AAkBA,
|
|
1
|
+
{"version":3,"file":"DecisionBanners.js","names":["AiDisclaimer","tr","useTr","cn","className","Info","DecisionsUnavailableBanner","useSubscriberBot","AlertTriangle","message","onRetry","navigateTo"],"sources":["../../../../src/subscriberbot/components/decisions/DecisionBanners.tsx"],"sourcesContent":["/**\n * Decision surface banners\n * @module subscriberbot/components/decisions\n *\n * - {@link AiDisclaimer}: the persistent, non-dismissable notice that every\n * recommendation is machine-generated and may be wrong. It has no close\n * control on purpose and must render on every surface that shows decisions.\n * - {@link DecisionsUnavailableBanner}: shown in place of the decision feed\n * when the decision engine cannot be reached, so the rest of the page (agent\n * and policy management, relationships) keeps working.\n */\n\nimport type { FC } from 'react';\nimport { AlertTriangle, Info } from 'lucide-react';\nimport { useTr } from '../../hooks/useTr';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { cn } from '../../utils/cn';\n\nexport const AiDisclaimer: FC<{ className?: string }> = ({ className }) => {\n const tr = useTr();\n return (\n <div\n role=\"note\"\n data-testid=\"ai-disclaimer\"\n className={cn(\n 'flex items-start gap-2.5 rounded-lg border border-border-subtle bg-bg-sunken px-4 py-2.5 text-xs text-text-secondary',\n className\n )}\n >\n <Info className=\"mt-0.5 h-4 w-4 shrink-0 text-text-secondary\" aria-hidden />\n <p>\n <span className=\"font-medium text-text-primary\">\n {tr('decisions.disclaimer.title', 'AI-generated recommendations.')}\n </span>{' '}\n {tr(\n 'decisions.disclaimer.body',\n 'They are produced automatically from your subscription data and may be wrong. Check the linked source records before you apply one. Nothing changes until you apply it.'\n )}\n </p>\n </div>\n );\n};\n\nexport const DecisionsUnavailableBanner: FC<{\n message?: string;\n onRetry?: () => void;\n className?: string;\n}> = ({ message, onRetry, className }) => {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n return (\n <div\n role=\"status\"\n data-testid=\"decisions-unavailable\"\n className={cn(\n 'flex flex-col gap-3 rounded-lg border border-status-warning-text/30 bg-status-warning-bg-subtle px-4 py-3 text-sm text-status-warning-text sm:flex-row sm:items-center sm:justify-between',\n className\n )}\n >\n <div className=\"flex items-start gap-2.5\">\n <AlertTriangle className=\"mt-0.5 h-4 w-4 shrink-0\" aria-hidden />\n <div>\n <p className=\"font-medium\">\n {tr('decisions.unavailable.title', 'AI recommendations are unavailable right now.')}\n </p>\n <p className=\"mt-0.5 text-xs\">\n {tr(\n 'decisions.unavailable.body',\n 'Agents and policies still work, and every change can be made by hand from the relationship page.'\n )}\n {message ? ` (${message})` : ''}\n </p>\n </div>\n </div>\n <div className=\"flex shrink-0 gap-2\">\n {onRetry && (\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"rounded-lg border border-border-subtle bg-bg-surface px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken\"\n >\n {tr('decisions.unavailable.retry', 'Retry')}\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships')}\n className=\"rounded-lg border border-border-subtle bg-bg-surface px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken\"\n >\n {tr('decisions.unavailable.manual', 'Manage relationships')}\n </button>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;AAkBA,IAAaA,KAA4C,EAAE,mBAAgB;CACzE,IAAMC,IAAKC,EAAM;CACjB,OACE,kBAAC,OAAD;EACE,MAAK;EACL,eAAY;EACZ,WAAWC,EACT,wHACAC,CACF;EANF,UAAA,CAQE,kBAACC,GAAD;GAAM,WAAU;GAA8C,eAAA;EAAa,CAAA,GAC3E,kBAAC,KAAD,EAAA,UAAA;GACE,kBAAC,QAAD;IAAM,WAAU;IACb,UAAAJ,EAAG,8BAA8B,+BAA+B;GAC7D,CAAA;GAAE;GACPA,EACC,6BACA,yKACF;EACC,EAAA,CAAA,CACA;;AAET,GAEaK,KAIP,EAAE,YAAS,YAAS,mBAAgB;CACxC,IAAML,IAAKC,EAAM,GACX,EAAE,kBAAeK,EAAiB;CACxC,OACE,kBAAC,OAAD;EACE,MAAK;EACL,eAAY;EACZ,WAAWJ,EACT,6LACAC,CACF;EANF,UAAA,CAQE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAACI,GAAD;IAAe,WAAU;IAA0B,eAAA;GAAa,CAAA,GAChE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,KAAD;IAAG,WAAU;IACV,UAAAP,EAAG,+BAA+B,+CAA+C;GACjF,CAAA,GACH,kBAAC,KAAD;IAAG,WAAU;IAAb,UAAA,CACGA,EACC,8BACA,kGACF,GACCQ,IAAU,KAAKA,EAAQ,KAAK,EAC5B;GACA,CAAA,CAAA,EAAA,CAAA,CACF;EACL,CAAA,GAAA,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACGC,KACC,kBAAC,UAAD;IACE,MAAK;IACL,SAASA;IACT,WAAU;IAET,UAAAT,EAAG,+BAA+B,OAAO;GACpC,CAAA,GAEV,kBAAC,UAAD;IACE,MAAK;IACL,eAAeU,EAAW,gBAAgB;IAC1C,WAAU;IAET,UAAAV,EAAG,gCAAgC,sBAAsB;GACpD,CAAA,CACL;EACF,CAAA,CAAA;;AAET"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { SubDecision } from '../../types';
|
|
3
|
-
|
|
4
3
|
export declare const ApplyDecisionDialog: FC<{
|
|
5
4
|
decision: SubDecision;
|
|
6
5
|
onClose: () => void;
|
|
@@ -19,4 +18,3 @@ export declare const DecisionCard: FC<{
|
|
|
19
18
|
/** Hide the agent name (e.g. on the agent's own page). */
|
|
20
19
|
hideAgent?: boolean;
|
|
21
20
|
}>;
|
|
22
|
-
//# sourceMappingURL=DecisionCard.d.ts.map
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { useFormatters as e } from "../../hooks/useFormatters.js";
|
|
2
|
+
import { Modal as t } from "../Modal.js";
|
|
3
|
+
import { StatusBadge as n } from "../StatusBadge.js";
|
|
4
|
+
import { useTr as r } from "../../hooks/useTr.js";
|
|
5
|
+
import { useSubscriberBot as i } from "../../context/SubscriberBotContext.js";
|
|
6
|
+
import { useApplyDecision as a, useDismissDecision as o } from "../../hooks/useSubscriberBotApi.js";
|
|
7
|
+
import { cn as s } from "../../utils/cn.js";
|
|
8
8
|
import { DECISION_KIND_LABEL as c, RECOMMENDATION_LABEL as l, confidencePercent as u, evidenceSources as d, isActionable as f, isDestructive as p, relationshipSnapshot as m } from "./decisionModel.js";
|
|
9
9
|
import { useState as h } from "react";
|
|
10
10
|
import { CheckCircle2 as g, ExternalLink as _, Gauge as v, PiggyBank as y, ShieldAlert as b, XCircle as x } from "lucide-react";
|
|
11
11
|
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
12
12
|
import { GlassCard as w } from "@burdenoff/fe-libs/ui";
|
|
13
|
-
|
|
13
|
+
// src/subscriberbot/components/decisions/DecisionCard.tsx
|
|
14
14
|
function T(e, t) {
|
|
15
15
|
return e instanceof Error && e.message ? e.message : t;
|
|
16
16
|
}
|
|
17
|
-
function E(
|
|
18
|
-
let { formatCurrency:
|
|
17
|
+
function E(t) {
|
|
18
|
+
let { formatCurrency: n, formatEnumLabel: r } = e(), i = m(t), a = i.amount === null ? null : `${n(i.amount, i.currency ?? t.currency)}${i.interval ? ` / ${r(i.interval).toLowerCase()}` : ""}`;
|
|
19
19
|
return {
|
|
20
|
-
label: i.label ??
|
|
20
|
+
label: i.label ?? t.relationshipId,
|
|
21
21
|
amount: a
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
var D = ({ decision: e, onClose: n, onApplied: i }) => {
|
|
25
|
-
let
|
|
26
|
-
return /* @__PURE__ */ S(
|
|
27
|
-
title:
|
|
28
|
-
description:
|
|
25
|
+
let o = r(), c = a(), [u, d] = h(!1), [f, m] = h(null), g = p(e.recommendation), _ = E(e), v = l[e.recommendation], y = !c.isPending && (!g || u);
|
|
26
|
+
return /* @__PURE__ */ S(t, {
|
|
27
|
+
title: o("decisions.apply.title", "Apply: {{action}}", { action: o(v.key, v.fallback) }),
|
|
28
|
+
description: o("decisions.apply.description", "This runs the same change you could make by hand on the relationship page."),
|
|
29
29
|
onClose: n,
|
|
30
30
|
children: /* @__PURE__ */ C("div", {
|
|
31
31
|
className: "space-y-4",
|
|
@@ -36,7 +36,7 @@ var D = ({ decision: e, onClose: n, onApplied: i }) => {
|
|
|
36
36
|
children: [
|
|
37
37
|
/* @__PURE__ */ S("p", {
|
|
38
38
|
className: "text-xs text-text-secondary",
|
|
39
|
-
children:
|
|
39
|
+
children: o("decisions.apply.relationship", "Subscription")
|
|
40
40
|
}),
|
|
41
41
|
/* @__PURE__ */ S("p", {
|
|
42
42
|
className: "text-sm font-semibold text-text-primary",
|
|
@@ -62,7 +62,7 @@ var D = ({ decision: e, onClose: n, onApplied: i }) => {
|
|
|
62
62
|
onChange: (e) => d(e.target.checked),
|
|
63
63
|
className: "mt-0.5 size-4 shrink-0 rounded border-border-subtle",
|
|
64
64
|
"data-testid": "confirm-destructive"
|
|
65
|
-
}), /* @__PURE__ */ S("span", { children:
|
|
65
|
+
}), /* @__PURE__ */ S("span", { children: o("decisions.apply.acknowledgeCancel", "I want to cancel \"{{label}}\"{{amount}}. I understand the subscription will stop.", {
|
|
66
66
|
label: _.label,
|
|
67
67
|
amount: _.amount ? ` (${_.amount})` : ""
|
|
68
68
|
}) })]
|
|
@@ -78,7 +78,7 @@ var D = ({ decision: e, onClose: n, onApplied: i }) => {
|
|
|
78
78
|
type: "button",
|
|
79
79
|
onClick: n,
|
|
80
80
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
81
|
-
children:
|
|
81
|
+
children: o("decisions.apply.back", "Not now")
|
|
82
82
|
}), /* @__PURE__ */ S("button", {
|
|
83
83
|
type: "button",
|
|
84
84
|
onClick: () => {
|
|
@@ -86,32 +86,32 @@ var D = ({ decision: e, onClose: n, onApplied: i }) => {
|
|
|
86
86
|
onSuccess: (e) => {
|
|
87
87
|
i?.(e.decision), n();
|
|
88
88
|
},
|
|
89
|
-
onError: (e) => m(T(e,
|
|
89
|
+
onError: (e) => m(T(e, o("decisions.apply.error", "Could not apply this decision.")))
|
|
90
90
|
}));
|
|
91
91
|
},
|
|
92
92
|
disabled: !y,
|
|
93
93
|
"data-testid": "confirm-apply",
|
|
94
|
-
className:
|
|
95
|
-
children: c.isPending ?
|
|
94
|
+
className: s("rounded-lg px-4 py-2 text-sm font-medium hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50", g ? "bg-action-danger-bg text-action-danger-text hover:bg-action-danger-bg-hover" : "bg-action-primary-bg text-action-primary-text"),
|
|
95
|
+
children: c.isPending ? o("decisions.apply.applying", "Applying…") : o("decisions.apply.submit", "Apply")
|
|
96
96
|
})]
|
|
97
97
|
})
|
|
98
98
|
]
|
|
99
99
|
})
|
|
100
100
|
});
|
|
101
101
|
}, O = ({ decision: e, onClose: n }) => {
|
|
102
|
-
let
|
|
103
|
-
return /* @__PURE__ */ S(
|
|
104
|
-
title:
|
|
102
|
+
let i = r(), a = o(), [s, c] = h(""), [l, u] = h(null), d = E(e);
|
|
103
|
+
return /* @__PURE__ */ S(t, {
|
|
104
|
+
title: i("decisions.dismiss.title", "Dismiss recommendation"),
|
|
105
105
|
description: d.label,
|
|
106
106
|
onClose: n,
|
|
107
107
|
children: /* @__PURE__ */ C("form", {
|
|
108
108
|
onSubmit: (t) => {
|
|
109
|
-
t.preventDefault(), u(null),
|
|
109
|
+
t.preventDefault(), u(null), a.mutate({
|
|
110
110
|
id: e.id,
|
|
111
|
-
reason:
|
|
111
|
+
reason: s
|
|
112
112
|
}, {
|
|
113
113
|
onSuccess: () => n(),
|
|
114
|
-
onError: (e) => u(T(e,
|
|
114
|
+
onError: (e) => u(T(e, i("decisions.dismiss.error", "Could not dismiss this decision.")))
|
|
115
115
|
});
|
|
116
116
|
},
|
|
117
117
|
className: "space-y-4",
|
|
@@ -120,14 +120,14 @@ var D = ({ decision: e, onClose: n, onApplied: i }) => {
|
|
|
120
120
|
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
|
|
121
121
|
htmlFor: `dismiss-reason-${e.id}`,
|
|
122
122
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
123
|
-
children:
|
|
123
|
+
children: i("decisions.dismiss.reason", "Reason (optional)")
|
|
124
124
|
}), /* @__PURE__ */ S("textarea", {
|
|
125
125
|
id: `dismiss-reason-${e.id}`,
|
|
126
|
-
value:
|
|
126
|
+
value: s,
|
|
127
127
|
onChange: (e) => c(e.target.value),
|
|
128
128
|
rows: 3,
|
|
129
129
|
maxLength: 500,
|
|
130
|
-
placeholder:
|
|
130
|
+
placeholder: i("decisions.dismiss.placeholder", "e.g. We still use this every week"),
|
|
131
131
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
132
132
|
})] }),
|
|
133
133
|
l && /* @__PURE__ */ S("div", {
|
|
@@ -141,30 +141,30 @@ var D = ({ decision: e, onClose: n, onApplied: i }) => {
|
|
|
141
141
|
type: "button",
|
|
142
142
|
onClick: n,
|
|
143
143
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
144
|
-
children:
|
|
144
|
+
children: i("decisions.dismiss.back", "Back")
|
|
145
145
|
}), /* @__PURE__ */ S("button", {
|
|
146
146
|
type: "submit",
|
|
147
|
-
disabled:
|
|
147
|
+
disabled: a.isPending,
|
|
148
148
|
"data-testid": "confirm-dismiss",
|
|
149
149
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
|
|
150
|
-
children:
|
|
150
|
+
children: a.isPending ? i("decisions.dismiss.dismissing", "Dismissing…") : i("decisions.dismiss.submit", "Dismiss")
|
|
151
151
|
})]
|
|
152
152
|
})
|
|
153
153
|
]
|
|
154
154
|
})
|
|
155
155
|
});
|
|
156
|
-
}, k = ({ decision:
|
|
157
|
-
let
|
|
158
|
-
relationship:
|
|
159
|
-
keptRelationship:
|
|
160
|
-
plan:
|
|
161
|
-
alternativePlan:
|
|
162
|
-
renewalEvent:
|
|
163
|
-
entitlement:
|
|
156
|
+
}, k = ({ decision: e, limit: t }) => {
|
|
157
|
+
let n = r(), { navigateTo: a } = i(), o = d(e), s = t ? o.slice(0, t) : o, c = {
|
|
158
|
+
relationship: n("decisions.sources.relationship", "Subscription"),
|
|
159
|
+
keptRelationship: n("decisions.sources.keptRelationship", "Keep instead"),
|
|
160
|
+
plan: n("decisions.sources.plan", "Current plan"),
|
|
161
|
+
alternativePlan: n("decisions.sources.alternativePlan", "Suggested plan"),
|
|
162
|
+
renewalEvent: n("decisions.sources.renewalEvent", "Renewal event"),
|
|
163
|
+
entitlement: n("decisions.sources.entitlement", "Entitlement usage")
|
|
164
164
|
};
|
|
165
165
|
return /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
|
|
166
166
|
className: "text-[10px] font-medium uppercase tracking-wide text-text-secondary",
|
|
167
|
-
children:
|
|
167
|
+
children: n("decisions.sources.title", "Based on")
|
|
168
168
|
}), /* @__PURE__ */ C("ul", {
|
|
169
169
|
className: "mt-1.5 flex flex-wrap gap-1.5",
|
|
170
170
|
"data-testid": "decision-sources",
|
|
@@ -191,20 +191,20 @@ var D = ({ decision: e, onClose: n, onApplied: i }) => {
|
|
|
191
191
|
"aria-hidden": !0
|
|
192
192
|
})
|
|
193
193
|
]
|
|
194
|
-
}) }, `${e.kind}-${e.id}`)),
|
|
194
|
+
}) }, `${e.kind}-${e.id}`)), t && o.length > t && /* @__PURE__ */ S("li", {
|
|
195
195
|
className: "px-1 py-0.5 text-[11px] text-text-secondary",
|
|
196
|
-
children:
|
|
196
|
+
children: n("decisions.sources.more", "+{{count}} more", { count: o.length - t })
|
|
197
197
|
})]
|
|
198
198
|
})] });
|
|
199
|
-
}, A = ({ decision:
|
|
200
|
-
let { formatCurrency:
|
|
199
|
+
}, A = ({ decision: t, hideAgent: a = !1 }) => {
|
|
200
|
+
let { formatCurrency: o, formatRelativeTime: d } = e(), m = r(), { navigateTo: _ } = i(), [T, A] = h(null), j = c[t.kind], M = l[t.recommendation], N = p(t.recommendation), P = f(t), F = E(t);
|
|
201
201
|
return /* @__PURE__ */ C(w, {
|
|
202
202
|
treatment: "metric",
|
|
203
203
|
className: "flex flex-col gap-3 p-4",
|
|
204
204
|
"data-testid": "decision-card",
|
|
205
|
-
"data-decision-id":
|
|
206
|
-
"data-recommendation":
|
|
207
|
-
"data-status":
|
|
205
|
+
"data-decision-id": t.id,
|
|
206
|
+
"data-recommendation": t.recommendation,
|
|
207
|
+
"data-status": t.status,
|
|
208
208
|
children: [
|
|
209
209
|
/* @__PURE__ */ C("div", {
|
|
210
210
|
className: "flex flex-wrap items-start justify-between gap-2",
|
|
@@ -213,11 +213,11 @@ var D = ({ decision: e, onClose: n, onApplied: i }) => {
|
|
|
213
213
|
children: [
|
|
214
214
|
/* @__PURE__ */ C("p", {
|
|
215
215
|
className: "text-[11px] font-medium uppercase tracking-wide text-text-secondary",
|
|
216
|
-
children: [m(j.key, j.fallback), !
|
|
216
|
+
children: [m(j.key, j.fallback), !a && t.agent ? ` · ${t.agent.name}` : ""]
|
|
217
217
|
}),
|
|
218
218
|
/* @__PURE__ */ C("button", {
|
|
219
219
|
type: "button",
|
|
220
|
-
onClick: () => _(`/decisions/${
|
|
220
|
+
onClick: () => _(`/decisions/${t.id}`),
|
|
221
221
|
className: "mt-0.5 flex items-center gap-1.5 text-start text-sm font-semibold text-text-primary hover:underline",
|
|
222
222
|
children: [
|
|
223
223
|
N && /* @__PURE__ */ S(b, {
|
|
@@ -234,11 +234,11 @@ var D = ({ decision: e, onClose: n, onApplied: i }) => {
|
|
|
234
234
|
children: F.amount
|
|
235
235
|
})
|
|
236
236
|
]
|
|
237
|
-
}), /* @__PURE__ */ S(
|
|
237
|
+
}), /* @__PURE__ */ S(n, { status: t.status })]
|
|
238
238
|
}),
|
|
239
239
|
/* @__PURE__ */ S("p", {
|
|
240
240
|
className: "text-sm text-text-secondary",
|
|
241
|
-
children:
|
|
241
|
+
children: t.rationale
|
|
242
242
|
}),
|
|
243
243
|
/* @__PURE__ */ C("div", {
|
|
244
244
|
className: "flex flex-wrap gap-2 text-xs",
|
|
@@ -248,37 +248,37 @@ var D = ({ decision: e, onClose: n, onApplied: i }) => {
|
|
|
248
248
|
children: [/* @__PURE__ */ S(v, {
|
|
249
249
|
className: "h-3.5 w-3.5",
|
|
250
250
|
"aria-hidden": !0
|
|
251
|
-
}), m("decisions.card.confidence", "Confidence {{pct}}%", { pct: u(
|
|
251
|
+
}), m("decisions.card.confidence", "Confidence {{pct}}%", { pct: u(t.confidence) })]
|
|
252
252
|
}),
|
|
253
|
-
|
|
253
|
+
t.estimatedSavings > 0 && /* @__PURE__ */ C("span", {
|
|
254
254
|
className: "inline-flex items-center gap-1.5 rounded-md bg-status-success-bg-subtle px-2 py-0.5 font-medium text-status-success-text tabular-nums",
|
|
255
255
|
children: [/* @__PURE__ */ S(y, {
|
|
256
256
|
className: "h-3.5 w-3.5",
|
|
257
257
|
"aria-hidden": !0
|
|
258
|
-
}), m("decisions.card.savings", "Saves {{amount}} a year", { amount:
|
|
258
|
+
}), m("decisions.card.savings", "Saves {{amount}} a year", { amount: o(t.estimatedSavings, t.currency) })]
|
|
259
259
|
}),
|
|
260
260
|
/* @__PURE__ */ S("span", {
|
|
261
261
|
className: "inline-flex items-center rounded-md bg-bg-sunken px-2 py-0.5 text-text-secondary",
|
|
262
|
-
children: d(
|
|
262
|
+
children: d(t.createdAt)
|
|
263
263
|
})
|
|
264
264
|
]
|
|
265
265
|
}),
|
|
266
266
|
/* @__PURE__ */ S(k, {
|
|
267
|
-
decision:
|
|
267
|
+
decision: t,
|
|
268
268
|
limit: 4
|
|
269
269
|
}),
|
|
270
|
-
|
|
270
|
+
t.status === "FLAGGED" && t.validationErrors.length > 0 && /* @__PURE__ */ C("p", {
|
|
271
271
|
className: "rounded-md bg-status-warning-bg-subtle px-3 py-2 text-xs text-status-warning-text",
|
|
272
272
|
children: [
|
|
273
273
|
m("decisions.card.flagged", "Held back: failed validation"),
|
|
274
274
|
" —",
|
|
275
275
|
" ",
|
|
276
|
-
|
|
276
|
+
t.validationErrors.join("; ")
|
|
277
277
|
]
|
|
278
278
|
}),
|
|
279
|
-
|
|
279
|
+
t.status === "DISMISSED" && t.dismissedReason && /* @__PURE__ */ S("p", {
|
|
280
280
|
className: "text-xs text-text-secondary",
|
|
281
|
-
children: m("decisions.card.dismissedReason", "Dismissed: {{reason}}", { reason:
|
|
281
|
+
children: m("decisions.card.dismissedReason", "Dismissed: {{reason}}", { reason: t.dismissedReason })
|
|
282
282
|
}),
|
|
283
283
|
P && /* @__PURE__ */ C("div", {
|
|
284
284
|
className: "flex flex-wrap justify-end gap-2 border-t border-border-subtle pt-3",
|
|
@@ -295,7 +295,7 @@ var D = ({ decision: e, onClose: n, onApplied: i }) => {
|
|
|
295
295
|
type: "button",
|
|
296
296
|
onClick: () => A("apply"),
|
|
297
297
|
"data-testid": "apply-decision",
|
|
298
|
-
className:
|
|
298
|
+
className: s("inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium hover:opacity-90", N ? "border border-status-error-text/40 bg-status-error-bg-subtle text-status-error-text" : "bg-action-primary-bg text-action-primary-text"),
|
|
299
299
|
children: [/* @__PURE__ */ S(g, {
|
|
300
300
|
className: "h-3.5 w-3.5",
|
|
301
301
|
"aria-hidden": !0
|
|
@@ -303,17 +303,16 @@ var D = ({ decision: e, onClose: n, onApplied: i }) => {
|
|
|
303
303
|
})]
|
|
304
304
|
}),
|
|
305
305
|
T === "apply" && /* @__PURE__ */ S(D, {
|
|
306
|
-
decision:
|
|
306
|
+
decision: t,
|
|
307
307
|
onClose: () => A(null)
|
|
308
308
|
}),
|
|
309
309
|
T === "dismiss" && /* @__PURE__ */ S(O, {
|
|
310
|
-
decision:
|
|
310
|
+
decision: t,
|
|
311
311
|
onClose: () => A(null)
|
|
312
312
|
})
|
|
313
313
|
]
|
|
314
314
|
});
|
|
315
315
|
};
|
|
316
|
-
//#endregion
|
|
317
316
|
export { D as ApplyDecisionDialog, A as DecisionCard, k as DecisionSources, O as DismissDecisionDialog };
|
|
318
317
|
|
|
319
318
|
//# sourceMappingURL=DecisionCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecisionCard.js","names":[],"sources":["../../../../src/subscriberbot/components/decisions/DecisionCard.tsx"],"sourcesContent":["import { useFormatters } from '../../hooks/useFormatters';\n/**\n * Decision card + apply / dismiss dialogs\n * @module subscriberbot/components/decisions\n *\n * Renders one `SubDecision` from the decision engine: the recommendation, the\n * rationale, confidence, estimated annual saving, the relationship it concerns\n * and the source rows it reasoned over. Apply and dismiss go through\n * `subApplyDecision` / `subDismissDecision`.\n *\n * Apply always opens a confirmation dialog that names the relationship and its\n * amount. For a destructive recommendation (cancel) the Apply button stays\n * disabled until the user ticks an acknowledgement that names the same\n * relationship and amount, so a cancellation can never happen on a misclick.\n */\n\nimport { useState, type FC } from 'react';\nimport { CheckCircle2, ExternalLink, Gauge, PiggyBank, ShieldAlert, XCircle } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { Modal } from '../Modal';\nimport { StatusBadge } from '../StatusBadge';\nimport { useTr } from '../../hooks/useTr';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { useApplyDecision, useDismissDecision } from '../../hooks/useSubscriberBotApi';\n\nimport { cn } from '../../utils/cn';\nimport type { SubDecision } from '../../types';\nimport {\n DECISION_KIND_LABEL,\n RECOMMENDATION_LABEL,\n confidencePercent,\n evidenceSources,\n isActionable,\n isDestructive,\n relationshipSnapshot,\n} from './decisionModel';\n\nfunction errorText(err: unknown, fallback: string): string {\n return err instanceof Error && err.message ? err.message : fallback;\n}\n\n/** \"Netflix Premium · 15.49 USD / monthly\" — the identity a confirmation must name. */\nfunction useRelationshipIdentity(decision: SubDecision): { label: string; amount: string | null } {\n const { formatCurrency, formatEnumLabel } = useFormatters();\n\n const snap = relationshipSnapshot(decision);\n const amount =\n snap.amount !== null\n ? `${formatCurrency(snap.amount, snap.currency ?? decision.currency)}${snap.interval ? ` / ${formatEnumLabel(snap.interval).toLowerCase()}` : ''}`\n : null;\n return { label: snap.label ?? decision.relationshipId, amount };\n}\n\n// ---------------------------------------------------------------------------\n// Apply confirmation\n// ---------------------------------------------------------------------------\n\nexport const ApplyDecisionDialog: FC<{\n decision: SubDecision;\n onClose: () => void;\n onApplied?: (decision: SubDecision) => void;\n}> = ({ decision, onClose, onApplied }) => {\n const tr = useTr();\n const apply = useApplyDecision();\n const [acknowledged, setAcknowledged] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const destructive = isDestructive(decision.recommendation);\n const identity = useRelationshipIdentity(decision);\n const rec = RECOMMENDATION_LABEL[decision.recommendation];\n const canSubmit = !apply.isPending && (!destructive || acknowledged);\n\n const submit = () => {\n if (!canSubmit) return;\n setError(null);\n apply.mutate(decision.id, {\n onSuccess: (result) => {\n onApplied?.(result.decision);\n onClose();\n },\n onError: (err) =>\n setError(errorText(err, tr('decisions.apply.error', 'Could not apply this decision.'))),\n });\n };\n\n return (\n <Modal\n title={tr('decisions.apply.title', 'Apply: {{action}}', {\n action: tr(rec.key, rec.fallback),\n })}\n description={tr(\n 'decisions.apply.description',\n 'This runs the same change you could make by hand on the relationship page.'\n )}\n onClose={onClose}\n >\n <div className=\"space-y-4\" data-testid=\"apply-decision-dialog\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-sunken px-4 py-3\">\n <p className=\"text-xs text-text-secondary\">\n {tr('decisions.apply.relationship', 'Subscription')}\n </p>\n <p className=\"text-sm font-semibold text-text-primary\" data-testid=\"confirm-label\">\n {identity.label}\n </p>\n {identity.amount && (\n <p className=\"text-sm tabular-nums text-text-primary\" data-testid=\"confirm-amount\">\n {identity.amount}\n </p>\n )}\n </div>\n <p className=\"text-sm text-text-secondary\">{decision.rationale}</p>\n\n {destructive && (\n <label className=\"flex items-start gap-2.5 rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text\">\n <input\n type=\"checkbox\"\n checked={acknowledged}\n onChange={(e) => setAcknowledged(e.target.checked)}\n className=\"mt-0.5 size-4 shrink-0 rounded border-border-subtle\"\n data-testid=\"confirm-destructive\"\n />\n <span>\n {tr(\n 'decisions.apply.acknowledgeCancel',\n 'I want to cancel \"{{label}}\"{{amount}}. I understand the subscription will stop.',\n {\n label: identity.label,\n amount: identity.amount ? ` (${identity.amount})` : '',\n }\n )}\n </span>\n </label>\n )}\n\n {error && (\n <div\n role=\"alert\"\n className=\"rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text\"\n >\n {error}\n </div>\n )}\n\n <div className=\"flex justify-end gap-3\">\n <button\n type=\"button\"\n onClick={onClose}\n className=\"rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n {tr('decisions.apply.back', 'Not now')}\n </button>\n <button\n type=\"button\"\n onClick={submit}\n disabled={!canSubmit}\n data-testid=\"confirm-apply\"\n className={cn(\n 'rounded-lg px-4 py-2 text-sm font-medium hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50',\n destructive\n ? 'bg-action-danger-bg text-action-danger-text hover:bg-action-danger-bg-hover'\n : 'bg-action-primary-bg text-action-primary-text'\n )}\n >\n {apply.isPending\n ? tr('decisions.apply.applying', 'Applying…')\n : tr('decisions.apply.submit', 'Apply')}\n </button>\n </div>\n </div>\n </Modal>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Dismiss\n// ---------------------------------------------------------------------------\n\nexport const DismissDecisionDialog: FC<{ decision: SubDecision; onClose: () => void }> = ({\n decision,\n onClose,\n}) => {\n const tr = useTr();\n const dismiss = useDismissDecision();\n const [reason, setReason] = useState('');\n const [error, setError] = useState<string | null>(null);\n const identity = useRelationshipIdentity(decision);\n\n const submit = (e: React.FormEvent) => {\n e.preventDefault();\n setError(null);\n dismiss.mutate(\n { id: decision.id, reason },\n {\n onSuccess: () => onClose(),\n onError: (err) =>\n setError(\n errorText(err, tr('decisions.dismiss.error', 'Could not dismiss this decision.'))\n ),\n }\n );\n };\n\n return (\n <Modal\n title={tr('decisions.dismiss.title', 'Dismiss recommendation')}\n description={identity.label}\n onClose={onClose}\n >\n <form onSubmit={submit} className=\"space-y-4\" data-testid=\"dismiss-decision-dialog\">\n <div>\n <label\n htmlFor={`dismiss-reason-${decision.id}`}\n className=\"mb-1 block text-xs font-medium text-text-secondary\"\n >\n {tr('decisions.dismiss.reason', 'Reason (optional)')}\n </label>\n <textarea\n id={`dismiss-reason-${decision.id}`}\n value={reason}\n onChange={(e) => setReason(e.target.value)}\n rows={3}\n maxLength={500}\n placeholder={tr('decisions.dismiss.placeholder', 'e.g. We still use this every week')}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n {error && (\n <div\n role=\"alert\"\n className=\"rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text\"\n >\n {error}\n </div>\n )}\n <div className=\"flex justify-end gap-3\">\n <button\n type=\"button\"\n onClick={onClose}\n className=\"rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n {tr('decisions.dismiss.back', 'Back')}\n </button>\n <button\n type=\"submit\"\n disabled={dismiss.isPending}\n data-testid=\"confirm-dismiss\"\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50\"\n >\n {dismiss.isPending\n ? tr('decisions.dismiss.dismissing', 'Dismissing…')\n : tr('decisions.dismiss.submit', 'Dismiss')}\n </button>\n </div>\n </form>\n </Modal>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Source rows\n// ---------------------------------------------------------------------------\n\nexport const DecisionSources: FC<{ decision: SubDecision; limit?: number }> = ({\n decision,\n limit,\n}) => {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const all = evidenceSources(decision);\n const shown = limit ? all.slice(0, limit) : all;\n const kindLabel: Record<string, string> = {\n relationship: tr('decisions.sources.relationship', 'Subscription'),\n keptRelationship: tr('decisions.sources.keptRelationship', 'Keep instead'),\n plan: tr('decisions.sources.plan', 'Current plan'),\n alternativePlan: tr('decisions.sources.alternativePlan', 'Suggested plan'),\n renewalEvent: tr('decisions.sources.renewalEvent', 'Renewal event'),\n entitlement: tr('decisions.sources.entitlement', 'Entitlement usage'),\n };\n return (\n <div>\n <p className=\"text-[10px] font-medium uppercase tracking-wide text-text-secondary\">\n {tr('decisions.sources.title', 'Based on')}\n </p>\n <ul className=\"mt-1.5 flex flex-wrap gap-1.5\" data-testid=\"decision-sources\">\n {shown.map((source) => (\n <li key={`${source.kind}-${source.id}`}>\n <button\n type=\"button\"\n onClick={() => navigateTo(source.path)}\n data-source-kind={source.kind}\n className=\"inline-flex max-w-full items-center gap-1.5 rounded-md border border-border-subtle bg-bg-sunken px-2 py-0.5 text-start text-[11px] text-text-secondary hover:text-text-primary\"\n >\n <span className=\"font-medium text-text-primary\">{kindLabel[source.kind]}</span>\n <span className=\"truncate\">{source.title}</span>\n {source.detail && <span className=\"tabular-nums\">{source.detail}</span>}\n <ExternalLink className=\"h-3 w-3 shrink-0\" aria-hidden />\n </button>\n </li>\n ))}\n {limit && all.length > limit && (\n <li className=\"px-1 py-0.5 text-[11px] text-text-secondary\">\n {tr('decisions.sources.more', '+{{count}} more', { count: all.length - limit })}\n </li>\n )}\n </ul>\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Card\n// ---------------------------------------------------------------------------\n\nexport const DecisionCard: FC<{\n decision: SubDecision;\n /** Hide the agent name (e.g. on the agent's own page). */\n hideAgent?: boolean;\n}> = ({ decision, hideAgent = false }) => {\n const { formatCurrency, formatRelativeTime } = useFormatters();\n\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const [dialog, setDialog] = useState<'apply' | 'dismiss' | null>(null);\n const kind = DECISION_KIND_LABEL[decision.kind];\n const rec = RECOMMENDATION_LABEL[decision.recommendation];\n const destructive = isDestructive(decision.recommendation);\n const actionable = isActionable(decision);\n const identity = useRelationshipIdentity(decision);\n\n return (\n <GlassCard\n treatment=\"metric\"\n className=\"flex flex-col gap-3 p-4\"\n data-testid=\"decision-card\"\n data-decision-id={decision.id}\n data-recommendation={decision.recommendation}\n data-status={decision.status}\n >\n <div className=\"flex flex-wrap items-start justify-between gap-2\">\n <div className=\"min-w-0\">\n <p className=\"text-[11px] font-medium uppercase tracking-wide text-text-secondary\">\n {tr(kind.key, kind.fallback)}\n {!hideAgent && decision.agent ? ` · ${decision.agent.name}` : ''}\n </p>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/decisions/${decision.id}`)}\n className=\"mt-0.5 flex items-center gap-1.5 text-start text-sm font-semibold text-text-primary hover:underline\"\n >\n {destructive && (\n <ShieldAlert className=\"h-4 w-4 shrink-0 text-status-error-text\" aria-hidden />\n )}\n {tr(rec.key, rec.fallback)}: {identity.label}\n </button>\n {identity.amount && (\n <p className=\"text-xs tabular-nums text-text-secondary\">{identity.amount}</p>\n )}\n </div>\n <StatusBadge status={decision.status} />\n </div>\n\n <p className=\"text-sm text-text-secondary\">{decision.rationale}</p>\n\n <div className=\"flex flex-wrap gap-2 text-xs\">\n <span className=\"inline-flex items-center gap-1.5 rounded-md bg-bg-sunken px-2 py-0.5 text-text-secondary\">\n <Gauge className=\"h-3.5 w-3.5\" aria-hidden />\n {tr('decisions.card.confidence', 'Confidence {{pct}}%', {\n pct: confidencePercent(decision.confidence),\n })}\n </span>\n {decision.estimatedSavings > 0 && (\n <span className=\"inline-flex items-center gap-1.5 rounded-md bg-status-success-bg-subtle px-2 py-0.5 font-medium text-status-success-text tabular-nums\">\n <PiggyBank className=\"h-3.5 w-3.5\" aria-hidden />\n {tr('decisions.card.savings', 'Saves {{amount}} a year', {\n amount: formatCurrency(decision.estimatedSavings, decision.currency),\n })}\n </span>\n )}\n <span className=\"inline-flex items-center rounded-md bg-bg-sunken px-2 py-0.5 text-text-secondary\">\n {formatRelativeTime(decision.createdAt)}\n </span>\n </div>\n\n <DecisionSources decision={decision} limit={4} />\n\n {decision.status === 'FLAGGED' && decision.validationErrors.length > 0 && (\n <p className=\"rounded-md bg-status-warning-bg-subtle px-3 py-2 text-xs text-status-warning-text\">\n {tr('decisions.card.flagged', 'Held back: failed validation')} —{' '}\n {decision.validationErrors.join('; ')}\n </p>\n )}\n {decision.status === 'DISMISSED' && decision.dismissedReason && (\n <p className=\"text-xs text-text-secondary\">\n {tr('decisions.card.dismissedReason', 'Dismissed: {{reason}}', {\n reason: decision.dismissedReason,\n })}\n </p>\n )}\n\n {actionable && (\n <div className=\"flex flex-wrap justify-end gap-2 border-t border-border-subtle pt-3\">\n <button\n type=\"button\"\n onClick={() => setDialog('dismiss')}\n data-testid=\"dismiss-decision\"\n className=\"inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken\"\n >\n <XCircle className=\"h-3.5 w-3.5\" aria-hidden />\n {tr('decisions.card.dismiss', 'Dismiss')}\n </button>\n <button\n type=\"button\"\n onClick={() => setDialog('apply')}\n data-testid=\"apply-decision\"\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium hover:opacity-90',\n destructive\n ? 'border border-status-error-text/40 bg-status-error-bg-subtle text-status-error-text'\n : 'bg-action-primary-bg text-action-primary-text'\n )}\n >\n <CheckCircle2 className=\"h-3.5 w-3.5\" aria-hidden />\n {tr('decisions.card.apply', 'Review and apply')}\n </button>\n </div>\n )}\n\n {dialog === 'apply' && (\n <ApplyDecisionDialog decision={decision} onClose={() => setDialog(null)} />\n )}\n {dialog === 'dismiss' && (\n <DismissDecisionDialog decision={decision} onClose={() => setDialog(null)} />\n )}\n </GlassCard>\n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0B,8BAA8B;KAAE;KAAG;KAChE,EAAS,iBAAiB,KAAK,IAAI;IACnC;;GAEJ,EAAS,WAAW,eAAe,EAAS,mBAC3C,kBAAC,KAAD;IAAG,WAAU;cACV,EAAG,kCAAkC,yBAAyB,EAC7D,QAAQ,EAAS,gBACnB,CAAC;GACA,CAAA;GAGJ,KACC,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,UAAD;KACE,MAAK;KACL,eAAe,EAAU,SAAS;KAClC,eAAY;KACZ,WAAU;eAJZ,CAME,kBAAC,GAAD;MAAS,WAAU;MAAc,eAAA;KAAa,CAAA,GAC7C,EAAG,0BAA0B,SAAS,CACjC;QACR,kBAAC,UAAD;KACE,MAAK;KACL,eAAe,EAAU,OAAO;KAChC,eAAY;KACZ,WAAW,EACT,gGACA,IACI,wFACA,+CACN;eATF,CAWE,kBAAC,GAAD;MAAc,WAAU;MAAc,eAAA;KAAa,CAAA,GAClD,EAAG,wBAAwB,kBAAkB,CACxC;MACL;;GAGN,MAAW,WACV,kBAAC,GAAD;IAA+B;IAAU,eAAe,EAAU,IAAI;GAAI,CAAA;GAE3E,MAAW,aACV,kBAAC,GAAD;IAAiC;IAAU,eAAe,EAAU,IAAI;GAAI,CAAA;EAErE;;AAEf"}
|
|
1
|
+
{"version":3,"file":"DecisionCard.js","names":["errorText","err","fallback","useRelationshipIdentity","useFormatters","snap","relationshipSnapshot","decision","amount","formatCurrency","formatEnumLabel","ApplyDecisionDialog","tr","useTr","apply","useApplyDecision","acknowledged","setAcknowledged","useState","error","setError","destructive","isDestructive","identity","rec","RECOMMENDATION_LABEL","canSubmit","Modal","onClose","onApplied","result","cn","DismissDecisionDialog","dismiss","useDismissDecision","reason","setReason","e","DecisionSources","useSubscriberBot","all","evidenceSources","shown","limit","kindLabel","navigateTo","source","ExternalLink","DecisionCard","dialog","setDialog","kind","DECISION_KIND_LABEL","actionable","isActionable","GlassCard","hideAgent","ShieldAlert","StatusBadge","Gauge","confidencePercent","PiggyBank","formatRelativeTime","XCircle","CheckCircle2"],"sources":["../../../../src/subscriberbot/components/decisions/DecisionCard.tsx"],"sourcesContent":["import { useFormatters } from '../../hooks/useFormatters';\n/**\n * Decision card + apply / dismiss dialogs\n * @module subscriberbot/components/decisions\n *\n * Renders one `SubDecision` from the decision engine: the recommendation, the\n * rationale, confidence, estimated annual saving, the relationship it concerns\n * and the source rows it reasoned over. Apply and dismiss go through\n * `subApplyDecision` / `subDismissDecision`.\n *\n * Apply always opens a confirmation dialog that names the relationship and its\n * amount. For a destructive recommendation (cancel) the Apply button stays\n * disabled until the user ticks an acknowledgement that names the same\n * relationship and amount, so a cancellation can never happen on a misclick.\n */\n\nimport { useState, type FC } from 'react';\nimport { CheckCircle2, ExternalLink, Gauge, PiggyBank, ShieldAlert, XCircle } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { Modal } from '../Modal';\nimport { StatusBadge } from '../StatusBadge';\nimport { useTr } from '../../hooks/useTr';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { useApplyDecision, useDismissDecision } from '../../hooks/useSubscriberBotApi';\n\nimport { cn } from '../../utils/cn';\nimport type { SubDecision } from '../../types';\nimport {\n DECISION_KIND_LABEL,\n RECOMMENDATION_LABEL,\n confidencePercent,\n evidenceSources,\n isActionable,\n isDestructive,\n relationshipSnapshot,\n} from './decisionModel';\n\nfunction errorText(err: unknown, fallback: string): string {\n return err instanceof Error && err.message ? err.message : fallback;\n}\n\n/** \"Netflix Premium · 15.49 USD / monthly\" — the identity a confirmation must name. */\nfunction useRelationshipIdentity(decision: SubDecision): { label: string; amount: string | null } {\n const { formatCurrency, formatEnumLabel } = useFormatters();\n\n const snap = relationshipSnapshot(decision);\n const amount =\n snap.amount !== null\n ? `${formatCurrency(snap.amount, snap.currency ?? decision.currency)}${snap.interval ? ` / ${formatEnumLabel(snap.interval).toLowerCase()}` : ''}`\n : null;\n return { label: snap.label ?? decision.relationshipId, amount };\n}\n\n// ---------------------------------------------------------------------------\n// Apply confirmation\n// ---------------------------------------------------------------------------\n\nexport const ApplyDecisionDialog: FC<{\n decision: SubDecision;\n onClose: () => void;\n onApplied?: (decision: SubDecision) => void;\n}> = ({ decision, onClose, onApplied }) => {\n const tr = useTr();\n const apply = useApplyDecision();\n const [acknowledged, setAcknowledged] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const destructive = isDestructive(decision.recommendation);\n const identity = useRelationshipIdentity(decision);\n const rec = RECOMMENDATION_LABEL[decision.recommendation];\n const canSubmit = !apply.isPending && (!destructive || acknowledged);\n\n const submit = () => {\n if (!canSubmit) return;\n setError(null);\n apply.mutate(decision.id, {\n onSuccess: (result) => {\n onApplied?.(result.decision);\n onClose();\n },\n onError: (err) =>\n setError(errorText(err, tr('decisions.apply.error', 'Could not apply this decision.'))),\n });\n };\n\n return (\n <Modal\n title={tr('decisions.apply.title', 'Apply: {{action}}', {\n action: tr(rec.key, rec.fallback),\n })}\n description={tr(\n 'decisions.apply.description',\n 'This runs the same change you could make by hand on the relationship page.'\n )}\n onClose={onClose}\n >\n <div className=\"space-y-4\" data-testid=\"apply-decision-dialog\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-sunken px-4 py-3\">\n <p className=\"text-xs text-text-secondary\">\n {tr('decisions.apply.relationship', 'Subscription')}\n </p>\n <p className=\"text-sm font-semibold text-text-primary\" data-testid=\"confirm-label\">\n {identity.label}\n </p>\n {identity.amount && (\n <p className=\"text-sm tabular-nums text-text-primary\" data-testid=\"confirm-amount\">\n {identity.amount}\n </p>\n )}\n </div>\n <p className=\"text-sm text-text-secondary\">{decision.rationale}</p>\n\n {destructive && (\n <label className=\"flex items-start gap-2.5 rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text\">\n <input\n type=\"checkbox\"\n checked={acknowledged}\n onChange={(e) => setAcknowledged(e.target.checked)}\n className=\"mt-0.5 size-4 shrink-0 rounded border-border-subtle\"\n data-testid=\"confirm-destructive\"\n />\n <span>\n {tr(\n 'decisions.apply.acknowledgeCancel',\n 'I want to cancel \"{{label}}\"{{amount}}. I understand the subscription will stop.',\n {\n label: identity.label,\n amount: identity.amount ? ` (${identity.amount})` : '',\n }\n )}\n </span>\n </label>\n )}\n\n {error && (\n <div\n role=\"alert\"\n className=\"rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text\"\n >\n {error}\n </div>\n )}\n\n <div className=\"flex justify-end gap-3\">\n <button\n type=\"button\"\n onClick={onClose}\n className=\"rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n {tr('decisions.apply.back', 'Not now')}\n </button>\n <button\n type=\"button\"\n onClick={submit}\n disabled={!canSubmit}\n data-testid=\"confirm-apply\"\n className={cn(\n 'rounded-lg px-4 py-2 text-sm font-medium hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50',\n destructive\n ? 'bg-action-danger-bg text-action-danger-text hover:bg-action-danger-bg-hover'\n : 'bg-action-primary-bg text-action-primary-text'\n )}\n >\n {apply.isPending\n ? tr('decisions.apply.applying', 'Applying…')\n : tr('decisions.apply.submit', 'Apply')}\n </button>\n </div>\n </div>\n </Modal>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Dismiss\n// ---------------------------------------------------------------------------\n\nexport const DismissDecisionDialog: FC<{ decision: SubDecision; onClose: () => void }> = ({\n decision,\n onClose,\n}) => {\n const tr = useTr();\n const dismiss = useDismissDecision();\n const [reason, setReason] = useState('');\n const [error, setError] = useState<string | null>(null);\n const identity = useRelationshipIdentity(decision);\n\n const submit = (e: React.FormEvent) => {\n e.preventDefault();\n setError(null);\n dismiss.mutate(\n { id: decision.id, reason },\n {\n onSuccess: () => onClose(),\n onError: (err) =>\n setError(\n errorText(err, tr('decisions.dismiss.error', 'Could not dismiss this decision.'))\n ),\n }\n );\n };\n\n return (\n <Modal\n title={tr('decisions.dismiss.title', 'Dismiss recommendation')}\n description={identity.label}\n onClose={onClose}\n >\n <form onSubmit={submit} className=\"space-y-4\" data-testid=\"dismiss-decision-dialog\">\n <div>\n <label\n htmlFor={`dismiss-reason-${decision.id}`}\n className=\"mb-1 block text-xs font-medium text-text-secondary\"\n >\n {tr('decisions.dismiss.reason', 'Reason (optional)')}\n </label>\n <textarea\n id={`dismiss-reason-${decision.id}`}\n value={reason}\n onChange={(e) => setReason(e.target.value)}\n rows={3}\n maxLength={500}\n placeholder={tr('decisions.dismiss.placeholder', 'e.g. We still use this every week')}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n {error && (\n <div\n role=\"alert\"\n className=\"rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text\"\n >\n {error}\n </div>\n )}\n <div className=\"flex justify-end gap-3\">\n <button\n type=\"button\"\n onClick={onClose}\n className=\"rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n {tr('decisions.dismiss.back', 'Back')}\n </button>\n <button\n type=\"submit\"\n disabled={dismiss.isPending}\n data-testid=\"confirm-dismiss\"\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50\"\n >\n {dismiss.isPending\n ? tr('decisions.dismiss.dismissing', 'Dismissing…')\n : tr('decisions.dismiss.submit', 'Dismiss')}\n </button>\n </div>\n </form>\n </Modal>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Source rows\n// ---------------------------------------------------------------------------\n\nexport const DecisionSources: FC<{ decision: SubDecision; limit?: number }> = ({\n decision,\n limit,\n}) => {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const all = evidenceSources(decision);\n const shown = limit ? all.slice(0, limit) : all;\n const kindLabel: Record<string, string> = {\n relationship: tr('decisions.sources.relationship', 'Subscription'),\n keptRelationship: tr('decisions.sources.keptRelationship', 'Keep instead'),\n plan: tr('decisions.sources.plan', 'Current plan'),\n alternativePlan: tr('decisions.sources.alternativePlan', 'Suggested plan'),\n renewalEvent: tr('decisions.sources.renewalEvent', 'Renewal event'),\n entitlement: tr('decisions.sources.entitlement', 'Entitlement usage'),\n };\n return (\n <div>\n <p className=\"text-[10px] font-medium uppercase tracking-wide text-text-secondary\">\n {tr('decisions.sources.title', 'Based on')}\n </p>\n <ul className=\"mt-1.5 flex flex-wrap gap-1.5\" data-testid=\"decision-sources\">\n {shown.map((source) => (\n <li key={`${source.kind}-${source.id}`}>\n <button\n type=\"button\"\n onClick={() => navigateTo(source.path)}\n data-source-kind={source.kind}\n className=\"inline-flex max-w-full items-center gap-1.5 rounded-md border border-border-subtle bg-bg-sunken px-2 py-0.5 text-start text-[11px] text-text-secondary hover:text-text-primary\"\n >\n <span className=\"font-medium text-text-primary\">{kindLabel[source.kind]}</span>\n <span className=\"truncate\">{source.title}</span>\n {source.detail && <span className=\"tabular-nums\">{source.detail}</span>}\n <ExternalLink className=\"h-3 w-3 shrink-0\" aria-hidden />\n </button>\n </li>\n ))}\n {limit && all.length > limit && (\n <li className=\"px-1 py-0.5 text-[11px] text-text-secondary\">\n {tr('decisions.sources.more', '+{{count}} more', { count: all.length - limit })}\n </li>\n )}\n </ul>\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Card\n// ---------------------------------------------------------------------------\n\nexport const DecisionCard: FC<{\n decision: SubDecision;\n /** Hide the agent name (e.g. on the agent's own page). */\n hideAgent?: boolean;\n}> = ({ decision, hideAgent = false }) => {\n const { formatCurrency, formatRelativeTime } = useFormatters();\n\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const [dialog, setDialog] = useState<'apply' | 'dismiss' | null>(null);\n const kind = DECISION_KIND_LABEL[decision.kind];\n const rec = RECOMMENDATION_LABEL[decision.recommendation];\n const destructive = isDestructive(decision.recommendation);\n const actionable = isActionable(decision);\n const identity = useRelationshipIdentity(decision);\n\n return (\n <GlassCard\n treatment=\"metric\"\n className=\"flex flex-col gap-3 p-4\"\n data-testid=\"decision-card\"\n data-decision-id={decision.id}\n data-recommendation={decision.recommendation}\n data-status={decision.status}\n >\n <div className=\"flex flex-wrap items-start justify-between gap-2\">\n <div className=\"min-w-0\">\n <p className=\"text-[11px] font-medium uppercase tracking-wide text-text-secondary\">\n {tr(kind.key, kind.fallback)}\n {!hideAgent && decision.agent ? ` · ${decision.agent.name}` : ''}\n </p>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/decisions/${decision.id}`)}\n className=\"mt-0.5 flex items-center gap-1.5 text-start text-sm font-semibold text-text-primary hover:underline\"\n >\n {destructive && (\n <ShieldAlert className=\"h-4 w-4 shrink-0 text-status-error-text\" aria-hidden />\n )}\n {tr(rec.key, rec.fallback)}: {identity.label}\n </button>\n {identity.amount && (\n <p className=\"text-xs tabular-nums text-text-secondary\">{identity.amount}</p>\n )}\n </div>\n <StatusBadge status={decision.status} />\n </div>\n\n <p className=\"text-sm text-text-secondary\">{decision.rationale}</p>\n\n <div className=\"flex flex-wrap gap-2 text-xs\">\n <span className=\"inline-flex items-center gap-1.5 rounded-md bg-bg-sunken px-2 py-0.5 text-text-secondary\">\n <Gauge className=\"h-3.5 w-3.5\" aria-hidden />\n {tr('decisions.card.confidence', 'Confidence {{pct}}%', {\n pct: confidencePercent(decision.confidence),\n })}\n </span>\n {decision.estimatedSavings > 0 && (\n <span className=\"inline-flex items-center gap-1.5 rounded-md bg-status-success-bg-subtle px-2 py-0.5 font-medium text-status-success-text tabular-nums\">\n <PiggyBank className=\"h-3.5 w-3.5\" aria-hidden />\n {tr('decisions.card.savings', 'Saves {{amount}} a year', {\n amount: formatCurrency(decision.estimatedSavings, decision.currency),\n })}\n </span>\n )}\n <span className=\"inline-flex items-center rounded-md bg-bg-sunken px-2 py-0.5 text-text-secondary\">\n {formatRelativeTime(decision.createdAt)}\n </span>\n </div>\n\n <DecisionSources decision={decision} limit={4} />\n\n {decision.status === 'FLAGGED' && decision.validationErrors.length > 0 && (\n <p className=\"rounded-md bg-status-warning-bg-subtle px-3 py-2 text-xs text-status-warning-text\">\n {tr('decisions.card.flagged', 'Held back: failed validation')} —{' '}\n {decision.validationErrors.join('; ')}\n </p>\n )}\n {decision.status === 'DISMISSED' && decision.dismissedReason && (\n <p className=\"text-xs text-text-secondary\">\n {tr('decisions.card.dismissedReason', 'Dismissed: {{reason}}', {\n reason: decision.dismissedReason,\n })}\n </p>\n )}\n\n {actionable && (\n <div className=\"flex flex-wrap justify-end gap-2 border-t border-border-subtle pt-3\">\n <button\n type=\"button\"\n onClick={() => setDialog('dismiss')}\n data-testid=\"dismiss-decision\"\n className=\"inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken\"\n >\n <XCircle className=\"h-3.5 w-3.5\" aria-hidden />\n {tr('decisions.card.dismiss', 'Dismiss')}\n </button>\n <button\n type=\"button\"\n onClick={() => setDialog('apply')}\n data-testid=\"apply-decision\"\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium hover:opacity-90',\n destructive\n ? 'border border-status-error-text/40 bg-status-error-bg-subtle text-status-error-text'\n : 'bg-action-primary-bg text-action-primary-text'\n )}\n >\n <CheckCircle2 className=\"h-3.5 w-3.5\" aria-hidden />\n {tr('decisions.card.apply', 'Review and apply')}\n </button>\n </div>\n )}\n\n {dialog === 'apply' && (\n <ApplyDecisionDialog decision={decision} onClose={() => setDialog(null)} />\n )}\n {dialog === 'dismiss' && (\n <DismissDecisionDialog decision={decision} onClose={() => setDialog(null)} />\n )}\n </GlassCard>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAqCA,SAASA,EAAU,GAAc,GAA0B;CACzD,OAAOC,aAAe,SAASA,EAAI,UAAUA,EAAI,UAAUC;AAC7D;AAGA,SAASC,EAAwB,GAAiE;CAChG,IAAM,EAAE,mBAAgB,uBAAoBC,EAAc,GAEpDC,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+1,4 @@
|
|
|
1
1
|
import { SubAgentKind, SubDecision, SubDecisionKind, SubDecisionRecommendation, SubDecisionStatus } from '../../types';
|
|
2
|
-
|
|
3
2
|
/** Agent kinds the decision engine implements; the rest are refused server-side. */
|
|
4
3
|
export declare const RUNNABLE_AGENT_KINDS: ReadonlySet<SubAgentKind>;
|
|
5
4
|
export declare const DECISION_KINDS: SubDecisionKind[];
|
|
@@ -49,4 +48,3 @@ export interface EvidenceSource {
|
|
|
49
48
|
* renewal events and entitlements the strategy inspected.
|
|
50
49
|
*/
|
|
51
50
|
export declare function evidenceSources(decision: SubDecision): EvidenceSource[];
|
|
52
|
-
//# sourceMappingURL=decisionModel.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
var e = new Set([
|
|
1
|
+
// src/subscriberbot/components/decisions/decisionModel.ts
|
|
2
|
+
var e = /* @__PURE__ */ new Set([
|
|
3
3
|
"COST",
|
|
4
4
|
"RENEWAL",
|
|
5
5
|
"VENDOR",
|
|
@@ -146,7 +146,6 @@ function f(e) {
|
|
|
146
146
|
}
|
|
147
147
|
return i;
|
|
148
148
|
}
|
|
149
|
-
//#endregion
|
|
150
149
|
export { t as DECISION_KINDS, n as DECISION_KIND_LABEL, r as RECOMMENDATION_LABEL, e as RUNNABLE_AGENT_KINDS, o as confidencePercent, f as evidenceSources, a as isActionable, i as isDestructive, u as relationshipSnapshot };
|
|
151
150
|
|
|
152
151
|
//# sourceMappingURL=decisionModel.js.map
|