@bcrumbs.net/inbox 0.0.63 → 0.0.65
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/assets/ar/inbox.json +40 -6
- package/assets/en/inbox.json +40 -6
- package/e2e/auth.setup.d.ts +1 -0
- package/e2e/checkout/checkout.flows.d.ts +24 -0
- package/e2e/global.teardown.d.ts +1 -0
- package/e2e/support/auth.d.ts +22 -0
- package/e2e/support/cleanup.d.ts +20 -0
- package/e2e/support/config.d.ts +23 -0
- package/e2e/support/fixtures.d.ts +16 -0
- package/e2e/support/identifiers.d.ts +13 -0
- package/e2e/support/index.d.ts +6 -0
- package/index.cjs.js +39202 -1083
- package/index.esm.js +39206 -1088
- package/package.json +2 -2
- package/playwright.config.d.ts +0 -4
- package/src/app/ai/components/Crumby/CrumbyChatError.d.ts +9 -0
- package/src/app/ai/components/Crumby/CrumbyChatErrorBoundary.d.ts +13 -0
- package/src/app/ai/components/Crumby/CrumbyHeader.d.ts +9 -0
- package/src/app/ai/components/Crumby/CrumbyPageContext.d.ts +22 -0
- package/src/app/ai/components/Crumby/CrumbyRuntimeProvider.d.ts +9 -0
- package/src/app/ai/components/CrumbySettings/CrumbyEditsBanner.d.ts +14 -0
- package/src/app/ai/components/CrumbySettings/VoiceSettingsSection.d.ts +9 -0
- package/src/app/ai/components/playground/Button.d.ts +1 -1
- package/src/app/ai/components/playground/ThreadMessages.d.ts +3 -1
- package/src/app/ai/components/playground/TooltipIconButton.d.ts +1 -1
- package/src/app/ai/components/sources/mediaTypeForFile.d.ts +8 -0
- package/src/app/ai/config/promptSettings.d.ts +31 -0
- package/src/app/ai/hooks/usePromptCopilot.d.ts +22 -0
- package/src/app/ai/tools/PromptEditorTool.d.ts +2 -0
- package/src/app/ai/types/index.d.ts +1 -1
- package/src/app/ai/utils/clientToolResubmit.d.ts +8 -0
- package/src/app/ai/utils/crumbyChatFetch.d.ts +15 -0
- package/src/app/auth/components/AcceptInvitation.d.ts +2 -0
- package/src/app/auth/components/AuthLanguagePicker.d.ts +3 -0
- package/src/app/auth/components/AuthVisualCarousel.d.ts +1 -0
- package/src/app/auth/components/ClerkSessionBridge.d.ts +4 -0
- package/src/app/auth/components/password-page/AuthPasswordPageLayout.d.ts +3 -1
- package/src/app/auth/components/password-page/PasswordSuccessView.d.ts +2 -1
- package/src/app/auth/config/authProvider.d.ts +20 -2
- package/src/app/auth/config/clerkAppearance.d.ts +152 -49
- package/src/app/auth/config/clerkLocalization.d.ts +6 -0
- package/src/app/auth/pages/Auth.style.d.ts +14 -0
- package/src/app/auth/pages/Login.d.ts +2 -1
- package/src/app/auth/pages/Register.d.ts +1 -0
- package/src/app/billing/pages/GatewayWelcomePage.d.ts +5 -0
- package/src/app/billing/utils/isGatewayPlan.d.ts +2 -0
- package/src/app/broadcast/components/BroadcastAnalysisReciepientsHeader.d.ts +2 -1
- package/src/app/broadcast/components/BroadcastDetailsSection.d.ts +3 -1
- package/src/app/broadcast/constants.d.ts +2 -0
- package/src/app/dashboard/components/AgentCard.d.ts +2 -1
- package/src/app/dashboard/components/AgentsCard.d.ts +4 -2
- package/src/app/dashboard/components/BroadcastDashboard.d.ts +3 -1
- package/src/app/dashboard/components/ChatsByLifeCycleCard.d.ts +13 -0
- package/src/app/dashboard/components/DashboardFilters.d.ts +27 -0
- package/src/app/dashboard/components/DashboardPdfCaptureArea.d.ts +11 -0
- package/src/app/dashboard/components/DashboardPdfExportButton.d.ts +7 -0
- package/src/app/dashboard/components/DashboardPdfHeader.d.ts +11 -0
- package/src/app/dashboard/components/DashboardSections.d.ts +7 -2
- package/src/app/dashboard/components/InboxDashboard.d.ts +3 -1
- package/src/app/dashboard/hooks/useDashboardPdfMeta.d.ts +31 -0
- package/src/app/dashboard/hooks/useDashboardTabsPdfExport.d.ts +26 -0
- package/src/app/dashboard/utils/dashboardReportExports.d.ts +16 -1
- package/src/app/dashboard/utils/exportDashboardPdf.d.ts +19 -0
- package/src/app/dashboard/utils/lifecycleStages.d.ts +53 -0
- package/src/app/dashboard/utils/reportHelpers.d.ts +9 -0
- package/src/app/gatewayHome/components/ChecklistStep.d.ts +15 -0
- package/src/app/gatewayHome/components/CreditBalanceCard.d.ts +6 -0
- package/src/app/gatewayHome/components/MessageStats.d.ts +5 -0
- package/src/app/gatewayHome/components/SetupChecklist.d.ts +11 -0
- package/src/app/gatewayHome/components/console/QuickstartConsole.d.ts +11 -0
- package/src/app/gatewayHome/components/console/RunRequestBar.d.ts +15 -0
- package/src/app/gatewayHome/components/console/consoleStyles.d.ts +77 -0
- package/src/app/gatewayHome/components/steps/ApiKeyStepBody.d.ts +8 -0
- package/src/app/gatewayHome/components/steps/ChannelStepBody.d.ts +3 -0
- package/src/app/gatewayHome/components/steps/MetaStepBody.d.ts +6 -0
- package/src/app/gatewayHome/components/steps/WebhookStepBody.d.ts +7 -0
- package/src/app/gatewayHome/components/styles.d.ts +29 -0
- package/src/app/gatewayHome/config/constants.d.ts +22 -0
- package/src/app/gatewayHome/hooks/useGatewaySetup.d.ts +59 -0
- package/src/app/gatewayHome/hooks/useMessageStats.d.ts +17 -0
- package/src/app/gatewayHome/hooks/useQuickstartRequest.d.ts +31 -0
- package/src/app/gatewayHome/hooks/useSendableTemplates.d.ts +9 -0
- package/src/app/gatewayHome/pages/GatewayHomePage.d.ts +1 -0
- package/src/app/gatewayHome/types/index.d.ts +21 -0
- package/src/app/gatewayHome/utils/buildRequestBody.d.ts +7 -0
- package/src/app/gatewayHome/utils/buildSnippet.d.ts +9 -0
- package/src/app/gatewayHome/utils/sendTestMessage.d.ts +3 -0
- package/src/app/gatewayHome/utils/setupStorage.d.ts +8 -0
- package/src/app/gatewayHome/utils/templateHasParameters.d.ts +6 -0
- package/src/app/generic/components/HeaderImageInput.d.ts +3 -1
- package/src/app/generic/components/MessagePreview.d.ts +1 -1
- package/src/app/generic/components/PreviewHeaderDocument.d.ts +5 -0
- package/src/app/generic/hooks/usePaginatedQuery.d.ts +1 -0
- package/src/app/generic/utils/chunkErrorRecovery.d.ts +7 -0
- package/src/app/generic/utils/onesignal.d.ts +13 -0
- package/src/app/inbox/calls/useIncomingCallAlerts.d.ts +2 -0
- package/src/app/inbox/components/Calls/ActiveCallControls.d.ts +6 -0
- package/src/app/inbox/components/Calls/IncomingCallBanner.d.ts +6 -0
- package/src/app/inbox/components/Chat/ChatContent.d.ts +3 -1
- package/src/app/inbox/components/Chat/QuickReplyEmpty.d.ts +5 -0
- package/src/app/inbox/components/Chat/QuickReplyPickerMenu.d.ts +2 -2
- package/src/app/inbox/components/NewDetails/ClientSection.d.ts +3 -1
- package/src/app/inbox/components/NewDetails/ContactActionsMenu.d.ts +9 -0
- package/src/app/inbox/components/NewDetails/SuggestedAssignee.d.ts +7 -0
- package/src/app/inbox/components/NewDetails/SuggestedStage.d.ts +13 -0
- package/src/app/inbox/components/NewDetails/SuggestedTags.d.ts +18 -0
- package/src/app/inbox/components/NewDetails/SuggestionItems.d.ts +16 -0
- package/src/app/inbox/components/NewDetails/UserHeader.d.ts +2 -1
- package/src/app/inbox/components/Shared/SharedStyle.d.ts +8 -0
- package/src/app/inbox/constants/index.d.ts +1 -0
- package/src/app/inbox/context/CallSession.d.ts +16 -0
- package/src/app/inbox/context/SuggestionsContext.d.ts +25 -0
- package/src/app/inbox/hooks/useAgentSuggestions.d.ts +20 -0
- package/src/app/inbox/hooks/useApplySuggestion.d.ts +18 -0
- package/src/app/inbox/hooks/useConvEnhance.d.ts +3 -1
- package/src/app/inbox/hooks/useConversationsPerodicFetch.d.ts +37 -0
- package/src/app/inbox/hooks/useIncomingCallAlerts.d.ts +2 -0
- package/src/app/inbox/hooks/useNewSortedEvents.d.ts +1 -1
- package/src/app/inbox/hooks/useQuickReplyPicker.d.ts +5 -3
- package/src/app/inbox/pages/InboxPage.d.ts +1 -1
- package/src/app/inbox/utils/callUi.d.ts +25 -0
- package/src/app/inbox/utils/convAssistStorage.d.ts +9 -4
- package/src/app/inbox/utils/convSuggestions.d.ts +59 -0
- package/src/app/inbox/utils/convSuggestionsStorage.d.ts +20 -0
- package/src/app/inbox/utils/convs.d.ts +4 -0
- package/src/app/inbox/utils/sounds.d.ts +4 -0
- package/src/app/layout/components/LogoutPopin.d.ts +6 -3
- package/src/app/layout/components/language/index.d.ts +5 -1
- package/src/app/layout/constants/index.d.ts +35 -0
- package/src/app/layout/hooks/useCallsEnabled.d.ts +1 -0
- package/src/app/layout/hooks/useGatewayPlanEnabled.d.ts +5 -0
- package/src/app/layout/hooks/useWebchatEnabled.d.ts +5 -0
- package/src/app/managemnet/components/channels/ChannelItem.d.ts +2 -1
- package/src/app/managemnet/components/channels/ChannelSettingsDrawer.d.ts +15 -0
- package/src/app/managemnet/components/channels/ShareChannelLinkDialog.d.ts +11 -0
- package/src/app/managemnet/components/channels/WebChatSnippetBlock.d.ts +7 -0
- package/src/app/managemnet/config/webchat.d.ts +5 -0
- package/src/app/managemnet/config/webhookDefinition.d.ts +4 -0
- package/src/app/managemnet/pages/connectChannel/ConnectChannel.d.ts +2 -0
- package/src/app/managemnet/pages/generalSettings/NoiseFilterSettings.d.ts +8 -0
- package/src/app/managemnet/pages/generalSettings/WritingAssistanceSettings.d.ts +9 -0
- package/src/app/managemnet/pages/generalSettings/holidayConstants.d.ts +5 -0
- package/src/app/managemnet/pages/generalSettings/noiseFilterConstants.d.ts +24 -0
- package/src/app/managemnet/pages/generalSettings/writingConstants.d.ts +6 -0
- package/src/app/managemnet/utils/webChatSnippet.d.ts +2 -0
- package/src/app/onboarding/components/OnboardingView.d.ts +3 -1
- package/src/app/onboarding/components/useOnboardingChecklist.d.ts +12 -9
- package/src/app/onboarding/constants/workspaceProfileOptions.d.ts +30 -0
- package/src/app/onboarding/utils/onboardingApi.d.ts +23 -0
- package/src/app/onboarding/utils/onboardingChecklistStorage.d.ts +42 -49
- package/src/app/resources/components/Agents/CreateAgent.d.ts +7 -3
- package/src/app/resources/components/Integrations/ChannelDialogLayout.d.ts +6 -1
- package/src/app/resources/components/Integrations/RenderCorrectIntegrationFlow.d.ts +3 -1
- package/src/app/resources/components/Integrations/WebChat/index.d.ts +8 -0
- package/src/app/resources/components/Integrations/WhatsApp/index.d.ts +1 -0
- package/src/app/resources/components/ListResources/Utils.d.ts +1 -0
- package/src/app/resources/hooks/useFBPagesHook.d.ts +4 -2
- package/src/app/resources/hooks/useWabaHook.d.ts +5 -4
- package/src/app/resources/utils/channelSetupTracking.d.ts +21 -0
- package/src/app/resources/utils/facebookSdk.d.ts +11 -0
- package/src/app/subscriptions/components/NewSubscription/OnboardingStepper.d.ts +2 -2
- package/src/app/subscriptions/components/NewSubscription/SubscriptionName.d.ts +2 -0
- package/src/app/subscriptions/components/NewSubscription/SubscriptionSuccess.d.ts +3 -1
- package/src/app/subscriptions/components/NewSubscription/WorkspaceProfile.d.ts +18 -0
- package/src/app/subscriptions/components/NewSubscription/WorkspaceStepLayout.d.ts +5 -2
- package/src/app/subscriptions/components/Plans/PlanCard.d.ts +3 -1
- package/src/app/subscriptions/components/Plans/ShowcasePlans.d.ts +3 -1
- package/src/app/subscriptions/components/SubscriptionSettings/SubscriptionCreditsCard.d.ts +5 -0
- package/src/app/subscriptions/components/SubscriptionSettings/SubscriptionProfile.d.ts +0 -1
- package/src/app/subscriptions/components/SubscriptionSettings/SubscriptionUsers.d.ts +0 -1
- package/src/app/subscriptions/components/SubscriptionSettings/index.d.ts +17 -2
- package/src/app/subscriptions/constants/Plans.d.ts +2 -1
- package/src/app/subscriptions/hooks/useWorkspaceProfileSubmit.d.ts +12 -0
- package/src/app/subscriptions/utils/estimateUpgradeProration.d.ts +7 -0
- package/src/app/subscriptions/utils/newWorkspaceContext.d.ts +8 -0
- package/src/assets/locales/translations.d.ts +444 -0
- package/src/config/constants.d.ts +1 -2
- package/src/environments/environment.dev.d.ts +2 -0
- package/src/environments/types.d.ts +2 -0
- package/src/graphql.autogenerated.d.ts +2718 -22
- package/src/graphql.billing.autogenerated.d.ts +193 -0
- package/src/lib/index.d.ts +1 -0
- package/src/testUtils/bcUiMock.d.ts +16 -0
- package/src/utils/colorPool.d.ts +1 -2
- package/src/utils/getActiveChannelList.d.ts +6 -1
- package/src/utils/globalHelper.d.ts +22 -0
- package/src/app/contact/components/ImportProgressDialog.d.ts +0 -13
- package/src/app/managemnet/components/channels/EditChannelDialog.d.ts +0 -11
- package/src/app/onboarding/utils/onboardingChecklistPersistence.d.ts +0 -18
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SnippetLang } from '../types';
|
|
2
|
+
type SnippetInput = {
|
|
3
|
+
url: string;
|
|
4
|
+
/** Sent raw in the Authorization header; omitted for webhook simulations. */
|
|
5
|
+
apiKey?: string;
|
|
6
|
+
body: Record<string, unknown>;
|
|
7
|
+
};
|
|
8
|
+
export declare function buildSnippet(lang: SnippetLang, input: SnippetInput): string;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SetupStepStatus } from '../types';
|
|
2
|
+
/** Choices for optional steps that have no server-side record (skip / done on Meta). */
|
|
3
|
+
export type LocalSetupChoices = {
|
|
4
|
+
webhook?: SetupStepStatus;
|
|
5
|
+
meta?: SetupStepStatus;
|
|
6
|
+
};
|
|
7
|
+
export declare function readSetupChoices(workspaceId: number): LocalSetupChoices;
|
|
8
|
+
export declare function writeSetupChoices(workspaceId: number, choices: LocalSetupChoices): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True when a WhatsApp template needs values at send time: text/URL placeholders,
|
|
3
|
+
* a media or location header, a code button, or an authentication (OTP) template.
|
|
4
|
+
* The Quickstart console sends templates without components, so those would fail.
|
|
5
|
+
*/
|
|
6
|
+
export declare function templateHasParameters(rawComponents: unknown, category?: string | null): boolean;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
type HeaderMediaKind = 'image' | 'document';
|
|
2
3
|
type HeaderImageInputProps = {
|
|
3
4
|
value: string;
|
|
4
5
|
onChange: (value: string) => void;
|
|
5
6
|
hint?: string;
|
|
6
7
|
layout?: 'row' | 'column';
|
|
8
|
+
mediaKind?: HeaderMediaKind;
|
|
7
9
|
};
|
|
8
|
-
declare const _default: React.MemoExoticComponent<({ value, onChange, hint, layout }: HeaderImageInputProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
|
|
10
|
+
declare const _default: React.MemoExoticComponent<({ value, onChange, hint, layout, mediaKind }: HeaderImageInputProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
|
|
9
11
|
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reports a recovery when this page load followed a guarded reload. Call it once
|
|
3
|
+
* the app shell has loaded, which proves the reloaded chunks are healthy.
|
|
4
|
+
*/
|
|
5
|
+
export declare function reportChunkRecoveryIfReloaded(): void;
|
|
6
|
+
/** Registers the global chunk-failure listeners. Call once at startup. */
|
|
7
|
+
export declare function setupChunkErrorRecovery(): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import OneSignal from 'react-onesignal';
|
|
2
|
+
type OneSignalInitOptions = Parameters<typeof OneSignal.init>[0];
|
|
3
|
+
/**
|
|
4
|
+
* Start OneSignal. Best effort: a blocked or failed OneSignal script must not
|
|
5
|
+
* break app startup (for example with Firefox tracking protection or an ad blocker).
|
|
6
|
+
*/
|
|
7
|
+
export declare function initOneSignal(options: OneSignalInitOptions): Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Register the signed-in user with OneSignal for push notifications. Best effort:
|
|
10
|
+
* a blocked or failed OneSignal script must not break sign-in.
|
|
11
|
+
*/
|
|
12
|
+
export declare function registerOneSignalUser(userId: string, email?: string): Promise<void>;
|
|
13
|
+
export {};
|
|
@@ -14,6 +14,8 @@ interface ChatContentProps {
|
|
|
14
14
|
searchMatchNo: number;
|
|
15
15
|
onSearchMatchCount: (count: number) => void;
|
|
16
16
|
onMessageReply: (messageId: string) => void;
|
|
17
|
+
onMessageReact?: (messageId: string, emoji: string) => void;
|
|
18
|
+
onMessageUnreact?: (messageId: string, emoji: string) => void;
|
|
17
19
|
replyMessage: {
|
|
18
20
|
title: string;
|
|
19
21
|
content: string;
|
|
@@ -30,5 +32,5 @@ interface ChatContentProps {
|
|
|
30
32
|
/** Called when user clicks "Add Contact" on a contact message card */
|
|
31
33
|
onContactAddContact?: (contact: ContactMessagePayload) => void;
|
|
32
34
|
}
|
|
33
|
-
declare const ChatContent: ({ messages, olderMessages, canContribute, sendMessage, loadOlderMessages, agentsIdsAvatarsMap, noteMode, onNoteSend, onCloseNoteMode, onAddNoteClick, searchPattern, searchMatchNo, onSearchMatchCount, onMessageReply, replyMessage, onCancelReplyMessage, errorMessage, statusFailureMessage, logo, conversationId, onContactMessage, onContactAddContact, }: ChatContentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
35
|
+
declare const ChatContent: ({ messages, olderMessages, canContribute, sendMessage, loadOlderMessages, agentsIdsAvatarsMap, noteMode, onNoteSend, onCloseNoteMode, onAddNoteClick, searchPattern, searchMatchNo, onSearchMatchCount, onMessageReply, onMessageReact, onMessageUnreact, replyMessage, onCancelReplyMessage, errorMessage, statusFailureMessage, logo, conversationId, onContactMessage, onContactAddContact, }: ChatContentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
34
36
|
export default ChatContent;
|
|
@@ -5,10 +5,10 @@ export interface QuickReplyPickerMenuProps {
|
|
|
5
5
|
anchor: QuickReplyPickerAnchor;
|
|
6
6
|
items: QuickReplyPickerItem[];
|
|
7
7
|
highlightedIndex: number;
|
|
8
|
-
emptyLabel: string;
|
|
9
8
|
menuRef?: Ref<HTMLDivElement>;
|
|
10
9
|
onHighlight: (index: number) => void;
|
|
11
10
|
onSelect: (item: QuickReplyPickerItem) => void;
|
|
11
|
+
filtered: boolean;
|
|
12
12
|
}
|
|
13
|
-
declare const QuickReplyPickerMenu: ({ anchor, items, highlightedIndex,
|
|
13
|
+
declare const QuickReplyPickerMenu: ({ anchor, items, highlightedIndex, menuRef, onHighlight, onSelect, filtered, }: QuickReplyPickerMenuProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
14
14
|
export default QuickReplyPickerMenu;
|
|
@@ -6,6 +6,8 @@ interface ClientSectionProps {
|
|
|
6
6
|
tagsLoading: boolean;
|
|
7
7
|
refetchTags: () => void;
|
|
8
8
|
onBackToList?: () => void;
|
|
9
|
+
/** Changing this value refetches the client (e.g. after an AI suggestion is applied). */
|
|
10
|
+
refreshKey?: number;
|
|
9
11
|
}
|
|
10
|
-
declare const ClientSection: ({ conv, clientTags, conversationTags, tagsLoading, refetchTags, onBackToList, }: ClientSectionProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare const ClientSection: ({ conv, clientTags, conversationTags, tagsLoading, refetchTags, onBackToList, refreshKey, }: ClientSectionProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
13
|
export default ClientSection;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface ContactActionsMenuProps {
|
|
2
|
+
clientId: string;
|
|
3
|
+
clientName: string;
|
|
4
|
+
deletedAt?: string | null;
|
|
5
|
+
blacklistedAt?: string | null;
|
|
6
|
+
onActionComplete?: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare const ContactActionsMenu: ({ clientId, clientName, deletedAt, blacklistedAt, onActionComplete, }: ContactActionsMenuProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default ContactActionsMenu;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Suggested assignee shown under the contact's suggested life cycle: the agent who handled most of
|
|
3
|
+
* this contact's previous conversations (not AI). Shown only when the conversation is unassigned or
|
|
4
|
+
* assigned to a different live agent. Clicking it assigns the open conversation.
|
|
5
|
+
*/
|
|
6
|
+
declare const SuggestedAssignee: () => import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export default SuggestedAssignee;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type SuggestionScope } from '../../utils/convSuggestions';
|
|
2
|
+
type Props = {
|
|
3
|
+
/** 'conv' suggests the conversation life cycle; 'client' suggests the contact lifecycle. */
|
|
4
|
+
scope: SuggestionScope;
|
|
5
|
+
currentStageId?: string | null;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* AI-suggested life cycle shown under the conversation or contact tags. Clicking it sets the stage
|
|
10
|
+
* through the same mutation (and, for conversations, the same timeline note) as a manual change.
|
|
11
|
+
*/
|
|
12
|
+
declare const SuggestedStage: ({ scope, currentStageId, disabled }: Props) => import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export default SuggestedStage;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { type SuggestionScope } from '../../utils/convSuggestions';
|
|
3
|
+
type Props = {
|
|
4
|
+
scope: SuggestionScope;
|
|
5
|
+
/** Tags already on the conversation or contact; suggestions for these are hidden. */
|
|
6
|
+
appliedTags: string[];
|
|
7
|
+
/** The tag input's own add handler, so suggested tags behave exactly like picked ones. */
|
|
8
|
+
onAdd: (tag: string) => Promise<void>;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
/** A "✦ <label>" row shown under an input; shared by suggested tags and the suggested life cycle. */
|
|
12
|
+
export declare const SuggestedRow: ({ label, children }: {
|
|
13
|
+
label: string;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
16
|
+
/** AI-suggested tags shown under a tag input; clicking one adds it, × dismisses it. */
|
|
17
|
+
declare const SuggestedTags: ({ scope, appliedTags, onAdd, disabled }: Props) => import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
export default SuggestedTags;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type SuggestionMeta = {
|
|
2
|
+
/** Model confidence (0-1); omitted for rule-based suggestions such as the assignee. */
|
|
3
|
+
confidence?: number;
|
|
4
|
+
reason: string;
|
|
5
|
+
};
|
|
6
|
+
type SuggestedTagChipProps = SuggestionMeta & {
|
|
7
|
+
tag: string;
|
|
8
|
+
/** True while this suggestion is being applied. */
|
|
9
|
+
applying: boolean;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
onApply: () => void;
|
|
12
|
+
onDismiss: () => void;
|
|
13
|
+
};
|
|
14
|
+
/** A suggestion styled like an added tag (dashed, faded): click to apply, × to dismiss. */
|
|
15
|
+
export declare const SuggestedTagChip: ({ tag, applying, disabled, onApply, onDismiss, ...meta }: SuggestedTagChipProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -3,6 +3,7 @@ interface UserHeaderProps {
|
|
|
3
3
|
clientData: ClientQuery['client'] | undefined;
|
|
4
4
|
setEditMode: (editMode: boolean) => void;
|
|
5
5
|
onBackToList?: () => void;
|
|
6
|
+
onClientActionComplete?: () => void;
|
|
6
7
|
}
|
|
7
|
-
declare const UserHeader: ({ clientData, setEditMode, onBackToList }: UserHeaderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare const UserHeader: ({ clientData, setEditMode, onBackToList, onClientActionComplete }: UserHeaderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
9
|
export default UserHeader;
|
|
@@ -33,3 +33,11 @@ export declare const ArchivedLabelStyle: import("@emotion/styled").StyledCompone
|
|
|
33
33
|
theme?: import("@emotion/react").Theme | undefined;
|
|
34
34
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
35
35
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
36
|
+
export declare const BlockedLabelStyle: import("@emotion/styled").StyledComponent<{
|
|
37
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
38
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
39
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
40
|
+
export declare const StatusLabelsRow: import("@emotion/styled").StyledComponent<{
|
|
41
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
42
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
43
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -15,6 +15,7 @@ export declare const WABA_TEMPLATE_COSTS: {
|
|
|
15
15
|
UTILITY: number;
|
|
16
16
|
AUTHENTIC: number;
|
|
17
17
|
};
|
|
18
|
+
export declare const META_TEMPLATES_URL = "https://business.facebook.com/latest/whatsapp_manager/message_templates";
|
|
18
19
|
export declare const CONVERSATIONS_LIMIT = 300;
|
|
19
20
|
export declare const WhatsappLanguageCodes: {
|
|
20
21
|
ar: string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { LocalCallState, PortalCall } from '../utils/callUi';
|
|
3
|
+
type CallSessionValue = {
|
|
4
|
+
activeCallId: string | null;
|
|
5
|
+
localCall: LocalCallState | null;
|
|
6
|
+
muted: boolean;
|
|
7
|
+
answer: (call: PortalCall) => Promise<void>;
|
|
8
|
+
reject: (call: PortalCall) => Promise<void>;
|
|
9
|
+
hangup: (call: PortalCall) => Promise<void>;
|
|
10
|
+
toggleMute: () => Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
export declare function CallSessionProvider({ children }: {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function useCallSession(): CallSessionValue;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Agent, Conversation } from '../../../graphql.autogenerated';
|
|
3
|
+
import useAgentSuggestions from '../hooks/useAgentSuggestions';
|
|
4
|
+
import useApplySuggestion from '../hooks/useApplySuggestion';
|
|
5
|
+
type SuggestionsContextValue = {
|
|
6
|
+
conv: Conversation;
|
|
7
|
+
agents: Agent[];
|
|
8
|
+
suggestions: ReturnType<typeof useAgentSuggestions>;
|
|
9
|
+
apply: ReturnType<typeof useApplySuggestion>;
|
|
10
|
+
};
|
|
11
|
+
type Props = {
|
|
12
|
+
conv: Conversation;
|
|
13
|
+
agents: Agent[];
|
|
14
|
+
onConvUpdate?: () => void;
|
|
15
|
+
onClientUpdate?: () => void;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Loads AI suggestions once per open conversation and shares them with the inline suggestions:
|
|
20
|
+
* tags and life cycle under the conversation and contact tags, and the assignee under the contact.
|
|
21
|
+
*/
|
|
22
|
+
export declare const SuggestionsProvider: ({ conv, agents, onConvUpdate, onClientUpdate, children }: Props) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
|
+
/** Null outside a SuggestionsProvider (e.g. contact pages), so consumers simply render nothing. */
|
|
24
|
+
export declare const useSuggestionsContext: () => SuggestionsContextValue | null;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ClientSuggestionsPayload, Conversation, ConvSuggestionsPayload } from '../../../graphql.autogenerated';
|
|
2
|
+
type Props = {
|
|
3
|
+
conv: Conversation;
|
|
4
|
+
/** Turn off fetching (e.g. ended conversations); cached suggestions are still shown. */
|
|
5
|
+
autoFetch: boolean;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Loads AI suggestions for the open conversation and its client.
|
|
9
|
+
* Fetches automatically after a few customer messages and again every few new ones; results and
|
|
10
|
+
* dismissals are cached per conversation in localStorage, so reopening a conversation (or reloading)
|
|
11
|
+
* does not ask again until new customer messages arrive or the cache expires.
|
|
12
|
+
* Keyed on primitives because `conv` gets a new identity on every inbox poll.
|
|
13
|
+
*/
|
|
14
|
+
declare const useAgentSuggestions: ({ conv, autoFetch }: Props) => {
|
|
15
|
+
conversation: ConvSuggestionsPayload | null;
|
|
16
|
+
client: ClientSuggestionsPayload | null;
|
|
17
|
+
hidden: Set<string>;
|
|
18
|
+
hide: (key: string) => void;
|
|
19
|
+
};
|
|
20
|
+
export default useAgentSuggestions;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Conversation } from '../../../graphql.autogenerated';
|
|
2
|
+
type Props = {
|
|
3
|
+
conv: Conversation;
|
|
4
|
+
onConvUpdate?: () => void;
|
|
5
|
+
onClientUpdate?: () => void;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Applies one AI stage / assignee / lifecycle suggestion through the same mutations and audit notes as
|
|
9
|
+
* the manual editors. Suggested tags are added by the tag inputs' own handlers (SuggestedTags).
|
|
10
|
+
* `applying` holds the key of the suggestion in flight; each apply resolves to true on success.
|
|
11
|
+
*/
|
|
12
|
+
declare const useApplySuggestion: ({ conv, onConvUpdate, onClientUpdate }: Props) => {
|
|
13
|
+
applying: string | null;
|
|
14
|
+
applyConvStage: (stageId: string, stage: string) => Promise<boolean>;
|
|
15
|
+
applyAssignee: (agentId: string, agentName: string) => Promise<boolean>;
|
|
16
|
+
applyClientStage: (stageId: string, stage: string) => Promise<boolean>;
|
|
17
|
+
};
|
|
18
|
+
export default useApplySuggestion;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { type MutableRefObject } from 'react';
|
|
2
|
+
import { type EnhanceWritingCacheSettings } from '../utils/convAssistStorage';
|
|
2
3
|
export interface UseConvEnhanceOptions {
|
|
3
4
|
enabled: boolean;
|
|
4
5
|
workspaceId: number | undefined;
|
|
5
6
|
conversationId: string | undefined;
|
|
6
7
|
composerDraftRef: MutableRefObject<string>;
|
|
8
|
+
writingSettings: EnhanceWritingCacheSettings;
|
|
7
9
|
onBeforeEnhance?: () => void;
|
|
8
10
|
/** Fired when replace draft is applied so parent can skip auto-complete debounce for that update. */
|
|
9
11
|
onReplaceDraftApplied?: () => void;
|
|
10
12
|
}
|
|
11
|
-
export declare function useConvEnhance({ enabled, workspaceId, conversationId, composerDraftRef, onBeforeEnhance, onReplaceDraftApplied, }: UseConvEnhanceOptions): {
|
|
13
|
+
export declare function useConvEnhance({ enabled, workspaceId, conversationId, composerDraftRef, writingSettings, onBeforeEnhance, onReplaceDraftApplied, }: UseConvEnhanceOptions): {
|
|
12
14
|
autoCompleteReplaceDraft: string | undefined;
|
|
13
15
|
autoCompleteReplaceDraftKey: number;
|
|
14
16
|
isEnhanceLoading: boolean;
|
|
@@ -24,6 +24,7 @@ declare function useConversationsPeriodicFetch(selectedConvId?: string, onSelect
|
|
|
24
24
|
broadcastName?: string | null | undefined;
|
|
25
25
|
sourceType?: string | null | undefined;
|
|
26
26
|
sourceUrl?: string | null | undefined;
|
|
27
|
+
sentiment?: import("../../../graphql.autogenerated").ConversationSentiment | null | undefined;
|
|
27
28
|
integrationSwitches?: {
|
|
28
29
|
__typename?: "ConvIntegrationSwitch" | undefined;
|
|
29
30
|
fromIntegrationId: string;
|
|
@@ -46,12 +47,20 @@ declare function useConversationsPeriodicFetch(selectedConvId?: string, onSelect
|
|
|
46
47
|
externalMessageId?: string | null | undefined;
|
|
47
48
|
tags?: string[] | null | undefined;
|
|
48
49
|
createdAt: any;
|
|
50
|
+
transcript?: string | null | undefined;
|
|
49
51
|
context?: {
|
|
50
52
|
__typename?: "MessageContext" | undefined;
|
|
51
53
|
replyToId?: string | null | undefined;
|
|
52
54
|
replyToContent: string;
|
|
53
55
|
replyToType: import("../../../graphql.autogenerated").MessageType;
|
|
54
56
|
} | null | undefined;
|
|
57
|
+
reactions?: {
|
|
58
|
+
__typename?: "MessageReaction" | undefined;
|
|
59
|
+
emoji: string;
|
|
60
|
+
isAgent: boolean;
|
|
61
|
+
agentId?: string | null | undefined;
|
|
62
|
+
createdAt: any;
|
|
63
|
+
}[] | null | undefined;
|
|
55
64
|
}[] | null | undefined;
|
|
56
65
|
client?: {
|
|
57
66
|
__typename?: "ConversationClient" | undefined;
|
|
@@ -68,6 +77,34 @@ declare function useConversationsPeriodicFetch(selectedConvId?: string, onSelect
|
|
|
68
77
|
assignDate?: any;
|
|
69
78
|
isAi?: boolean | null | undefined;
|
|
70
79
|
} | null)[] | null | undefined;
|
|
80
|
+
activeCall?: {
|
|
81
|
+
__typename?: "Call" | undefined;
|
|
82
|
+
id: string;
|
|
83
|
+
status: import("../../../graphql.autogenerated").CallStatus;
|
|
84
|
+
handler: import("../../../graphql.autogenerated").CallHandler;
|
|
85
|
+
direction: import("../../../graphql.autogenerated").CallDirection;
|
|
86
|
+
roomName?: string | null | undefined;
|
|
87
|
+
startedAt: any;
|
|
88
|
+
answeredAt?: any;
|
|
89
|
+
duration?: number | null | undefined;
|
|
90
|
+
assigneeId?: string | null | undefined;
|
|
91
|
+
aiId?: string | null | undefined;
|
|
92
|
+
convId: string;
|
|
93
|
+
clientId: string;
|
|
94
|
+
workspaceId: number;
|
|
95
|
+
integrationId: string;
|
|
96
|
+
} | null | undefined;
|
|
97
|
+
classificationRuns?: {
|
|
98
|
+
__typename?: "ConversationClassificationRun" | undefined;
|
|
99
|
+
mode: string;
|
|
100
|
+
convInboundCount: number;
|
|
101
|
+
assignedToAgent: boolean;
|
|
102
|
+
humanDecisionWins: boolean;
|
|
103
|
+
status: string;
|
|
104
|
+
tag?: string | null | undefined;
|
|
105
|
+
error?: string | null | undefined;
|
|
106
|
+
createdAt: any;
|
|
107
|
+
}[] | null | undefined;
|
|
71
108
|
}[] | null | undefined;
|
|
72
109
|
loading: boolean;
|
|
73
110
|
refetch: () => void;
|
|
@@ -7,7 +7,7 @@ export type EventType = {
|
|
|
7
7
|
timestamp: number;
|
|
8
8
|
formattedDate: string;
|
|
9
9
|
formattedTime: string;
|
|
10
|
-
type: 'assignee' | 'note' | 'start' | 'end' | 'switch';
|
|
10
|
+
type: 'assignee' | 'note' | 'start' | 'end' | 'switch' | 'classify';
|
|
11
11
|
noteType?: NoteType;
|
|
12
12
|
content: string;
|
|
13
13
|
Icon: React.ReactNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import { QuickReplyPickerItem } from '../utils/quickReplyPicker';
|
|
3
3
|
export interface UseQuickReplyPickerOptions {
|
|
4
4
|
workspaceId: number | undefined;
|
|
@@ -6,12 +6,14 @@ export interface UseQuickReplyPickerOptions {
|
|
|
6
6
|
enabled: boolean;
|
|
7
7
|
noteMode: boolean;
|
|
8
8
|
onSelect: (content: string) => void;
|
|
9
|
+
composerDraft: string;
|
|
10
|
+
setComposerDraft: Dispatch<SetStateAction<string>>;
|
|
9
11
|
}
|
|
10
|
-
export declare function useQuickReplyPicker({ workspaceId, conversationId, enabled, noteMode, onSelect, }: UseQuickReplyPickerOptions): {
|
|
12
|
+
export declare function useQuickReplyPicker({ workspaceId, conversationId, enabled, noteMode, onSelect, composerDraft, setComposerDraft, }: UseQuickReplyPickerOptions): {
|
|
11
13
|
isOpen: boolean;
|
|
12
14
|
filteredItems: QuickReplyPickerItem[];
|
|
13
15
|
highlightedIndex: number;
|
|
14
|
-
setHighlightedIndex:
|
|
16
|
+
setHighlightedIndex: Dispatch<SetStateAction<number>>;
|
|
15
17
|
onComposerInputChange: (text: string) => void;
|
|
16
18
|
selectItem: (item: QuickReplyPickerItem) => void;
|
|
17
19
|
dismiss: () => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const InboxPage: () => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
2
|
-
export default
|
|
2
|
+
export default function InboxPageRoot(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type PortalCall = {
|
|
2
|
+
id: string;
|
|
3
|
+
status: string;
|
|
4
|
+
handler: string;
|
|
5
|
+
workspaceId: number;
|
|
6
|
+
convId: string;
|
|
7
|
+
answeredAt?: string | null;
|
|
8
|
+
};
|
|
9
|
+
export declare function isRingingCall(call?: {
|
|
10
|
+
status?: string | null;
|
|
11
|
+
} | null, enabled?: boolean): boolean;
|
|
12
|
+
export declare function isLiveCall(call?: {
|
|
13
|
+
status?: string | null;
|
|
14
|
+
} | null, enabled?: boolean): boolean;
|
|
15
|
+
export type LocalCallState = {
|
|
16
|
+
id: string;
|
|
17
|
+
status: string;
|
|
18
|
+
answeredAt?: string | null;
|
|
19
|
+
};
|
|
20
|
+
export declare function presentCall<T extends {
|
|
21
|
+
id: string;
|
|
22
|
+
status: string;
|
|
23
|
+
answeredAt?: string | null;
|
|
24
|
+
}>(call: T | null | undefined, local: LocalCallState | null): T | null | undefined;
|
|
25
|
+
export declare function formatCallElapsed(answeredAt?: string | null, now?: number): string;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export
|
|
1
|
+
/** Writing settings that affect enhance output (included in cache key). */
|
|
2
|
+
export type EnhanceWritingCacheSettings = {
|
|
3
|
+
readingLevel: string;
|
|
4
|
+
brandVoice: string;
|
|
5
|
+
};
|
|
6
|
+
/** Enhance cache key: workspace + writing settings + draft (no conversation). */
|
|
7
|
+
export declare function buildEnhanceCacheKey(workspaceId: number, draft: string, writingSettings: EnhanceWritingCacheSettings): string;
|
|
3
8
|
export declare function getPersistedAutoComplete(workspaceId: number, cacheKey: string): string | undefined;
|
|
4
9
|
export declare function setPersistedAutoComplete(workspaceId: number, cacheKey: string, suffix: string): void;
|
|
5
10
|
/** Removes all auto-complete entries for a conversation (e.g. when it is closed). */
|
|
6
11
|
export declare function clearPersistedAutoCompleteForConversation(workspaceId: number, convId: string): void;
|
|
7
|
-
export declare function getPersistedEnhance(workspaceId: number, draft: string): string | undefined;
|
|
8
|
-
export declare function setPersistedEnhance(workspaceId: number, draft: string, enhancedText: string): void;
|
|
12
|
+
export declare function getPersistedEnhance(workspaceId: number, draft: string, writingSettings: EnhanceWritingCacheSettings): string | undefined;
|
|
13
|
+
export declare function setPersistedEnhance(workspaceId: number, draft: string, writingSettings: EnhanceWritingCacheSettings, enhancedText: string): void;
|
|
9
14
|
/** Warm in-memory LRU from localStorage (bounded). */
|
|
10
15
|
export declare function hydrateAutoCompleteMemoryCache(workspaceId: number, memoryCache: {
|
|
11
16
|
set: (key: string, suffix: string) => void;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** First automatic suggestions run once the customer has sent this many messages. */
|
|
2
|
+
export declare const MIN_CUSTOMER_MESSAGES_FOR_SUGGESTIONS = 3;
|
|
3
|
+
/** Suggestions refresh automatically after this many new customer messages. */
|
|
4
|
+
export declare const SUGGESTIONS_REFRESH_EVERY = 5;
|
|
5
|
+
type CountableMessage = {
|
|
6
|
+
isAgent?: boolean | null;
|
|
7
|
+
type?: string | null;
|
|
8
|
+
};
|
|
9
|
+
/** Customer text and voice messages: the content the suggestion model can actually read. */
|
|
10
|
+
export declare const countCustomerMessages: (messages: CountableMessage[] | null | undefined) => number;
|
|
11
|
+
/**
|
|
12
|
+
* Groups message counts so suggestions refresh every few customer messages, not on every poll.
|
|
13
|
+
* Returns 0 while the conversation is too short for useful suggestions.
|
|
14
|
+
*/
|
|
15
|
+
export declare const getSuggestionsBucket: (customerMessages: number) => number;
|
|
16
|
+
type TagLike = {
|
|
17
|
+
tag: string;
|
|
18
|
+
};
|
|
19
|
+
type StageLike = {
|
|
20
|
+
stageId: string;
|
|
21
|
+
};
|
|
22
|
+
type AssigneeLike = {
|
|
23
|
+
agentId: string;
|
|
24
|
+
};
|
|
25
|
+
type SuggestionsLike<T extends TagLike, S extends StageLike, A extends AssigneeLike> = {
|
|
26
|
+
tags: T[];
|
|
27
|
+
stage?: S | null;
|
|
28
|
+
assignee?: A | null;
|
|
29
|
+
};
|
|
30
|
+
export type SuggestionScope = 'conv' | 'client';
|
|
31
|
+
type CurrentState = {
|
|
32
|
+
scope: SuggestionScope;
|
|
33
|
+
tags?: string[] | null;
|
|
34
|
+
stageId?: string | null;
|
|
35
|
+
assigneeId?: string | null;
|
|
36
|
+
/** Keys of suggestions the agent dismissed or already applied in this session. */
|
|
37
|
+
hidden?: Set<string>;
|
|
38
|
+
};
|
|
39
|
+
/** Stable keys for one suggestion, scoped so a conversation and client tag with the same name differ. */
|
|
40
|
+
export declare const suggestionKey: {
|
|
41
|
+
tag: (scope: SuggestionScope, tag: string) => string;
|
|
42
|
+
stage: (scope: SuggestionScope, stageId: string) => string;
|
|
43
|
+
assignee: (agentId: string) => string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Hides suggestions that were applied (the conversation or client already has them)
|
|
47
|
+
* or hidden by the agent, so the card stays in sync with polling without a refetch.
|
|
48
|
+
*/
|
|
49
|
+
export declare const pendingSuggestions: <T extends TagLike, S extends StageLike, A extends AssigneeLike>(suggestions: SuggestionsLike<T, S, A> | null | undefined, { scope, tags, stageId, assigneeId, hidden }: CurrentState) => {
|
|
50
|
+
tags: T[];
|
|
51
|
+
stage: S | null;
|
|
52
|
+
assignee: A | null;
|
|
53
|
+
};
|
|
54
|
+
export declare const hasPendingSuggestions: (pending: {
|
|
55
|
+
tags: unknown[];
|
|
56
|
+
stage?: unknown;
|
|
57
|
+
assignee?: unknown;
|
|
58
|
+
}) => boolean;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ClientSuggestionsPayload, ConvSuggestionsPayload } from '../../../graphql.autogenerated';
|
|
2
|
+
/** Conversations kept per workspace; the least recently used are dropped first. */
|
|
3
|
+
export declare const MAX_CACHED_CONVERSATIONS = 100;
|
|
4
|
+
/** Cached suggestions older than this are fetched again even if no new messages arrived. */
|
|
5
|
+
export declare const SUGGESTIONS_CACHE_TTL_MS: number;
|
|
6
|
+
export type CachedSuggestions = {
|
|
7
|
+
/** Message bucket the suggestions were fetched for (see getSuggestionsBucket). */
|
|
8
|
+
bucket: number;
|
|
9
|
+
savedAt: number;
|
|
10
|
+
conversation: ConvSuggestionsPayload | null;
|
|
11
|
+
client: ClientSuggestionsPayload | null;
|
|
12
|
+
/** Suggestion keys the agent dismissed or applied in this conversation. */
|
|
13
|
+
hidden: string[];
|
|
14
|
+
};
|
|
15
|
+
/** The cached entry for a conversation (any bucket), used to restore dismissed suggestions. */
|
|
16
|
+
export declare function readCachedConversation(workspaceId: number, convId: string): CachedSuggestions | undefined;
|
|
17
|
+
/** Cached suggestions for this exact message bucket, if still fresh. */
|
|
18
|
+
export declare function readCachedSuggestions(workspaceId: number, convId: string, bucket: number, now?: number): CachedSuggestions | undefined;
|
|
19
|
+
export declare function saveSuggestions(workspaceId: number, convId: string, result: Pick<CachedSuggestions, 'bucket' | 'conversation' | 'client'>, now?: number): void;
|
|
20
|
+
export declare function saveHidden(workspaceId: number, convId: string, hidden: string[], now?: number): void;
|
|
@@ -46,6 +46,10 @@ interface BuildLifeCycleMenuOptions {
|
|
|
46
46
|
export declare function getNumOfNewClientMessages(messages: Maybe<Message[]> | undefined): number;
|
|
47
47
|
export declare function getLastMessage(messages: Maybe<Message[]> | undefined, filterFn?: (m: Message) => boolean): Message | undefined;
|
|
48
48
|
export declare function hashStatuses(messages?: Maybe<Message[]> | null): string;
|
|
49
|
+
/** Include reaction fingerprint so reaction updates remount into chat without a status change. */
|
|
50
|
+
export declare function hashReactions(messages?: Maybe<Message[]> | null): string;
|
|
51
|
+
/** Replace or remove the business-side reaction while keeping the client's. */
|
|
52
|
+
export declare function replaceAgentReaction(reactions: Message['reactions'] | undefined, emoji: string | null, agentId?: string | null): NonNullable<Message['reactions']>;
|
|
49
53
|
export declare function isOutside24HourWindow(message: Message | null | undefined): boolean;
|
|
50
54
|
export declare function formatSeconds(value: number): string;
|
|
51
55
|
type StartedTimeAgoTranslation = (key: string, options?: {
|