@webex/contact-center 3.12.0-next.16 → 3.12.0-next.161

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 (328) hide show
  1. package/.sdd/manifest.json +887 -0
  2. package/AGENTS.md +94 -0
  3. package/ai-docs/ARCHITECTURE.md +168 -0
  4. package/ai-docs/CONTRACTS.md +62 -0
  5. package/ai-docs/GETTING_STARTED.md +168 -0
  6. package/ai-docs/GLOSSARY.md +43 -0
  7. package/ai-docs/README.md +138 -0
  8. package/ai-docs/REVIEW_CHECKLIST.md +41 -0
  9. package/ai-docs/RULES.md +444 -0
  10. package/ai-docs/SECURITY.md +52 -0
  11. package/ai-docs/SERVICE_STATE.md +52 -0
  12. package/ai-docs/SPEC_INDEX.md +65 -0
  13. package/ai-docs/adr/0001-spec-source-policy.md +55 -0
  14. package/ai-docs/adr/README.md +8 -0
  15. package/ai-docs/adr/_adr-template.md +31 -0
  16. package/ai-docs/contact-center-spec.md +385 -0
  17. package/ai-docs/features/consult-transfer-list-policy/spec/feature-spec.md +362 -0
  18. package/ai-docs/features/contact-owner-change-refactor.md +78 -0
  19. package/ai-docs/features/generated-spec-conformance-fidelity-remediation/spec/feature-spec.md +117 -0
  20. package/ai-docs/features/residual-warning-coverage-completion/spec/feature-spec.md +203 -0
  21. package/ai-docs/features/validator-code-fidelity-drift-fix/spec/feature-spec.md +315 -0
  22. package/ai-docs/patterns/event-driven-patterns.md +485 -0
  23. package/ai-docs/patterns/testing-patterns.md +480 -0
  24. package/ai-docs/patterns/typescript-patterns.md +365 -0
  25. package/ai-docs/templates/README.md +102 -0
  26. package/ai-docs/templates/documentation/create-agents-md.md +240 -0
  27. package/ai-docs/templates/documentation/create-architecture-md.md +295 -0
  28. package/ai-docs/templates/existing-service/bug-fix.md +254 -0
  29. package/ai-docs/templates/existing-service/feature-enhancement.md +450 -0
  30. package/ai-docs/templates/new-method/00-master.md +80 -0
  31. package/ai-docs/templates/new-method/01-requirements.md +232 -0
  32. package/ai-docs/templates/new-method/02-implementation.md +295 -0
  33. package/ai-docs/templates/new-method/03-tests.md +201 -0
  34. package/ai-docs/templates/new-method/04-validation.md +141 -0
  35. package/ai-docs/templates/new-service/00-master.md +109 -0
  36. package/ai-docs/templates/new-service/01-pre-questions.md +159 -0
  37. package/ai-docs/templates/new-service/02-code-generation.md +346 -0
  38. package/ai-docs/templates/new-service/03-integration.md +178 -0
  39. package/ai-docs/templates/new-service/04-test-generation.md +205 -0
  40. package/ai-docs/templates/new-service/05-validation.md +145 -0
  41. package/dist/cc.js +888 -49
  42. package/dist/cc.js.map +1 -1
  43. package/dist/config.js +13 -0
  44. package/dist/config.js.map +1 -1
  45. package/dist/constants.js +38 -3
  46. package/dist/constants.js.map +1 -1
  47. package/dist/index.js +54 -17
  48. package/dist/index.js.map +1 -1
  49. package/dist/metrics/MetricsManager.js +16 -0
  50. package/dist/metrics/MetricsManager.js.map +1 -1
  51. package/dist/metrics/behavioral-events.js +185 -0
  52. package/dist/metrics/behavioral-events.js.map +1 -1
  53. package/dist/metrics/constants.js +54 -4
  54. package/dist/metrics/constants.js.map +1 -1
  55. package/dist/services/AddressBook.js +18 -15
  56. package/dist/services/AddressBook.js.map +1 -1
  57. package/dist/services/AnswerCallOnWebexService.js +202 -0
  58. package/dist/services/AnswerCallOnWebexService.js.map +1 -0
  59. package/dist/services/ApiAiAssistant.js +369 -14
  60. package/dist/services/ApiAiAssistant.js.map +1 -1
  61. package/dist/services/EntryPoint.js +46 -68
  62. package/dist/services/EntryPoint.js.map +1 -1
  63. package/dist/services/Queue.js +27 -22
  64. package/dist/services/Queue.js.map +1 -1
  65. package/dist/services/UserPreference.js +427 -0
  66. package/dist/services/UserPreference.js.map +1 -0
  67. package/dist/services/WebCallingService.js +10 -2
  68. package/dist/services/WebCallingService.js.map +1 -1
  69. package/dist/services/WebexCrossClientService.js +225 -0
  70. package/dist/services/WebexCrossClientService.js.map +1 -0
  71. package/dist/services/WxAppTelephonyMercurySync.js +111 -0
  72. package/dist/services/WxAppTelephonyMercurySync.js.map +1 -0
  73. package/dist/services/config/Util.js +48 -48
  74. package/dist/services/config/Util.js.map +1 -1
  75. package/dist/services/config/constants.js +56 -78
  76. package/dist/services/config/constants.js.map +1 -1
  77. package/dist/services/config/index.js +100 -226
  78. package/dist/services/config/index.js.map +1 -1
  79. package/dist/services/config/types.js +93 -24
  80. package/dist/services/config/types.js.map +1 -1
  81. package/dist/services/constants.js +11 -1
  82. package/dist/services/constants.js.map +1 -1
  83. package/dist/services/core/Err.js.map +1 -1
  84. package/dist/services/core/Utils.js +131 -32
  85. package/dist/services/core/Utils.js.map +1 -1
  86. package/dist/services/core/WebexRequest.js +6 -2
  87. package/dist/services/core/WebexRequest.js.map +1 -1
  88. package/dist/services/core/aqm-reqs.js +17 -11
  89. package/dist/services/core/aqm-reqs.js.map +1 -1
  90. package/dist/services/core/constants.js +9 -1
  91. package/dist/services/core/constants.js.map +1 -1
  92. package/dist/services/core/types.js.map +1 -1
  93. package/dist/services/core/websocket/WebSocketManager.js +19 -2
  94. package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
  95. package/dist/services/core/websocket/types.js.map +1 -1
  96. package/dist/services/index.js +1 -1
  97. package/dist/services/index.js.map +1 -1
  98. package/dist/services/task/Task.js +955 -0
  99. package/dist/services/task/Task.js.map +1 -0
  100. package/dist/services/task/TaskFactory.js +50 -0
  101. package/dist/services/task/TaskFactory.js.map +1 -0
  102. package/dist/services/task/TaskManager.js +1272 -605
  103. package/dist/services/task/TaskManager.js.map +1 -1
  104. package/dist/services/task/TaskUtils.js +221 -27
  105. package/dist/services/task/TaskUtils.js.map +1 -1
  106. package/dist/services/task/WebexCallingUtils.js +70 -0
  107. package/dist/services/task/WebexCallingUtils.js.map +1 -0
  108. package/dist/services/task/constants.js +19 -2
  109. package/dist/services/task/constants.js.map +1 -1
  110. package/dist/services/task/contact.js +29 -0
  111. package/dist/services/task/contact.js.map +1 -1
  112. package/dist/services/task/digital/Digital.js +78 -0
  113. package/dist/services/task/digital/Digital.js.map +1 -0
  114. package/dist/services/task/state-machine/TaskStateMachine.js +982 -0
  115. package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -0
  116. package/dist/services/task/state-machine/actions.js +572 -0
  117. package/dist/services/task/state-machine/actions.js.map +1 -0
  118. package/dist/services/task/state-machine/constants.js +161 -0
  119. package/dist/services/task/state-machine/constants.js.map +1 -0
  120. package/dist/services/task/state-machine/guards.js +379 -0
  121. package/dist/services/task/state-machine/guards.js.map +1 -0
  122. package/dist/services/task/state-machine/index.js +53 -0
  123. package/dist/services/task/state-machine/index.js.map +1 -0
  124. package/dist/services/task/state-machine/types.js +54 -0
  125. package/dist/services/task/state-machine/types.js.map +1 -0
  126. package/dist/services/task/state-machine/uiControlsComputer.js +703 -0
  127. package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -0
  128. package/dist/services/task/taskDataNormalizer.js +99 -0
  129. package/dist/services/task/taskDataNormalizer.js.map +1 -0
  130. package/dist/services/task/types.js +215 -5
  131. package/dist/services/task/types.js.map +1 -1
  132. package/dist/services/task/voice/Voice.js +1504 -0
  133. package/dist/services/task/voice/Voice.js.map +1 -0
  134. package/dist/services/task/voice/WebRTC.js +152 -0
  135. package/dist/services/task/voice/WebRTC.js.map +1 -0
  136. package/dist/services/task/voice/wxAppOfferObservability.js +145 -0
  137. package/dist/services/task/voice/wxAppOfferObservability.js.map +1 -0
  138. package/dist/services/task/voice/wxAppVoiceMethods.js +395 -0
  139. package/dist/services/task/voice/wxAppVoiceMethods.js.map +1 -0
  140. package/dist/services/wxAppDiagnosticLogging.js +159 -0
  141. package/dist/services/wxAppDiagnosticLogging.js.map +1 -0
  142. package/dist/services/wxAppTelephonyUtils.js +19 -0
  143. package/dist/services/wxAppTelephonyUtils.js.map +1 -0
  144. package/dist/types/cc.d.ts +152 -9
  145. package/dist/types/config.d.ts +13 -0
  146. package/dist/types/constants.d.ts +36 -1
  147. package/dist/types/index.d.ts +54 -20
  148. package/dist/types/metrics/MetricsManager.d.ts +6 -0
  149. package/dist/types/metrics/constants.d.ts +48 -1
  150. package/dist/types/services/AddressBook.d.ts +2 -1
  151. package/dist/types/services/AnswerCallOnWebexService.d.ts +38 -0
  152. package/dist/types/services/ApiAiAssistant.d.ts +67 -5
  153. package/dist/types/services/EntryPoint.d.ts +7 -5
  154. package/dist/types/services/Queue.d.ts +5 -3
  155. package/dist/types/services/UserPreference.d.ts +118 -0
  156. package/dist/types/services/WebexCrossClientService.d.ts +32 -0
  157. package/dist/types/services/WxAppTelephonyMercurySync.d.ts +28 -0
  158. package/dist/types/services/config/Util.d.ts +4 -8
  159. package/dist/types/services/config/constants.d.ts +49 -76
  160. package/dist/types/services/config/index.d.ts +16 -64
  161. package/dist/types/services/config/types.d.ts +240 -114
  162. package/dist/types/services/constants.d.ts +9 -0
  163. package/dist/types/services/core/Err.d.ts +2 -0
  164. package/dist/types/services/core/Utils.d.ts +43 -13
  165. package/dist/types/services/core/WebexRequest.d.ts +1 -0
  166. package/dist/types/services/core/constants.d.ts +7 -0
  167. package/dist/types/services/core/types.d.ts +2 -0
  168. package/dist/types/services/core/websocket/WebSocketManager.d.ts +1 -0
  169. package/dist/types/services/core/websocket/types.d.ts +1 -1
  170. package/dist/types/services/index.d.ts +1 -1
  171. package/dist/types/services/task/Task.d.ts +186 -0
  172. package/dist/types/services/task/TaskFactory.d.ts +14 -0
  173. package/dist/types/services/task/TaskUtils.d.ts +54 -2
  174. package/dist/types/services/task/WebexCallingUtils.d.ts +11 -0
  175. package/dist/types/services/task/constants.d.ts +17 -0
  176. package/dist/types/services/task/contact.d.ts +4 -0
  177. package/dist/types/services/task/digital/Digital.d.ts +23 -0
  178. package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +1442 -0
  179. package/dist/types/services/task/state-machine/actions.d.ts +10 -0
  180. package/dist/types/services/task/state-machine/constants.d.ts +107 -0
  181. package/dist/types/services/task/state-machine/guards.d.ts +103 -0
  182. package/dist/types/services/task/state-machine/index.d.ts +13 -0
  183. package/dist/types/services/task/state-machine/types.d.ts +277 -0
  184. package/dist/types/services/task/state-machine/uiControlsComputer.d.ts +9 -0
  185. package/dist/types/services/task/taskDataNormalizer.d.ts +10 -0
  186. package/dist/types/services/task/types.d.ts +738 -66
  187. package/dist/types/services/task/voice/Voice.d.ts +241 -0
  188. package/dist/types/services/task/voice/WebRTC.d.ts +54 -0
  189. package/dist/types/services/task/voice/wxAppOfferObservability.d.ts +39 -0
  190. package/dist/types/services/task/voice/wxAppVoiceMethods.d.ts +68 -0
  191. package/dist/types/services/wxAppDiagnosticLogging.d.ts +63 -0
  192. package/dist/types/services/wxAppTelephonyUtils.d.ts +5 -0
  193. package/dist/types/types.d.ts +213 -11
  194. package/dist/types/utils/PageCache.d.ts +20 -3
  195. package/dist/types/webex.d.ts +1 -0
  196. package/dist/types.js +168 -6
  197. package/dist/types.js.map +1 -1
  198. package/dist/utils/PageCache.js +19 -5
  199. package/dist/utils/PageCache.js.map +1 -1
  200. package/dist/webex.js +22 -2
  201. package/dist/webex.js.map +1 -1
  202. package/package.json +16 -12
  203. package/src/cc.ts +1137 -67
  204. package/src/config.ts +13 -0
  205. package/src/constants.ts +39 -1
  206. package/src/index.ts +62 -15
  207. package/src/metrics/MetricsManager.ts +16 -0
  208. package/src/metrics/ai-docs/AGENTS.md +350 -0
  209. package/src/metrics/ai-docs/ARCHITECTURE.md +338 -0
  210. package/src/metrics/ai-docs/metrics-spec.md +971 -0
  211. package/src/metrics/behavioral-events.ts +190 -0
  212. package/src/metrics/constants.ts +59 -4
  213. package/src/services/AddressBook.ts +17 -6
  214. package/src/services/AnswerCallOnWebexService.ts +239 -0
  215. package/src/services/ApiAiAssistant.ts +494 -15
  216. package/src/services/EntryPoint.ts +59 -60
  217. package/src/services/Queue.ts +29 -12
  218. package/src/services/UserPreference.ts +509 -0
  219. package/src/services/WebCallingService.ts +16 -2
  220. package/src/services/WebexCrossClientService.ts +298 -0
  221. package/src/services/WxAppTelephonyMercurySync.ts +142 -0
  222. package/src/services/agent/ai-docs/AGENTS.md +240 -0
  223. package/src/services/agent/ai-docs/ARCHITECTURE.md +304 -0
  224. package/src/services/agent/ai-docs/agent-spec.md +505 -0
  225. package/src/services/ai-docs/AGENTS.md +386 -0
  226. package/src/services/ai-docs/services-spec.md +512 -0
  227. package/src/services/config/Util.ts +54 -84
  228. package/src/services/config/ai-docs/AGENTS.md +250 -0
  229. package/src/services/config/ai-docs/ARCHITECTURE.md +413 -0
  230. package/src/services/config/ai-docs/config-spec.md +669 -0
  231. package/src/services/config/constants.ts +63 -85
  232. package/src/services/config/index.ts +116 -277
  233. package/src/services/config/types.ts +229 -125
  234. package/src/services/constants.ts +10 -0
  235. package/src/services/core/Err.ts +1 -0
  236. package/src/services/core/Utils.ts +151 -37
  237. package/src/services/core/WebexRequest.ts +3 -1
  238. package/src/services/core/ai-docs/AGENTS.md +381 -0
  239. package/src/services/core/ai-docs/ARCHITECTURE.md +698 -0
  240. package/src/services/core/ai-docs/core-spec.md +797 -0
  241. package/src/services/core/aqm-reqs.ts +18 -12
  242. package/src/services/core/constants.ts +8 -0
  243. package/src/services/core/types.ts +33 -1
  244. package/src/services/core/websocket/WebSocketManager.ts +28 -2
  245. package/src/services/core/websocket/types.ts +1 -1
  246. package/src/services/index.ts +1 -1
  247. package/src/services/task/Task.ts +1211 -0
  248. package/src/services/task/TaskFactory.ts +82 -0
  249. package/src/services/task/TaskManager.ts +1585 -724
  250. package/src/services/task/TaskUtils.ts +316 -25
  251. package/src/services/task/WebexCallingUtils.ts +136 -0
  252. package/src/services/task/ai-docs/AGENTS.md +457 -0
  253. package/src/services/task/ai-docs/ARCHITECTURE.md +595 -0
  254. package/src/services/task/ai-docs/task-spec.md +1501 -0
  255. package/src/services/task/constants.ts +18 -0
  256. package/src/services/task/contact.ts +30 -0
  257. package/src/services/task/digital/Digital.ts +102 -0
  258. package/src/services/task/state-machine/TaskStateMachine.ts +1320 -0
  259. package/src/services/task/state-machine/actions.ts +741 -0
  260. package/src/services/task/state-machine/ai-docs/AGENTS.md +460 -0
  261. package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +1156 -0
  262. package/src/services/task/state-machine/ai-docs/task-state-machine-spec.md +2247 -0
  263. package/src/services/task/state-machine/constants.ts +172 -0
  264. package/src/services/task/state-machine/guards.ts +442 -0
  265. package/src/services/task/state-machine/index.ts +28 -0
  266. package/src/services/task/state-machine/types.ts +258 -0
  267. package/src/services/task/state-machine/uiControlsComputer.ts +1135 -0
  268. package/src/services/task/taskDataNormalizer.ts +137 -0
  269. package/src/services/task/types.ts +918 -70
  270. package/src/services/task/voice/Voice.ts +1878 -0
  271. package/src/services/task/voice/WebRTC.ts +194 -0
  272. package/src/services/task/voice/wxAppOfferObservability.ts +204 -0
  273. package/src/services/task/voice/wxAppVoiceMethods.ts +575 -0
  274. package/src/services/wxAppDiagnosticLogging.ts +286 -0
  275. package/src/services/wxAppTelephonyUtils.ts +14 -0
  276. package/src/types.ts +272 -13
  277. package/src/utils/AGENTS.md +289 -0
  278. package/src/utils/PageCache.ts +38 -5
  279. package/src/utils/ai-docs/utils-spec.md +391 -0
  280. package/src/webex.js +10 -0
  281. package/test/unit/fixtures/aiSummaryTestUtils.ts +40 -0
  282. package/test/unit/spec/cc.ts +3553 -107
  283. package/test/unit/spec/index.ts +885 -0
  284. package/test/unit/spec/logger-proxy.ts +70 -0
  285. package/test/unit/spec/metrics/MetricsManager.ts +25 -0
  286. package/test/unit/spec/metrics/behavioral-events.ts +60 -0
  287. package/test/unit/spec/services/AddressBook.ts +37 -6
  288. package/test/unit/spec/services/AnswerCallOnWebexService.ts +264 -0
  289. package/test/unit/spec/services/ApiAiAssistant.ts +442 -23
  290. package/test/unit/spec/services/EntryPoint.ts +87 -40
  291. package/test/unit/spec/services/Queue.ts +123 -12
  292. package/test/unit/spec/services/UserPreference.ts +401 -0
  293. package/test/unit/spec/services/WebCallingService.ts +45 -1
  294. package/test/unit/spec/services/WebexCrossClientService.ts +509 -0
  295. package/test/unit/spec/services/WxAppTelephonyMercurySync.ts +136 -0
  296. package/test/unit/spec/services/config/Util.ts +501 -0
  297. package/test/unit/spec/services/config/index.ts +317 -547
  298. package/test/unit/spec/services/core/Utils.ts +447 -8
  299. package/test/unit/spec/services/core/WebexRequest.ts +8 -7
  300. package/test/unit/spec/services/core/aqm-reqs.ts +142 -1
  301. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +129 -53
  302. package/test/unit/spec/services/task/AutoWrapup.ts +63 -0
  303. package/test/unit/spec/services/task/Task.ts +2723 -0
  304. package/test/unit/spec/services/task/TaskFactory.ts +116 -0
  305. package/test/unit/spec/services/task/TaskManager.ts +4734 -1769
  306. package/test/unit/spec/services/task/TaskUtils.ts +307 -0
  307. package/test/unit/spec/services/task/WebexCallingUtils.ts +153 -0
  308. package/test/unit/spec/services/task/contact.ts +33 -0
  309. package/test/unit/spec/services/task/digital/Digital.ts +105 -0
  310. package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +4060 -0
  311. package/test/unit/spec/services/task/state-machine/guards.ts +839 -0
  312. package/test/unit/spec/services/task/state-machine/types.ts +18 -0
  313. package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +3101 -0
  314. package/test/unit/spec/services/task/taskTestUtils.ts +87 -0
  315. package/test/unit/spec/services/task/voice/Voice.ts +2355 -0
  316. package/test/unit/spec/services/task/voice/WebRTC.ts +235 -0
  317. package/test/unit/spec/services/task/voice/wxAppOfferObservability.ts +361 -0
  318. package/test/unit/spec/services/task/voice/wxAppVoiceMethods.ts +719 -0
  319. package/test/unit/spec/services/wxAppDiagnosticLogging.ts +179 -0
  320. package/test/unit/spec/wellnessSampleUtils.ts +288 -0
  321. package/typedoc.md +1 -1
  322. package/umd/contact-center.min.js +2 -2
  323. package/umd/contact-center.min.js.map +1 -1
  324. package/dist/services/task/index.js +0 -1530
  325. package/dist/services/task/index.js.map +0 -1
  326. package/dist/types/services/task/index.d.ts +0 -650
  327. package/src/services/task/index.ts +0 -1806
  328. package/test/unit/spec/services/task/index.ts +0 -2205
@@ -1,6 +1,4 @@
1
- /// <reference types="node" />
2
- import { CallId } from '@webex/calling/dist/types/common/types';
3
- import EventEmitter from 'events';
1
+ import { TaskEventPayload } from './state-machine';
4
2
  import { Msg } from '../core/GlobalTypes';
5
3
  import AutoWrapup from './AutoWrapup';
6
4
  /**
@@ -8,6 +6,10 @@ import AutoWrapup from './AutoWrapup';
8
6
  * @public
9
7
  */
10
8
  export type TaskId = string;
9
+ /**
10
+ * Unique identifier for a call in the Webex calling system
11
+ */
12
+ export type CallId = string;
11
13
  /**
12
14
  * Defines the valid destination types for routing tasks within the contact center
13
15
  * Used to specify where a task should be directed
@@ -20,7 +22,7 @@ export declare const DESTINATION_TYPE: {
20
22
  DIALNUMBER: string;
21
23
  /** Route task to a specific agent */
22
24
  AGENT: string;
23
- /** Route task to an entry point (supported only for consult operations) */
25
+ /** Route task to an entry point */
24
26
  ENTRYPOINT: string;
25
27
  };
26
28
  /**
@@ -77,6 +79,22 @@ export declare const MEDIA_CHANNEL: {
77
79
  * @public
78
80
  */
79
81
  export type MEDIA_CHANNEL = Enum<typeof MEDIA_CHANNEL>;
82
+ /**
83
+ * Supported task channel types for UI control configuration
84
+ */
85
+ export declare const TASK_CHANNEL_TYPE: {
86
+ readonly VOICE: "voice";
87
+ readonly DIGITAL: "digital";
88
+ };
89
+ export type TaskChannelType = Enum<typeof TASK_CHANNEL_TYPE>;
90
+ /**
91
+ * Voice channel variants that toggle PSTN/WebRTC specific behaviors
92
+ */
93
+ export declare const VOICE_VARIANT: {
94
+ readonly PSTN: "pstn";
95
+ readonly WEBRTC: "webrtc";
96
+ };
97
+ export type VoiceVariant = Enum<typeof VOICE_VARIANT>;
80
98
  /**
81
99
  * Enumeration of all task-related events that can occur in the contact center system
82
100
  * These events represent different states and actions in the task lifecycle
@@ -181,6 +199,14 @@ export declare enum TASK_EVENTS {
181
199
  * ```
182
200
  */
183
201
  TASK_CONSULT_QUEUE_FAILED = "task:consultQueueFailed",
202
+ /**
203
+ * Triggered whenever task UI controls are recalculated
204
+ */
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",
184
210
  /**
185
211
  * Triggered when a consultation request is accepted
186
212
  * @example
@@ -258,6 +284,16 @@ export declare enum TASK_EVENTS {
258
284
  * ```
259
285
  */
260
286
  TASK_WRAPPEDUP = "task:wrappedup",
287
+ /**
288
+ * Triggered when recording is started
289
+ * @example
290
+ * ```typescript
291
+ * task.on(TASK_EVENTS.TASK_RECORDING_STARTED, (task: ITask) => {
292
+ * console.log('Recording started:', task.data.interactionId);
293
+ * });
294
+ * ```
295
+ */
296
+ TASK_RECORDING_STARTED = "task:recordingStarted",
261
297
  /**
262
298
  * Triggered when recording is paused
263
299
  * @example
@@ -471,6 +507,40 @@ export declare enum TASK_EVENTS {
471
507
  * ```
472
508
  */
473
509
  TASK_PARTICIPANT_LEFT_FAILED = "task:participantLeftFailed",
510
+ /**
511
+ * Triggered when agent initiates exit from conference
512
+ * @example
513
+ * ```typescript
514
+ * task.on(TASK_EVENTS.TASK_EXIT_CONFERENCE, (task: ITask) => {
515
+ * console.log('Exiting conference:', task.data.interactionId);
516
+ * // Handle conference exit initiation
517
+ * });
518
+ * ```
519
+ */
520
+ TASK_EXIT_CONFERENCE = "task:exitConference",
521
+ /**
522
+ * Triggered when agent initiates conference transfer
523
+ * @example
524
+ * ```typescript
525
+ * task.on(TASK_EVENTS.TASK_TRANSFER_CONFERENCE, (task: ITask) => {
526
+ * console.log('Transferring conference:', task.data.interactionId);
527
+ * // Handle conference transfer initiation
528
+ * });
529
+ * ```
530
+ */
531
+ TASK_TRANSFER_CONFERENCE = "task:transferConference",
532
+ /**
533
+ * Triggered when agent switches between consult call and main call.
534
+ * Use task.uiControls to determine current state and button visibility.
535
+ * @example
536
+ * ```typescript
537
+ * task.on(TASK_EVENTS.TASK_SWITCH_CALL, (task: ITask) => {
538
+ * console.log('Call switched:', task.data.interactionId);
539
+ * // Update UI based on task.uiControls.main.switch / task.uiControls.consult.switch
540
+ * });
541
+ * ```
542
+ */
543
+ TASK_SWITCH_CALL = "task:switchCall",
474
544
  /**
475
545
  * Triggered when a contact is merged
476
546
  * @example
@@ -493,6 +563,16 @@ export declare enum TASK_EVENTS {
493
563
  * ```
494
564
  */
495
565
  TASK_POST_CALL_ACTIVITY = "task:postCallActivity",
566
+ /**
567
+ * Triggered when a multi-login task update should hydrate SDK instances without Mobius registration.
568
+ * @example
569
+ * ```typescript
570
+ * task.on(TASK_EVENTS.TASK_MULTI_LOGIN_HYDRATE, (task: ITask) => {
571
+ * console.log('Multi-login hydrate:', task.data.interactionId);
572
+ * });
573
+ * ```
574
+ */
575
+ TASK_MULTI_LOGIN_HYDRATE = "task:multiLoginHydrate",
496
576
  /**
497
577
  * Triggered when a campaign preview contact is offered to the agent
498
578
  * @example
@@ -547,13 +627,165 @@ export declare enum TASK_EVENTS {
547
627
  * });
548
628
  * ```
549
629
  */
550
- TASK_CAMPAIGN_CONTACT_UPDATED = "task:campaignContactUpdated"
630
+ TASK_CAMPAIGN_CONTACT_UPDATED = "task:campaignContactUpdated",
631
+ /**
632
+ * Triggered when a mid-call summary is received for the task.
633
+ */
634
+ TASK_MID_CALL_SUMMARY_RECEIVED = "task:midCallSummaryReceived",
635
+ /**
636
+ * Triggered on the task object when AI feature enablement flags arrive for that task's interaction.
637
+ * Fires immediately if the frame arrived after the task was registered, or at registration time
638
+ * if the frame arrived before the task (orphan retention). Consumers should use this event
639
+ * instead of the cc-level `FEATURE_ENABLEMENT` event so they do not need to maintain an
640
+ * interactionId → flags map manually.
641
+ * @example
642
+ * ```typescript
643
+ * task.on(TASK_EVENTS.TASK_FEATURE_ENABLEMENT, (enablement: AISummaryFeatureEnablement) => {
644
+ * const { midCallEnabled, postCallEnabled } = enablement;
645
+ * // gate summary UI on these flags
646
+ * });
647
+ * ```
648
+ */
649
+ TASK_FEATURE_ENABLEMENT = "task:featureEnablement"
551
650
  }
552
651
  /**
553
652
  * Represents a customer interaction within the contact center system
554
653
  * Contains comprehensive details about an ongoing customer interaction
555
654
  * @public
556
655
  */
656
+ export interface CallAssociatedDatum {
657
+ /** Whether the field can be edited by the agent */
658
+ agentEditable: boolean;
659
+ /** Whether the field is visible to the agent */
660
+ agentViewable: boolean;
661
+ /** Display name for the field */
662
+ displayName: string;
663
+ /** Whether the field is global */
664
+ global: boolean;
665
+ /** Whether the field is secure */
666
+ isSecure: boolean;
667
+ /** Internal field name */
668
+ name: string;
669
+ /** Whether the field is reportable */
670
+ reportable: boolean;
671
+ /** Secure key identifier */
672
+ secureKeyId: string;
673
+ /** Secure key version */
674
+ secureKeyVersion: number;
675
+ /** Data type of the field */
676
+ type: string;
677
+ /** Field value */
678
+ value: string;
679
+ }
680
+ export type CallAssociatedData = Record<string, CallAssociatedDatum>;
681
+ export type CallAssociatedDetails = Record<string, string>;
682
+ export interface FlowParameter {
683
+ /** Parameter name */
684
+ name?: string;
685
+ /** Additional qualifier */
686
+ qualifier?: string;
687
+ /** Description of the parameter */
688
+ description?: string;
689
+ /** Data type of the value */
690
+ valueDataType?: string;
691
+ /** Value associated with the parameter */
692
+ value?: string;
693
+ }
694
+ export interface InteractionParticipant {
695
+ /** Unique participant identifier */
696
+ id: string;
697
+ /** Participant type label used by backend */
698
+ pType: string;
699
+ /** Friendly participant type */
700
+ type: string;
701
+ /** Whether the participant has joined */
702
+ hasJoined: boolean;
703
+ /** Whether the participant has left */
704
+ hasLeft: boolean;
705
+ /** Whether the participant is still in pre-dial */
706
+ isInPredial: boolean;
707
+ /** Optional caller identifier */
708
+ callerId?: string | null;
709
+ /** Whether auto-answer is enabled */
710
+ autoAnswerEnabled?: boolean;
711
+ /** Backchannel/bnr details */
712
+ bnrDetails?: unknown;
713
+ /** Channel identifier for the participant */
714
+ channelId?: string;
715
+ /** Current consult state */
716
+ consultState?: string | null;
717
+ /** Timestamp when consult started */
718
+ consultTimestamp?: number | null;
719
+ /** Current participant state */
720
+ currentState?: string | null;
721
+ /** Timestamp of the current state */
722
+ currentStateTimestamp?: number | null;
723
+ /** Device call identifier */
724
+ deviceCallId?: string | null;
725
+ /** Device identifier */
726
+ deviceId?: string | null;
727
+ /** Device type (AGENT_DN, BROWSER, etc.) */
728
+ deviceType?: string | null;
729
+ /** Dial number associated with participant */
730
+ dn?: string | null;
731
+ /** Whether participant is currently consulted */
732
+ isConsulted?: boolean;
733
+ /** Whether participant offer is active */
734
+ isOffered?: boolean;
735
+ /** Whether participant is in wrap-up */
736
+ isWrapUp?: boolean;
737
+ /** Whether participant completed wrap-up */
738
+ isWrappedUp?: boolean;
739
+ /** Timestamp of when participant joined */
740
+ joinTimestamp?: number | null;
741
+ /** Last updated timestamp */
742
+ lastUpdated?: number | null;
743
+ /** Friendly name of participant */
744
+ name?: string | null;
745
+ /** Queue identifier associated with participant */
746
+ queueId?: string;
747
+ /** Queue manager identifier */
748
+ queueMgrId?: string;
749
+ /** Session identifier */
750
+ sessionId?: string;
751
+ /** Site identifier */
752
+ siteId?: string;
753
+ /** Skill identifier */
754
+ skillId?: string | null;
755
+ /** Skill name */
756
+ skillName?: string | null;
757
+ /** Skill list for participant */
758
+ skills?: string[];
759
+ /** Team identifier */
760
+ teamId?: string;
761
+ /** Team name */
762
+ teamName?: string;
763
+ /** Timestamp for wrap-up */
764
+ wrapUpTimestamp?: number | null;
765
+ /** Additional metadata */
766
+ [key: string]: unknown;
767
+ }
768
+ export type InteractionParticipants = Record<string, InteractionParticipant>;
769
+ /**
770
+ * Media entry type from interaction.media
771
+ * Used for media state tracking in consult and conference scenarios
772
+ */
773
+ export type MediaEntry = {
774
+ /** Unique identifier for the media resource */
775
+ mediaResourceId: string;
776
+ /** Type of media channel */
777
+ mediaType: MEDIA_CHANNEL;
778
+ /** Media manager handling this media */
779
+ mediaMgr: string;
780
+ /** List of participant identifiers */
781
+ participants: string[];
782
+ /** Type of media (e.g., 'mainCall', 'consult') */
783
+ mType: string;
784
+ /** Indicates if media is on hold */
785
+ isHold: boolean;
786
+ /** Timestamp when media was put on hold */
787
+ holdTimestamp: number | null;
788
+ };
557
789
  export type Interaction = {
558
790
  /** Indicates if the interaction is managed by Flow Control */
559
791
  isFcManaged: boolean;
@@ -568,7 +800,11 @@ export type Interaction = {
568
800
  /** Current virtual team handling the interaction */
569
801
  currentVTeam: string;
570
802
  /** List of participants in the interaction */
571
- participants: any;
803
+ participants: InteractionParticipants;
804
+ /** Detailed call associated data */
805
+ callAssociatedData?: CallAssociatedData;
806
+ /** Simplified call associated key/value pairs */
807
+ callAssociatedDetails?: CallAssociatedDetails;
572
808
  /** Unique identifier for the interaction */
573
809
  interactionId: string;
574
810
  /** Organization identifier */
@@ -577,7 +813,18 @@ export type Interaction = {
577
813
  createdTimestamp?: number;
578
814
  /** Indicates if wrap-up assistance is enabled */
579
815
  isWrapUpAssist?: boolean;
580
- /** Detailed call processing information and metadata */
816
+ /** Identifier of parent interaction if applicable */
817
+ parentInteractionId?: string;
818
+ /** Indicates if media is forked for this interaction */
819
+ isMediaForked?: boolean;
820
+ /** Retroactive flow properties returned by backend */
821
+ flowProperties?: Record<string, unknown> | null;
822
+ /** Media specific properties returned by backend */
823
+ mediaProperties?: Record<string, unknown> | null;
824
+ /**
825
+ * Detailed call processing information and metadata.
826
+ * Mirrors the callProcessingDetails section described in Webex Contact Center Agent Contact payloads.
827
+ */
581
828
  callProcessingDetails: {
582
829
  /** Name of the Queue Manager handling this interaction */
583
830
  QMgrName: string;
@@ -595,20 +842,24 @@ export type Interaction = {
595
842
  QueueId: string;
596
843
  /** Virtual team identifier */
597
844
  vteamId: string;
598
- /** Indicates if pause/resume functionality is enabled */
599
- pauseResumeEnabled?: string;
845
+ /** Agent capability for pause/resume on this interaction */
846
+ pauseResumeEnabled?: boolean;
600
847
  /** Duration of pause in seconds */
601
848
  pauseDuration?: string;
602
- /** Indicates if the interaction is currently paused */
603
- isPaused?: string;
604
- /** Indicates if recording is in progress */
605
- recordInProgress?: string;
606
- /** Indicates if recording has started */
607
- recordingStarted?: string;
849
+ /** Legacy pause indicator (recordInProgress=false is the active pause signal) */
850
+ isPaused?: boolean;
851
+ /** Recording is actively capturing audio right now */
852
+ recordInProgress?: boolean;
853
+ /** Recording was started for this interaction (may be paused) */
854
+ recordingStarted?: boolean;
855
+ /** Customer geographic region */
856
+ customerRegion?: string;
857
+ /** Flow tag identifier */
858
+ flowTagId?: string;
608
859
  /** Indicates if Consult to Queue is in progress */
609
- ctqInProgress?: string;
860
+ ctqInProgress?: boolean;
610
861
  /** Indicates if outdial transfer to queue is enabled */
611
- outdialTransferToQueueEnabled?: string;
862
+ outdialTransferToQueueEnabled?: boolean;
612
863
  /** IVR conversation transcript */
613
864
  convIvrTranscript?: string;
614
865
  /** Customer's name */
@@ -695,6 +946,8 @@ export type Interaction = {
695
946
  fcDesktopView?: string;
696
947
  /** Agent ID who initiated the outdial call */
697
948
  outdialAgentId?: string;
949
+ /** Indicates if the customer has left the call during an active consult */
950
+ hasCustomerLeft?: string;
698
951
  /** Indicates if the skip action is disabled for campaign preview contacts */
699
952
  campaignPreviewSkipDisabled?: string;
700
953
  /** Indicates if the remove action is disabled for campaign preview contacts */
@@ -706,56 +959,54 @@ export type Interaction = {
706
959
  };
707
960
  /** Main interaction identifier for related interactions */
708
961
  mainInteractionId?: string;
962
+ /** Timestamp when interaction entered queue */
963
+ queuedTimestamp?: number | null;
709
964
  /** Media-specific information for the interaction */
710
- media: Record<string, {
711
- /** Unique identifier for the media resource */
712
- mediaResourceId: string;
713
- /** Type of media channel */
714
- mediaType: MEDIA_CHANNEL;
715
- /** Media manager handling this media */
716
- mediaMgr: string;
717
- /** List of participant identifiers */
718
- participants: string[];
719
- /** Type of media */
720
- mType: string;
721
- /** Indicates if media is on hold */
722
- isHold: boolean;
723
- /** Timestamp when media was put on hold */
724
- holdTimestamp: number | null;
725
- }>;
965
+ media: Record<string, MediaEntry>;
726
966
  /** Owner of the interaction */
727
967
  owner: string;
728
968
  /** Primary media channel for the interaction */
729
- mediaChannel: MEDIA_CHANNEL;
969
+ mediaChannel: string;
730
970
  /** Direction information for the contact */
731
971
  contactDirection: {
732
972
  type: string;
733
973
  };
734
974
  /** Type of outbound interaction */
735
975
  outboundType?: string;
976
+ /** Optional workflow manager identifier */
977
+ workflowManager?: string | null;
736
978
  /** Parameters passed through the call flow */
737
- callFlowParams: Record<string, {
738
- /** Name of the parameter */
739
- name: string;
740
- /** Qualifier for the parameter */
741
- qualifier: string;
742
- /** Description of the parameter */
743
- description: string;
744
- /** Data type of the parameter value */
745
- valueDataType: string;
746
- /** Value of the parameter */
747
- value: string;
748
- }>;
979
+ callFlowParams?: Record<string, FlowParameter>;
749
980
  };
750
981
  /**
751
- * Task payload containing detailed information about a contact center task
752
- * This structure encapsulates all relevant data for task management
982
+ * Task payload mirroring the Agent Contact event payload from Webex Contact Center
983
+ * (developer.webex.com). Arrives on AGENT_* websocket events and is the source of truth
984
+ * for UI/state machine updates.
753
985
  * @public
754
986
  */
987
+ export type RealtimeTranscription = {
988
+ agentId: string;
989
+ orgId: string;
990
+ notifType: string;
991
+ notifDetails: {
992
+ actionEvent: string;
993
+ };
994
+ data: {
995
+ role: 'AGENT' | 'CALLER';
996
+ utteranceId: string;
997
+ conversationId: string;
998
+ publishTimestamp: number;
999
+ messageId: string;
1000
+ isFinal: boolean;
1001
+ languageCode: string;
1002
+ orgId: string;
1003
+ content: string;
1004
+ };
1005
+ };
755
1006
  export type TaskData = {
756
- /** Unique identifier for the media resource handling this task */
1007
+ /** Primary media resource identifier for the active leg (matches interaction.media[].mediaResourceId) */
757
1008
  mediaResourceId: string;
758
- /** Type of event that triggered this task data */
1009
+ /** Agent event name from the websocket stream (e.g., AGENT_CONTACT_ASSIGNED) */
759
1010
  eventType: string;
760
1011
  /** Timestamp when the event occurred */
761
1012
  eventTime?: number;
@@ -765,7 +1016,7 @@ export type TaskData = {
765
1016
  destAgentId: string;
766
1017
  /** Unique tracking identifier for the task */
767
1018
  trackingId: string;
768
- /** Media resource identifier for consultation operations */
1019
+ /** Media resource identifier for consultation leg when present */
769
1020
  consultMediaResourceId: string;
770
1021
  /** Detailed interaction information */
771
1022
  interaction: Interaction;
@@ -777,7 +1028,7 @@ export type TaskData = {
777
1028
  toOwner?: boolean;
778
1029
  /** Identifier for child interaction in consult/transfer scenarios */
779
1030
  childInteractionId?: string;
780
- /** Unique identifier for the interaction */
1031
+ /** Interaction/contact identifier from backend (same as interaction.interactionId) */
781
1032
  interactionId: string;
782
1033
  /** Organization identifier */
783
1034
  orgId: string;
@@ -787,7 +1038,7 @@ export type TaskData = {
787
1038
  queueMgr: string;
788
1039
  /** Name of the queue where task is queued */
789
1040
  queueName?: string;
790
- /** Type of the task */
1041
+ /** Task/interaction type returned by the platform (routing/monitoring/etc.) */
791
1042
  type: string;
792
1043
  /** Timeout value for RONA (Redirection on No Answer) in seconds */
793
1044
  ronaTimeout?: number;
@@ -823,11 +1074,114 @@ export type TaskData = {
823
1074
  reservedAgentChannelId?: string;
824
1075
  /** Indicates if wrap-up is required for this task */
825
1076
  wrapUpRequired?: boolean;
1077
+ /** SDK-internal: skip task:outdialFailed when non-wxApp agent-terminated outdial still needs wrapup */
1078
+ suppressOutdialFailedPopup?: boolean;
1079
+ /**
1080
+ * Current consultation status derived from state machine
1081
+ * Values: CONSULT_INITIATED, CONSULT_ACCEPTED, BEING_CONSULTED,
1082
+ * BEING_CONSULTED_ACCEPTED, CONNECTED, CONFERENCE, CONSULT_COMPLETED
1083
+ */
1084
+ consultStatus?: string;
1085
+ /**
1086
+ * Indicates if consultation is in progress (state machine: CONSULTING)
1087
+ */
1088
+ isConsultInProgress?: boolean;
1089
+ /**
1090
+ * Indicates if the task is incoming for the active agent
1091
+ */
1092
+ isIncomingTask?: boolean;
1093
+ /**
1094
+ * Indicates if the task is on hold (state machine: HELD)
1095
+ */
1096
+ isOnHold?: boolean;
1097
+ /**
1098
+ * Indicates if customer is currently in the call
1099
+ * Derived from participants in main media
1100
+ */
1101
+ isCustomerInCall?: boolean;
1102
+ /**
1103
+ * Count of conference participants (agents only)
1104
+ * Used for determining if max participants reached
1105
+ */
1106
+ conferenceParticipantsCount?: number;
1107
+ /**
1108
+ * Indicates if this is a secondary agent (consulted party)
1109
+ */
1110
+ isSecondaryAgent?: boolean;
1111
+ /**
1112
+ * Indicates if this is a secondary EP-DN agent (telephony consult to external)
1113
+ */
1114
+ isSecondaryEpDnAgent?: boolean;
1115
+ /**
1116
+ * Task state for MPC (Multi-Party Conference) scenarios
1117
+ * Maps participant consultState to task state
1118
+ */
1119
+ mpcState?: string;
826
1120
  /** Indicates if auto-answer is in progress for this task */
827
1121
  isAutoAnswering?: boolean;
828
1122
  /** Indicates if wrap-up is required for this task */
829
1123
  agentsPendingWrapUp?: string[];
830
1124
  };
1125
+ export type TaskUIControlState = {
1126
+ isVisible: boolean;
1127
+ isEnabled: boolean;
1128
+ };
1129
+ /**
1130
+ * UI control representation for a single interaction leg.
1131
+ */
1132
+ export type InteractionUIControls = {
1133
+ accept: TaskUIControlState;
1134
+ decline: TaskUIControlState;
1135
+ hold: TaskUIControlState;
1136
+ transfer: TaskUIControlState;
1137
+ consult: TaskUIControlState;
1138
+ end: TaskUIControlState;
1139
+ recording: TaskUIControlState;
1140
+ mute: TaskUIControlState;
1141
+ consultTransfer: TaskUIControlState;
1142
+ endConsult: TaskUIControlState;
1143
+ conference: TaskUIControlState;
1144
+ exitConference: TaskUIControlState;
1145
+ transferConference: TaskUIControlState;
1146
+ mergeToConference: TaskUIControlState;
1147
+ wrapup: TaskUIControlState;
1148
+ switch: TaskUIControlState;
1149
+ keypad?: TaskUIControlState;
1150
+ };
1151
+ /** Options for {@link ITask.toggleMute} — wxApp engaged calls use `muted` for target state. */
1152
+ export type TaskToggleMuteOptions = {
1153
+ muted?: boolean;
1154
+ lineOwnerId?: string;
1155
+ };
1156
+ /** Options for {@link ITask.transmitDtmf} — wxApp engaged in-call DTMF. */
1157
+ export type TaskTransmitDtmfOptions = {
1158
+ dtmf: string;
1159
+ lineOwnerId?: string;
1160
+ };
1161
+ export type TaskUILeg = 'main' | 'consult';
1162
+ /**
1163
+ * UI controls surfaced to task consumers.
1164
+ * Consumers should read controls from the per-leg surfaces and use `activeLeg`
1165
+ * to determine which one is currently interactive.
1166
+ */
1167
+ export type TaskUIControls = {
1168
+ main: InteractionUIControls;
1169
+ consult: InteractionUIControls;
1170
+ activeLeg: TaskUILeg;
1171
+ /**
1172
+ * Ordered destination categories available for each action.
1173
+ * The first category is the default for consumers that render a destination picker.
1174
+ */
1175
+ consultTransferDestinations: {
1176
+ consult: ConsultTransferDestinationType[];
1177
+ transfer: ConsultTransferDestinationType[];
1178
+ };
1179
+ };
1180
+ /**
1181
+ * Helper class for managing task action control state
1182
+ * Tracks visibility and enabled state for task actions that can be executed
1183
+ * @public
1184
+ */
831
1185
  /**
832
1186
  * Type representing an agent contact message within the contact center system
833
1187
  * Contains comprehensive interaction and task related details for agent operations
@@ -1038,6 +1392,14 @@ export type TransferPayload = {
1038
1392
  /** Type of the transfer destination */
1039
1393
  destinationType: DestinationType;
1040
1394
  };
1395
+ /**
1396
+ * Options for configuring transfer behavior
1397
+ * @public
1398
+ */
1399
+ export type TransferOptions = {
1400
+ /** Additional transfer configuration options */
1401
+ [key: string]: unknown;
1402
+ };
1041
1403
  /**
1042
1404
  * API payload for ending a consultation
1043
1405
  * This is the actual payload that is sent to the developer API
@@ -1153,6 +1515,19 @@ export type ContactCleanupData = {
1153
1515
  type: string;
1154
1516
  };
1155
1517
  };
1518
+ /**
1519
+ * Boolean-like fields in callProcessingDetails that may arrive as strings.
1520
+ * Used by taskDataNormalizer to coerce payloads to actual booleans.
1521
+ */
1522
+ export type CallProcessingBooleanKey = 'recordingStarted' | 'recordInProgress' | 'isPaused' | 'pauseResumeEnabled' | 'ctqInProgress' | 'outdialTransferToQueueEnabled' | 'taskToBeSelfServiced' | 'CONTINUE_RECORDING_ON_TRANSFER' | 'isParked' | 'participantInviteTimeout' | 'checkAgentAvailability';
1523
+ /**
1524
+ * Interaction-level boolean fields that may arrive as strings from backend payloads.
1525
+ */
1526
+ export type InteractionBooleanKey = 'isFcManaged' | 'isMediaForked' | 'isTerminated';
1527
+ /**
1528
+ * Participant boolean fields that may arrive as strings and need normalization.
1529
+ */
1530
+ export type ParticipantBooleanKey = 'autoAnswerEnabled' | 'hasJoined' | 'hasLeft' | 'isConsulted' | 'isInPredial' | 'isOffered' | 'isWrapUp' | 'isWrappedUp';
1156
1531
  /**
1157
1532
  * Response type for task public methods
1158
1533
  * Can be an {@link AgentContact} object containing updated task state,
@@ -1160,17 +1535,111 @@ export type ContactCleanupData = {
1160
1535
  * @public
1161
1536
  */
1162
1537
  export type TaskResponse = AgentContact | Error | void;
1538
+ /** AI-assisted mid-call summary action. @public */
1539
+ export type AISummaryAction = 'CONSULT' | 'TRANSFER';
1540
+ /** Feedback value sent with an AI summary response. @public */
1541
+ export type AISummaryFeedback = 'none' | 'thumbs_up' | 'thumbs_down';
1542
+ /** AI summary response state for post-call and mid-call flows. @public */
1543
+ export type AISummaryState = 'DEFAULT' | 'EXCLUDED' | 'IGNORED' | 'MID_CALL_CANCELLED' | 'NOT_RECEIVED';
1544
+ /** Structured fields shared by post-call and mid-call summaries. @public */
1545
+ export type AISummarySections = {
1546
+ initialContactReason?: string;
1547
+ additionalContactReasons?: string;
1548
+ additionalContext?: string;
1549
+ keyActionsTaken?: string;
1550
+ nextSteps?: string;
1551
+ reasonForTransferOrConsult?: string;
1552
+ };
1553
+ /** RTD payload returned or delivered for an AI summary. @public */
1554
+ export type AISummary = {
1555
+ conversationId: string;
1556
+ adaptiveCard?: Record<string, unknown>;
1557
+ adaptiveCardId?: string;
1558
+ editAdaptiveCard?: Record<string, unknown>;
1559
+ editAdaptiveCardId?: string;
1560
+ areTranscriptsAvailable?: boolean;
1561
+ languageCode?: string;
1562
+ resolution?: string;
1563
+ sections?: AISummarySections;
1564
+ suggestedWrapUpCodes?: Array<{
1565
+ name: string;
1566
+ [key: string]: unknown;
1567
+ }>;
1568
+ suggestedWrapUpCodesMessage?: string;
1569
+ summaryText?: string;
1570
+ timestamp?: number;
1571
+ [key: string]: unknown;
1572
+ };
1573
+ /** RTD payload describing AI-summary feature enablement for an interaction. @public */
1574
+ export type AISummaryFeatureEnablement = {
1575
+ interactionId: string;
1576
+ midCallEnabled?: boolean;
1577
+ postCallEnabled?: boolean;
1578
+ actionTimestamp?: number;
1579
+ [key: string]: unknown;
1580
+ };
1581
+ /** Current AI-summary capabilities for a task. @public */
1582
+ export type AISummaryCapabilities = Required<Pick<AISummaryFeatureEnablement, 'midCallEnabled' | 'postCallEnabled'>>;
1583
+ /**
1584
+ * Payload sent when reporting a post-call or mid-call summary result.
1585
+ * Transport timestamps are generated by the SDK when the response is sent.
1586
+ * @public
1587
+ */
1588
+ export type AISummaryResponse = {
1589
+ summary: AISummarySections | string;
1590
+ feedback: AISummaryFeedback;
1591
+ state: AISummaryState;
1592
+ numberOfTimesViewed: number;
1593
+ numberOfTimesEdited: number;
1594
+ numberOfTimesCopied: number;
1595
+ summaryReceived?: boolean;
1596
+ wrapUpCode?: string;
1597
+ };
1598
+ /**
1599
+ * Request payload for removing a supported participant from an active conference.
1600
+ * @public
1601
+ */
1602
+ export type DropConferenceParticipantPayload = {
1603
+ /** Participant identifier supplied by the current task roster. */
1604
+ participantId: string;
1605
+ };
1606
+ /**
1607
+ * Payload shape used by consult conference helper utilities.
1608
+ */
1609
+ export type consultConferencePayloadData = {
1610
+ agentId?: string;
1611
+ destinationType?: string;
1612
+ destAgentId?: string;
1613
+ };
1614
+ /**
1615
+ * Minimal event-emitter contract exposed to SDK consumers.
1616
+ * Defined here so that consumers do NOT need `@types/node` in their tsconfig.
1617
+ * The runtime Task class still extends Node's EventEmitter (via ampersand-events),
1618
+ * which satisfies this interface at runtime.
1619
+ * @public
1620
+ */
1621
+ export interface IEventEmitter {
1622
+ on(event: string, listener: (...args: any[]) => void): this;
1623
+ off(event: string, listener: (...args: any[]) => void): this;
1624
+ once(event: string, listener: (...args: any[]) => void): this;
1625
+ emit(event: string, ...args: any[]): boolean;
1626
+ }
1163
1627
  /**
1164
1628
  * Interface for managing task-related operations in the contact center
1165
- * Extends EventEmitter to support event-driven task updates
1629
+ * Extends IEventEmitter to support event-driven task updates
1166
1630
  */
1167
- export interface ITask extends EventEmitter {
1631
+ export interface ITask extends IEventEmitter {
1168
1632
  /**
1169
1633
  * Event data received in the Contact Center events.
1170
1634
  * Contains detailed task information including interaction details, media resources,
1171
1635
  * and participant data as defined in {@link TaskData}
1172
1636
  */
1173
1637
  data: TaskData;
1638
+ /**
1639
+ * Current AI-summary capabilities for this task. Both flags are false until
1640
+ * the matching feature-enablement event is received.
1641
+ */
1642
+ readonly aiSummaryCapabilities: Readonly<AISummaryCapabilities>;
1174
1643
  /**
1175
1644
  * Map associating tasks with their corresponding call identifiers.
1176
1645
  */
@@ -1181,6 +1650,21 @@ export interface ITask extends EventEmitter {
1181
1650
  * as defined in {@link AutoWrapup}
1182
1651
  */
1183
1652
  autoWrapup?: AutoWrapup;
1653
+ /**
1654
+ * Latest UI controls derived from the state machine.
1655
+ * Each control has `isVisible` and `isEnabled` flags computed from current task state.
1656
+ * Subscribe to {@link TASK_EVENTS.TASK_UI_CONTROLS_UPDATED} for change notifications.
1657
+ */
1658
+ readonly uiControls: TaskUIControls;
1659
+ /**
1660
+ * Current wxApp mute state for engaged telephony (Voice tasks only).
1661
+ */
1662
+ getWxAppMuted?(): boolean;
1663
+ /**
1664
+ * Re-seed wxApp mute from GET telephony/calls/{callId}. Resolves to muted state when known.
1665
+ */
1666
+ syncWxAppMuteFromCallDetails?(): Promise<boolean | undefined>;
1667
+ state?: any;
1184
1668
  /**
1185
1669
  * Cancels the auto-wrapup timer for the task.
1186
1670
  * This method stops the auto-wrapup process if it is currently active.
@@ -1188,6 +1672,30 @@ export interface ITask extends EventEmitter {
1188
1672
  * @returns void
1189
1673
  */
1190
1674
  cancelAutoWrapupTimer(): void;
1675
+ /**
1676
+ * Requests an AI-generated post-call summary for this task.
1677
+ * @returns Promise resolving with the matching post-call summary payload.
1678
+ */
1679
+ requestPostCallSummary(): Promise<AISummary>;
1680
+ /**
1681
+ * Sends the consumer's post-call summary response.
1682
+ * @param response - Validated post-call response observations and summary state.
1683
+ * @returns Promise resolving when AI Assistant acknowledges the response.
1684
+ */
1685
+ sendPostCallSummaryResponse(response: AISummaryResponse): Promise<void>;
1686
+ /**
1687
+ * Requests an AI-generated mid-call summary for a consult or transfer flow.
1688
+ * @param action - The consult or transfer flow requesting the summary.
1689
+ * @returns Promise resolving with the matching mid-call summary payload.
1690
+ */
1691
+ requestMidCallSummary(action: AISummaryAction): Promise<AISummary>;
1692
+ /**
1693
+ * Sends the consumer's mid-call summary response for a consult or transfer flow.
1694
+ * @param response - Validated mid-call response observations and summary state.
1695
+ * @param action - The consult or transfer flow responding to the summary.
1696
+ * @returns Promise resolving when AI Assistant acknowledges the response.
1697
+ */
1698
+ sendMidCallSummaryResponse(response: AISummaryResponse, action: AISummaryAction): Promise<void>;
1191
1699
  /**
1192
1700
  * Deregisters all web call event listeners.
1193
1701
  * Used when cleaning up task resources.
@@ -1200,7 +1708,7 @@ export interface ITask extends EventEmitter {
1200
1708
  * @returns Updated task instance
1201
1709
  * @ignore
1202
1710
  */
1203
- updateTaskData(newData: TaskData): ITask;
1711
+ updateTaskData(newData: TaskData): void;
1204
1712
  /**
1205
1713
  * Answers or accepts an incoming task.
1206
1714
  * Once accepted, the task will be assigned to the agent and trigger a {@link TASK_EVENTS.TASK_ASSIGNED} event.
@@ -1321,26 +1829,27 @@ export interface ITask extends EventEmitter {
1321
1829
  * await task.transfer({ to: "queueId", destinationType: "queue" });
1322
1830
  * ```
1323
1831
  */
1324
- transfer(transferPayload: TransferPayLoad): Promise<TaskResponse>;
1832
+ transfer(transferPayload: TransferPayLoad, options?: TransferOptions): Promise<TaskResponse>;
1325
1833
  /**
1326
- * Transfers the task after consultation.
1327
- * @param consultTransferPayload - Details for consult transfer (optional)
1834
+ * Initiates a consult conference (merge consult call with main call).
1328
1835
  * @returns Promise<TaskResponse>
1329
1836
  * @example
1330
1837
  * ```typescript
1331
- * await task.consultTransfer({ to: "agentId", destinationType: "agent" });
1838
+ * await task.consultConference();
1332
1839
  * ```
1333
1840
  */
1334
- consultTransfer(consultTransferPayload?: ConsultTransferPayLoad): Promise<TaskResponse>;
1841
+ consultConference(): Promise<TaskResponse>;
1335
1842
  /**
1336
- * Initiates a consult conference (merge consult call with main call).
1843
+ * Removes a supported participant from the active conference.
1844
+ * Resolves after the correlated ParticipantLeftConference routing event.
1845
+ * @param payload - Participant identifier to remove
1337
1846
  * @returns Promise<TaskResponse>
1338
1847
  * @example
1339
1848
  * ```typescript
1340
- * await task.consultConference();
1849
+ * await task.dropConferenceParticipant({participantId: 'participant-id'});
1341
1850
  * ```
1342
1851
  */
1343
- consultConference(): Promise<TaskResponse>;
1852
+ dropConferenceParticipant(payload: DropConferenceParticipantPayload): Promise<TaskResponse>;
1344
1853
  /**
1345
1854
  * Exits from an ongoing conference.
1346
1855
  * @returns Promise<TaskResponse>
@@ -1360,12 +1869,175 @@ export interface ITask extends EventEmitter {
1360
1869
  */
1361
1870
  transferConference(): Promise<TaskResponse>;
1362
1871
  /**
1363
- * Toggles mute/unmute for the local audio stream during a WebRTC task.
1872
+ * Toggles between consult call and main call during consulting.
1873
+ * If on consult leg, switches to main call (holds consult).
1874
+ * If on main call, switches to consult (resumes consult).
1875
+ * Only available when in CONSULTING state.
1876
+ * @returns Promise<TaskResponse>
1877
+ * @example
1878
+ * ```typescript
1879
+ * await task.switchCall();
1880
+ * ```
1881
+ */
1882
+ switchCall(): Promise<TaskResponse>;
1883
+ /**
1884
+ * Toggles mute/unmute for the active call.
1885
+ * WebRTC tasks toggle the local stream; wxApp engaged tasks route to telephony mute REST when
1886
+ * `enableWxBetterTogether` is active.
1887
+ * @param options - Optional target mute state (`muted`) for wxApp; ignored for WebRTC toggle.
1364
1888
  * @returns Promise<void>
1365
1889
  * @example
1366
1890
  * ```typescript
1367
1891
  * await task.toggleMute();
1892
+ * await task.toggleMute({ muted: true });
1893
+ * ```
1894
+ */
1895
+ toggleMute(options?: TaskToggleMuteOptions): Promise<void>;
1896
+ /**
1897
+ * Sends in-call DTMF tones for wxApp engaged telephony tasks when `enableWxBetterTogether` is active.
1898
+ * @param options - DTMF digit(s) and optional shared-line owner id.
1899
+ * @returns Promise<void>
1900
+ * @example
1901
+ * ```typescript
1902
+ * await task.transmitDtmf({ dtmf: '5' });
1368
1903
  * ```
1369
1904
  */
1370
- toggleMute(): Promise<void>;
1905
+ transmitDtmf(options: TaskTransmitDtmfOptions): Promise<void>;
1906
+ }
1907
+ /**
1908
+ * Interface for managing digital channel task operations in the contact center
1909
+ * Digital channels (chat, email, social, SMS) have a simpler interface than voice
1910
+ * Extends ITask but overrides updateTaskData to return IDigital
1911
+ * @public
1912
+ */
1913
+ export interface IDigital extends Omit<ITask, 'updateTaskData'> {
1914
+ /**
1915
+ * Updates the task data
1916
+ * @param newData - Updated task data
1917
+ * @param shouldOverwrite - Whether to completely replace existing data
1918
+ * @returns Updated Digital task instance
1919
+ */
1920
+ updateTaskData(newData: TaskData, shouldOverwrite?: boolean): IDigital;
1921
+ }
1922
+ /**
1923
+ * Interface for managing voice/telephony task operations in the contact center
1924
+ * Extends ITask with voice-specific functionality for hold/resume operations
1925
+ * @public
1926
+ */
1927
+ export interface IVoice extends ITask {
1928
+ /**
1929
+ * Toggles hold/resume state for a voice task.
1930
+ * If the task is currently on hold, it will be resumed.
1931
+ * If the task is active, it will be placed on hold.
1932
+ * @returns Promise<TaskResponse>
1933
+ * @example
1934
+ * ```typescript
1935
+ * await voiceTask.holdResume();
1936
+ * ```
1937
+ */
1938
+ holdResume(): Promise<TaskResponse>;
1939
+ /** @see wxAppVoiceMethods — WXCC-6026 */
1940
+ isWebexAppCallingOffer(): boolean;
1941
+ /** @see wxAppVoiceMethods — WXCC-6026 */
1942
+ getCallingDeviceDetails(): import('./WebexCallingUtils').WebexCallingDeviceDetails | undefined;
1943
+ /** @see wxAppVoiceMethods — WXCC-6026 */
1944
+ getWebexCallingCallId(): string | null;
1945
+ }
1946
+ /**
1947
+ * Configuration options for voice task UI controls
1948
+ */
1949
+ export type VoiceUIControlOptions = {
1950
+ isEndTaskEnabled?: boolean;
1951
+ isEndConsultEnabled?: boolean;
1952
+ voiceVariant?: VoiceVariant;
1953
+ isRecordingEnabled?: boolean;
1954
+ enableWxBetterTogether?: boolean;
1955
+ consultTransferConfig?: ConsultTransferDestinationConfig;
1956
+ answerCallOnWebexService?: import('../AnswerCallOnWebexService').default;
1957
+ /** Read-only observability: whether usersub answer-calls-on-wxcc is active this session. */
1958
+ getUsersubPublished?: () => boolean;
1959
+ };
1960
+ /**
1961
+ * Participant information for UI display
1962
+ */
1963
+ export type Participant = {
1964
+ id: string;
1965
+ name?: string;
1966
+ pType?: string;
1967
+ };
1968
+ /**
1969
+ * @deprecated Use Participant instead
1970
+ */
1971
+ export type TaskAccessorParticipant = Participant;
1972
+ export interface IWebRTC extends IVoice {
1973
+ /**
1974
+ * This method is used to mute/unmute the call.
1975
+ * @returns Promise<void>
1976
+ * @example
1977
+ * ```typescript
1978
+ * task.toggleMute();
1979
+ * ```
1980
+ */
1981
+ toggleMute(options?: TaskToggleMuteOptions): Promise<void>;
1982
+ /**
1983
+ * Decline the incoming task for Browser Login
1984
+ *
1985
+ * @example
1986
+ * ```
1987
+ * task.decline();
1988
+ * ```
1989
+ */
1990
+ decline(): Promise<TaskResponse>;
1991
+ /**
1992
+ * This method is used to unregister the web call listeners.
1993
+ * @returns void
1994
+ * @example
1995
+ * ```typescript
1996
+ * task.unregisterWebCallListeners();
1997
+ * ```
1998
+ */
1999
+ unregisterWebCallListeners(): void;
2000
+ }
2001
+ export type WebSocketPayload = TaskData & {
2002
+ type: string;
2003
+ mediaResourceId?: string;
2004
+ reason?: string;
2005
+ /** ContactEnded: party that ended the contact (e.g. 'Agent', 'Customer') */
2006
+ terminatingParty?: string;
2007
+ /**
2008
+ * Optional real-time transcript chunk payload.
2009
+ * Present on REAL_TIME_TRANSCRIPTION notifications.
2010
+ */
2011
+ data?: RealtimeTranscription['data'];
2012
+ };
2013
+ export type WebSocketMessage = {
2014
+ keepalive?: 'true' | 'false' | boolean;
2015
+ type?: string;
2016
+ data: WebSocketPayload;
2017
+ };
2018
+ /**
2019
+ * Actions to be performed after handling an event
2020
+ *
2021
+ * These actions represent TaskManager-level concerns (task collection lifecycle,
2022
+ * resource cleanup) rather than task-level state machine concerns. The separation
2023
+ * ensures proper responsibility:
2024
+ * - TaskManager: Collection management, metrics, cleanup
2025
+ * - State Machine: Task state transitions, event emissions, UI controls
2026
+ */
2027
+ export interface TaskEventActions {
2028
+ task?: ITask;
2029
+ }
2030
+ /**
2031
+ * Context for processing an event
2032
+ *
2033
+ * Contains all information needed to process a WebSocket event:
2034
+ * - Event type and payload from the backend
2035
+ * - Task instance (if exists)
2036
+ * - Pre-mapped state machine event (if applicable)
2037
+ */
2038
+ export interface EventContext {
2039
+ eventType: string;
2040
+ payload: WebSocketPayload;
2041
+ task?: ITask;
2042
+ stateMachineEvent?: TaskEventPayload | null;
1371
2043
  }