@webex/contact-center 3.12.0-webex-services-ready.4 → 3.13.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.sdd/manifest.json +24 -13
- package/ai-docs/ARCHITECTURE.md +1 -1
- package/ai-docs/CONTRACTS.md +21 -3
- package/ai-docs/SECURITY.md +1 -1
- package/ai-docs/SERVICE_STATE.md +4 -0
- package/ai-docs/contact-center-spec.md +53 -6
- package/ai-docs/features/consult-transfer-list-policy/spec/feature-spec.md +362 -0
- package/ai-docs/features/contact-owner-change-refactor.md +78 -0
- package/dist/cc.js +816 -26
- package/dist/cc.js.map +1 -1
- package/dist/config.js +7 -0
- package/dist/config.js.map +1 -1
- package/dist/constants.js +29 -2
- package/dist/constants.js.map +1 -1
- package/dist/index.js +66 -12
- package/dist/index.js.map +1 -1
- package/dist/metrics/MetricsManager.js +16 -0
- package/dist/metrics/MetricsManager.js.map +1 -1
- package/dist/metrics/behavioral-events.js +110 -0
- package/dist/metrics/behavioral-events.js.map +1 -1
- package/dist/metrics/constants.js +33 -0
- package/dist/metrics/constants.js.map +1 -1
- package/dist/services/AddressBook.js +18 -15
- package/dist/services/AddressBook.js.map +1 -1
- package/dist/services/AnswerCallOnWebexService.js +202 -0
- package/dist/services/AnswerCallOnWebexService.js.map +1 -0
- package/dist/services/ApiAiAssistant.js +221 -11
- package/dist/services/ApiAiAssistant.js.map +1 -1
- package/dist/services/EntryPoint.js +46 -68
- package/dist/services/EntryPoint.js.map +1 -1
- package/dist/services/Queue.js +27 -22
- package/dist/services/Queue.js.map +1 -1
- package/dist/services/WebCallingService.js +287 -37
- package/dist/services/WebCallingService.js.map +1 -1
- package/dist/services/WebexCrossClientService.js +225 -0
- package/dist/services/WebexCrossClientService.js.map +1 -0
- package/dist/services/WxAppTelephonyMercurySync.js +111 -0
- package/dist/services/WxAppTelephonyMercurySync.js.map +1 -0
- package/dist/services/config/Util.js +46 -46
- package/dist/services/config/Util.js.map +1 -1
- package/dist/services/config/constants.js +34 -77
- package/dist/services/config/constants.js.map +1 -1
- package/dist/services/config/index.js +100 -226
- package/dist/services/config/index.js.map +1 -1
- package/dist/services/config/types.js +55 -35
- package/dist/services/config/types.js.map +1 -1
- package/dist/services/constants.js +11 -1
- package/dist/services/constants.js.map +1 -1
- package/dist/services/core/Err.js.map +1 -1
- package/dist/services/core/Utils.js +25 -1
- package/dist/services/core/Utils.js.map +1 -1
- package/dist/services/core/WebexRequest.js +6 -2
- package/dist/services/core/WebexRequest.js.map +1 -1
- package/dist/services/core/aqm-reqs.js +17 -11
- package/dist/services/core/aqm-reqs.js.map +1 -1
- package/dist/services/core/constants.js +9 -1
- package/dist/services/core/constants.js.map +1 -1
- package/dist/services/core/types.js.map +1 -1
- package/dist/services/core/websocket/WebSocketManager.js +17 -1
- package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
- package/dist/services/task/Task.js +275 -8
- package/dist/services/task/Task.js.map +1 -1
- package/dist/services/task/TaskFactory.js +11 -6
- package/dist/services/task/TaskFactory.js.map +1 -1
- package/dist/services/task/TaskManager.js +590 -42
- package/dist/services/task/TaskManager.js.map +1 -1
- package/dist/services/task/TaskUtils.js +11 -1
- package/dist/services/task/TaskUtils.js.map +1 -1
- package/dist/services/task/WebexCallingUtils.js +70 -0
- package/dist/services/task/WebexCallingUtils.js.map +1 -0
- package/dist/services/task/constants.js +14 -2
- package/dist/services/task/constants.js.map +1 -1
- package/dist/services/task/contact.js +29 -0
- package/dist/services/task/contact.js.map +1 -1
- package/dist/services/task/digital/Digital.js +4 -3
- package/dist/services/task/digital/Digital.js.map +1 -1
- package/dist/services/task/state-machine/TaskStateMachine.js +162 -53
- package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -1
- package/dist/services/task/state-machine/actions.js +6 -1
- package/dist/services/task/state-machine/actions.js.map +1 -1
- package/dist/services/task/state-machine/guards.js +7 -10
- package/dist/services/task/state-machine/guards.js.map +1 -1
- package/dist/services/task/state-machine/types.js.map +1 -1
- package/dist/services/task/state-machine/uiControlsComputer.js +118 -18
- package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -1
- package/dist/services/task/types.js +47 -1
- package/dist/services/task/types.js.map +1 -1
- package/dist/services/task/voice/Voice.js +477 -17
- package/dist/services/task/voice/Voice.js.map +1 -1
- package/dist/services/task/voice/WebRTC.js +6 -3
- package/dist/services/task/voice/WebRTC.js.map +1 -1
- package/dist/services/task/voice/wxAppOfferObservability.js +145 -0
- package/dist/services/task/voice/wxAppOfferObservability.js.map +1 -0
- package/dist/services/task/voice/wxAppVoiceMethods.js +395 -0
- package/dist/services/task/voice/wxAppVoiceMethods.js.map +1 -0
- package/dist/services/wxAppDiagnosticLogging.js +159 -0
- package/dist/services/wxAppDiagnosticLogging.js.map +1 -0
- package/dist/services/wxAppTelephonyUtils.js +19 -0
- package/dist/services/wxAppTelephonyUtils.js.map +1 -0
- package/dist/types/cc.d.ts +127 -9
- package/dist/types/config.d.ts +7 -0
- package/dist/types/constants.d.ts +23 -0
- package/dist/types/index.d.ts +38 -17
- package/dist/types/metrics/MetricsManager.d.ts +6 -0
- package/dist/types/metrics/constants.d.ts +31 -0
- package/dist/types/services/AddressBook.d.ts +2 -1
- package/dist/types/services/AnswerCallOnWebexService.d.ts +38 -0
- package/dist/types/services/ApiAiAssistant.d.ts +48 -4
- package/dist/types/services/EntryPoint.d.ts +7 -5
- package/dist/types/services/Queue.d.ts +5 -3
- package/dist/types/services/WebexCrossClientService.d.ts +32 -0
- package/dist/types/services/WxAppTelephonyMercurySync.d.ts +28 -0
- package/dist/types/services/config/Util.d.ts +4 -8
- package/dist/types/services/config/constants.d.ts +28 -76
- package/dist/types/services/config/index.d.ts +16 -64
- package/dist/types/services/config/types.d.ts +150 -173
- package/dist/types/services/constants.d.ts +9 -0
- package/dist/types/services/core/Err.d.ts +2 -0
- package/dist/types/services/core/Utils.d.ts +10 -0
- package/dist/types/services/core/WebexRequest.d.ts +1 -0
- package/dist/types/services/core/constants.d.ts +7 -0
- package/dist/types/services/core/types.d.ts +2 -0
- package/dist/types/services/task/Task.d.ts +34 -5
- package/dist/types/services/task/TaskFactory.d.ts +4 -2
- package/dist/types/services/task/TaskUtils.d.ts +6 -0
- package/dist/types/services/task/WebexCallingUtils.d.ts +11 -0
- package/dist/types/services/task/constants.d.ts +12 -0
- package/dist/types/services/task/contact.d.ts +4 -0
- package/dist/types/services/task/digital/Digital.d.ts +4 -3
- package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +304 -56
- package/dist/types/services/task/state-machine/guards.d.ts +6 -5
- package/dist/types/services/task/state-machine/types.d.ts +9 -1
- package/dist/types/services/task/types.d.ts +192 -5
- package/dist/types/services/task/voice/Voice.d.ts +68 -11
- package/dist/types/services/task/voice/WebRTC.d.ts +5 -4
- package/dist/types/services/task/voice/wxAppOfferObservability.d.ts +39 -0
- package/dist/types/services/task/voice/wxAppVoiceMethods.d.ts +68 -0
- package/dist/types/services/wxAppDiagnosticLogging.d.ts +63 -0
- package/dist/types/services/wxAppTelephonyUtils.d.ts +5 -0
- package/dist/types/types.d.ts +125 -13
- package/dist/types/utils/PageCache.d.ts +20 -3
- package/dist/types.js +90 -8
- package/dist/types.js.map +1 -1
- package/dist/utils/PageCache.js +19 -5
- package/dist/utils/PageCache.js.map +1 -1
- package/dist/webex.js +9 -1
- package/dist/webex.js.map +1 -1
- package/package.json +10 -9
- package/src/cc.ts +1047 -48
- package/src/config.ts +7 -0
- package/src/constants.ts +36 -0
- package/src/index.ts +49 -11
- package/src/metrics/MetricsManager.ts +16 -0
- package/src/metrics/ai-docs/metrics-spec.md +138 -21
- package/src/metrics/behavioral-events.ts +112 -0
- package/src/metrics/constants.ts +36 -0
- package/src/services/AddressBook.ts +17 -6
- package/src/services/AnswerCallOnWebexService.ts +239 -0
- package/src/services/ApiAiAssistant.ts +297 -13
- package/src/services/EntryPoint.ts +59 -60
- package/src/services/Queue.ts +29 -12
- package/src/services/WebCallingService.ts +362 -40
- package/src/services/WebexCrossClientService.ts +298 -0
- package/src/services/WxAppTelephonyMercurySync.ts +142 -0
- package/src/services/agent/ai-docs/AGENTS.md +1 -1
- package/src/services/agent/ai-docs/agent-spec.md +1 -0
- package/src/services/ai-docs/AGENTS.md +11 -11
- package/src/services/ai-docs/services-spec.md +25 -5
- package/src/services/config/Util.ts +52 -82
- package/src/services/config/ai-docs/AGENTS.md +35 -40
- package/src/services/config/ai-docs/ARCHITECTURE.md +90 -103
- package/src/services/config/ai-docs/config-spec.md +132 -132
- package/src/services/config/constants.ts +39 -85
- package/src/services/config/index.ts +116 -277
- package/src/services/config/types.ts +145 -195
- package/src/services/constants.ts +10 -0
- package/src/services/core/Err.ts +1 -0
- package/src/services/core/Utils.ts +28 -0
- package/src/services/core/WebexRequest.ts +3 -1
- package/src/services/core/ai-docs/core-spec.md +25 -11
- package/src/services/core/aqm-reqs.ts +18 -12
- package/src/services/core/constants.ts +8 -0
- package/src/services/core/types.ts +33 -1
- package/src/services/core/websocket/WebSocketManager.ts +26 -2
- package/src/services/task/Task.ts +386 -12
- package/src/services/task/TaskFactory.ts +33 -6
- package/src/services/task/TaskManager.ts +857 -41
- package/src/services/task/TaskUtils.ts +13 -0
- package/src/services/task/WebexCallingUtils.ts +136 -0
- package/src/services/task/ai-docs/ARCHITECTURE.md +1 -0
- package/src/services/task/ai-docs/task-spec.md +190 -8
- package/src/services/task/constants.ts +13 -0
- package/src/services/task/contact.ts +30 -0
- package/src/services/task/digital/Digital.ts +11 -4
- package/src/services/task/state-machine/TaskStateMachine.ts +235 -81
- package/src/services/task/state-machine/actions.ts +5 -2
- package/src/services/task/state-machine/ai-docs/AGENTS.md +6 -4
- package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +35 -16
- package/src/services/task/state-machine/ai-docs/task-state-machine-spec.md +103 -33
- package/src/services/task/state-machine/guards.ts +7 -10
- package/src/services/task/state-machine/types.ts +16 -1
- package/src/services/task/state-machine/uiControlsComputer.ts +206 -32
- package/src/services/task/types.ts +269 -4
- package/src/services/task/voice/Voice.ts +625 -17
- package/src/services/task/voice/WebRTC.ts +11 -4
- package/src/services/task/voice/wxAppOfferObservability.ts +204 -0
- package/src/services/task/voice/wxAppVoiceMethods.ts +575 -0
- package/src/services/wxAppDiagnosticLogging.ts +286 -0
- package/src/services/wxAppTelephonyUtils.ts +14 -0
- package/src/types.ts +159 -13
- package/src/utils/AGENTS.md +21 -10
- package/src/utils/PageCache.ts +38 -5
- package/src/utils/ai-docs/utils-spec.md +21 -11
- package/src/webex.js +8 -0
- package/test/unit/fixtures/aiSummaryTestUtils.ts +40 -0
- package/test/unit/spec/cc.ts +3595 -120
- package/test/unit/spec/index.ts +891 -0
- package/test/unit/spec/metrics/MetricsManager.ts +25 -0
- package/test/unit/spec/metrics/behavioral-events.ts +60 -0
- package/test/unit/spec/services/AddressBook.ts +37 -6
- package/test/unit/spec/services/AnswerCallOnWebexService.ts +264 -0
- package/test/unit/spec/services/ApiAiAssistant.ts +269 -8
- package/test/unit/spec/services/EntryPoint.ts +87 -40
- package/test/unit/spec/services/Queue.ts +123 -12
- package/test/unit/spec/services/WebCallingService.ts +483 -54
- package/test/unit/spec/services/WebexCrossClientService.ts +509 -0
- package/test/unit/spec/services/WxAppTelephonyMercurySync.ts +136 -0
- package/test/unit/spec/services/config/Util.ts +501 -0
- package/test/unit/spec/services/config/index.ts +313 -543
- package/test/unit/spec/services/core/Utils.ts +22 -0
- package/test/unit/spec/services/core/WebexRequest.ts +8 -7
- package/test/unit/spec/services/core/aqm-reqs.ts +142 -1
- package/test/unit/spec/services/core/websocket/WebSocketManager.ts +64 -14
- package/test/unit/spec/services/task/Task.ts +2257 -11
- package/test/unit/spec/services/task/TaskFactory.ts +56 -2
- package/test/unit/spec/services/task/TaskManager.ts +5559 -1493
- package/test/unit/spec/services/task/TaskUtils.ts +72 -0
- package/test/unit/spec/services/task/WebexCallingUtils.ts +153 -0
- package/test/unit/spec/services/task/contact.ts +33 -0
- package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +1501 -92
- package/test/unit/spec/services/task/state-machine/guards.ts +210 -8
- package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +445 -7
- package/test/unit/spec/services/task/voice/Voice.ts +1710 -4
- package/test/unit/spec/services/task/voice/wxAppOfferObservability.ts +361 -0
- package/test/unit/spec/services/task/voice/wxAppVoiceMethods.ts +719 -0
- package/test/unit/spec/services/wxAppDiagnosticLogging.ts +179 -0
- package/test/unit/spec/wellnessSampleUtils.ts +288 -0
- package/typedoc.md +1 -1
- package/umd/contact-center.min.js +2 -2
- package/umd/contact-center.min.js.map +1 -1
|
@@ -22,7 +22,7 @@ export declare const DESTINATION_TYPE: {
|
|
|
22
22
|
DIALNUMBER: string;
|
|
23
23
|
/** Route task to a specific agent */
|
|
24
24
|
AGENT: string;
|
|
25
|
-
/** Route task to an entry point
|
|
25
|
+
/** Route task to an entry point */
|
|
26
26
|
ENTRYPOINT: string;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
@@ -203,6 +203,10 @@ export declare enum TASK_EVENTS {
|
|
|
203
203
|
* Triggered whenever task UI controls are recalculated
|
|
204
204
|
*/
|
|
205
205
|
TASK_UI_CONTROLS_UPDATED = "task:ui-controls-updated",
|
|
206
|
+
/**
|
|
207
|
+
* Triggered when wxApp mute state changes from Webex App (Mercury sync or call details).
|
|
208
|
+
*/
|
|
209
|
+
TASK_WXAPP_MUTE_STATE_UPDATED = "task:wxapp-mute-state-updated",
|
|
206
210
|
/**
|
|
207
211
|
* Triggered when a consultation request is accepted
|
|
208
212
|
* @example
|
|
@@ -623,7 +627,26 @@ export declare enum TASK_EVENTS {
|
|
|
623
627
|
* });
|
|
624
628
|
* ```
|
|
625
629
|
*/
|
|
626
|
-
TASK_CAMPAIGN_CONTACT_UPDATED = "task:campaignContactUpdated"
|
|
630
|
+
TASK_CAMPAIGN_CONTACT_UPDATED = "task:campaignContactUpdated",
|
|
631
|
+
/**
|
|
632
|
+
* Triggered when a mid-call summary is received for the task.
|
|
633
|
+
*/
|
|
634
|
+
TASK_MID_CALL_SUMMARY_RECEIVED = "task:midCallSummaryReceived",
|
|
635
|
+
/**
|
|
636
|
+
* Triggered on the task object when AI feature enablement flags arrive for that task's interaction.
|
|
637
|
+
* Fires immediately if the frame arrived after the task was registered, or at registration time
|
|
638
|
+
* if the frame arrived before the task (orphan retention). Consumers should use this event
|
|
639
|
+
* instead of the cc-level `FEATURE_ENABLEMENT` event so they do not need to maintain an
|
|
640
|
+
* interactionId → flags map manually.
|
|
641
|
+
* @example
|
|
642
|
+
* ```typescript
|
|
643
|
+
* task.on(TASK_EVENTS.TASK_FEATURE_ENABLEMENT, (enablement: AISummaryFeatureEnablement) => {
|
|
644
|
+
* const { midCallEnabled, postCallEnabled } = enablement;
|
|
645
|
+
* // gate summary UI on these flags
|
|
646
|
+
* });
|
|
647
|
+
* ```
|
|
648
|
+
*/
|
|
649
|
+
TASK_FEATURE_ENABLEMENT = "task:featureEnablement"
|
|
627
650
|
}
|
|
628
651
|
/**
|
|
629
652
|
* Represents a customer interaction within the contact center system
|
|
@@ -1051,6 +1074,8 @@ export type TaskData = {
|
|
|
1051
1074
|
reservedAgentChannelId?: string;
|
|
1052
1075
|
/** Indicates if wrap-up is required for this task */
|
|
1053
1076
|
wrapUpRequired?: boolean;
|
|
1077
|
+
/** SDK-internal: skip task:outdialFailed when non-wxApp agent-terminated outdial still needs wrapup */
|
|
1078
|
+
suppressOutdialFailedPopup?: boolean;
|
|
1054
1079
|
/**
|
|
1055
1080
|
* Current consultation status derived from state machine
|
|
1056
1081
|
* Values: CONSULT_INITIATED, CONSULT_ACCEPTED, BEING_CONSULTED,
|
|
@@ -1121,6 +1146,17 @@ export type InteractionUIControls = {
|
|
|
1121
1146
|
mergeToConference: TaskUIControlState;
|
|
1122
1147
|
wrapup: TaskUIControlState;
|
|
1123
1148
|
switch: TaskUIControlState;
|
|
1149
|
+
keypad?: TaskUIControlState;
|
|
1150
|
+
};
|
|
1151
|
+
/** Options for {@link ITask.toggleMute} — wxApp engaged calls use `muted` for target state. */
|
|
1152
|
+
export type TaskToggleMuteOptions = {
|
|
1153
|
+
muted?: boolean;
|
|
1154
|
+
lineOwnerId?: string;
|
|
1155
|
+
};
|
|
1156
|
+
/** Options for {@link ITask.transmitDtmf} — wxApp engaged in-call DTMF. */
|
|
1157
|
+
export type TaskTransmitDtmfOptions = {
|
|
1158
|
+
dtmf: string;
|
|
1159
|
+
lineOwnerId?: string;
|
|
1124
1160
|
};
|
|
1125
1161
|
export type TaskUILeg = 'main' | 'consult';
|
|
1126
1162
|
/**
|
|
@@ -1132,6 +1168,14 @@ export type TaskUIControls = {
|
|
|
1132
1168
|
main: InteractionUIControls;
|
|
1133
1169
|
consult: InteractionUIControls;
|
|
1134
1170
|
activeLeg: TaskUILeg;
|
|
1171
|
+
/**
|
|
1172
|
+
* Ordered destination categories available for each action.
|
|
1173
|
+
* The first category is the default for consumers that render a destination picker.
|
|
1174
|
+
*/
|
|
1175
|
+
consultTransferDestinations: {
|
|
1176
|
+
consult: ConsultTransferDestinationType[];
|
|
1177
|
+
transfer: ConsultTransferDestinationType[];
|
|
1178
|
+
};
|
|
1135
1179
|
};
|
|
1136
1180
|
/**
|
|
1137
1181
|
* Helper class for managing task action control state
|
|
@@ -1491,6 +1535,74 @@ export type ParticipantBooleanKey = 'autoAnswerEnabled' | 'hasJoined' | 'hasLeft
|
|
|
1491
1535
|
* @public
|
|
1492
1536
|
*/
|
|
1493
1537
|
export type TaskResponse = AgentContact | Error | void;
|
|
1538
|
+
/** AI-assisted mid-call summary action. @public */
|
|
1539
|
+
export type AISummaryAction = 'CONSULT' | 'TRANSFER';
|
|
1540
|
+
/** Feedback value sent with an AI summary response. @public */
|
|
1541
|
+
export type AISummaryFeedback = 'none' | 'thumbs_up' | 'thumbs_down';
|
|
1542
|
+
/** AI summary response state for post-call and mid-call flows. @public */
|
|
1543
|
+
export type AISummaryState = 'DEFAULT' | 'EXCLUDED' | 'IGNORED' | 'MID_CALL_CANCELLED' | 'NOT_RECEIVED';
|
|
1544
|
+
/** Structured fields shared by post-call and mid-call summaries. @public */
|
|
1545
|
+
export type AISummarySections = {
|
|
1546
|
+
initialContactReason?: string;
|
|
1547
|
+
additionalContactReasons?: string;
|
|
1548
|
+
additionalContext?: string;
|
|
1549
|
+
keyActionsTaken?: string;
|
|
1550
|
+
nextSteps?: string;
|
|
1551
|
+
reasonForTransferOrConsult?: string;
|
|
1552
|
+
};
|
|
1553
|
+
/** RTD payload returned or delivered for an AI summary. @public */
|
|
1554
|
+
export type AISummary = {
|
|
1555
|
+
conversationId: string;
|
|
1556
|
+
adaptiveCard?: Record<string, unknown>;
|
|
1557
|
+
adaptiveCardId?: string;
|
|
1558
|
+
editAdaptiveCard?: Record<string, unknown>;
|
|
1559
|
+
editAdaptiveCardId?: string;
|
|
1560
|
+
areTranscriptsAvailable?: boolean;
|
|
1561
|
+
languageCode?: string;
|
|
1562
|
+
resolution?: string;
|
|
1563
|
+
sections?: AISummarySections;
|
|
1564
|
+
suggestedWrapUpCodes?: Array<{
|
|
1565
|
+
name: string;
|
|
1566
|
+
[key: string]: unknown;
|
|
1567
|
+
}>;
|
|
1568
|
+
suggestedWrapUpCodesMessage?: string;
|
|
1569
|
+
summaryText?: string;
|
|
1570
|
+
timestamp?: number;
|
|
1571
|
+
[key: string]: unknown;
|
|
1572
|
+
};
|
|
1573
|
+
/** RTD payload describing AI-summary feature enablement for an interaction. @public */
|
|
1574
|
+
export type AISummaryFeatureEnablement = {
|
|
1575
|
+
interactionId: string;
|
|
1576
|
+
midCallEnabled?: boolean;
|
|
1577
|
+
postCallEnabled?: boolean;
|
|
1578
|
+
actionTimestamp?: number;
|
|
1579
|
+
[key: string]: unknown;
|
|
1580
|
+
};
|
|
1581
|
+
/** Current AI-summary capabilities for a task. @public */
|
|
1582
|
+
export type AISummaryCapabilities = Required<Pick<AISummaryFeatureEnablement, 'midCallEnabled' | 'postCallEnabled'>>;
|
|
1583
|
+
/**
|
|
1584
|
+
* Payload sent when reporting a post-call or mid-call summary result.
|
|
1585
|
+
* Transport timestamps are generated by the SDK when the response is sent.
|
|
1586
|
+
* @public
|
|
1587
|
+
*/
|
|
1588
|
+
export type AISummaryResponse = {
|
|
1589
|
+
summary: AISummarySections | string;
|
|
1590
|
+
feedback: AISummaryFeedback;
|
|
1591
|
+
state: AISummaryState;
|
|
1592
|
+
numberOfTimesViewed: number;
|
|
1593
|
+
numberOfTimesEdited: number;
|
|
1594
|
+
numberOfTimesCopied: number;
|
|
1595
|
+
summaryReceived?: boolean;
|
|
1596
|
+
wrapUpCode?: string;
|
|
1597
|
+
};
|
|
1598
|
+
/**
|
|
1599
|
+
* Request payload for removing a supported participant from an active conference.
|
|
1600
|
+
* @public
|
|
1601
|
+
*/
|
|
1602
|
+
export type DropConferenceParticipantPayload = {
|
|
1603
|
+
/** Participant identifier supplied by the current task roster. */
|
|
1604
|
+
participantId: string;
|
|
1605
|
+
};
|
|
1494
1606
|
/**
|
|
1495
1607
|
* Payload shape used by consult conference helper utilities.
|
|
1496
1608
|
*/
|
|
@@ -1523,6 +1635,11 @@ export interface ITask extends IEventEmitter {
|
|
|
1523
1635
|
* and participant data as defined in {@link TaskData}
|
|
1524
1636
|
*/
|
|
1525
1637
|
data: TaskData;
|
|
1638
|
+
/**
|
|
1639
|
+
* Current AI-summary capabilities for this task. Both flags are false until
|
|
1640
|
+
* the matching feature-enablement event is received.
|
|
1641
|
+
*/
|
|
1642
|
+
readonly aiSummaryCapabilities: Readonly<AISummaryCapabilities>;
|
|
1526
1643
|
/**
|
|
1527
1644
|
* Map associating tasks with their corresponding call identifiers.
|
|
1528
1645
|
*/
|
|
@@ -1539,6 +1656,14 @@ export interface ITask extends IEventEmitter {
|
|
|
1539
1656
|
* Subscribe to {@link TASK_EVENTS.TASK_UI_CONTROLS_UPDATED} for change notifications.
|
|
1540
1657
|
*/
|
|
1541
1658
|
readonly uiControls: TaskUIControls;
|
|
1659
|
+
/**
|
|
1660
|
+
* Current wxApp mute state for engaged telephony (Voice tasks only).
|
|
1661
|
+
*/
|
|
1662
|
+
getWxAppMuted?(): boolean;
|
|
1663
|
+
/**
|
|
1664
|
+
* Re-seed wxApp mute from GET telephony/calls/{callId}. Resolves to muted state when known.
|
|
1665
|
+
*/
|
|
1666
|
+
syncWxAppMuteFromCallDetails?(): Promise<boolean | undefined>;
|
|
1542
1667
|
state?: any;
|
|
1543
1668
|
/**
|
|
1544
1669
|
* Cancels the auto-wrapup timer for the task.
|
|
@@ -1547,6 +1672,30 @@ export interface ITask extends IEventEmitter {
|
|
|
1547
1672
|
* @returns void
|
|
1548
1673
|
*/
|
|
1549
1674
|
cancelAutoWrapupTimer(): void;
|
|
1675
|
+
/**
|
|
1676
|
+
* Requests an AI-generated post-call summary for this task.
|
|
1677
|
+
* @returns Promise resolving with the matching post-call summary payload.
|
|
1678
|
+
*/
|
|
1679
|
+
requestPostCallSummary(): Promise<AISummary>;
|
|
1680
|
+
/**
|
|
1681
|
+
* Sends the consumer's post-call summary response.
|
|
1682
|
+
* @param response - Validated post-call response observations and summary state.
|
|
1683
|
+
* @returns Promise resolving when AI Assistant acknowledges the response.
|
|
1684
|
+
*/
|
|
1685
|
+
sendPostCallSummaryResponse(response: AISummaryResponse): Promise<void>;
|
|
1686
|
+
/**
|
|
1687
|
+
* Requests an AI-generated mid-call summary for a consult or transfer flow.
|
|
1688
|
+
* @param action - The consult or transfer flow requesting the summary.
|
|
1689
|
+
* @returns Promise resolving with the matching mid-call summary payload.
|
|
1690
|
+
*/
|
|
1691
|
+
requestMidCallSummary(action: AISummaryAction): Promise<AISummary>;
|
|
1692
|
+
/**
|
|
1693
|
+
* Sends the consumer's mid-call summary response for a consult or transfer flow.
|
|
1694
|
+
* @param response - Validated mid-call response observations and summary state.
|
|
1695
|
+
* @param action - The consult or transfer flow responding to the summary.
|
|
1696
|
+
* @returns Promise resolving when AI Assistant acknowledges the response.
|
|
1697
|
+
*/
|
|
1698
|
+
sendMidCallSummaryResponse(response: AISummaryResponse, action: AISummaryAction): Promise<void>;
|
|
1550
1699
|
/**
|
|
1551
1700
|
* Deregisters all web call event listeners.
|
|
1552
1701
|
* Used when cleaning up task resources.
|
|
@@ -1690,6 +1839,17 @@ export interface ITask extends IEventEmitter {
|
|
|
1690
1839
|
* ```
|
|
1691
1840
|
*/
|
|
1692
1841
|
consultConference(): Promise<TaskResponse>;
|
|
1842
|
+
/**
|
|
1843
|
+
* Removes a supported participant from the active conference.
|
|
1844
|
+
* Resolves after the correlated ParticipantLeftConference routing event.
|
|
1845
|
+
* @param payload - Participant identifier to remove
|
|
1846
|
+
* @returns Promise<TaskResponse>
|
|
1847
|
+
* @example
|
|
1848
|
+
* ```typescript
|
|
1849
|
+
* await task.dropConferenceParticipant({participantId: 'participant-id'});
|
|
1850
|
+
* ```
|
|
1851
|
+
*/
|
|
1852
|
+
dropConferenceParticipant(payload: DropConferenceParticipantPayload): Promise<TaskResponse>;
|
|
1693
1853
|
/**
|
|
1694
1854
|
* Exits from an ongoing conference.
|
|
1695
1855
|
* @returns Promise<TaskResponse>
|
|
@@ -1721,14 +1881,28 @@ export interface ITask extends IEventEmitter {
|
|
|
1721
1881
|
*/
|
|
1722
1882
|
switchCall(): Promise<TaskResponse>;
|
|
1723
1883
|
/**
|
|
1724
|
-
* Toggles mute/unmute for the
|
|
1884
|
+
* Toggles mute/unmute for the active call.
|
|
1885
|
+
* WebRTC tasks toggle the local stream; wxApp engaged tasks route to telephony mute REST when
|
|
1886
|
+
* `enableWxBetterTogether` is active.
|
|
1887
|
+
* @param options - Optional target mute state (`muted`) for wxApp; ignored for WebRTC toggle.
|
|
1725
1888
|
* @returns Promise<void>
|
|
1726
1889
|
* @example
|
|
1727
1890
|
* ```typescript
|
|
1728
1891
|
* await task.toggleMute();
|
|
1892
|
+
* await task.toggleMute({ muted: true });
|
|
1893
|
+
* ```
|
|
1894
|
+
*/
|
|
1895
|
+
toggleMute(options?: TaskToggleMuteOptions): Promise<void>;
|
|
1896
|
+
/**
|
|
1897
|
+
* Sends in-call DTMF tones for wxApp engaged telephony tasks when `enableWxBetterTogether` is active.
|
|
1898
|
+
* @param options - DTMF digit(s) and optional shared-line owner id.
|
|
1899
|
+
* @returns Promise<void>
|
|
1900
|
+
* @example
|
|
1901
|
+
* ```typescript
|
|
1902
|
+
* await task.transmitDtmf({ dtmf: '5' });
|
|
1729
1903
|
* ```
|
|
1730
1904
|
*/
|
|
1731
|
-
|
|
1905
|
+
transmitDtmf(options: TaskTransmitDtmfOptions): Promise<void>;
|
|
1732
1906
|
}
|
|
1733
1907
|
/**
|
|
1734
1908
|
* Interface for managing digital channel task operations in the contact center
|
|
@@ -1762,6 +1936,12 @@ export interface IVoice extends ITask {
|
|
|
1762
1936
|
* ```
|
|
1763
1937
|
*/
|
|
1764
1938
|
holdResume(): Promise<TaskResponse>;
|
|
1939
|
+
/** @see wxAppVoiceMethods — WXCC-6026 */
|
|
1940
|
+
isWebexAppCallingOffer(): boolean;
|
|
1941
|
+
/** @see wxAppVoiceMethods — WXCC-6026 */
|
|
1942
|
+
getCallingDeviceDetails(): import('./WebexCallingUtils').WebexCallingDeviceDetails | undefined;
|
|
1943
|
+
/** @see wxAppVoiceMethods — WXCC-6026 */
|
|
1944
|
+
getWebexCallingCallId(): string | null;
|
|
1765
1945
|
}
|
|
1766
1946
|
/**
|
|
1767
1947
|
* Configuration options for voice task UI controls
|
|
@@ -1771,6 +1951,11 @@ export type VoiceUIControlOptions = {
|
|
|
1771
1951
|
isEndConsultEnabled?: boolean;
|
|
1772
1952
|
voiceVariant?: VoiceVariant;
|
|
1773
1953
|
isRecordingEnabled?: boolean;
|
|
1954
|
+
enableWxBetterTogether?: boolean;
|
|
1955
|
+
consultTransferConfig?: ConsultTransferDestinationConfig;
|
|
1956
|
+
answerCallOnWebexService?: import('../AnswerCallOnWebexService').default;
|
|
1957
|
+
/** Read-only observability: whether usersub answer-calls-on-wxcc is active this session. */
|
|
1958
|
+
getUsersubPublished?: () => boolean;
|
|
1774
1959
|
};
|
|
1775
1960
|
/**
|
|
1776
1961
|
* Participant information for UI display
|
|
@@ -1793,7 +1978,7 @@ export interface IWebRTC extends IVoice {
|
|
|
1793
1978
|
* task.toggleMute();
|
|
1794
1979
|
* ```
|
|
1795
1980
|
*/
|
|
1796
|
-
toggleMute(): Promise<void>;
|
|
1981
|
+
toggleMute(options?: TaskToggleMuteOptions): Promise<void>;
|
|
1797
1982
|
/**
|
|
1798
1983
|
* Decline the incoming task for Browser Login
|
|
1799
1984
|
*
|
|
@@ -1817,6 +2002,8 @@ export type WebSocketPayload = TaskData & {
|
|
|
1817
2002
|
type: string;
|
|
1818
2003
|
mediaResourceId?: string;
|
|
1819
2004
|
reason?: string;
|
|
2005
|
+
/** ContactEnded: party that ended the contact (e.g. 'Agent', 'Customer') */
|
|
2006
|
+
terminatingParty?: string;
|
|
1820
2007
|
/**
|
|
1821
2008
|
* Optional real-time transcript chunk payload.
|
|
1822
2009
|
* Present on REAL_TIME_TRANSCRIPTION notifications.
|
|
@@ -1,25 +1,75 @@
|
|
|
1
1
|
import routingContact from '../contact';
|
|
2
|
-
import { ConsultPayload, ConsultEndPayload, ResumeRecordingPayload, TaskData, TaskResponse, IVoice, VoiceUIControlOptions, TransferPayLoad } from '../types';
|
|
2
|
+
import { ConsultPayload, ConsultEndPayload, ResumeRecordingPayload, TaskData, TaskResponse, DropConferenceParticipantPayload, IVoice, VoiceUIControlOptions, TaskToggleMuteOptions, TaskTransmitDtmfOptions, TransferPayLoad } from '../types';
|
|
3
3
|
import Task from '../Task';
|
|
4
4
|
import { TaskActionArgs } from '../state-machine';
|
|
5
|
-
import { WrapupData } from '../../config/types';
|
|
5
|
+
import type { WrapupData } from '../../config/types';
|
|
6
|
+
import type ApiAIAssistant from '../../ApiAiAssistant';
|
|
6
7
|
export default class Voice extends Task implements IVoice {
|
|
7
|
-
|
|
8
|
+
private static readonly WXAPP_MUTE_SYNC_RETRY_DELAY_MS;
|
|
9
|
+
private static readonly WXAPP_MUTE_SYNC_MAX_RETRIES;
|
|
10
|
+
private answerCallOnWebexService?;
|
|
11
|
+
private enableWxBetterTogether;
|
|
12
|
+
private wxAppMuted;
|
|
13
|
+
private wxAppAnswerPending;
|
|
14
|
+
private wxAppAcceptInFlight;
|
|
15
|
+
private wxAppMuteSyncInFlight?;
|
|
16
|
+
private wxAppMuteToggleTail;
|
|
17
|
+
private wxAppDtmfTail;
|
|
18
|
+
/** Lazy — `super()` may call `updateUiControls` before field initializers run. */
|
|
19
|
+
private wxAppOfferObservability;
|
|
20
|
+
private getUsersubPublished?;
|
|
21
|
+
constructor(contact: ReturnType<typeof routingContact>, data: TaskData, callOptions?: VoiceUIControlOptions, wrapupData?: WrapupData, agentId?: string, agentName?: string, apiAIAssistant?: ApiAIAssistant);
|
|
22
|
+
private getWxAppVoiceDependencies;
|
|
23
|
+
/** @deprecated Use {@link Voice.getWxAppVoiceDependencies} */
|
|
24
|
+
private getWxAppVoiceDeps;
|
|
25
|
+
isWebexAppCallingOffer(): boolean;
|
|
26
|
+
isWebexAppInboundCallingOffer(): boolean;
|
|
27
|
+
private setWxAppAnswerPending;
|
|
28
|
+
private setWxAppAcceptInFlight;
|
|
29
|
+
setEnableWxBetterTogether(enabled: boolean): void;
|
|
30
|
+
private getOrCreateWxAppOfferObservability;
|
|
31
|
+
protected updateUiControls(forceEmit?: boolean): void;
|
|
32
|
+
/**
|
|
33
|
+
* Re-run OFFERED wxApp diagnostics without emitting UI controls.
|
|
34
|
+
* Used after usersub publish so a pre-publish offer can schedule mismatch grace.
|
|
35
|
+
*/
|
|
36
|
+
refreshWxAppOfferObservability(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Cancel pending participant-mismatch grace timer. Observability only.
|
|
39
|
+
*/
|
|
40
|
+
disposeWxAppOfferObservability(): void;
|
|
41
|
+
private getWxAppOfferObservabilityContext;
|
|
42
|
+
applyWxAppMuteStateFromSync(incomingCallId: string, muted: boolean): void;
|
|
43
|
+
getWxAppMuted(): boolean;
|
|
44
|
+
private static delay;
|
|
45
|
+
private canRetryWxAppMuteSync;
|
|
46
|
+
private shouldSkipWxAppMuteSync;
|
|
47
|
+
private applyWxAppMuteFromBackfill;
|
|
48
|
+
syncWxAppMuteFromCallDetails(retryAttempt?: number): Promise<boolean | undefined>;
|
|
49
|
+
private performWxAppMuteSync;
|
|
50
|
+
protected onTaskAssigned(): void;
|
|
51
|
+
protected onTaskHydrated(): void;
|
|
52
|
+
getCallingDeviceDetails(): import("../WebexCallingUtils").WebexCallingDeviceDetails;
|
|
53
|
+
getWebexCallingCallId(): string | null;
|
|
54
|
+
private createWxAppLifecycle;
|
|
8
55
|
private getStateMachineSnapshot;
|
|
56
|
+
private getWxAppAcceptReasonForMetrics;
|
|
9
57
|
/**
|
|
10
|
-
*
|
|
11
|
-
* It is expected to be overridden by child classes.
|
|
12
|
-
* @returns Promise<TaskResponse>
|
|
13
|
-
* @throws Error
|
|
58
|
+
* Accepts the task. Routes to wxApp telephony answer when `enableWxBetterTogether` and wxApp offer.
|
|
14
59
|
*/
|
|
15
60
|
accept(): Promise<TaskResponse>;
|
|
16
61
|
/**
|
|
17
|
-
*
|
|
18
|
-
* It is expected to be overridden by child classes.
|
|
19
|
-
* @returns Promise<TaskResponse>
|
|
20
|
-
* @throws Error
|
|
62
|
+
* Declines the task. Routes wxApp inbound to telephony reject; wxApp outdial offer to cancelTask.
|
|
21
63
|
*/
|
|
22
64
|
decline(): Promise<TaskResponse>;
|
|
65
|
+
/**
|
|
66
|
+
* Toggles mute for wxApp engaged telephony when `enableWxBetterTogether` is active.
|
|
67
|
+
*/
|
|
68
|
+
toggleMute(options?: TaskToggleMuteOptions): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Sends in-call DTMF for wxApp engaged telephony when `enableWxBetterTogether` is active.
|
|
71
|
+
*/
|
|
72
|
+
transmitDtmf(options: TaskTransmitDtmfOptions): Promise<void>;
|
|
23
73
|
/**
|
|
24
74
|
* This is used to hold the task.
|
|
25
75
|
* @returns Promise<TaskResponse>
|
|
@@ -121,6 +171,13 @@ export default class Voice extends Task implements IVoice {
|
|
|
121
171
|
* Start a consult conference, merging main and consult calls.
|
|
122
172
|
*/
|
|
123
173
|
consultConference(): Promise<TaskResponse>;
|
|
174
|
+
/**
|
|
175
|
+
* Removes another participant from an active conference.
|
|
176
|
+
* Completion is correlated with ParticipantLeftConference by the AQM request layer.
|
|
177
|
+
* @param payload - Participant identifier to remove
|
|
178
|
+
* @returns Promise<TaskResponse>
|
|
179
|
+
*/
|
|
180
|
+
dropConferenceParticipant(payload: DropConferenceParticipantPayload): Promise<TaskResponse>;
|
|
124
181
|
/**
|
|
125
182
|
* Exit from a conference call.
|
|
126
183
|
* Per conference-spec.md:
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import routingContact from '../contact';
|
|
2
|
-
import { TaskData, TaskResponse, IWebRTC, VoiceUIControlOptions } from '../types';
|
|
2
|
+
import { TaskData, TaskResponse, IWebRTC, VoiceUIControlOptions, TaskToggleMuteOptions } from '../types';
|
|
3
3
|
import Voice from './Voice';
|
|
4
4
|
import WebCallingService from '../../WebCallingService';
|
|
5
|
-
import { WrapupData } from '../../config/types';
|
|
5
|
+
import type { WrapupData } from '../../config/types';
|
|
6
|
+
import type ApiAIAssistant from '../../ApiAiAssistant';
|
|
6
7
|
export default class WebRTC extends Voice implements IWebRTC {
|
|
7
8
|
private localAudioStream;
|
|
8
9
|
private webCallingService;
|
|
9
|
-
constructor(contact: ReturnType<typeof routingContact>, webCallingService: WebCallingService, data: TaskData, callOptions?: VoiceUIControlOptions, wrapupData?: WrapupData, agentId?: string);
|
|
10
|
+
constructor(contact: ReturnType<typeof routingContact>, webCallingService: WebCallingService, data: TaskData, callOptions?: VoiceUIControlOptions, wrapupData?: WrapupData, agentId?: string, agentName?: string, apiAIAssistant?: ApiAIAssistant);
|
|
10
11
|
private registerWebCallListeners;
|
|
11
12
|
private handleRemoteMedia;
|
|
12
13
|
/**
|
|
@@ -49,5 +50,5 @@ export default class WebRTC extends Voice implements IWebRTC {
|
|
|
49
50
|
* task.toggleMute().then(()=>{}).catch(()=>{})
|
|
50
51
|
* ```
|
|
51
52
|
*/
|
|
52
|
-
toggleMute(): Promise<void>;
|
|
53
|
+
toggleMute(options?: TaskToggleMuteOptions): Promise<void>;
|
|
53
54
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import MetricsManager from '../../../metrics/MetricsManager';
|
|
2
|
+
import { TaskState } from '../state-machine';
|
|
3
|
+
import { VoiceVariant } from '../types';
|
|
4
|
+
import { WxAppVoiceDependencies } from './wxAppVoiceMethods';
|
|
5
|
+
/** Defer mismatch WARN/metric so transient WS ordering gaps (~200–300 ms) do not false-alarm. */
|
|
6
|
+
export declare const WXAPP_PARTICIPANT_MISMATCH_GRACE_MS = 500;
|
|
7
|
+
export type WxAppOfferObservabilityContext = {
|
|
8
|
+
getInteractionId: () => string;
|
|
9
|
+
getTaskState: () => TaskState | undefined;
|
|
10
|
+
getAcceptControl: () => {
|
|
11
|
+
isVisible: boolean;
|
|
12
|
+
isEnabled: boolean;
|
|
13
|
+
} | undefined;
|
|
14
|
+
getVoiceVariant: () => VoiceVariant;
|
|
15
|
+
isOutdial: () => boolean;
|
|
16
|
+
isWxAppInboundOffer: () => boolean;
|
|
17
|
+
isWxAppCallingOffer: () => boolean;
|
|
18
|
+
getWxAppAcceptInFlight: () => boolean;
|
|
19
|
+
getWxAppAnswerPending: () => boolean;
|
|
20
|
+
getEnableWxBetterTogether: () => boolean;
|
|
21
|
+
getUsersubPublished: () => boolean;
|
|
22
|
+
getWxAppVoiceDependencies: () => WxAppVoiceDependencies;
|
|
23
|
+
getMetricsManager: () => MetricsManager;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* OFFERED-state wxApp offer diagnostics: acceptReason logging and deferred participant mismatch.
|
|
27
|
+
* Invoked from Voice.updateUiControls — observability only.
|
|
28
|
+
*/
|
|
29
|
+
export declare class WxAppOfferObservability {
|
|
30
|
+
private lastLoggedWxAppAcceptReason?;
|
|
31
|
+
private lastLoggedWxAppParticipantMismatch;
|
|
32
|
+
private wxAppParticipantMismatchGraceTimer?;
|
|
33
|
+
private disposed;
|
|
34
|
+
handleUiControlsUpdate(ctx: WxAppOfferObservabilityContext): void;
|
|
35
|
+
dispose(): void;
|
|
36
|
+
private cancelGraceTimer;
|
|
37
|
+
private scheduleGraceTimer;
|
|
38
|
+
private emitParticipantMismatchIfStillNeeded;
|
|
39
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import AnswerCallOnWebexService from '../../AnswerCallOnWebexService';
|
|
2
|
+
import { TaskData, TaskToggleMuteOptions, TaskTransmitDtmfOptions } from '../types';
|
|
3
|
+
import { TaskState } from '../state-machine';
|
|
4
|
+
import MetricsManager from '../../../metrics/MetricsManager';
|
|
5
|
+
import { WebexCallingDeviceDetails } from '../WebexCallingUtils';
|
|
6
|
+
import { type WxAppAcceptReason } from '../../wxAppDiagnosticLogging';
|
|
7
|
+
export type WxAppVoiceDependencies = {
|
|
8
|
+
enableWxBetterTogether: boolean;
|
|
9
|
+
answerCallOnWebexService?: AnswerCallOnWebexService;
|
|
10
|
+
agentId?: string;
|
|
11
|
+
metricsManager: MetricsManager;
|
|
12
|
+
getTaskData: () => TaskData;
|
|
13
|
+
getTaskState: () => TaskState | undefined;
|
|
14
|
+
getWxAppMuted: () => boolean;
|
|
15
|
+
setWxAppMuted: (muted: boolean) => void;
|
|
16
|
+
/** Read-only observability: whether usersub answer-calls-on-wxcc is active this session. */
|
|
17
|
+
getUsersubPublished?: () => boolean;
|
|
18
|
+
};
|
|
19
|
+
export type WxAppParticipantDiagnostics = {
|
|
20
|
+
participantDeviceType?: string;
|
|
21
|
+
hasDeviceCallId: boolean;
|
|
22
|
+
hasDeviceId: boolean;
|
|
23
|
+
hasValidWxAppParticipant: boolean;
|
|
24
|
+
};
|
|
25
|
+
/** @deprecated Use {@link WxAppVoiceDependencies} */
|
|
26
|
+
export type WxAppVoiceDeps = WxAppVoiceDependencies;
|
|
27
|
+
export type WxAppVoiceLifecycle = {
|
|
28
|
+
setWxAppAcceptInFlight: (inFlight: boolean) => void;
|
|
29
|
+
setWxAppAnswerPending: (pending: boolean) => void;
|
|
30
|
+
resetWxAppMuted: () => void;
|
|
31
|
+
syncWxAppMuteFromCallDetails: () => Promise<boolean | undefined>;
|
|
32
|
+
mapWxAppVoiceError: (error: unknown, method: string) => never;
|
|
33
|
+
};
|
|
34
|
+
export declare function getWxAppParticipantDiagnostics(deps: WxAppVoiceDependencies): WxAppParticipantDiagnostics;
|
|
35
|
+
export declare function getCallingDeviceDetails(deps: WxAppVoiceDependencies): WebexCallingDeviceDetails | undefined;
|
|
36
|
+
export declare function isWebexAppCallingOffer(deps: WxAppVoiceDependencies): boolean;
|
|
37
|
+
/** Inbound wxApp offer only — outdial decline uses CC routing, not telephony reject. */
|
|
38
|
+
export declare function isWebexAppInboundCallingOffer(deps: WxAppVoiceDependencies): boolean;
|
|
39
|
+
export declare function getWebexCallingCallId(deps: WxAppVoiceDependencies): string | null;
|
|
40
|
+
export declare function getWxAppLineOwnerId(deps: WxAppVoiceDependencies): string | undefined;
|
|
41
|
+
export declare function resolveWxAppLineOwnerId(deps: WxAppVoiceDependencies, override?: string): string | undefined;
|
|
42
|
+
export declare function acceptOnWebex(deps: WxAppVoiceDependencies, options?: {
|
|
43
|
+
lineOwnerId?: string;
|
|
44
|
+
}): Promise<void>;
|
|
45
|
+
export declare function rejectOnWebex(deps: WxAppVoiceDependencies, options?: {
|
|
46
|
+
lineOwnerId?: string;
|
|
47
|
+
}): Promise<void>;
|
|
48
|
+
export declare function toggleMuteOnWebex(deps: WxAppVoiceDependencies, options?: {
|
|
49
|
+
lineOwnerId?: string;
|
|
50
|
+
muted?: boolean;
|
|
51
|
+
}): Promise<void>;
|
|
52
|
+
export declare function transmitDtmfOnWebex(deps: WxAppVoiceDependencies, options: {
|
|
53
|
+
dtmf: string;
|
|
54
|
+
lineOwnerId?: string;
|
|
55
|
+
}): Promise<void>;
|
|
56
|
+
export type WxAppAcceptRejectOptions = {
|
|
57
|
+
lineOwnerId?: string;
|
|
58
|
+
acceptReason?: WxAppAcceptReason;
|
|
59
|
+
};
|
|
60
|
+
export declare function runWxAppAccept(deps: WxAppVoiceDependencies, lifecycle: WxAppVoiceLifecycle, options?: WxAppAcceptRejectOptions): Promise<void>;
|
|
61
|
+
export declare function runWxAppReject(deps: WxAppVoiceDependencies, lifecycle: WxAppVoiceLifecycle, options?: WxAppAcceptRejectOptions): Promise<void>;
|
|
62
|
+
export type WxAppOutdialDeclineOptions = {
|
|
63
|
+
acceptReason?: WxAppAcceptReason;
|
|
64
|
+
};
|
|
65
|
+
export declare function runWxAppOutdialDecline<T>(deps: WxAppVoiceDependencies, executeCancel: () => Promise<T>, options?: WxAppOutdialDeclineOptions): Promise<T>;
|
|
66
|
+
export declare function runWxAppToggleMute(deps: WxAppVoiceDependencies, lifecycle: WxAppVoiceLifecycle, options?: TaskToggleMuteOptions): Promise<void>;
|
|
67
|
+
export declare function runWxAppTransmitDtmf(deps: WxAppVoiceDependencies, lifecycle: WxAppVoiceLifecycle, options: TaskTransmitDtmfOptions): Promise<void>;
|
|
68
|
+
export declare function mapWxAppVoiceError(error: unknown, method: string, module: string): never;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export declare const WXAPP_LOG_FEATURE = "wxApp";
|
|
2
|
+
export declare const WXAPP_LOG_PREFIX = "[CC wxApp]";
|
|
3
|
+
export type WxAppAcceptReason = 'wxApp_offer_ready' | 'wxApp_answer_pending' | 'wxApp_accept_in_flight' | 'extension_non_wxApp_offer' | 'browser_webrtc_offer' | 'outdial_auto_answer';
|
|
4
|
+
export type WxAppSessionSkipReason = 'unsupported_browser_login' | 'flag_disabled' | 'mercury_subscribe_failed' | 'publish_failed';
|
|
5
|
+
export type WxAppTelephonyAction = 'accept' | 'decline' | 'mute' | 'dtmf';
|
|
6
|
+
export type WxAppTelephonyPhase = 'started' | 'success' | 'failed';
|
|
7
|
+
/** Last 8 chars of callId for correlation without logging full id. */
|
|
8
|
+
export declare function callIdSuffix(callId: string | null | undefined): string | undefined;
|
|
9
|
+
export declare function logWxAppSessionReadiness(params: {
|
|
10
|
+
enableWxBetterTogether: boolean;
|
|
11
|
+
loginOption: string | undefined;
|
|
12
|
+
wxAppHooksApplied: boolean;
|
|
13
|
+
usersubPublished: boolean;
|
|
14
|
+
mercurySubscribed: boolean;
|
|
15
|
+
telephonyTaskType: 'Voice' | 'WebRTC' | 'unknown';
|
|
16
|
+
skipReason?: WxAppSessionSkipReason;
|
|
17
|
+
}): void;
|
|
18
|
+
export declare function deriveWxAppAcceptReason(params: {
|
|
19
|
+
isWxAppInboundOffer: boolean;
|
|
20
|
+
isWxAppOutdialOffer: boolean;
|
|
21
|
+
isWebrtc: boolean;
|
|
22
|
+
isOutdial: boolean;
|
|
23
|
+
wxAppAcceptInFlight: boolean;
|
|
24
|
+
wxAppAnswerPending: boolean;
|
|
25
|
+
enableWxBetterTogether: boolean;
|
|
26
|
+
hasDeviceCallId: boolean;
|
|
27
|
+
}): WxAppAcceptReason;
|
|
28
|
+
export declare function logWxAppOfferDecision(params: {
|
|
29
|
+
interactionId: string;
|
|
30
|
+
acceptVisible: boolean;
|
|
31
|
+
acceptEnabled: boolean;
|
|
32
|
+
acceptReason: WxAppAcceptReason;
|
|
33
|
+
wxAppParticipantDeviceType?: string;
|
|
34
|
+
hasDeviceCallId: boolean;
|
|
35
|
+
hasDeviceId?: boolean;
|
|
36
|
+
usersubPublished?: boolean;
|
|
37
|
+
}): void;
|
|
38
|
+
export declare function logWxAppOfferParticipantMismatch(params: {
|
|
39
|
+
interactionId: string;
|
|
40
|
+
usersubPublished: boolean;
|
|
41
|
+
hasDeviceCallId: boolean;
|
|
42
|
+
hasDeviceId: boolean;
|
|
43
|
+
participantDeviceType?: string;
|
|
44
|
+
acceptVisible: boolean;
|
|
45
|
+
acceptEnabled: boolean;
|
|
46
|
+
acceptReason: WxAppAcceptReason;
|
|
47
|
+
}): void;
|
|
48
|
+
export declare function logWxAppTelephonyAction(params: {
|
|
49
|
+
action: WxAppTelephonyAction;
|
|
50
|
+
phase: WxAppTelephonyPhase;
|
|
51
|
+
interactionId?: string;
|
|
52
|
+
trackingId?: string;
|
|
53
|
+
httpStatus?: number | string;
|
|
54
|
+
failureReason?: string;
|
|
55
|
+
}): void;
|
|
56
|
+
export declare function logWxAppValidationFailure(reason: string, interactionId?: string): void;
|
|
57
|
+
export declare function logWxAppMercuryMuteSync(params: {
|
|
58
|
+
phase: 'received' | 'applied' | 'dropped';
|
|
59
|
+
muted?: boolean;
|
|
60
|
+
callIdSuffix?: string;
|
|
61
|
+
interactionId?: string;
|
|
62
|
+
dropReason?: string;
|
|
63
|
+
}): void;
|