@webex/contact-center 3.12.0-llmrefactor.1 → 3.12.0-llmrefactor.11

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.
Files changed (198) hide show
  1. package/.sdd/manifest.json +7 -5
  2. package/ai-docs/ARCHITECTURE.md +1 -1
  3. package/ai-docs/CONTRACTS.md +8 -3
  4. package/ai-docs/SECURITY.md +1 -1
  5. package/ai-docs/contact-center-spec.md +22 -4
  6. package/ai-docs/features/consult-transfer-list-policy/spec/feature-spec.md +362 -0
  7. package/dist/cc.js +544 -12
  8. package/dist/cc.js.map +1 -1
  9. package/dist/config.js +7 -0
  10. package/dist/config.js.map +1 -1
  11. package/dist/constants.js +10 -2
  12. package/dist/constants.js.map +1 -1
  13. package/dist/index.js.map +1 -1
  14. package/dist/metrics/MetricsManager.js +16 -0
  15. package/dist/metrics/MetricsManager.js.map +1 -1
  16. package/dist/metrics/behavioral-events.js +104 -0
  17. package/dist/metrics/behavioral-events.js.map +1 -1
  18. package/dist/metrics/constants.js +18 -0
  19. package/dist/metrics/constants.js.map +1 -1
  20. package/dist/services/AddressBook.js +18 -15
  21. package/dist/services/AddressBook.js.map +1 -1
  22. package/dist/services/AnswerCallOnWebexService.js +202 -0
  23. package/dist/services/AnswerCallOnWebexService.js.map +1 -0
  24. package/dist/services/EntryPoint.js +46 -68
  25. package/dist/services/EntryPoint.js.map +1 -1
  26. package/dist/services/Queue.js +27 -22
  27. package/dist/services/Queue.js.map +1 -1
  28. package/dist/services/WebexCrossClientService.js +222 -0
  29. package/dist/services/WebexCrossClientService.js.map +1 -0
  30. package/dist/services/WxAppTelephonyMercurySync.js +108 -0
  31. package/dist/services/WxAppTelephonyMercurySync.js.map +1 -0
  32. package/dist/services/config/Util.js +3 -0
  33. package/dist/services/config/Util.js.map +1 -1
  34. package/dist/services/config/constants.js +10 -6
  35. package/dist/services/config/constants.js.map +1 -1
  36. package/dist/services/config/types.js +4 -0
  37. package/dist/services/config/types.js.map +1 -1
  38. package/dist/services/core/Err.js.map +1 -1
  39. package/dist/services/core/WebexRequest.js +6 -2
  40. package/dist/services/core/WebexRequest.js.map +1 -1
  41. package/dist/services/core/aqm-reqs.js +28 -14
  42. package/dist/services/core/aqm-reqs.js.map +1 -1
  43. package/dist/services/core/types.js.map +1 -1
  44. package/dist/services/task/Task.js +73 -7
  45. package/dist/services/task/Task.js.map +1 -1
  46. package/dist/services/task/TaskFactory.js +8 -4
  47. package/dist/services/task/TaskFactory.js.map +1 -1
  48. package/dist/services/task/TaskManager.js +490 -21
  49. package/dist/services/task/TaskManager.js.map +1 -1
  50. package/dist/services/task/WebexCallingUtils.js +70 -0
  51. package/dist/services/task/WebexCallingUtils.js.map +1 -0
  52. package/dist/services/task/constants.js +4 -1
  53. package/dist/services/task/constants.js.map +1 -1
  54. package/dist/services/task/contact.js +29 -0
  55. package/dist/services/task/contact.js.map +1 -1
  56. package/dist/services/task/digital/Digital.js +3 -2
  57. package/dist/services/task/digital/Digital.js.map +1 -1
  58. package/dist/services/task/state-machine/TaskStateMachine.js +162 -53
  59. package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -1
  60. package/dist/services/task/state-machine/actions.js +6 -1
  61. package/dist/services/task/state-machine/actions.js.map +1 -1
  62. package/dist/services/task/state-machine/guards.js +7 -10
  63. package/dist/services/task/state-machine/guards.js.map +1 -1
  64. package/dist/services/task/state-machine/types.js.map +1 -1
  65. package/dist/services/task/state-machine/uiControlsComputer.js +118 -18
  66. package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -1
  67. package/dist/services/task/types.js +16 -1
  68. package/dist/services/task/types.js.map +1 -1
  69. package/dist/services/task/voice/Voice.js +456 -15
  70. package/dist/services/task/voice/Voice.js.map +1 -1
  71. package/dist/services/task/voice/WebRTC.js +4 -1
  72. package/dist/services/task/voice/WebRTC.js.map +1 -1
  73. package/dist/services/task/voice/wxAppVoiceMethods.js +354 -0
  74. package/dist/services/task/voice/wxAppVoiceMethods.js.map +1 -0
  75. package/dist/services/wxAppDiagnosticLogging.js +122 -0
  76. package/dist/services/wxAppDiagnosticLogging.js.map +1 -0
  77. package/dist/services/wxAppTelephonyUtils.js +19 -0
  78. package/dist/services/wxAppTelephonyUtils.js.map +1 -0
  79. package/dist/types/cc.d.ts +78 -4
  80. package/dist/types/config.d.ts +7 -0
  81. package/dist/types/constants.d.ts +8 -0
  82. package/dist/types/index.d.ts +3 -1
  83. package/dist/types/metrics/MetricsManager.d.ts +6 -0
  84. package/dist/types/metrics/constants.d.ts +17 -0
  85. package/dist/types/services/AddressBook.d.ts +2 -1
  86. package/dist/types/services/AnswerCallOnWebexService.d.ts +38 -0
  87. package/dist/types/services/EntryPoint.d.ts +7 -5
  88. package/dist/types/services/Queue.d.ts +5 -3
  89. package/dist/types/services/WebexCrossClientService.d.ts +32 -0
  90. package/dist/types/services/WxAppTelephonyMercurySync.d.ts +28 -0
  91. package/dist/types/services/config/constants.d.ts +8 -5
  92. package/dist/types/services/config/types.d.ts +17 -4
  93. package/dist/types/services/core/Err.d.ts +2 -0
  94. package/dist/types/services/core/WebexRequest.d.ts +1 -0
  95. package/dist/types/services/core/types.d.ts +2 -0
  96. package/dist/types/services/task/Task.d.ts +20 -2
  97. package/dist/types/services/task/TaskFactory.d.ts +2 -1
  98. package/dist/types/services/task/WebexCallingUtils.d.ts +11 -0
  99. package/dist/types/services/task/constants.d.ts +3 -0
  100. package/dist/types/services/task/contact.d.ts +4 -0
  101. package/dist/types/services/task/digital/Digital.d.ts +2 -2
  102. package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +304 -56
  103. package/dist/types/services/task/state-machine/guards.d.ts +6 -5
  104. package/dist/types/services/task/state-machine/types.d.ts +9 -1
  105. package/dist/types/services/task/types.d.ts +81 -4
  106. package/dist/types/services/task/voice/Voice.d.ts +52 -9
  107. package/dist/types/services/task/voice/WebRTC.d.ts +2 -2
  108. package/dist/types/services/task/voice/wxAppVoiceMethods.d.ts +55 -0
  109. package/dist/types/services/wxAppDiagnosticLogging.d.ts +51 -0
  110. package/dist/types/services/wxAppTelephonyUtils.d.ts +5 -0
  111. package/dist/types/types.d.ts +14 -8
  112. package/dist/types/utils/PageCache.d.ts +20 -3
  113. package/dist/types.js +7 -2
  114. package/dist/types.js.map +1 -1
  115. package/dist/utils/PageCache.js +19 -5
  116. package/dist/utils/PageCache.js.map +1 -1
  117. package/dist/webex.js +1 -1
  118. package/package.json +8 -8
  119. package/src/cc.ts +657 -12
  120. package/src/config.ts +7 -0
  121. package/src/constants.ts +8 -0
  122. package/src/index.ts +2 -0
  123. package/src/metrics/MetricsManager.ts +16 -0
  124. package/src/metrics/ai-docs/metrics-spec.md +78 -10
  125. package/src/metrics/behavioral-events.ts +106 -0
  126. package/src/metrics/constants.ts +20 -0
  127. package/src/services/AddressBook.ts +17 -6
  128. package/src/services/AnswerCallOnWebexService.ts +239 -0
  129. package/src/services/EntryPoint.ts +59 -60
  130. package/src/services/Queue.ts +29 -12
  131. package/src/services/WebexCrossClientService.ts +293 -0
  132. package/src/services/WxAppTelephonyMercurySync.ts +142 -0
  133. package/src/services/agent/ai-docs/agent-spec.md +1 -0
  134. package/src/services/ai-docs/AGENTS.md +10 -10
  135. package/src/services/ai-docs/services-spec.md +6 -1
  136. package/src/services/config/Util.ts +3 -0
  137. package/src/services/config/ai-docs/AGENTS.md +1 -1
  138. package/src/services/config/ai-docs/ARCHITECTURE.md +2 -2
  139. package/src/services/config/ai-docs/config-spec.md +6 -0
  140. package/src/services/config/constants.ts +10 -6
  141. package/src/services/config/types.ts +16 -4
  142. package/src/services/core/Err.ts +1 -0
  143. package/src/services/core/WebexRequest.ts +3 -1
  144. package/src/services/core/ai-docs/core-spec.md +5 -1
  145. package/src/services/core/aqm-reqs.ts +30 -15
  146. package/src/services/core/types.ts +2 -0
  147. package/src/services/task/Task.ts +79 -8
  148. package/src/services/task/TaskFactory.ts +8 -3
  149. package/src/services/task/TaskManager.ts +716 -17
  150. package/src/services/task/WebexCallingUtils.ts +136 -0
  151. package/src/services/task/ai-docs/ARCHITECTURE.md +1 -0
  152. package/src/services/task/ai-docs/task-spec.md +156 -3
  153. package/src/services/task/constants.ts +3 -0
  154. package/src/services/task/contact.ts +30 -0
  155. package/src/services/task/digital/Digital.ts +4 -2
  156. package/src/services/task/state-machine/TaskStateMachine.ts +235 -81
  157. package/src/services/task/state-machine/actions.ts +5 -2
  158. package/src/services/task/state-machine/ai-docs/AGENTS.md +6 -4
  159. package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +35 -16
  160. package/src/services/task/state-machine/ai-docs/task-state-machine-spec.md +103 -33
  161. package/src/services/task/state-machine/guards.ts +7 -10
  162. package/src/services/task/state-machine/types.ts +16 -1
  163. package/src/services/task/state-machine/uiControlsComputer.ts +206 -32
  164. package/src/services/task/types.ts +114 -4
  165. package/src/services/task/voice/Voice.ts +595 -14
  166. package/src/services/task/voice/WebRTC.ts +5 -1
  167. package/src/services/task/voice/wxAppVoiceMethods.ts +516 -0
  168. package/src/services/wxAppDiagnosticLogging.ts +174 -0
  169. package/src/services/wxAppTelephonyUtils.ts +14 -0
  170. package/src/types.ts +33 -9
  171. package/src/utils/AGENTS.md +21 -10
  172. package/src/utils/PageCache.ts +38 -5
  173. package/src/utils/ai-docs/utils-spec.md +21 -11
  174. package/test/unit/spec/cc.ts +1522 -19
  175. package/test/unit/spec/metrics/MetricsManager.ts +25 -0
  176. package/test/unit/spec/metrics/behavioral-events.ts +60 -0
  177. package/test/unit/spec/services/AddressBook.ts +37 -6
  178. package/test/unit/spec/services/AnswerCallOnWebexService.ts +264 -0
  179. package/test/unit/spec/services/EntryPoint.ts +87 -40
  180. package/test/unit/spec/services/Queue.ts +123 -12
  181. package/test/unit/spec/services/WebexCrossClientService.ts +467 -0
  182. package/test/unit/spec/services/WxAppTelephonyMercurySync.ts +136 -0
  183. package/test/unit/spec/services/config/Util.ts +85 -0
  184. package/test/unit/spec/services/core/WebexRequest.ts +3 -1
  185. package/test/unit/spec/services/core/aqm-reqs.ts +113 -1
  186. package/test/unit/spec/services/task/Task.ts +274 -6
  187. package/test/unit/spec/services/task/TaskFactory.ts +39 -2
  188. package/test/unit/spec/services/task/TaskManager.ts +1717 -9
  189. package/test/unit/spec/services/task/WebexCallingUtils.ts +153 -0
  190. package/test/unit/spec/services/task/contact.ts +33 -0
  191. package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +1485 -109
  192. package/test/unit/spec/services/task/state-machine/guards.ts +210 -8
  193. package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +445 -7
  194. package/test/unit/spec/services/task/voice/Voice.ts +1412 -0
  195. package/test/unit/spec/services/task/voice/wxAppVoiceMethods.ts +603 -0
  196. package/test/unit/spec/services/wxAppDiagnosticLogging.ts +143 -0
  197. package/umd/contact-center.min.js +2 -2
  198. 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 (supported only for consult operations) */
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
@@ -1051,6 +1055,8 @@ export type TaskData = {
1051
1055
  reservedAgentChannelId?: string;
1052
1056
  /** Indicates if wrap-up is required for this task */
1053
1057
  wrapUpRequired?: boolean;
1058
+ /** SDK-internal: skip task:outdialFailed when non-wxApp agent-terminated outdial still needs wrapup */
1059
+ suppressOutdialFailedPopup?: boolean;
1054
1060
  /**
1055
1061
  * Current consultation status derived from state machine
1056
1062
  * Values: CONSULT_INITIATED, CONSULT_ACCEPTED, BEING_CONSULTED,
@@ -1121,6 +1127,17 @@ export type InteractionUIControls = {
1121
1127
  mergeToConference: TaskUIControlState;
1122
1128
  wrapup: TaskUIControlState;
1123
1129
  switch: TaskUIControlState;
1130
+ keypad?: TaskUIControlState;
1131
+ };
1132
+ /** Options for {@link ITask.toggleMute} — wxApp engaged calls use `muted` for target state. */
1133
+ export type TaskToggleMuteOptions = {
1134
+ muted?: boolean;
1135
+ lineOwnerId?: string;
1136
+ };
1137
+ /** Options for {@link ITask.transmitDtmf} — wxApp engaged in-call DTMF. */
1138
+ export type TaskTransmitDtmfOptions = {
1139
+ dtmf: string;
1140
+ lineOwnerId?: string;
1124
1141
  };
1125
1142
  export type TaskUILeg = 'main' | 'consult';
1126
1143
  /**
@@ -1132,6 +1149,14 @@ export type TaskUIControls = {
1132
1149
  main: InteractionUIControls;
1133
1150
  consult: InteractionUIControls;
1134
1151
  activeLeg: TaskUILeg;
1152
+ /**
1153
+ * Ordered destination categories available for each action.
1154
+ * The first category is the default for consumers that render a destination picker.
1155
+ */
1156
+ consultTransferDestinations: {
1157
+ consult: ConsultTransferDestinationType[];
1158
+ transfer: ConsultTransferDestinationType[];
1159
+ };
1135
1160
  };
1136
1161
  /**
1137
1162
  * Helper class for managing task action control state
@@ -1491,6 +1516,14 @@ export type ParticipantBooleanKey = 'autoAnswerEnabled' | 'hasJoined' | 'hasLeft
1491
1516
  * @public
1492
1517
  */
1493
1518
  export type TaskResponse = AgentContact | Error | void;
1519
+ /**
1520
+ * Request payload for removing a supported participant from an active conference.
1521
+ * @public
1522
+ */
1523
+ export type DropConferenceParticipantPayload = {
1524
+ /** Participant identifier supplied by the current task roster. */
1525
+ participantId: string;
1526
+ };
1494
1527
  /**
1495
1528
  * Payload shape used by consult conference helper utilities.
1496
1529
  */
@@ -1539,6 +1572,14 @@ export interface ITask extends IEventEmitter {
1539
1572
  * Subscribe to {@link TASK_EVENTS.TASK_UI_CONTROLS_UPDATED} for change notifications.
1540
1573
  */
1541
1574
  readonly uiControls: TaskUIControls;
1575
+ /**
1576
+ * Current wxApp mute state for engaged telephony (Voice tasks only).
1577
+ */
1578
+ getWxAppMuted?(): boolean;
1579
+ /**
1580
+ * Re-seed wxApp mute from GET telephony/calls/{callId}. Resolves to muted state when known.
1581
+ */
1582
+ syncWxAppMuteFromCallDetails?(): Promise<boolean | undefined>;
1542
1583
  state?: any;
1543
1584
  /**
1544
1585
  * Cancels the auto-wrapup timer for the task.
@@ -1690,6 +1731,17 @@ export interface ITask extends IEventEmitter {
1690
1731
  * ```
1691
1732
  */
1692
1733
  consultConference(): Promise<TaskResponse>;
1734
+ /**
1735
+ * Removes a supported participant from the active conference.
1736
+ * Resolves after the correlated ParticipantLeftConference routing event.
1737
+ * @param payload - Participant identifier to remove
1738
+ * @returns Promise<TaskResponse>
1739
+ * @example
1740
+ * ```typescript
1741
+ * await task.dropConferenceParticipant({participantId: 'participant-id'});
1742
+ * ```
1743
+ */
1744
+ dropConferenceParticipant(payload: DropConferenceParticipantPayload): Promise<TaskResponse>;
1693
1745
  /**
1694
1746
  * Exits from an ongoing conference.
1695
1747
  * @returns Promise<TaskResponse>
@@ -1721,14 +1773,28 @@ export interface ITask extends IEventEmitter {
1721
1773
  */
1722
1774
  switchCall(): Promise<TaskResponse>;
1723
1775
  /**
1724
- * Toggles mute/unmute for the local audio stream during a WebRTC task.
1776
+ * Toggles mute/unmute for the active call.
1777
+ * WebRTC tasks toggle the local stream; wxApp engaged tasks route to telephony mute REST when
1778
+ * `enableWxBetterTogether` is active.
1779
+ * @param options - Optional target mute state (`muted`) for wxApp; ignored for WebRTC toggle.
1725
1780
  * @returns Promise<void>
1726
1781
  * @example
1727
1782
  * ```typescript
1728
1783
  * await task.toggleMute();
1784
+ * await task.toggleMute({ muted: true });
1785
+ * ```
1786
+ */
1787
+ toggleMute(options?: TaskToggleMuteOptions): Promise<void>;
1788
+ /**
1789
+ * Sends in-call DTMF tones for wxApp engaged telephony tasks when `enableWxBetterTogether` is active.
1790
+ * @param options - DTMF digit(s) and optional shared-line owner id.
1791
+ * @returns Promise<void>
1792
+ * @example
1793
+ * ```typescript
1794
+ * await task.transmitDtmf({ dtmf: '5' });
1729
1795
  * ```
1730
1796
  */
1731
- toggleMute(): Promise<void>;
1797
+ transmitDtmf(options: TaskTransmitDtmfOptions): Promise<void>;
1732
1798
  }
1733
1799
  /**
1734
1800
  * Interface for managing digital channel task operations in the contact center
@@ -1762,6 +1828,12 @@ export interface IVoice extends ITask {
1762
1828
  * ```
1763
1829
  */
1764
1830
  holdResume(): Promise<TaskResponse>;
1831
+ /** @see wxAppVoiceMethods — WXCC-6026 */
1832
+ isWebexAppCallingOffer(): boolean;
1833
+ /** @see wxAppVoiceMethods — WXCC-6026 */
1834
+ getCallingDeviceDetails(): import('./WebexCallingUtils').WebexCallingDeviceDetails | undefined;
1835
+ /** @see wxAppVoiceMethods — WXCC-6026 */
1836
+ getWebexCallingCallId(): string | null;
1765
1837
  }
1766
1838
  /**
1767
1839
  * Configuration options for voice task UI controls
@@ -1771,6 +1843,9 @@ export type VoiceUIControlOptions = {
1771
1843
  isEndConsultEnabled?: boolean;
1772
1844
  voiceVariant?: VoiceVariant;
1773
1845
  isRecordingEnabled?: boolean;
1846
+ enableWxBetterTogether?: boolean;
1847
+ consultTransferConfig?: ConsultTransferDestinationConfig;
1848
+ answerCallOnWebexService?: import('../AnswerCallOnWebexService').default;
1774
1849
  };
1775
1850
  /**
1776
1851
  * Participant information for UI display
@@ -1793,7 +1868,7 @@ export interface IWebRTC extends IVoice {
1793
1868
  * task.toggleMute();
1794
1869
  * ```
1795
1870
  */
1796
- toggleMute(): Promise<void>;
1871
+ toggleMute(options?: TaskToggleMuteOptions): Promise<void>;
1797
1872
  /**
1798
1873
  * Decline the incoming task for Browser Login
1799
1874
  *
@@ -1817,6 +1892,8 @@ export type WebSocketPayload = TaskData & {
1817
1892
  type: string;
1818
1893
  mediaResourceId?: string;
1819
1894
  reason?: string;
1895
+ /** ContactEnded: party that ended the contact (e.g. 'Agent', 'Customer') */
1896
+ terminatingParty?: string;
1820
1897
  /**
1821
1898
  * Optional real-time transcript chunk payload.
1822
1899
  * Present on REAL_TIME_TRANSCRIPTION notifications.
@@ -1,25 +1,61 @@
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
5
  import { WrapupData } from '../../config/types';
6
6
  export default class Voice extends Task implements IVoice {
7
+ private static readonly WXAPP_MUTE_SYNC_RETRY_DELAY_MS;
8
+ private static readonly WXAPP_MUTE_SYNC_MAX_RETRIES;
9
+ private answerCallOnWebexService?;
10
+ private enableWxBetterTogether;
11
+ private wxAppMuted;
12
+ private wxAppAnswerPending;
13
+ private wxAppAcceptInFlight;
14
+ private wxAppMuteSyncInFlight?;
15
+ private wxAppMuteToggleTail;
16
+ private wxAppDtmfTail;
17
+ private lastLoggedWxAppAcceptReason?;
7
18
  constructor(contact: ReturnType<typeof routingContact>, data: TaskData, callOptions?: VoiceUIControlOptions, wrapupData?: WrapupData, agentId?: string);
19
+ private getWxAppVoiceDependencies;
20
+ /** @deprecated Use {@link Voice.getWxAppVoiceDependencies} */
21
+ private getWxAppVoiceDeps;
22
+ isWebexAppCallingOffer(): boolean;
23
+ isWebexAppInboundCallingOffer(): boolean;
24
+ private setWxAppAnswerPending;
25
+ private setWxAppAcceptInFlight;
26
+ setEnableWxBetterTogether(enabled: boolean): void;
27
+ protected updateUiControls(forceEmit?: boolean): void;
28
+ private logWxAppOfferDecisionIfNeeded;
29
+ applyWxAppMuteStateFromSync(incomingCallId: string, muted: boolean): void;
30
+ getWxAppMuted(): boolean;
31
+ private static delay;
32
+ private canRetryWxAppMuteSync;
33
+ private shouldSkipWxAppMuteSync;
34
+ private applyWxAppMuteFromBackfill;
35
+ syncWxAppMuteFromCallDetails(retryAttempt?: number): Promise<boolean | undefined>;
36
+ private performWxAppMuteSync;
37
+ protected onTaskAssigned(): void;
38
+ protected onTaskHydrated(): void;
39
+ getCallingDeviceDetails(): import("../WebexCallingUtils").WebexCallingDeviceDetails;
40
+ getWebexCallingCallId(): string | null;
41
+ private createWxAppLifecycle;
8
42
  private getStateMachineSnapshot;
9
43
  /**
10
- * This method is used to accept the task.
11
- * It is expected to be overridden by child classes.
12
- * @returns Promise<TaskResponse>
13
- * @throws Error
44
+ * Accepts the task. Routes to wxApp telephony answer when `enableWxBetterTogether` and wxApp offer.
14
45
  */
15
46
  accept(): Promise<TaskResponse>;
16
47
  /**
17
- * This method is used to decline the task.
18
- * It is expected to be overridden by child classes.
19
- * @returns Promise<TaskResponse>
20
- * @throws Error
48
+ * Declines the task. Routes wxApp inbound to telephony reject; wxApp outdial offer to cancelTask.
21
49
  */
22
50
  decline(): Promise<TaskResponse>;
51
+ /**
52
+ * Toggles mute for wxApp engaged telephony when `enableWxBetterTogether` is active.
53
+ */
54
+ toggleMute(options?: TaskToggleMuteOptions): Promise<void>;
55
+ /**
56
+ * Sends in-call DTMF for wxApp engaged telephony when `enableWxBetterTogether` is active.
57
+ */
58
+ transmitDtmf(options: TaskTransmitDtmfOptions): Promise<void>;
23
59
  /**
24
60
  * This is used to hold the task.
25
61
  * @returns Promise<TaskResponse>
@@ -121,6 +157,13 @@ export default class Voice extends Task implements IVoice {
121
157
  * Start a consult conference, merging main and consult calls.
122
158
  */
123
159
  consultConference(): Promise<TaskResponse>;
160
+ /**
161
+ * Removes another participant from an active conference.
162
+ * Completion is correlated with ParticipantLeftConference by the AQM request layer.
163
+ * @param payload - Participant identifier to remove
164
+ * @returns Promise<TaskResponse>
165
+ */
166
+ dropConferenceParticipant(payload: DropConferenceParticipantPayload): Promise<TaskResponse>;
124
167
  /**
125
168
  * Exit from a conference call.
126
169
  * Per conference-spec.md:
@@ -1,5 +1,5 @@
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
5
  import { WrapupData } from '../../config/types';
@@ -49,5 +49,5 @@ export default class WebRTC extends Voice implements IWebRTC {
49
49
  * task.toggleMute().then(()=>{}).catch(()=>{})
50
50
  * ```
51
51
  */
52
- toggleMute(): Promise<void>;
52
+ toggleMute(options?: TaskToggleMuteOptions): Promise<void>;
53
53
  }
@@ -0,0 +1,55 @@
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
+ export type WxAppVoiceDependencies = {
7
+ enableWxBetterTogether: boolean;
8
+ answerCallOnWebexService?: AnswerCallOnWebexService;
9
+ agentId?: string;
10
+ metricsManager: MetricsManager;
11
+ getTaskData: () => TaskData;
12
+ getTaskState: () => TaskState | undefined;
13
+ getWxAppMuted: () => boolean;
14
+ setWxAppMuted: (muted: boolean) => void;
15
+ };
16
+ /** @deprecated Use {@link WxAppVoiceDependencies} */
17
+ export type WxAppVoiceDeps = WxAppVoiceDependencies;
18
+ export type WxAppVoiceLifecycle = {
19
+ setWxAppAcceptInFlight: (inFlight: boolean) => void;
20
+ setWxAppAnswerPending: (pending: boolean) => void;
21
+ resetWxAppMuted: () => void;
22
+ syncWxAppMuteFromCallDetails: () => Promise<boolean | undefined>;
23
+ mapWxAppVoiceError: (error: unknown, method: string) => never;
24
+ };
25
+ export declare function getCallingDeviceDetails(deps: WxAppVoiceDependencies): WebexCallingDeviceDetails | undefined;
26
+ export declare function isWebexAppCallingOffer(deps: WxAppVoiceDependencies): boolean;
27
+ /** Inbound wxApp offer only — outdial decline uses CC routing, not telephony reject. */
28
+ export declare function isWebexAppInboundCallingOffer(deps: WxAppVoiceDependencies): boolean;
29
+ export declare function getWebexCallingCallId(deps: WxAppVoiceDependencies): string | null;
30
+ export declare function getWxAppLineOwnerId(deps: WxAppVoiceDependencies): string | undefined;
31
+ export declare function resolveWxAppLineOwnerId(deps: WxAppVoiceDependencies, override?: string): string | undefined;
32
+ export declare function acceptOnWebex(deps: WxAppVoiceDependencies, options?: {
33
+ lineOwnerId?: string;
34
+ }): Promise<void>;
35
+ export declare function rejectOnWebex(deps: WxAppVoiceDependencies, options?: {
36
+ lineOwnerId?: string;
37
+ }): Promise<void>;
38
+ export declare function toggleMuteOnWebex(deps: WxAppVoiceDependencies, options?: {
39
+ lineOwnerId?: string;
40
+ muted?: boolean;
41
+ }): Promise<void>;
42
+ export declare function transmitDtmfOnWebex(deps: WxAppVoiceDependencies, options: {
43
+ dtmf: string;
44
+ lineOwnerId?: string;
45
+ }): Promise<void>;
46
+ export declare function runWxAppAccept(deps: WxAppVoiceDependencies, lifecycle: WxAppVoiceLifecycle, options?: {
47
+ lineOwnerId?: string;
48
+ }): Promise<void>;
49
+ export declare function runWxAppReject(deps: WxAppVoiceDependencies, lifecycle: WxAppVoiceLifecycle, options?: {
50
+ lineOwnerId?: string;
51
+ }): Promise<void>;
52
+ export declare function runWxAppOutdialDecline<T>(deps: WxAppVoiceDependencies, executeCancel: () => Promise<T>): Promise<T>;
53
+ export declare function runWxAppToggleMute(deps: WxAppVoiceDependencies, lifecycle: WxAppVoiceLifecycle, options?: TaskToggleMuteOptions): Promise<void>;
54
+ export declare function runWxAppTransmitDtmf(deps: WxAppVoiceDependencies, lifecycle: WxAppVoiceLifecycle, options: TaskTransmitDtmfOptions): Promise<void>;
55
+ export declare function mapWxAppVoiceError(error: unknown, method: string, module: string): never;
@@ -0,0 +1,51 @@
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
+ }): void;
36
+ export declare function logWxAppTelephonyAction(params: {
37
+ action: WxAppTelephonyAction;
38
+ phase: WxAppTelephonyPhase;
39
+ interactionId?: string;
40
+ trackingId?: string;
41
+ httpStatus?: number | string;
42
+ failureReason?: string;
43
+ }): void;
44
+ export declare function logWxAppValidationFailure(reason: string, interactionId?: string): void;
45
+ export declare function logWxAppMercuryMuteSync(params: {
46
+ phase: 'received' | 'applied' | 'dropped';
47
+ muted?: boolean;
48
+ callIdSuffix?: string;
49
+ interactionId?: string;
50
+ dropReason?: string;
51
+ }): void;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Expected Hydra responses when mute backfill races call creation (WXCC-6026).
3
+ * These must not be logged as errors — see task-spec wxApp mute backfill guard.
4
+ */
5
+ export declare function isWxAppCallNotFoundError(error: unknown): boolean;
@@ -108,6 +108,8 @@ export interface CCPluginConfig {
108
108
  callingClientConfig: CallingClientConfig;
109
109
  /** Whether to skip Mobius/WebRTC registration for browser login flows */
110
110
  disableWebRTCRegistration?: boolean;
111
+ /** Whether wxApp Better Together (telephony REST + usersub) is enabled at init (WXCC-6026) */
112
+ enableWxBetterTogether?: boolean;
111
113
  }
112
114
  /**
113
115
  * Logger interface for standardized logging throughout the plugin.
@@ -366,24 +368,26 @@ export type AgentLogin = {
366
368
  export type AgentProfileUpdate = Pick<AgentLogin, 'loginOption' | 'dialNumber' | 'teamId'>;
367
369
  /**
368
370
  * Represents the options to fetch buddy agents for the logged in agent.
369
- * Buddy agents are other agents who can be consulted or transfered to.
371
+ * Buddy agents are other agents who can be consulted or transferred to.
370
372
  * @public
371
373
  * @example
372
374
  * const opts: BuddyAgents = { mediaType: 'telephony', state: 'Available' };
373
- * @ignore
374
375
  */
375
376
  export type BuddyAgents = {
376
377
  /**
377
- * The media type channel to filter buddy agents.
378
- * Determines which channel capability the returned agents must have.
378
+ * The media type channel to filter buddy agents. Defaults to telephony when omitted.
379
379
  */
380
- mediaType: 'telephony' | 'chat' | 'social' | 'email';
380
+ mediaType?: 'telephony' | 'chat' | 'social' | 'email';
381
381
  /**
382
382
  * Optional filter for agent state.
383
383
  * If specified, returns only agents in that state.
384
384
  * If omitted, returns both available and idle agents.
385
385
  */
386
386
  state?: 'Available' | 'Idle';
387
+ /**
388
+ * Applies the default state policy for the operation. An explicit state takes precedence.
389
+ */
390
+ action?: 'Consult' | 'Transfer';
387
391
  };
388
392
  /**
389
393
 
@@ -464,10 +468,12 @@ export interface AddressBookEntrySearchParams extends BaseSearchParams {
464
468
  export interface EntryPointRecord {
465
469
  id: string;
466
470
  name: string;
471
+ /** Dialled number mapped to this entry point when included in the list response. */
472
+ number?: string;
467
473
  description?: string;
468
- type: string;
469
- isActive: boolean;
470
- orgId: string;
474
+ type?: string;
475
+ isActive?: boolean;
476
+ orgId?: string;
471
477
  createdAt?: string;
472
478
  updatedAt?: string;
473
479
  settings?: Record<string, any>;
@@ -90,6 +90,12 @@ export interface CacheValidationParams {
90
90
  attributes?: string;
91
91
  /** Sort by parameter */
92
92
  sortBy?: string;
93
+ /** Desktop-profile filtering changes the returned result set */
94
+ desktopProfileFilter?: boolean;
95
+ /** Provisioning-view filtering changes the returned result set */
96
+ provisioningView?: boolean;
97
+ /** Single-object response mode changes the response shape */
98
+ singleObjectResponse?: boolean;
93
99
  }
94
100
  /**
95
101
  * Page cache utility class for managing paginated API response caching.
@@ -103,8 +109,18 @@ export interface CacheValidationParams {
103
109
  * // Create a cache instance for a specific data type
104
110
  * const cache = new PageCache<AddressBookEntry>('AddressBook');
105
111
  *
106
- * // Check if we can use cache (no search/filter parameters)
107
- * if (cache.canUseCache({ search, filter })) {
112
+ * // Check if we can use cache for the complete result/response-shape input set
113
+ * if (
114
+ * cache.canUseCache({
115
+ * search,
116
+ * filter,
117
+ * attributes,
118
+ * sortBy,
119
+ * desktopProfileFilter,
120
+ * provisioningView,
121
+ * singleObjectResponse,
122
+ * })
123
+ * ) {
108
124
  * const cacheKey = cache.buildCacheKey(orgId, page, pageSize);
109
125
  * const cachedPage = cache.getCachedPage(cacheKey);
110
126
  *
@@ -128,7 +144,8 @@ export declare class PageCache<T> {
128
144
  constructor(apiName: string);
129
145
  /**
130
146
  * Checks if cache can be used for the given parameters.
131
- * Cache is only used for simple pagination without search/filter/attributes/sort.
147
+ * Cache is only used for simple pagination without query variants or enabled
148
+ * result/response-shape flags.
132
149
  * @param {CacheValidationParams} params - Parameters to validate
133
150
  * @returns {boolean} True if cache can be used
134
151
  * @public
package/dist/types.js CHANGED
@@ -58,6 +58,12 @@ const HTTP_METHODS = exports.HTTP_METHODS = {
58
58
  * @ignore
59
59
  */
60
60
 
61
+ /**
62
+ * Mercury event handler callback.
63
+ * @internal
64
+ * @ignore
65
+ */
66
+
61
67
  /**
62
68
  * Event listener removal function type.
63
69
  * @internal
@@ -228,11 +234,10 @@ const LoginOption = exports.LoginOption = {
228
234
 
229
235
  /**
230
236
  * Represents the options to fetch buddy agents for the logged in agent.
231
- * Buddy agents are other agents who can be consulted or transfered to.
237
+ * Buddy agents are other agents who can be consulted or transferred to.
232
238
  * @public
233
239
  * @example
234
240
  * const opts: BuddyAgents = { mediaType: 'telephony', state: 'Available' };
235
- * @ignore
236
241
  */
237
242
 
238
243
  /**