@webex/contact-center 3.12.0-webex-services-ready.4 → 3.13.0

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 (250) hide show
  1. package/.sdd/manifest.json +24 -13
  2. package/ai-docs/ARCHITECTURE.md +1 -1
  3. package/ai-docs/CONTRACTS.md +19 -3
  4. package/ai-docs/SECURITY.md +1 -1
  5. package/ai-docs/SERVICE_STATE.md +4 -0
  6. package/ai-docs/contact-center-spec.md +50 -6
  7. package/ai-docs/features/consult-transfer-list-policy/spec/feature-spec.md +362 -0
  8. package/ai-docs/features/contact-owner-change-refactor.md +78 -0
  9. package/dist/cc.js +757 -22
  10. package/dist/cc.js.map +1 -1
  11. package/dist/config.js +7 -0
  12. package/dist/config.js.map +1 -1
  13. package/dist/constants.js +23 -2
  14. package/dist/constants.js.map +1 -1
  15. package/dist/index.js +34 -12
  16. package/dist/index.js.map +1 -1
  17. package/dist/metrics/MetricsManager.js +16 -0
  18. package/dist/metrics/MetricsManager.js.map +1 -1
  19. package/dist/metrics/behavioral-events.js +110 -0
  20. package/dist/metrics/behavioral-events.js.map +1 -1
  21. package/dist/metrics/constants.js +33 -0
  22. package/dist/metrics/constants.js.map +1 -1
  23. package/dist/services/AddressBook.js +18 -15
  24. package/dist/services/AddressBook.js.map +1 -1
  25. package/dist/services/AnswerCallOnWebexService.js +202 -0
  26. package/dist/services/AnswerCallOnWebexService.js.map +1 -0
  27. package/dist/services/ApiAiAssistant.js +221 -11
  28. package/dist/services/ApiAiAssistant.js.map +1 -1
  29. package/dist/services/EntryPoint.js +46 -68
  30. package/dist/services/EntryPoint.js.map +1 -1
  31. package/dist/services/Queue.js +27 -22
  32. package/dist/services/Queue.js.map +1 -1
  33. package/dist/services/WebCallingService.js +10 -2
  34. package/dist/services/WebCallingService.js.map +1 -1
  35. package/dist/services/WebexCrossClientService.js +225 -0
  36. package/dist/services/WebexCrossClientService.js.map +1 -0
  37. package/dist/services/WxAppTelephonyMercurySync.js +111 -0
  38. package/dist/services/WxAppTelephonyMercurySync.js.map +1 -0
  39. package/dist/services/config/Util.js +46 -46
  40. package/dist/services/config/Util.js.map +1 -1
  41. package/dist/services/config/constants.js +34 -77
  42. package/dist/services/config/constants.js.map +1 -1
  43. package/dist/services/config/index.js +100 -226
  44. package/dist/services/config/index.js.map +1 -1
  45. package/dist/services/config/types.js +51 -18
  46. package/dist/services/config/types.js.map +1 -1
  47. package/dist/services/constants.js +11 -1
  48. package/dist/services/constants.js.map +1 -1
  49. package/dist/services/core/Err.js.map +1 -1
  50. package/dist/services/core/Utils.js +25 -1
  51. package/dist/services/core/Utils.js.map +1 -1
  52. package/dist/services/core/WebexRequest.js +6 -2
  53. package/dist/services/core/WebexRequest.js.map +1 -1
  54. package/dist/services/core/aqm-reqs.js +17 -11
  55. package/dist/services/core/aqm-reqs.js.map +1 -1
  56. package/dist/services/core/constants.js +9 -1
  57. package/dist/services/core/constants.js.map +1 -1
  58. package/dist/services/core/types.js.map +1 -1
  59. package/dist/services/core/websocket/WebSocketManager.js +17 -1
  60. package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
  61. package/dist/services/task/Task.js +275 -8
  62. package/dist/services/task/Task.js.map +1 -1
  63. package/dist/services/task/TaskFactory.js +11 -6
  64. package/dist/services/task/TaskFactory.js.map +1 -1
  65. package/dist/services/task/TaskManager.js +590 -42
  66. package/dist/services/task/TaskManager.js.map +1 -1
  67. package/dist/services/task/TaskUtils.js +11 -1
  68. package/dist/services/task/TaskUtils.js.map +1 -1
  69. package/dist/services/task/WebexCallingUtils.js +70 -0
  70. package/dist/services/task/WebexCallingUtils.js.map +1 -0
  71. package/dist/services/task/constants.js +14 -2
  72. package/dist/services/task/constants.js.map +1 -1
  73. package/dist/services/task/contact.js +29 -0
  74. package/dist/services/task/contact.js.map +1 -1
  75. package/dist/services/task/digital/Digital.js +4 -3
  76. package/dist/services/task/digital/Digital.js.map +1 -1
  77. package/dist/services/task/state-machine/TaskStateMachine.js +162 -53
  78. package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -1
  79. package/dist/services/task/state-machine/actions.js +6 -1
  80. package/dist/services/task/state-machine/actions.js.map +1 -1
  81. package/dist/services/task/state-machine/guards.js +7 -10
  82. package/dist/services/task/state-machine/guards.js.map +1 -1
  83. package/dist/services/task/state-machine/types.js.map +1 -1
  84. package/dist/services/task/state-machine/uiControlsComputer.js +118 -18
  85. package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -1
  86. package/dist/services/task/types.js +47 -1
  87. package/dist/services/task/types.js.map +1 -1
  88. package/dist/services/task/voice/Voice.js +477 -17
  89. package/dist/services/task/voice/Voice.js.map +1 -1
  90. package/dist/services/task/voice/WebRTC.js +6 -3
  91. package/dist/services/task/voice/WebRTC.js.map +1 -1
  92. package/dist/services/task/voice/wxAppOfferObservability.js +145 -0
  93. package/dist/services/task/voice/wxAppOfferObservability.js.map +1 -0
  94. package/dist/services/task/voice/wxAppVoiceMethods.js +395 -0
  95. package/dist/services/task/voice/wxAppVoiceMethods.js.map +1 -0
  96. package/dist/services/wxAppDiagnosticLogging.js +159 -0
  97. package/dist/services/wxAppDiagnosticLogging.js.map +1 -0
  98. package/dist/services/wxAppTelephonyUtils.js +19 -0
  99. package/dist/services/wxAppTelephonyUtils.js.map +1 -0
  100. package/dist/types/cc.d.ts +102 -8
  101. package/dist/types/config.d.ts +7 -0
  102. package/dist/types/constants.d.ts +21 -0
  103. package/dist/types/index.d.ts +34 -15
  104. package/dist/types/metrics/MetricsManager.d.ts +6 -0
  105. package/dist/types/metrics/constants.d.ts +31 -0
  106. package/dist/types/services/AddressBook.d.ts +2 -1
  107. package/dist/types/services/AnswerCallOnWebexService.d.ts +38 -0
  108. package/dist/types/services/ApiAiAssistant.d.ts +48 -4
  109. package/dist/types/services/EntryPoint.d.ts +7 -5
  110. package/dist/types/services/Queue.d.ts +5 -3
  111. package/dist/types/services/WebexCrossClientService.d.ts +32 -0
  112. package/dist/types/services/WxAppTelephonyMercurySync.d.ts +28 -0
  113. package/dist/types/services/config/Util.d.ts +4 -8
  114. package/dist/types/services/config/constants.d.ts +28 -76
  115. package/dist/types/services/config/index.d.ts +16 -64
  116. package/dist/types/services/config/types.d.ts +146 -173
  117. package/dist/types/services/constants.d.ts +9 -0
  118. package/dist/types/services/core/Err.d.ts +2 -0
  119. package/dist/types/services/core/Utils.d.ts +10 -0
  120. package/dist/types/services/core/WebexRequest.d.ts +1 -0
  121. package/dist/types/services/core/constants.d.ts +7 -0
  122. package/dist/types/services/core/types.d.ts +2 -0
  123. package/dist/types/services/task/Task.d.ts +34 -5
  124. package/dist/types/services/task/TaskFactory.d.ts +4 -2
  125. package/dist/types/services/task/TaskUtils.d.ts +6 -0
  126. package/dist/types/services/task/WebexCallingUtils.d.ts +11 -0
  127. package/dist/types/services/task/constants.d.ts +12 -0
  128. package/dist/types/services/task/contact.d.ts +4 -0
  129. package/dist/types/services/task/digital/Digital.d.ts +4 -3
  130. package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +304 -56
  131. package/dist/types/services/task/state-machine/guards.d.ts +6 -5
  132. package/dist/types/services/task/state-machine/types.d.ts +9 -1
  133. package/dist/types/services/task/types.d.ts +192 -5
  134. package/dist/types/services/task/voice/Voice.d.ts +68 -11
  135. package/dist/types/services/task/voice/WebRTC.d.ts +5 -4
  136. package/dist/types/services/task/voice/wxAppOfferObservability.d.ts +39 -0
  137. package/dist/types/services/task/voice/wxAppVoiceMethods.d.ts +68 -0
  138. package/dist/types/services/wxAppDiagnosticLogging.d.ts +63 -0
  139. package/dist/types/services/wxAppTelephonyUtils.d.ts +5 -0
  140. package/dist/types/types.d.ts +80 -13
  141. package/dist/types/utils/PageCache.d.ts +20 -3
  142. package/dist/types.js +54 -8
  143. package/dist/types.js.map +1 -1
  144. package/dist/utils/PageCache.js +19 -5
  145. package/dist/utils/PageCache.js.map +1 -1
  146. package/dist/webex.js +9 -1
  147. package/dist/webex.js.map +1 -1
  148. package/package.json +10 -9
  149. package/src/cc.ts +969 -38
  150. package/src/config.ts +7 -0
  151. package/src/constants.ts +24 -0
  152. package/src/index.ts +39 -10
  153. package/src/metrics/MetricsManager.ts +16 -0
  154. package/src/metrics/ai-docs/metrics-spec.md +138 -21
  155. package/src/metrics/behavioral-events.ts +112 -0
  156. package/src/metrics/constants.ts +36 -0
  157. package/src/services/AddressBook.ts +17 -6
  158. package/src/services/AnswerCallOnWebexService.ts +239 -0
  159. package/src/services/ApiAiAssistant.ts +297 -13
  160. package/src/services/EntryPoint.ts +59 -60
  161. package/src/services/Queue.ts +29 -12
  162. package/src/services/WebCallingService.ts +16 -2
  163. package/src/services/WebexCrossClientService.ts +298 -0
  164. package/src/services/WxAppTelephonyMercurySync.ts +142 -0
  165. package/src/services/agent/ai-docs/AGENTS.md +1 -1
  166. package/src/services/agent/ai-docs/agent-spec.md +1 -0
  167. package/src/services/ai-docs/AGENTS.md +10 -10
  168. package/src/services/ai-docs/services-spec.md +25 -5
  169. package/src/services/config/Util.ts +52 -82
  170. package/src/services/config/ai-docs/AGENTS.md +35 -40
  171. package/src/services/config/ai-docs/ARCHITECTURE.md +90 -103
  172. package/src/services/config/ai-docs/config-spec.md +132 -132
  173. package/src/services/config/constants.ts +39 -85
  174. package/src/services/config/index.ts +116 -277
  175. package/src/services/config/types.ts +140 -195
  176. package/src/services/constants.ts +10 -0
  177. package/src/services/core/Err.ts +1 -0
  178. package/src/services/core/Utils.ts +28 -0
  179. package/src/services/core/WebexRequest.ts +3 -1
  180. package/src/services/core/ai-docs/core-spec.md +25 -11
  181. package/src/services/core/aqm-reqs.ts +18 -12
  182. package/src/services/core/constants.ts +8 -0
  183. package/src/services/core/types.ts +33 -1
  184. package/src/services/core/websocket/WebSocketManager.ts +26 -2
  185. package/src/services/task/Task.ts +386 -12
  186. package/src/services/task/TaskFactory.ts +33 -6
  187. package/src/services/task/TaskManager.ts +857 -41
  188. package/src/services/task/TaskUtils.ts +13 -0
  189. package/src/services/task/WebexCallingUtils.ts +136 -0
  190. package/src/services/task/ai-docs/ARCHITECTURE.md +1 -0
  191. package/src/services/task/ai-docs/task-spec.md +190 -8
  192. package/src/services/task/constants.ts +13 -0
  193. package/src/services/task/contact.ts +30 -0
  194. package/src/services/task/digital/Digital.ts +11 -4
  195. package/src/services/task/state-machine/TaskStateMachine.ts +235 -81
  196. package/src/services/task/state-machine/actions.ts +5 -2
  197. package/src/services/task/state-machine/ai-docs/AGENTS.md +6 -4
  198. package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +35 -16
  199. package/src/services/task/state-machine/ai-docs/task-state-machine-spec.md +103 -33
  200. package/src/services/task/state-machine/guards.ts +7 -10
  201. package/src/services/task/state-machine/types.ts +16 -1
  202. package/src/services/task/state-machine/uiControlsComputer.ts +206 -32
  203. package/src/services/task/types.ts +269 -4
  204. package/src/services/task/voice/Voice.ts +625 -17
  205. package/src/services/task/voice/WebRTC.ts +11 -4
  206. package/src/services/task/voice/wxAppOfferObservability.ts +204 -0
  207. package/src/services/task/voice/wxAppVoiceMethods.ts +575 -0
  208. package/src/services/wxAppDiagnosticLogging.ts +286 -0
  209. package/src/services/wxAppTelephonyUtils.ts +14 -0
  210. package/src/types.ts +108 -13
  211. package/src/utils/AGENTS.md +21 -10
  212. package/src/utils/PageCache.ts +38 -5
  213. package/src/utils/ai-docs/utils-spec.md +21 -11
  214. package/src/webex.js +8 -0
  215. package/test/unit/fixtures/aiSummaryTestUtils.ts +40 -0
  216. package/test/unit/spec/cc.ts +3408 -152
  217. package/test/unit/spec/index.ts +885 -0
  218. package/test/unit/spec/metrics/MetricsManager.ts +25 -0
  219. package/test/unit/spec/metrics/behavioral-events.ts +60 -0
  220. package/test/unit/spec/services/AddressBook.ts +37 -6
  221. package/test/unit/spec/services/AnswerCallOnWebexService.ts +264 -0
  222. package/test/unit/spec/services/ApiAiAssistant.ts +269 -8
  223. package/test/unit/spec/services/EntryPoint.ts +87 -40
  224. package/test/unit/spec/services/Queue.ts +123 -12
  225. package/test/unit/spec/services/WebCallingService.ts +38 -0
  226. package/test/unit/spec/services/WebexCrossClientService.ts +509 -0
  227. package/test/unit/spec/services/WxAppTelephonyMercurySync.ts +136 -0
  228. package/test/unit/spec/services/config/Util.ts +501 -0
  229. package/test/unit/spec/services/config/index.ts +313 -543
  230. package/test/unit/spec/services/core/Utils.ts +22 -0
  231. package/test/unit/spec/services/core/WebexRequest.ts +8 -7
  232. package/test/unit/spec/services/core/aqm-reqs.ts +142 -1
  233. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +64 -14
  234. package/test/unit/spec/services/task/Task.ts +2257 -11
  235. package/test/unit/spec/services/task/TaskFactory.ts +56 -2
  236. package/test/unit/spec/services/task/TaskManager.ts +5559 -1493
  237. package/test/unit/spec/services/task/TaskUtils.ts +72 -0
  238. package/test/unit/spec/services/task/WebexCallingUtils.ts +153 -0
  239. package/test/unit/spec/services/task/contact.ts +33 -0
  240. package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +1501 -92
  241. package/test/unit/spec/services/task/state-machine/guards.ts +210 -8
  242. package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +445 -7
  243. package/test/unit/spec/services/task/voice/Voice.ts +1710 -4
  244. package/test/unit/spec/services/task/voice/wxAppOfferObservability.ts +361 -0
  245. package/test/unit/spec/services/task/voice/wxAppVoiceMethods.ts +719 -0
  246. package/test/unit/spec/services/wxAppDiagnosticLogging.ts +179 -0
  247. package/test/unit/spec/wellnessSampleUtils.ts +288 -0
  248. package/typedoc.md +1 -1
  249. package/umd/contact-center.min.js +2 -2
  250. package/umd/contact-center.min.js.map +1 -1
@@ -12,6 +12,19 @@ import {TaskContext} from './state-machine/types';
12
12
  import {CC_EVENTS} from '../config/types';
13
13
  import {OUTBOUND_TYPE, OUTDIAL_DIRECTION, OUTDIAL_MEDIA_TYPE} from '../../constants';
14
14
 
15
+ type AISummaryError = Error & {data?: Record<string, unknown>};
16
+
17
+ export const isNonEmptyString = (value: unknown): value is string =>
18
+ typeof value === 'string' && value.length > 0;
19
+
20
+ export const createSummaryError = (errorCode: string): AISummaryError => {
21
+ const error = new Error(errorCode) as AISummaryError;
22
+
23
+ error.data = {errorCode};
24
+
25
+ return error;
26
+ };
27
+
15
28
  const CAMPAIGN_PREVIEW_OUTBOUND_TYPES = ['STANDARD_PREVIEW_CAMPAIGN', 'DIRECT_PREVIEW_CAMPAIGN'];
16
29
  const CAMPAIGN_PREVIEW_CAMPAIGN_TYPES = ['preview_standard', 'preview_direct'];
17
30
 
@@ -0,0 +1,136 @@
1
+ import {TaskState} from './state-machine/constants';
2
+
3
+ export type WebexCallingDeviceDetails = {
4
+ deviceType: string;
5
+ deviceId: string;
6
+ deviceCallId: string;
7
+ };
8
+
9
+ type WebexCallingParticipant = {
10
+ id?: unknown;
11
+ deviceType?: unknown;
12
+ deviceCallId?: unknown;
13
+ deviceId?: unknown;
14
+ };
15
+
16
+ const normalizeId = (id: unknown): string | undefined => {
17
+ if (typeof id !== 'string') {
18
+ return undefined;
19
+ }
20
+
21
+ const normalizedId = id.trim();
22
+
23
+ return normalizedId === '' ? undefined : normalizedId;
24
+ };
25
+
26
+ const isParticipantsById = (participants: unknown): participants is Record<string, unknown> =>
27
+ Boolean(participants) &&
28
+ typeof participants === 'object' &&
29
+ !Array.isArray(participants) &&
30
+ !(participants instanceof Map);
31
+
32
+ const hasWebexCallingDeviceDetails = (
33
+ participant: unknown
34
+ ): participant is WebexCallingParticipant &
35
+ Pick<WebexCallingDeviceDetails, 'deviceCallId' | 'deviceId'> => {
36
+ const participantDetails = participant as WebexCallingParticipant | undefined;
37
+
38
+ return (
39
+ typeof participantDetails?.deviceCallId === 'string' &&
40
+ participantDetails.deviceCallId.trim() !== '' &&
41
+ typeof participantDetails?.deviceId === 'string' &&
42
+ participantDetails.deviceId.trim() !== ''
43
+ );
44
+ };
45
+
46
+ const isWebexCallingParticipantForAgent = (
47
+ participant: unknown,
48
+ agentId: string
49
+ ): participant is WebexCallingParticipant &
50
+ Pick<WebexCallingDeviceDetails, 'deviceCallId' | 'deviceId'> => {
51
+ const participantDetails = participant as WebexCallingParticipant | undefined;
52
+
53
+ return (
54
+ normalizeId(participantDetails?.id) === agentId && hasWebexCallingDeviceDetails(participant)
55
+ );
56
+ };
57
+
58
+ const getWebexCallingDeviceDetails = (
59
+ participant: WebexCallingParticipant &
60
+ Pick<WebexCallingDeviceDetails, 'deviceCallId' | 'deviceId'>
61
+ ): WebexCallingDeviceDetails => ({
62
+ deviceType: typeof participant.deviceType === 'string' ? participant.deviceType : '',
63
+ deviceId: participant.deviceId,
64
+ deviceCallId: participant.deviceCallId,
65
+ });
66
+
67
+ export function getWebexCallingDeviceDetailsForAgent(
68
+ agentId: string | undefined,
69
+ participants: unknown
70
+ ): WebexCallingDeviceDetails | undefined {
71
+ const normalizedAgentId = normalizeId(agentId);
72
+ if (!normalizedAgentId || !isParticipantsById(participants)) {
73
+ return undefined;
74
+ }
75
+
76
+ const agentParticipant = participants[normalizedAgentId];
77
+ const matchingAgentParticipant = hasWebexCallingDeviceDetails(agentParticipant)
78
+ ? agentParticipant
79
+ : Object.values(participants).find((participant) =>
80
+ isWebexCallingParticipantForAgent(participant, normalizedAgentId)
81
+ );
82
+
83
+ if (!matchingAgentParticipant || !hasWebexCallingDeviceDetails(matchingAgentParticipant)) {
84
+ return undefined;
85
+ }
86
+
87
+ return getWebexCallingDeviceDetails(matchingAgentParticipant);
88
+ }
89
+
90
+ export function isWebexCallingCallForAgent(
91
+ agentId: string | undefined,
92
+ participants: unknown
93
+ ): boolean {
94
+ return Boolean(getWebexCallingDeviceDetailsForAgent(agentId, participants));
95
+ }
96
+
97
+ /** Matches wxAppVoiceMethods.getWebexCallingCallId engaged semantics for uiControls. */
98
+ export function isWxAppEngagedForControls(
99
+ enableWxBetterTogether: boolean,
100
+ agentId: string | undefined,
101
+ participants: unknown,
102
+ state: TaskState
103
+ ): boolean {
104
+ if (!enableWxBetterTogether) {
105
+ return false;
106
+ }
107
+
108
+ if (
109
+ !state ||
110
+ state === TaskState.OFFERED ||
111
+ state === TaskState.IDLE ||
112
+ state === TaskState.WRAPPING_UP ||
113
+ state === TaskState.TERMINATED ||
114
+ state === TaskState.COMPLETED
115
+ ) {
116
+ return false;
117
+ }
118
+
119
+ const details = getWebexCallingDeviceDetailsForAgent(agentId, participants);
120
+
121
+ return details?.deviceType === 'wxApp';
122
+ }
123
+
124
+ export function decodedLineOwnerId(lineOwnerId?: string): string | undefined {
125
+ if (!lineOwnerId) {
126
+ return undefined;
127
+ }
128
+
129
+ try {
130
+ const decoded = atob(lineOwnerId);
131
+
132
+ return decoded.split('/').pop();
133
+ } catch {
134
+ return undefined;
135
+ }
136
+ }
@@ -35,6 +35,7 @@
35
35
  - `state?: SnapshotFrom<TaskStateMachine>`
36
36
  - `autoWrapup?: AutoWrapup`
37
37
  - `uiControls: TaskUIControls` (getter)
38
+ - includes ordered, action-specific `consultTransferDestinations` computed from Task profile configuration and live interaction data
38
39
 
39
40
  **Methods**
40
41
 
@@ -11,8 +11,8 @@
11
11
  | Doc kind | Module spec |
12
12
  | Coverage score | Partial (manifest-authoritative); 15/15 required document fields present |
13
13
  | Generated from | `module-spec` @ SDLC template library `0.2.1` |
14
- | generated_by / approved_by / updated_at | Codex generator / developer-approved follow-up review remediation / 2026-07-21 |
15
- | Validation status | Follow-up validation passed (independent Claude fallback, 2026-07-21); 1 existing test-coverage gap; coverage remains Partial |
14
+ | generated_by / approved_by / updated_at | Codex generator / developer-approved follow-up review remediation / 2026-10-06 |
15
+ | Validation status | AI summary methods, delivery, and cleanup updates pending independent review (2026-10-06); prior follow-up validation passed (independent Claude fallback, 2026-07-21); 1 existing test-coverage gap; coverage remains Partial |
16
16
 
17
17
  ## Evidence Rules
18
18
  Every requirement cites stable source and test file paths. Code/tests are the behavioral referee; routed source text supplies explicit intent and rationale. Missing or contradictory evidence blocks promotion.
@@ -33,7 +33,7 @@ Manage task lifecycle including inbound/outbound calls, hold/resume, consult, tr
33
33
 
34
34
  - **Event Emission and Public APIs**: Task objects register listeners, update context, emit SDK events (e.g., `task:*`), and expose public methods that delegate to `contact.ts` for call control and to the state machine for transition validation.
35
35
 
36
- - **AQM Contact Operations**: `contact.ts` builds the AQM request surface for call control (accept, hold, consult, transfer, wrapup, end) and is the primary bridge from `Task`/`Voice`/`WebRTC`/`Digital` methods to WCC task APIs.
36
+ - **AQM Contact Operations**: `contact.ts` builds the AQM request surface for call control (accept, hold, consult, transfer, participant Drop, wrapup, end) and is the primary bridge from `Task`/`Voice`/`WebRTC`/`Digital` methods to WCC task APIs.
37
37
 
38
38
  - **Outbound and Preview-Campaign Dialing**: `dialer.ts` exposes `startOutdial` plus `acceptPreviewContact`, `skipPreviewContact`, and `removePreviewContact`; ContactCenter publishes these operations through typed `cc` methods.
39
39
 
@@ -141,6 +141,9 @@ services/task/
141
141
  |---|---|---|---|---|---|---|
142
142
  | `task.surface` | SDK / event / internal API | Exported Task/types/events plus application-facing task instances and call-control methods. | Stable module consumption boundary. | Additive changes by default; breaking package exports require a major-version transition. | `src/services/task/Task.ts` | `../../../../ai-docs/CONTRACTS.md` |
143
143
  | `task.preview-campaign` | SDK/AQM API | `acceptPreviewContact`, `skipPreviewContact`, `removePreviewContact`, and `PreviewContactPayload`. | Accept, skip, or remove a reserved campaign preview contact; each method returns `Promise<TaskResponse>`. | Additive semver-public methods; removals or signature changes are breaking. | `src/cc.ts`, `src/services/task/dialer.ts`, `src/services/task/types.ts` | `../../../../ai-docs/CONTRACTS.md` |
144
+ | `task.consult-transfer-controls` | SDK task controls | `TaskUIControls.consultTransferDestinations` with ordered `consult` and `transfer` arrays. | Surface default destination availability on every Task without an extra policy method. | Additive semver-public field/types; array order is meaningful and the first item is the default. | `src/services/task/types.ts`, `src/services/task/state-machine/uiControlsComputer.ts` | `../../../../ai-docs/CONTRACTS.md` |
145
+ | `task.conference-participant-drop` | SDK/AQM API | `task.dropConferenceParticipant(payload: DropConferenceParticipantPayload): Promise<TaskResponse>`. | Remove a supported target from a voice conference after correlated routing completion. | Additive semver-public method and payload; removals or signature changes are breaking. | `src/services/task/voice/Voice.ts`, `src/services/task/contact.ts`, `src/services/task/types.ts` | `../../../../ai-docs/CONTRACTS.md` |
146
+ | `task.ai-summary` | SDK/RTD API | Post-call and mid-call summary request/response methods, feature enablement, and receiving-agent summary events. | Provide task-scoped generated summaries without exposing RTD correlation to SDK consumers. | Additive semver-public methods, types, and events; removals or signature changes are breaking. | `src/services/task/Task.ts`, `src/services/task/TaskManager.ts`, `src/services/task/types.ts`, `src/services/ApiAiAssistant.ts` | `../../../../ai-docs/CONTRACTS.md` |
144
147
 
145
148
  Compatibility notes:
146
149
  - Do not remove or reinterpret exported symbols/events without a documented consumer migration.
@@ -149,8 +152,12 @@ Compatibility notes:
149
152
 
150
153
  - `TaskData`, `TaskId`, `TaskResponse`, `TaskUIControls` (`types.ts`)
151
154
 
155
+ - `AISummary`, `AISummaryResponse`, `AISummaryAction`, `AISummaryFeatureEnablement`, and `AISummaryCapabilities` (`types.ts`)
156
+
152
157
  - `PreviewContactPayload` (`types.ts`) with `interactionId` and campaign-name `campaignId`
153
158
 
159
+ - `DropConferenceParticipantPayload` (`types.ts`) with a runtime-validated non-empty `participantId`
160
+
154
161
  - `ITask`, `IVoice`, `IWebRTC`, `IDigital` (`types.ts`)
155
162
 
156
163
  - `MEDIA_CHANNEL`, `TASK_CHANNEL_TYPE`, `VOICE_VARIANT` (`types.ts`)
@@ -187,6 +194,8 @@ Compatibility notes:
187
194
  | `task:switchCall` | Switched between consult and main call |
188
195
  | `task:outdialFailed` | Outdial operation failed |
189
196
  | `task:ui-controls-updated` | UI controls changed due to state transition |
197
+ | `task:midCallSummaryReceived` | Mid-call summary delivered to a receiving agent |
198
+ | `task:featureEnablement` | Per-task AI summary enablement flags received |
190
199
  | `task:cleanup` | Internal cleanup signal emitted by state machine |
191
200
 
192
201
  > Full list is defined in `TASK_EVENTS` (`types.ts`).
@@ -196,6 +205,23 @@ Compatibility notes:
196
205
  | `REAL_TIME_TRANSCRIPTION` | A realtime transcript payload is received for the task interaction |
197
206
  | `SUGGESTED_RESPONSE` | A final AI Assistant suggestion payload is received for the task interaction |
198
207
 
208
+ ### AI summary APIs
209
+
210
+ - `requestPostCallSummary(): Promise<AISummary>` requests a post-call summary.
211
+ - `sendPostCallSummaryResponse(response: AISummaryResponse): Promise<void>` reports the agent's post-call summary outcome.
212
+ - `requestMidCallSummary(action: AISummaryAction): Promise<AISummary>` requests a consult or transfer summary.
213
+ - `sendMidCallSummaryResponse(response: AISummaryResponse, action: AISummaryAction): Promise<void>` reports the corresponding mid-call outcome.
214
+
215
+ Summary requests require both the organization-level generated-summary flag and the task-level feature enablement flag. The dedicated request methods read the current organization flags directly from the existing `ApiAIAssistant.aiFeature` field, populated by ContactCenter from the agent configuration. They check `generatedSummaries.wrapUpSummariesEnabled` or `generatedSummaries.consultTransferSummariesEnabled`; missing flags disable the corresponding request. No separate feature-flags argument or task-local organization configuration is needed. A request resolves only after the event POST succeeds and the matching RTD payload arrives; otherwise it rejects with the applicable disabled, transport, or timeout error. Receiving-agent summaries are delivered separately through `task:midCallSummaryReceived`. Summary content is application data and must not be written to logs or metrics.
216
+
217
+ Task-level feature flags survive `updateTaskData()`, including interaction ID changes during consults or task re-keying. Flags remain available throughout wrapup for post-call summary requests, and TaskManager clears them when the task is removed after wrapup completion or another terminal lifecycle event. Session cleanup also clears them.
218
+
219
+ Each dedicated Task summary method owns its event selection, payload construction, metrics, and error handling. The request methods call `ApiAIAssistant.requestAndWaitForRtd()`. Both response methods read `interactionId` from the current task data and use `interaction.mainInteractionId` as `conversationId`, falling back to `interactionId`. They call `ApiAIAssistant.sendEvent()` directly without caching request IDs on the task.
220
+
221
+ TaskManager reads the receiving task directly from `taskCollection[summary.conversationId]`; the RTD conversation ID is the task's collection key (`task.data.interactionId`). It emits `task:midCallSummaryReceived` immediately when that task exists. Otherwise it stores the latest summary for that ID in an in-memory map without an expiry timer, so an RTD frame can wait for task creation. The common AQM event-processing path replays the stored payload after task creation, updates that register the task under that ID, or merge publication. Replay after creation or merge follows the public task event so consumers can attach listeners. Delivery removes the stored summary, and session cleanup clears all pending summaries.
222
+
223
+ `clearAISummaryState()` cancels pending summary requests, clears task feature enablement, and empties both pending maps. ContactCenter's `deregister()` removes the RTD message listener synchronously before asynchronous teardown. RTD listener registration and removal control inbound delivery; `setConfigFlags()` only supplies task configuration.
224
+
199
225
  Initiate outbound call.
200
226
 
201
227
  **Parameters**:
@@ -346,9 +372,23 @@ End consultation without transfer.
346
372
 
347
373
  **Returns**: `Promise<TaskResponse>`
348
374
 
375
+ Remove another participant from a voice conference.
376
+
377
+ **Parameters**:
378
+
379
+ - `participantId` (string, required): backend participant target identifier; blank and non-string values reject before AQM registration or telemetry.
380
+
381
+ **Returns**: `Promise<TaskResponse>` after `ParticipantLeftConference` is received for the latest `interaction.mainInteractionId || task.data.interactionId`.
382
+
383
+ **Failure**: `ParticipantDropConferenceFailed`, HTTP rejection, or the default 20-second AQM timeout rejects the promise. The operation does not add a task state-machine event or optimistically change the roster.
384
+
385
+ ```typescript
386
+ await task.dropConferenceParticipant({participantId});
387
+ ```
388
+
349
389
  ### Complete TASK_EVENTS inventory
350
390
 
351
- The public `TASK_EVENTS` enum contains 49 members; every member is listed below from `src/services/task/types.ts`.
391
+ The public `TASK_EVENTS` enum contains 52 members; every member is listed below from `src/services/task/types.ts`.
352
392
 
353
393
  | Constant | Event string |
354
394
  |---|---|
@@ -362,6 +402,7 @@ The public `TASK_EVENTS` enum contains 49 members; every member is listed below
362
402
  | `TASK_CONSULT_QUEUE_CANCELLED` | `task:consultQueueCancelled` |
363
403
  | `TASK_CONSULT_QUEUE_FAILED` | `task:consultQueueFailed` |
364
404
  | `TASK_UI_CONTROLS_UPDATED` | `task:ui-controls-updated` |
405
+ | `TASK_WXAPP_MUTE_STATE_UPDATED` | `task:wxapp-mute-state-updated` |
365
406
  | `TASK_CONSULT_ACCEPTED` | `task:consultAccepted` |
366
407
  | `TASK_CONSULTING` | `task:consulting` |
367
408
  | `TASK_CONSULT_CREATED` | `task:consultCreated` |
@@ -401,6 +442,8 @@ The public `TASK_EVENTS` enum contains 49 members; every member is listed below
401
442
  | `TASK_CAMPAIGN_PREVIEW_SKIP_FAILED` | `task:campaignPreviewSkipFailed` |
402
443
  | `TASK_CAMPAIGN_PREVIEW_REMOVE_FAILED` | `task:campaignPreviewRemoveFailed` |
403
444
  | `TASK_CAMPAIGN_CONTACT_UPDATED` | `task:campaignContactUpdated` |
445
+ | `TASK_MID_CALL_SUMMARY_RECEIVED` | `task:midCallSummaryReceived` |
446
+ | `TASK_FEATURE_ENABLEMENT` | `task:featureEnablement` |
404
447
 
405
448
  ## Requires (dependencies)
406
449
  - Services contact/dialer AQM factories
@@ -417,6 +460,10 @@ The public `TASK_EVENTS` enum contains 49 members; every member is listed below
417
460
  | TASK-R-005 | The contact dependency belongs to Task/TaskFactory-created tasks; dialer is an AqmReqs request factory without that constructor. | Misattributing constructor dependencies causes invalid instantiation examples. | `src/services/task/TaskFactory.ts` | `test/unit/spec/services/task/dialer.ts` | None; source and test evidence rechecked during the 2026-07-09 remediation; independent document revalidation pending. | PRESENT |
418
461
  | TASK-R-006 | Keep credentials and authentication outside Task; remote operations delegate through contact/dialer routing, AqmReqs, and Core/WebexRequest. | Task lifecycle objects should never duplicate host token handling or leak authentication state into interaction data. | `src/services/task/Task.ts`, `src/services/task/contact.ts`, `src/services/core/WebexRequest.ts` | `test/unit/spec/services/task/Task.ts`, `test/unit/spec/services/task/contact.ts` | None; authentication ownership is explicit. | PRESENT |
419
462
  | TASK-R-007 | Route enabled preview-campaign accept, skip, and remove operations through the dialer AQM factory using `PreviewContactPayload`, returning `Promise<TaskResponse>` from the public ContactCenter methods. Before routing skip/remove, reject the operation when the matching task's disable flag is `'true'`. | Preview reservations require typed payloads and correlated backend completion, while campaign controls must block prohibited skip/remove requests before transport begins. | `src/cc.ts`, `src/services/task/dialer.ts`, `src/services/task/types.ts` | `test/unit/spec/cc.ts`, `test/unit/spec/services/task/dialer.ts` | Public delegation and dialer requests are covered; the `campaignPreviewSkipDisabled` and `campaignPreviewRemoveDisabled` early-exit guards lack direct unit coverage. Independent review identified this gap on 2026-07-15. | PRESENT |
463
+ | TASK-R-008 | Voice `dropConferenceParticipant` must validate the public target, resolve the latest main interaction, POST an empty body to the encoded participant-drop route, and settle only from `ParticipantLeftConference`, `ParticipantDropConferenceFailed`, HTTP failure, or the existing AQM timeout. | Participant removal is backend-authoritative and must preserve event-driven roster/state synchronization without exposing participant identifiers through telemetry or logs. | `src/services/task/voice/Voice.ts`, `src/services/task/contact.ts`, `src/services/task/types.ts` | `test/unit/spec/services/task/voice/Voice.ts`, `test/unit/spec/services/task/contact.ts`, `test/unit/spec/services/core/aqm-reqs.ts` | Backend authorization and media removal are remote-service responsibilities. | PRESENT |
464
+ | TASK-R-009 | ContactCenter must inject Desktop Profile collaboration policy into TaskFactory, and every created voice/digital Task must expose ordered Consult and Transfer destination categories through `TaskUIControls.consultTransferDestinations`. | Task consumers need one already-computed policy surface and must not fetch profile flags or duplicate destination decisions. | `src/cc.ts`, `src/services/task/TaskFactory.ts`, `src/services/task/types.ts` | `test/unit/spec/cc.ts`, `test/unit/spec/services/task/TaskFactory.ts` | Host-specific UI options may only further hide an SDK-allowed category. | PRESENT |
465
+ | TASK-R-010 | TaskManager must propagate backend owner promotion without electing an owner locally. `ContactOwnerChanged` resolves an exact task first, then one unique related task whose existing snapshot proves that the current Agent is active on `mainCall`, or whose incoming snapshot both names that Agent as `interaction.owner` and proves the same active-main-leg membership. Active membership requires a participant entry with `hasLeft !== true`. If no task exists, recovery is limited to that incoming owner=current-Agent proof: create the normal Task under the stable main interaction ID, silently HYDRATE its actor before listener installation, then process the original owner-change event so consumers receive one `task:hydrate` and no `task:incoming`. An owner-changing `ContactUpdated` uses the existing owner-change hydrate path only for an existing task, and a late `ParticipantLeftConference` cannot replace a confirmed active owner with the departed participant. | Every surviving agent must observe the backend-selected primary Agent immediately, including stale child-keyed and narrowly recoverable desynchronization cases, without duplicating tasks or exposing an uninitialized actor. | `src/services/task/TaskManager.ts` | `test/unit/spec/services/task/TaskManager.ts`, `test/unit/spec/services/task/Task.ts` | Backend owner selection and delivery of a complete owner-bearing `ContactOwnerChanged` payload remain remote responsibilities; missing-task `ContactUpdated` remains update-only. | PRESENT |
466
+ | TASK-R-011 | TaskManager must stamp `wrapUpRequired` once in `prepareEventContext` on `AGENT_WRAPUP`, `AGENT_CONSULT_CONFERENCE_ENDED`, `PARTICIPANT_LEFT_CONFERENCE`, and `AGENT_CONFERENCE_TRANSFERRED` before `updateTaskData` / mapper (mapper passes the already-stamped payload through). Voice `exitConference` stamps the same flag on `EXIT_CONFERENCE_SUCCESS` (that HTTP path skips TaskManager) using `shouldWrapUpForThisAgent`, then the same empty-pending self-exit fallback as leave (true unless this agent is a consulted non-owner). Voice pending-list precedence uses the correlated HTTP response only (a cached `agentsPendingWrapUp` is ignored when the response omits the list). `AGENT_WRAPUP` is always `true`. Conference-end uses explicit signals only (`agentsPendingWrapUp`, then `wrapUpRequired` / `isWrapUp`). A nonempty `agentsPendingWrapUp` is authoritative and wins over initiator fallback: `consultingAgentId === self` and actor `transferConferenceRequested` are honored only when the list is empty or absent. On participant leave: do not stamp when the actor ignores `PARTICIPANT_LEAVE` (`CONNECTED`, `HOLD_INITIATING`, `CONF_INITIATING`); stamp only in `HELD`, `RESUME_INITIATING`, `CONSULTING`, `CONSULT_INITIATING`, or `CONFERENCING` (or when no actor snapshot exists). A named other `participantId` is never self-leave (do not infer leave from a partial `participants` map); missing-map fallback applies only when `participantId` is absent (EP-DN), and when a previous task map exists it must have contained self. Remaining agents use explicit signals only; this agent left + nonempty pending uses `includes(self)`; this agent left + empty/absent pending stamps `true` unless this agent is a consulted non-owner. Remaining conference agents stay `false`. `setupAutoWrapupTimer()` still requires profile `autoWrapup !== false`, a valid interval, and a default reason. `PARTICIPANT_LEAVE` and Voice `EXIT_CONFERENCE_SUCCESS` into `WRAPPING_UP` do not transition-emit; the `WRAPPING_UP` entry still emits `task:wrapup`. `EXIT_CONFERENCE_SUCCESS` is handled in `CONNECTED`, `HELD`, and `CONFERENCING`. `TASK_WRAPUP` is handled in `HOLD_INITIATING`, `RESUME_INITIATING`, `CONSULT_INITIATING`, and `CONF_INITIATING` (transition `updateTaskData` + `markEnded` only). Late `TASK_WRAPUP` in `WRAPPING_UP` always runs `updateTaskData` and runs `emitTaskWrapup` only when `context.taskData.wrapUpRequired` was not already `true`. | Consumers rely on `task:wrapup` and `task.autoWrapup` when wrap-up starts; those surfaces only activate when ingress task data already has `wrapUpRequired === true`. | `src/services/task/TaskManager.ts`, `src/services/task/voice/Voice.ts`, `src/services/task/Task.ts`, `src/services/task/state-machine/TaskStateMachine.ts` | `test/unit/spec/services/task/TaskManager.ts`, `test/unit/spec/services/task/voice/Voice.ts`, `test/unit/spec/services/task/Task.ts`, `test/unit/spec/services/task/state-machine/TaskStateMachine.ts` | Profile auto wrap-up, interval, and default reason remain agent-config responsibilities. | PRESENT |
420
467
 
421
468
  ## Design Overview
422
469
  Task separates its stable consumption boundary from collaborators so ownership and failure behavior stay explicit. A shared Task base preserves a stable API while media-specific subclasses and a separate state engine enforce capability differences.
@@ -431,7 +478,7 @@ Task separates its stable consumption boundary from collaborators so ownership a
431
478
  | `facebook` | Unsupported by TaskFactory; throws `Unknown media type` |
432
479
  | `whatsapp` | Unsupported by TaskFactory; throws `Unknown media type` |
433
480
 
434
- If enabled in agent profile, wrapup completes automatically after timeout:
481
+ If enabled in agent profile, wrapup completes automatically after timeout. The timer starts only when ingress task data has `wrapUpRequired === true` (TASK-R-011).
435
482
 
436
483
  > **Host-application example:** `updateWrapupStatus` is a consumer-owned UI callback, not SDK package logging.
437
484
 
@@ -494,6 +541,8 @@ Returns an object of AQM request methods wired to `TASK_API` and `TASK_MESSAGE_T
494
541
 
495
542
  - `consultConference`
496
543
 
544
+ - `dropConferenceParticipant`
545
+
497
546
  - `exitConference`
498
547
 
499
548
  - `conferenceTransfer`
@@ -532,6 +581,8 @@ Uses `contact` for:
532
581
 
533
582
  - `consultConference`, `exitConference`, `conferenceTransfer`
534
583
 
584
+ - `dropConferenceParticipant` (Voice only; base Task rejects as unsupported)
585
+
535
586
  Uses `contact.accept` in `accept()`.
536
587
 
537
588
  TaskManager maintains a map of active tasks:
@@ -588,6 +639,18 @@ this.webSocketManager.on('message', (event) => {
588
639
 
589
640
  This keeps transcript and suggestion delivery aligned on the same per-task event surface.
590
641
 
642
+ **wxApp outdial `ContactEnded` / `AgentOutboundFailed` mapping:** Applies only when the current agent is a **wxApp-managed** outdial (`enableWxBetterTogether` + agent participant `deviceType: wxApp`). Pre-accept decline maps to `CONTACT_ENDED` when `wxAppAnswerPending` is false and `agentsPendingWrapUp` is empty — even if the backend sends misleading `interaction.state: wrapUp`. Post-accept wxApp agent end remaps to `OUTBOUND_FAILED` / `AGENT_ENDS` when `wxAppAnswerPending`, `agentsPendingWrapUp`, or `interaction.state === 'wrapUp'` indicates wrapup. **Non-wxApp** agent-terminated `AgentOutboundFailed` (`AGENT_ENDS` / `terminatingParty: Agent`) stays on `OUTBOUND_FAILED` so the OFFERED-state `shouldWrapUp` path runs; `suppressOutdialFailedPopup` on `taskData` skips the outdial-failed modal only. Non-wxApp `ContactEnded` keeps the legacy path. Other failure reasons (`CUSTOMER_BUSY`, etc.) still use `OUTBOUND_FAILED` with the popup. See `TaskManager.isWxAppManagedOutdialTask`, `isAgentTerminatedOutdialWrapup`, and `task-state-machine-spec.md`.
643
+
644
+ **wxApp consumer contract (WXCC-6026):** Hosts enable `enableWxBetterTogether` at init (Phase 1 init-only; re-init to change), bind UI to `task.uiControls` (including optional `main.keypad`), and call **`task.accept()`**, **`task.decline()`**, **`task.toggleMute({ muted? })`**, **`task.transmitDtmf({ dtmf })`**. SDK routes wxApp telephony internally on `Voice`. Shared-line `lineOwnerId` defaults from the wxApp agent participant when omitted.
645
+
646
+ **wxApp OFFERED diagnostics:** `Voice.updateUiControls` delegates offer-decision logging and deferred participant-mismatch WARN/metric to `voice/wxAppOfferObservability.ts` (500 ms grace; observability only). After usersub publish, `TaskManager.refreshWxAppOfferObservabilityForAllTasks()` re-invokes the observer without emitting UI controls. `removeTaskFromCollection` calls `disposeWxAppOfferObservability()` so a pending grace timer cannot emit after the task is dropped (including `CONTACT_MERGED` child removal). Dispose is terminal: the observer sets a disposed guard (timer cancel plus no-op `handleUiControlsUpdate`) so a later `updateUiControls` / refresh cannot schedule a new grace timer.
647
+
648
+ **wxApp offer UI (`uiControlsComputer`):** `wxAppAcceptInFlight` disables accept/decline during the accept REST call. `wxAppAnswerPending` additionally disables accept and decline for **inbound** offers until ASSIGN; wxApp **outdial** keeps decline enabled during the post-accept "Calling…" phase so `cancelTask` remains available.
649
+
650
+ **wxApp decline observability:** Inbound wxApp offers decline via telephony `rejectCall` (`runWxAppReject` → `WXAPP_TASK_DECLINE_*`). wxApp outdial cancellations use CC routing `cancelTask` (`runWxAppOutdialDecline` → additive `WXAPP_TASK_DECLINE_*` plus existing `TASK_DECLINE_*`).
651
+
652
+ **wxApp mute backfill guard (`Voice.syncWxAppMuteFromCallDetails`):** Skips telephony `GET /calls/{callId}` when the interaction is terminated or the task is a pre-accept wxApp OFFERED offer (`wxAppAnswerPending` false). Post-accept OFFERED and engaged CONNECTED sync still run. `isWxAppEngagedForControls` and `getWebexCallingCallId` exclude `TERMINATED` and `COMPLETED`. Expected 400 / "Call not found" / `101002` responses are not logged as errors.
653
+
591
654
  For BROWSER login, TaskManager integrates with WebCalling:
592
655
 
593
656
  ```mermaid
@@ -689,6 +752,7 @@ isSecondaryEpDnAgent(interaction);
689
752
  | `TASK_WRAPUP_SUCCESS` | operational | Wrapup completed |
690
753
  | `TASK_TRANSFER_SUCCESS` | behavioral, business | Transfer completed |
691
754
  | `TASK_OUTDIAL_SUCCESS` | behavioral, business | Outdial completed |
755
+ | `TASK_CONFERENCE_PARTICIPANT_DROP_SUCCESS` | operational, behavioral, business | Participant Drop completed |
692
756
 
693
757
  ## Data Flow
694
758
  1. **WebSocket event arrives** → `TaskManager` maps CC event to `TaskEvent`.
@@ -727,6 +791,7 @@ Sequence coverage:
727
791
  | Incoming task creation | Incoming task | Unsupported media or incomplete event context prevents publication of a partial task. |
728
792
  | Voice hold/resume | Hold or resume | Invalid state rejects before transport; failure notification/HTTP error/timeout sends the matching failure event and throws. |
729
793
  | Consult/transfer/conference | Consult and transfer | Backend failure notifications drive explicit failure actions and preserve stable call context. |
794
+ | Participant Drop | Participant Drop | Validation rejects locally; AQM success/failure/HTTP/timeout paths settle and clean up without optimistic state changes. |
730
795
  | Wrapup/end | Wrapup or end | Validation and backend failures throw; backend events retain distinct WRAPPING_UP/COMPLETED/TERMINATED outcomes. |
731
796
  | WebRTC and digital accept | Channel-specific accept | WebRTC media/calling failure and Digital AQM failure follow different rejection paths. |
732
797
 
@@ -820,6 +885,119 @@ sequenceDiagram
820
885
  end
821
886
  ```
822
887
 
888
+ ### Participant Drop
889
+
890
+ ```mermaid
891
+ sequenceDiagram
892
+ participant App
893
+ participant Voice
894
+ participant Contact as routingContact
895
+ participant AQM as AqmReqs
896
+ participant Backend
897
+ participant WS as Primary WebSocket
898
+ participant TM as TaskManager/state machine
899
+ App->>Voice: dropConferenceParticipant({participantId})
900
+ alt participantId is invalid
901
+ Voice-->>App: reject before metrics, HTTP, or bind registration
902
+ else valid target
903
+ Voice->>Voice: select latest main interaction ID
904
+ Voice->>Contact: participant Drop request
905
+ Contact->>AQM: POST encoded path with empty body and sensitive-log redaction
906
+ AQM->>Backend: authenticated HTTP initiation
907
+ alt ParticipantLeftConference
908
+ Backend-->>WS: ParticipantLeftConference
909
+ WS-->>AQM: correlated success
910
+ AQM-->>Voice: TaskResponse
911
+ WS-->>TM: existing PARTICIPANT_LEAVE mapping updates roster/conference state
912
+ Voice-->>App: resolve
913
+ else ParticipantDropConferenceFailed, HTTP failure, or timeout
914
+ AQM-->>Voice: structured rejection
915
+ Voice-->>App: reject without participant data in logs/metrics
916
+ end
917
+ end
918
+ ```
919
+
920
+ `ParticipantLeftConference` is authoritative for both a customer hangup and an
921
+ agent-initiated customer Drop. The task removes only participants absent from
922
+ the latest interaction snapshot. TaskManager first uses the exact interaction
923
+ key, then the existing reservation fallback, and finally one unique task whose
924
+ `interaction.mainInteractionId`, interaction-level `parentInteractionId`, or
925
+ `callProcessingDetails.parentInteractionId` matches an identifier carried by the
926
+ lifecycle event. Object aliases are deduplicated and all aliases are removed
927
+ during terminal cleanup; ambiguous related-interaction matches are ignored
928
+ without logging participant data. Events carrying none of those correlation
929
+ identifiers are not routed. `ContactMerged` removes the EP-DN child task,
930
+ hydrates the main-interaction task, and publishes the existing `task:merged`
931
+ event so consumers can rebind to the surviving task object.
932
+
933
+ Dropping an Agent while that Agent is consulting continues through the existing
934
+ `PARTICIPANT_LEAVE` transition, which clears consult state and emits the normal
935
+ participant-left and task-end lifecycle. `PARTICIPANT_LEAVE` is handled in
936
+ `HELD`, `RESUME_INITIATING`, `CONSULTING`, `CONSULT_INITIATING`, and
937
+ `CONFERENCING`; `CONNECTED`, `HOLD_INITIATING`, and `CONF_INITIATING` ignore the
938
+ event. The current Agent is treated as departed only when the event names that
939
+ Agent or the updated participants map omits that Agent (EP-DN removal). Remaining
940
+ in the map with `hasLeft`, or disappearing only from `mainCall` media, is
941
+ non-terminal. A consulted Agent receiving `AgentConsultEnded` continues through
942
+ `CONSULT_END`; current-agent departure is evaluated before consult-initiator
943
+ recovery and does not use mainCall membership as self-departure evidence.
944
+ Accepted consultees emit `task:consultEnd` and `task:end`, while an unaccepted
945
+ OFFERED consultee retains the existing consult-end-only signal. A surviving
946
+ consult initiator still returns to the main-call state selected by the existing
947
+ guards. The state-machine transition table lives in
948
+ `src/services/task/state-machine/ai-docs/task-state-machine-spec.md`
949
+ `TASK_STATE_MACHINE-R-008`.
950
+
951
+ Primary-Agent promotion remains backend-authoritative and follows the two-event
952
+ desktop contract. `ContactOwnerChanged` updates the promoted Agent; TaskManager
953
+ prefers an exact task, then one unique related task resolved through nested
954
+ main/parent identifiers, the task collection key, or the `mainCall` media-map
955
+ identity. A related candidate is eligible when its current
956
+ snapshot contains the current Agent's participant entry with `hasLeft !== true`
957
+ and membership on the `mType: mainCall` leg. The incoming snapshot can provide
958
+ that evidence only when it also names the current Agent as `interaction.owner`;
959
+ this permits an authoritative promotion payload to repair a stale child-keyed
960
+ snapshot while still excluding consult-only tasks. The update keeps the
961
+ surviving main interaction identity even when the notification names a
962
+ promoted-Agent child interaction. Conflicting main identifiers, ambiguous
963
+ matches, and a canonical key occupied by a distinct task are ignored rather
964
+ than replacing an existing task.
965
+
966
+ If no related task exists, TaskManager recovers only the promoted current Agent
967
+ from a non-terminal telephony `ContactOwnerChanged` payload that provides the same
968
+ active-main-leg evidence. It creates the normal Task through TaskFactory under the
969
+ stable main interaction ID, sends an internal HYDRATE before installing external
970
+ listeners, and then processes the original owner-change event. Consumers
971
+ therefore receive one `task:hydrate`, never a synthetic `task:incoming`, and a
972
+ later canonical contact or merge event reuses the same task rather than creating
973
+ an alias. Missing, partial, departed, consult-only, non-promoted, and ambiguous
974
+ payloads are ignored for recovery.
975
+
976
+ For other surviving Agents, a `ContactUpdated` whose non-empty
977
+ `interaction.owner` differs from the current owner is delivered through the
978
+ existing `CONTACT_OWNER_CHANGED`/`task:hydrate` path; same-owner or owner-less
979
+ updates remain data-only, and a missing task is not created from `ContactUpdated`.
980
+ If a later `ParticipantLeftConference` still names the departed participant as
981
+ owner, an already confirmed owner is retained only when the new roster proves
982
+ that confirmed owner remains active on `mainCall` and explicitly names the
983
+ incoming owner as `participantId` or marks it `hasLeft`. Main-call omission alone
984
+ is not departure evidence. The SDK never chooses the successor locally.
985
+
986
+ In the Contact Center sample roster, non-owner and Supervisor targets remain
987
+ visible but non-actionable; the UI does not display a separate read-only label.
988
+ The roster is visible whenever the viewing agent remains active on the main leg
989
+ and at least one supported non-customer participant (Agent, EP-DN, or Supervisor)
990
+ is visible. Consequently, Customer-only calls use the original 1-to-1 UI, while
991
+ a single Agent remains visible after the Customer leaves. Dropping the last
992
+ non-customer participant while the Customer remains restores the 1-to-1 UI.
993
+ Terminated tasks and viewing-agent departure hide the roster immediately.
994
+
995
+ The current consult leg may additionally contribute a pending EP-DN row before
996
+ conference merge. The sample displays its `dn`, then its participant/media key
997
+ as a fallback, and deduplicates the row once it joins the main leg. The owner can
998
+ see a disabled Drop action until merge; other active main-call agents see the
999
+ same row without an action. Consult-only Agent targets remain excluded.
1000
+
823
1001
  ### Wrapup or end
824
1002
 
825
1003
  ```mermaid
@@ -1000,7 +1178,7 @@ sequenceDiagram
1000
1178
 
1001
1179
  **API**
1002
1180
 
1003
- - `createTask(contact, webCallingService, data, configFlags, wrapupData?, agentId?): Task`
1181
+ - `createTask(contact, webCallingService, data, configFlags, wrapupData?, agentId?, agentName?): Task`
1004
1182
 
1005
1183
  **Behavior**
1006
1184
 
@@ -1076,7 +1254,7 @@ classDiagram
1076
1254
  }
1077
1255
 
1078
1256
  class TaskFactory {
1079
- + createTask(contact, webCallingService, data, configFlags, wrapupData, agentId) Task
1257
+ + createTask(contact, webCallingService, data, configFlags, wrapupData, agentId, agentName) Task
1080
1258
  }
1081
1259
 
1082
1260
  Task <|-- Voice
@@ -1270,7 +1448,7 @@ await cc.stationLogin({ loginOption: 'BROWSER', ... });
1270
1448
  - A shared Task base preserves a stable API while media-specific subclasses and a separate state engine enforce capability differences.
1271
1449
 
1272
1450
  ## Test-Case Strategy (module)
1273
- Use `test/unit/spec/services/task/Task.ts`, `TaskFactory.ts`, `TaskManager.ts`, media-specific suites, contact/dialer suites, and state-machine suites. Cover concrete-versus-interface method signatures, every TASK_EVENTS group, unsupported media rejection, primary/RTD event ownership, injected state actions, preview-campaign accept/skip/remove payloads and failure paths, the disabled skip/remove pre-guards, and success/failure/timeout paths.
1451
+ Use `test/unit/spec/services/task/Task.ts`, `TaskFactory.ts`, `TaskManager.ts`, media-specific suites, contact/dialer suites, and state-machine suites. Cover concrete-versus-interface method signatures, every TASK_EVENTS group, unsupported media rejection, primary/RTD event ownership, injected state actions, preview-campaign accept/skip/remove payloads and failure paths, the disabled skip/remove pre-guards, Participant Drop validation/correlation/privacy, primary-owner promotion propagation, and success/failure/timeout paths.
1274
1452
 
1275
1453
  | Behavior / Requirement | Existing test evidence | Gap |
1276
1454
  |---|---|---|
@@ -1281,6 +1459,10 @@ Use `test/unit/spec/services/task/Task.ts`, `TaskFactory.ts`, `TaskManager.ts`,
1281
1459
  | `TASK-R-005` | `test/unit/spec/services/task/TaskFactory.ts`, `test/unit/spec/services/task/dialer.ts` | None. |
1282
1460
  | `TASK-R-006` | `test/unit/spec/services/task/contact.ts`, `test/unit/spec/services/core/WebexRequest.ts` | Authentication ownership is verified across routing/Core boundaries. |
1283
1461
  | `TASK-R-007` | `test/unit/spec/cc.ts`, `test/unit/spec/services/task/dialer.ts` | Add direct tests proving disabled skip/remove flags throw before dialer invocation; keep public signatures, metrics/error handling, and AQM request contracts synchronized. |
1462
+ | `TASK-R-008` | `test/unit/spec/services/task/Task.ts`, `test/unit/spec/services/task/voice/Voice.ts`, `test/unit/spec/services/task/contact.ts`, `test/unit/spec/services/core/aqm-reqs.ts`, `test/unit/spec/services/task/TaskManager.ts` | None. |
1463
+ | `TASK-R-009` | `test/unit/spec/cc.ts`, `test/unit/spec/services/task/TaskFactory.ts`, `test/unit/spec/services/task/state-machine/uiControlsComputer.ts` | None. |
1464
+ | `TASK-R-010` | `test/unit/spec/services/task/TaskManager.ts`, `test/unit/spec/services/task/Task.ts` | None. |
1465
+ | `TASK-R-011` | `test/unit/spec/services/task/TaskManager.ts`, `test/unit/spec/services/task/voice/Voice.ts`, `test/unit/spec/services/task/Task.ts`, `test/unit/spec/services/task/state-machine/TaskStateMachine.ts` | None. |
1284
1466
 
1285
1467
  ## Traceability
1286
1468
  - Repo architecture: `../../../../ai-docs/ARCHITECTURE.md` · Registry: `../../../../ai-docs/SPEC_INDEX.md`
@@ -14,6 +14,8 @@ export const CONSULT = '/consult';
14
14
  export const CONSULT_ACCEPT = '/consult/accept';
15
15
  export const CONSULT_END = '/consult/end';
16
16
  export const TRANSFER = '/transfer';
17
+ /** Backend destination value for direct entry-point transfers through the vteam endpoint. */
18
+ export const ENTRY_POINT_TRANSFER_DESTINATION_TYPE = 'entrypointDialNumber';
17
19
  export const CONSULT_TRANSFER = '/consult/transfer';
18
20
  export const PAUSE = '/record/pause';
19
21
  export const RESUME = '/record/resume';
@@ -28,6 +30,10 @@ export const CAMPAIGN_PREVIEW_SKIP = '/skip';
28
30
  export const CAMPAIGN_PREVIEW_REMOVE = '/remove';
29
31
  /** 80-second timeout for accepting preview contact (outbound call setup takes longer than default 20s) */
30
32
  export const TIMEOUT_PREVIEW_ACCEPT = 80000;
33
+ /** RTD result deadline; the initiating HTTP acknowledgement uses the 20-second service timeout. */
34
+ export const AI_SUMMARY_DURATION_MS = 15000;
35
+ export const AI_SUMMARY_REQUEST_CANCELLED = 'AI_SUMMARY_REQUEST_CANCELLED' as const;
36
+
31
37
  export const TASK_MANAGER_FILE = 'taskManager';
32
38
  export const TASK_FILE = 'task';
33
39
 
@@ -73,6 +79,7 @@ export const METHODS = {
73
79
  TRANSFER: 'transfer',
74
80
  CONSULT_TRANSFER: 'consultTransfer',
75
81
  CONSULT_CONFERENCE: 'consultConference',
82
+ DROP_CONFERENCE_PARTICIPANT: 'dropConferenceParticipant',
76
83
  EXIT_CONFERENCE: 'exitConference',
77
84
  TRANSFER_CONFERENCE: 'transferConference',
78
85
  UPDATE_TASK_DATA: 'updateTaskData',
@@ -90,6 +97,12 @@ export const METHODS = {
90
97
  SETUP_AUTO_WRAPUP_TIMER: 'setupAutoWrapupTimer',
91
98
  CANCEL_AUTO_WRAPUP_TIMER: 'cancelAutoWrapupTimer',
92
99
  REQUEST_REAL_TIME_TRANSCRIPTS: 'requestRealTimeTranscripts',
100
+ REQUEST_POST_CALL_SUMMARY: 'requestPostCallSummary',
101
+ SEND_POST_CALL_SUMMARY_RESPONSE: 'sendPostCallSummaryResponse',
102
+ REQUEST_MID_CALL_SUMMARY: 'requestMidCallSummary',
103
+ SEND_MID_CALL_SUMMARY_RESPONSE: 'sendMidCallSummaryResponse',
104
+ HANDLE_AI_SUMMARY_EVENT: 'handleAISummaryEvent',
105
+ CLEAR_AI_SUMMARY_STATE: 'clearAISummaryState',
93
106
  };
94
107
 
95
108
  export const TRANSCRIPT_EVENT_MAP = {
@@ -458,6 +458,36 @@ export default function routingContact(aqm: AqmReqs) {
458
458
  })
459
459
  ),
460
460
 
461
+ /*
462
+ * Drop another participant from an active conference
463
+ */
464
+ dropConferenceParticipant: aqm.req((p: {interactionId: string; participantId: string}) => ({
465
+ url: `${TASK_API}${p.interactionId}/conference/participants/${encodeURIComponent(
466
+ p.participantId
467
+ )}/drop`,
468
+ data: {},
469
+ host: WCC_API_GATEWAY,
470
+ err,
471
+ redactSensitiveLogs: true,
472
+ notifSuccess: {
473
+ bind: {
474
+ type: TASK_MESSAGE_TYPE,
475
+ data: {
476
+ type: CC_EVENTS.PARTICIPANT_LEFT_CONFERENCE,
477
+ interactionId: p.interactionId,
478
+ },
479
+ },
480
+ msg: {} as Contact.AgentContact,
481
+ },
482
+ notifFail: {
483
+ bind: {
484
+ type: TASK_MESSAGE_TYPE,
485
+ data: {type: CC_EVENTS.PARTICIPANT_DROP_CONFERENCE_FAILED},
486
+ },
487
+ errId: 'Service.aqm.task.dropConferenceParticipant',
488
+ },
489
+ })),
490
+
461
491
  /*
462
492
  * Exit conference
463
493
  */
@@ -1,7 +1,8 @@
1
1
  import {CC_FILE, METHODS} from '../../../constants';
2
2
  import {getErrorDetails} from '../../core/Utils';
3
- import {IDigital, TaskResponse, TaskData} from '../types';
4
- import {WrapupData} from '../../config/types';
3
+ import {ConsultTransferDestinationConfig, IDigital, TaskResponse, TaskData} from '../types';
4
+ import type {WrapupData} from '../../config/types';
5
+ import type ApiAIAssistant from '../../ApiAiAssistant';
5
6
  import Task from '../Task';
6
7
  import routingContact from '../contact';
7
8
  import LoggerProxy from '../../../logger-proxy';
@@ -13,7 +14,10 @@ export default class Digital extends Task implements IDigital {
13
14
  contact: ReturnType<typeof routingContact>,
14
15
  data: TaskData,
15
16
  wrapupData?: WrapupData,
16
- agentId?: string
17
+ agentId?: string,
18
+ consultTransferConfig?: ConsultTransferDestinationConfig,
19
+ agentName?: string,
20
+ apiAIAssistant?: ApiAIAssistant
17
21
  ) {
18
22
  super(
19
23
  contact,
@@ -22,9 +26,12 @@ export default class Digital extends Task implements IDigital {
22
26
  isEndTaskEnabled: true,
23
27
  isEndConsultEnabled: false,
24
28
  isRecordingEnabled: false,
29
+ consultTransferConfig,
25
30
  },
26
31
  wrapupData,
27
- agentId
32
+ agentId,
33
+ agentName,
34
+ apiAIAssistant
28
35
  );
29
36
  }
30
37