@webex/contact-center 3.11.0 → 3.12.0-auth-prejoin-fetch.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (325) hide show
  1. package/.sdd/manifest.json +883 -0
  2. package/AGENTS.md +94 -0
  3. package/ai-docs/ARCHITECTURE.md +168 -0
  4. package/ai-docs/CONTRACTS.md +50 -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 +48 -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 +359 -0
  17. package/ai-docs/features/consult-transfer-list-policy/spec/feature-spec.md +362 -0
  18. package/ai-docs/features/generated-spec-conformance-fidelity-remediation/spec/feature-spec.md +117 -0
  19. package/ai-docs/features/residual-warning-coverage-completion/spec/feature-spec.md +203 -0
  20. package/ai-docs/features/validator-code-fidelity-drift-fix/spec/feature-spec.md +315 -0
  21. package/ai-docs/patterns/event-driven-patterns.md +485 -0
  22. package/ai-docs/patterns/testing-patterns.md +480 -0
  23. package/ai-docs/patterns/typescript-patterns.md +365 -0
  24. package/ai-docs/templates/README.md +102 -0
  25. package/ai-docs/templates/documentation/create-agents-md.md +240 -0
  26. package/ai-docs/templates/documentation/create-architecture-md.md +295 -0
  27. package/ai-docs/templates/existing-service/bug-fix.md +254 -0
  28. package/ai-docs/templates/existing-service/feature-enhancement.md +450 -0
  29. package/ai-docs/templates/new-method/00-master.md +80 -0
  30. package/ai-docs/templates/new-method/01-requirements.md +232 -0
  31. package/ai-docs/templates/new-method/02-implementation.md +295 -0
  32. package/ai-docs/templates/new-method/03-tests.md +201 -0
  33. package/ai-docs/templates/new-method/04-validation.md +141 -0
  34. package/ai-docs/templates/new-service/00-master.md +109 -0
  35. package/ai-docs/templates/new-service/01-pre-questions.md +159 -0
  36. package/ai-docs/templates/new-service/02-code-generation.md +346 -0
  37. package/ai-docs/templates/new-service/03-integration.md +178 -0
  38. package/ai-docs/templates/new-service/04-test-generation.md +205 -0
  39. package/ai-docs/templates/new-service/05-validation.md +145 -0
  40. package/dist/cc.js +818 -59
  41. package/dist/cc.js.map +1 -1
  42. package/dist/config.js +13 -0
  43. package/dist/config.js.map +1 -1
  44. package/dist/constants.js +31 -3
  45. package/dist/constants.js.map +1 -1
  46. package/dist/index.js +27 -5
  47. package/dist/index.js.map +1 -1
  48. package/dist/metrics/behavioral-events.js +127 -0
  49. package/dist/metrics/behavioral-events.js.map +1 -1
  50. package/dist/metrics/constants.js +34 -3
  51. package/dist/metrics/constants.js.map +1 -1
  52. package/dist/services/AddressBook.js +18 -15
  53. package/dist/services/AddressBook.js.map +1 -1
  54. package/dist/services/AnswerCallOnWebexService.js +174 -0
  55. package/dist/services/AnswerCallOnWebexService.js.map +1 -0
  56. package/dist/services/ApiAiAssistant.js +318 -0
  57. package/dist/services/ApiAiAssistant.js.map +1 -0
  58. package/dist/services/EntryPoint.js +46 -68
  59. package/dist/services/EntryPoint.js.map +1 -1
  60. package/dist/services/Queue.js +27 -22
  61. package/dist/services/Queue.js.map +1 -1
  62. package/dist/services/UserPreference.js +427 -0
  63. package/dist/services/UserPreference.js.map +1 -0
  64. package/dist/services/WebexCrossClientService.js +171 -0
  65. package/dist/services/WebexCrossClientService.js.map +1 -0
  66. package/dist/services/WxAppTelephonyMercurySync.js +93 -0
  67. package/dist/services/WxAppTelephonyMercurySync.js.map +1 -0
  68. package/dist/services/agent/types.js.map +1 -1
  69. package/dist/services/config/Util.js +11 -4
  70. package/dist/services/config/Util.js.map +1 -1
  71. package/dist/services/config/constants.js +45 -8
  72. package/dist/services/config/constants.js.map +1 -1
  73. package/dist/services/config/index.js +41 -2
  74. package/dist/services/config/index.js.map +1 -1
  75. package/dist/services/config/types.js +70 -8
  76. package/dist/services/config/types.js.map +1 -1
  77. package/dist/services/constants.js +27 -1
  78. package/dist/services/constants.js.map +1 -1
  79. package/dist/services/core/Err.js.map +1 -1
  80. package/dist/services/core/Utils.js +122 -25
  81. package/dist/services/core/Utils.js.map +1 -1
  82. package/dist/services/core/WebexRequest.js +6 -2
  83. package/dist/services/core/WebexRequest.js.map +1 -1
  84. package/dist/services/core/aqm-reqs.js +119 -30
  85. package/dist/services/core/aqm-reqs.js.map +1 -1
  86. package/dist/services/core/types.js.map +1 -1
  87. package/dist/services/core/websocket/WebSocketManager.js +22 -6
  88. package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
  89. package/dist/services/core/websocket/connection-service.js +3 -1
  90. package/dist/services/core/websocket/connection-service.js.map +1 -1
  91. package/dist/services/core/websocket/types.js.map +1 -1
  92. package/dist/services/index.js +6 -0
  93. package/dist/services/index.js.map +1 -1
  94. package/dist/services/task/Task.js +754 -0
  95. package/dist/services/task/Task.js.map +1 -0
  96. package/dist/services/task/TaskFactory.js +49 -0
  97. package/dist/services/task/TaskFactory.js.map +1 -0
  98. package/dist/services/task/TaskManager.js +1073 -447
  99. package/dist/services/task/TaskManager.js.map +1 -1
  100. package/dist/services/task/TaskUtils.js +220 -23
  101. package/dist/services/task/TaskUtils.js.map +1 -1
  102. package/dist/services/task/WebexCallingUtils.js +70 -0
  103. package/dist/services/task/WebexCallingUtils.js.map +1 -0
  104. package/dist/services/task/constants.js +26 -2
  105. package/dist/services/task/constants.js.map +1 -1
  106. package/dist/services/task/contact.js +29 -0
  107. package/dist/services/task/contact.js.map +1 -1
  108. package/dist/services/task/dialer.js +129 -0
  109. package/dist/services/task/dialer.js.map +1 -1
  110. package/dist/services/task/digital/Digital.js +78 -0
  111. package/dist/services/task/digital/Digital.js.map +1 -0
  112. package/dist/services/task/state-machine/TaskStateMachine.js +971 -0
  113. package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -0
  114. package/dist/services/task/state-machine/actions.js +572 -0
  115. package/dist/services/task/state-machine/actions.js.map +1 -0
  116. package/dist/services/task/state-machine/constants.js +161 -0
  117. package/dist/services/task/state-machine/constants.js.map +1 -0
  118. package/dist/services/task/state-machine/guards.js +409 -0
  119. package/dist/services/task/state-machine/guards.js.map +1 -0
  120. package/dist/services/task/state-machine/index.js +53 -0
  121. package/dist/services/task/state-machine/index.js.map +1 -0
  122. package/dist/services/task/state-machine/types.js +54 -0
  123. package/dist/services/task/state-machine/types.js.map +1 -0
  124. package/dist/services/task/state-machine/uiControlsComputer.js +703 -0
  125. package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -0
  126. package/dist/services/task/taskDataNormalizer.js +99 -0
  127. package/dist/services/task/taskDataNormalizer.js.map +1 -0
  128. package/dist/services/task/types.js +243 -5
  129. package/dist/services/task/types.js.map +1 -1
  130. package/dist/services/task/voice/Voice.js +1380 -0
  131. package/dist/services/task/voice/Voice.js.map +1 -0
  132. package/dist/services/task/voice/WebRTC.js +152 -0
  133. package/dist/services/task/voice/WebRTC.js.map +1 -0
  134. package/dist/services/task/voice/wxAppVoiceMethods.js +201 -0
  135. package/dist/services/task/voice/wxAppVoiceMethods.js.map +1 -0
  136. package/dist/services/wxAppTelephonyUtils.js +19 -0
  137. package/dist/services/wxAppTelephonyUtils.js.map +1 -0
  138. package/dist/types/cc.d.ts +967 -0
  139. package/dist/types/config.d.ts +79 -0
  140. package/dist/types/constants.d.ts +74 -0
  141. package/dist/types/index.d.ts +201 -0
  142. package/dist/types/logger-proxy.d.ts +71 -0
  143. package/dist/types/metrics/MetricsManager.d.ts +223 -0
  144. package/dist/types/metrics/behavioral-events.d.ts +29 -0
  145. package/dist/types/metrics/constants.d.ts +183 -0
  146. package/dist/types/services/AddressBook.d.ts +75 -0
  147. package/dist/types/services/AnswerCallOnWebexService.d.ts +37 -0
  148. package/dist/types/services/ApiAiAssistant.d.ts +49 -0
  149. package/dist/types/services/EntryPoint.d.ts +69 -0
  150. package/dist/types/services/Queue.d.ts +78 -0
  151. package/dist/types/services/UserPreference.d.ts +118 -0
  152. package/dist/types/services/WebCallingService.d.ts +1 -0
  153. package/dist/types/services/WebexCrossClientService.d.ts +28 -0
  154. package/dist/types/services/WxAppTelephonyMercurySync.d.ts +28 -0
  155. package/dist/types/services/agent/index.d.ts +46 -0
  156. package/dist/types/services/agent/types.d.ts +413 -0
  157. package/dist/types/services/config/Util.d.ts +20 -0
  158. package/dist/types/services/config/constants.d.ts +273 -0
  159. package/dist/types/services/config/index.d.ts +177 -0
  160. package/dist/types/services/config/types.d.ts +1381 -0
  161. package/dist/types/services/constants.d.ts +110 -0
  162. package/dist/types/services/core/Err.d.ts +127 -0
  163. package/dist/types/services/core/GlobalTypes.d.ts +58 -0
  164. package/dist/types/services/core/Utils.d.ts +121 -0
  165. package/dist/types/services/core/WebexRequest.d.ts +23 -0
  166. package/dist/types/services/core/aqm-reqs.d.ts +65 -0
  167. package/dist/types/services/core/constants.d.ts +99 -0
  168. package/dist/types/services/core/types.d.ts +49 -0
  169. package/dist/types/services/core/websocket/WebSocketManager.d.ts +36 -0
  170. package/dist/types/services/core/websocket/connection-service.d.ts +27 -0
  171. package/dist/types/services/core/websocket/keepalive.worker.d.ts +2 -0
  172. package/dist/types/services/core/websocket/types.d.ts +37 -0
  173. package/dist/types/services/index.d.ts +54 -0
  174. package/dist/types/services/task/AutoWrapup.d.ts +40 -0
  175. package/dist/types/services/task/Task.d.ts +175 -0
  176. package/dist/types/services/task/TaskFactory.d.ts +13 -0
  177. package/dist/types/services/task/TaskManager.d.ts +1 -0
  178. package/dist/types/services/task/TaskUtils.d.ts +138 -0
  179. package/dist/types/services/task/WebexCallingUtils.d.ts +11 -0
  180. package/dist/types/services/task/constants.d.ts +94 -0
  181. package/dist/types/services/task/contact.d.ts +73 -0
  182. package/dist/types/services/task/dialer.d.ts +73 -0
  183. package/dist/types/services/task/digital/Digital.d.ts +22 -0
  184. package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +1398 -0
  185. package/dist/types/services/task/state-machine/actions.d.ts +10 -0
  186. package/dist/types/services/task/state-machine/constants.d.ts +107 -0
  187. package/dist/types/services/task/state-machine/guards.d.ts +103 -0
  188. package/dist/types/services/task/state-machine/index.d.ts +13 -0
  189. package/dist/types/services/task/state-machine/types.d.ts +277 -0
  190. package/dist/types/services/task/state-machine/uiControlsComputer.d.ts +9 -0
  191. package/dist/types/services/task/taskDataNormalizer.d.ts +10 -0
  192. package/dist/types/services/task/types.d.ts +1933 -0
  193. package/dist/types/services/task/voice/Voice.d.ts +223 -0
  194. package/dist/types/services/task/voice/WebRTC.d.ts +53 -0
  195. package/dist/types/services/task/voice/wxAppVoiceMethods.d.ts +52 -0
  196. package/dist/types/services/wxAppTelephonyUtils.d.ts +5 -0
  197. package/dist/types/types.d.ts +784 -0
  198. package/dist/types/utils/PageCache.d.ts +190 -0
  199. package/dist/types/webex-config.d.ts +53 -0
  200. package/dist/types/webex.d.ts +8 -0
  201. package/dist/types.js +137 -3
  202. package/dist/types.js.map +1 -1
  203. package/dist/utils/PageCache.js +19 -5
  204. package/dist/utils/PageCache.js.map +1 -1
  205. package/dist/webex.js +14 -2
  206. package/dist/webex.js.map +1 -1
  207. package/package.json +16 -12
  208. package/src/cc.ts +983 -60
  209. package/src/config.ts +13 -0
  210. package/src/constants.ts +29 -1
  211. package/src/index.ts +26 -5
  212. package/src/metrics/ai-docs/AGENTS.md +350 -0
  213. package/src/metrics/ai-docs/ARCHITECTURE.md +338 -0
  214. package/src/metrics/ai-docs/metrics-spec.md +860 -0
  215. package/src/metrics/behavioral-events.ts +134 -0
  216. package/src/metrics/constants.ts +39 -3
  217. package/src/services/AddressBook.ts +17 -6
  218. package/src/services/AnswerCallOnWebexService.ts +206 -0
  219. package/src/services/ApiAiAssistant.ts +412 -0
  220. package/src/services/EntryPoint.ts +59 -60
  221. package/src/services/Queue.ts +29 -12
  222. package/src/services/UserPreference.ts +509 -0
  223. package/src/services/WebexCrossClientService.ts +212 -0
  224. package/src/services/WxAppTelephonyMercurySync.ts +115 -0
  225. package/src/services/agent/ai-docs/AGENTS.md +240 -0
  226. package/src/services/agent/ai-docs/ARCHITECTURE.md +304 -0
  227. package/src/services/agent/ai-docs/agent-spec.md +504 -0
  228. package/src/services/agent/types.ts +1 -1
  229. package/src/services/ai-docs/AGENTS.md +386 -0
  230. package/src/services/ai-docs/services-spec.md +497 -0
  231. package/src/services/config/Util.ts +13 -2
  232. package/src/services/config/ai-docs/AGENTS.md +255 -0
  233. package/src/services/config/ai-docs/ARCHITECTURE.md +426 -0
  234. package/src/services/config/ai-docs/config-spec.md +675 -0
  235. package/src/services/config/constants.ts +47 -7
  236. package/src/services/config/index.ts +45 -1
  237. package/src/services/config/types.ts +253 -11
  238. package/src/services/constants.ts +29 -0
  239. package/src/services/core/Err.ts +4 -0
  240. package/src/services/core/Utils.ts +143 -30
  241. package/src/services/core/WebexRequest.ts +3 -1
  242. package/src/services/core/ai-docs/AGENTS.md +381 -0
  243. package/src/services/core/ai-docs/ARCHITECTURE.md +698 -0
  244. package/src/services/core/ai-docs/core-spec.md +787 -0
  245. package/src/services/core/aqm-reqs.ts +125 -32
  246. package/src/services/core/types.ts +2 -0
  247. package/src/services/core/websocket/WebSocketManager.ts +23 -6
  248. package/src/services/core/websocket/connection-service.ts +5 -1
  249. package/src/services/core/websocket/types.ts +1 -1
  250. package/src/services/index.ts +4 -0
  251. package/src/services/task/Task.ts +908 -0
  252. package/src/services/task/TaskFactory.ts +60 -0
  253. package/src/services/task/TaskManager.ts +1291 -513
  254. package/src/services/task/TaskUtils.ts +314 -24
  255. package/src/services/task/WebexCallingUtils.ts +136 -0
  256. package/src/services/task/ai-docs/AGENTS.md +457 -0
  257. package/src/services/task/ai-docs/ARCHITECTURE.md +595 -0
  258. package/src/services/task/ai-docs/task-spec.md +1469 -0
  259. package/src/services/task/constants.ts +26 -0
  260. package/src/services/task/contact.ts +30 -0
  261. package/src/services/task/dialer.ts +136 -1
  262. package/src/services/task/digital/Digital.ts +97 -0
  263. package/src/services/task/state-machine/TaskStateMachine.ts +1313 -0
  264. package/src/services/task/state-machine/actions.ts +741 -0
  265. package/src/services/task/state-machine/ai-docs/AGENTS.md +462 -0
  266. package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +1146 -0
  267. package/src/services/task/state-machine/ai-docs/task-state-machine-spec.md +2209 -0
  268. package/src/services/task/state-machine/constants.ts +172 -0
  269. package/src/services/task/state-machine/guards.ts +498 -0
  270. package/src/services/task/state-machine/index.ts +28 -0
  271. package/src/services/task/state-machine/types.ts +258 -0
  272. package/src/services/task/state-machine/uiControlsComputer.ts +1135 -0
  273. package/src/services/task/taskDataNormalizer.ts +137 -0
  274. package/src/services/task/types.ts +843 -70
  275. package/src/services/task/voice/Voice.ts +1720 -0
  276. package/src/services/task/voice/WebRTC.ts +191 -0
  277. package/src/services/task/voice/wxAppVoiceMethods.ts +307 -0
  278. package/src/services/wxAppTelephonyUtils.ts +14 -0
  279. package/src/types.ts +238 -11
  280. package/src/utils/AGENTS.md +289 -0
  281. package/src/utils/PageCache.ts +38 -5
  282. package/src/utils/ai-docs/utils-spec.md +391 -0
  283. package/src/webex.js +2 -0
  284. package/test/unit/spec/cc.ts +1856 -122
  285. package/test/unit/spec/logger-proxy.ts +70 -0
  286. package/test/unit/spec/metrics/behavioral-events.ts +18 -0
  287. package/test/unit/spec/services/AddressBook.ts +37 -6
  288. package/test/unit/spec/services/AnswerCallOnWebexService.ts +223 -0
  289. package/test/unit/spec/services/ApiAiAssistant.ts +273 -0
  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 +7 -1
  294. package/test/unit/spec/services/WebexCrossClientService.ts +261 -0
  295. package/test/unit/spec/services/WxAppTelephonyMercurySync.ts +113 -0
  296. package/test/unit/spec/services/config/Util.ts +85 -0
  297. package/test/unit/spec/services/config/index.ts +85 -29
  298. package/test/unit/spec/services/core/Utils.ts +481 -2
  299. package/test/unit/spec/services/core/WebexRequest.ts +3 -1
  300. package/test/unit/spec/services/core/aqm-reqs.ts +113 -1
  301. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +137 -41
  302. package/test/unit/spec/services/core/websocket/connection-service.ts +3 -1
  303. package/test/unit/spec/services/task/AutoWrapup.ts +63 -0
  304. package/test/unit/spec/services/task/Task.ts +677 -0
  305. package/test/unit/spec/services/task/TaskFactory.ts +99 -0
  306. package/test/unit/spec/services/task/TaskManager.ts +2209 -918
  307. package/test/unit/spec/services/task/TaskUtils.ts +235 -0
  308. package/test/unit/spec/services/task/WebexCallingUtils.ts +153 -0
  309. package/test/unit/spec/services/task/contact.ts +33 -0
  310. package/test/unit/spec/services/task/dialer.ts +372 -96
  311. package/test/unit/spec/services/task/digital/Digital.ts +105 -0
  312. package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +3433 -0
  313. package/test/unit/spec/services/task/state-machine/guards.ts +839 -0
  314. package/test/unit/spec/services/task/state-machine/types.ts +18 -0
  315. package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +3101 -0
  316. package/test/unit/spec/services/task/taskTestUtils.ts +87 -0
  317. package/test/unit/spec/services/task/voice/Voice.ts +1523 -0
  318. package/test/unit/spec/services/task/voice/WebRTC.ts +235 -0
  319. package/test/unit/spec/services/task/voice/wxAppVoiceMethods.ts +459 -0
  320. package/umd/contact-center.min.js +2 -2
  321. package/umd/contact-center.min.js.map +1 -1
  322. package/dist/services/task/index.js +0 -1525
  323. package/dist/services/task/index.js.map +0 -1
  324. package/src/services/task/index.ts +0 -1801
  325. package/test/unit/spec/services/task/index.ts +0 -2184
@@ -0,0 +1,1933 @@
1
+ import { TaskEventPayload } from './state-machine';
2
+ import { Msg } from '../core/GlobalTypes';
3
+ import AutoWrapup from './AutoWrapup';
4
+ /**
5
+ * Unique identifier for a task in the contact center system
6
+ * @public
7
+ */
8
+ export type TaskId = string;
9
+ /**
10
+ * Unique identifier for a call in the Webex calling system
11
+ */
12
+ export type CallId = string;
13
+ /**
14
+ * Defines the valid destination types for routing tasks within the contact center
15
+ * Used to specify where a task should be directed
16
+ * @public
17
+ */
18
+ export declare const DESTINATION_TYPE: {
19
+ /** Route task to a specific queue */
20
+ QUEUE: string;
21
+ /** Route task to a specific dial number */
22
+ DIALNUMBER: string;
23
+ /** Route task to a specific agent */
24
+ AGENT: string;
25
+ /** Route task to an entry point */
26
+ ENTRYPOINT: string;
27
+ };
28
+ /**
29
+ * Type representing valid destination types for task routing
30
+ * Derived from the DESTINATION_TYPE constant
31
+ * @public
32
+ */
33
+ export type DestinationType = Enum<typeof DESTINATION_TYPE>;
34
+ /**
35
+ * Defines the valid destination types for consult transfer operations
36
+ * Used when transferring a task after consultation
37
+ * @public
38
+ */
39
+ export declare const CONSULT_TRANSFER_DESTINATION_TYPE: {
40
+ /** Transfer to a specific agent */
41
+ AGENT: string;
42
+ /** Transfer to an entry point */
43
+ ENTRYPOINT: string;
44
+ /** Transfer to a dial number */
45
+ DIALNUMBER: string;
46
+ /** Transfer to a queue */
47
+ QUEUE: string;
48
+ };
49
+ /**
50
+ * Type representing valid destination types for consult transfers
51
+ * Derived from the CONSULT_TRANSFER_DESTINATION_TYPE constant
52
+ * @public
53
+ */
54
+ export type ConsultTransferDestinationType = Enum<typeof CONSULT_TRANSFER_DESTINATION_TYPE>;
55
+ /**
56
+ * Defines all supported media channel types for customer interactions
57
+ * These represent the different ways customers can communicate with agents
58
+ * @public
59
+ */
60
+ export declare const MEDIA_CHANNEL: {
61
+ /** Email-based communication channel */
62
+ readonly EMAIL: "email";
63
+ /** Web-based chat communication channel */
64
+ readonly CHAT: "chat";
65
+ /** Voice/phone communication channel */
66
+ readonly TELEPHONY: "telephony";
67
+ /** Social media platform communication channel */
68
+ readonly SOCIAL: "social";
69
+ /** SMS text messaging communication channel */
70
+ readonly SMS: "sms";
71
+ /** Facebook Messenger communication channel */
72
+ readonly FACEBOOK: "facebook";
73
+ /** WhatsApp messaging communication channel */
74
+ readonly WHATSAPP: "whatsapp";
75
+ };
76
+ /**
77
+ * Type representing valid media channels
78
+ * Derived from the MEDIA_CHANNEL constant
79
+ * @public
80
+ */
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>;
98
+ /**
99
+ * Enumeration of all task-related events that can occur in the contact center system
100
+ * These events represent different states and actions in the task lifecycle
101
+ * @public
102
+ */
103
+ export declare enum TASK_EVENTS {
104
+ /**
105
+ * Triggered when a new task is received by the system
106
+ * @example
107
+ * ```typescript
108
+ * task.on(TASK_EVENTS.TASK_INCOMING, (task: ITask) => {
109
+ * console.log('New task received:', task.data.interactionId);
110
+ * // Handle incoming task
111
+ * });
112
+ * ```
113
+ */
114
+ TASK_INCOMING = "task:incoming",
115
+ /**
116
+ * Triggered when a task is successfully assigned to an agent
117
+ * @example
118
+ * ```typescript
119
+ * task.on(TASK_EVENTS.TASK_ASSIGNED, (task: ITask) => {
120
+ * console.log('Task assigned:', task.data.interactionId);
121
+ * // Begin handling the assigned task
122
+ * });
123
+ * ```
124
+ */
125
+ TASK_ASSIGNED = "task:assigned",
126
+ /**
127
+ * Triggered when the media state of a task changes
128
+ * @example
129
+ * ```typescript
130
+ * task.on(TASK_EVENTS.TASK_MEDIA, (track: MediaStreamTrack) => {
131
+ * // Handle media track updates
132
+ * });
133
+ * ```
134
+ */
135
+ TASK_MEDIA = "task:media",
136
+ /**
137
+ * Triggered when a task is removed from an agent
138
+ * @example
139
+ * ```typescript
140
+ * task.on(TASK_EVENTS.TASK_UNASSIGNED, (task: ITask) => {
141
+ * console.log('Task unassigned:', task.data.interactionId);
142
+ * // Clean up task resources
143
+ * });
144
+ * ```
145
+ */
146
+ TASK_UNASSIGNED = "task:unassigned",
147
+ /**
148
+ * Triggered when a task is placed on hold
149
+ * @example
150
+ * ```typescript
151
+ * task.on(TASK_EVENTS.TASK_HOLD, (task: ITask) => {
152
+ * console.log('Task placed on hold:', task.data.interactionId);
153
+ * // Update UI to show hold state
154
+ * });
155
+ * ```
156
+ */
157
+ TASK_HOLD = "task:hold",
158
+ /**
159
+ * Triggered when a task is resumed from hold
160
+ * @example
161
+ * ```typescript
162
+ * task.on(TASK_EVENTS.TASK_RESUME, (task: ITask) => {
163
+ * console.log('Task resumed from hold:', task.data.interactionId);
164
+ * // Update UI to show active state
165
+ * });
166
+ * ```
167
+ */
168
+ TASK_RESUME = "task:resume",
169
+ /**
170
+ * Triggered when a consultation session ends
171
+ * @example
172
+ * ```typescript
173
+ * task.on(TASK_EVENTS.TASK_CONSULT_END, (task: ITask) => {
174
+ * console.log('Consultation ended:', task.data.interactionId);
175
+ * // Clean up consultation resources
176
+ * });
177
+ * ```
178
+ */
179
+ TASK_CONSULT_END = "task:consultEnd",
180
+ /**
181
+ * Triggered when a queue consultation is cancelled
182
+ * @example
183
+ * ```typescript
184
+ * task.on(TASK_EVENTS.TASK_CONSULT_QUEUE_CANCELLED, (task: ITask) => {
185
+ * console.log('Queue consultation cancelled:', task.data.interactionId);
186
+ * // Handle consultation cancellation
187
+ * });
188
+ * ```
189
+ */
190
+ TASK_CONSULT_QUEUE_CANCELLED = "task:consultQueueCancelled",
191
+ /**
192
+ * Triggered when a queue consultation fails
193
+ * @example
194
+ * ```typescript
195
+ * task.on(TASK_EVENTS.TASK_CONSULT_QUEUE_FAILED, (task: ITask) => {
196
+ * console.log('Queue consultation failed:', task.data.interactionId);
197
+ * // Handle consultation failure
198
+ * });
199
+ * ```
200
+ */
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",
210
+ /**
211
+ * Triggered when a consultation request is accepted
212
+ * @example
213
+ * ```typescript
214
+ * task.on(TASK_EVENTS.TASK_CONSULT_ACCEPTED, (task: ITask) => {
215
+ * console.log('Consultation accepted:', task.data.interactionId);
216
+ * // Begin consultation
217
+ * });
218
+ * ```
219
+ */
220
+ TASK_CONSULT_ACCEPTED = "task:consultAccepted",
221
+ /**
222
+ * Triggered when consultation is in progress
223
+ * @example
224
+ * ```typescript
225
+ * task.on(TASK_EVENTS.TASK_CONSULTING, (task: ITask) => {
226
+ * console.log('Consulting in progress:', task.data.interactionId);
227
+ * // Handle ongoing consultation
228
+ * });
229
+ * ```
230
+ */
231
+ TASK_CONSULTING = "task:consulting",
232
+ /**
233
+ * Triggered when a new consultation is created
234
+ * @example
235
+ * ```typescript
236
+ * task.on(TASK_EVENTS.TASK_CONSULT_CREATED, (task: ITask) => {
237
+ * console.log('Consultation created:', task.data.interactionId);
238
+ * // Initialize consultation
239
+ * });
240
+ * ```
241
+ */
242
+ TASK_CONSULT_CREATED = "task:consultCreated",
243
+ /**
244
+ * Triggered when a consultation is offered
245
+ * @example
246
+ * ```typescript
247
+ * task.on(TASK_EVENTS.TASK_OFFER_CONSULT, (task: ITask) => {
248
+ * console.log('Consultation offered:', task.data.interactionId);
249
+ * // Handle consultation offer
250
+ * });
251
+ * ```
252
+ */
253
+ TASK_OFFER_CONSULT = "task:offerConsult",
254
+ /**
255
+ * Triggered when a task is completed/terminated
256
+ * @example
257
+ * ```typescript
258
+ * task.on(TASK_EVENTS.TASK_END, (task: ITask) => {
259
+ * console.log('Task ended:', task.data.interactionId);
260
+ * // Clean up and finalize task
261
+ * });
262
+ * ```
263
+ */
264
+ TASK_END = "task:end",
265
+ /**
266
+ * Triggered when a task enters wrap-up state
267
+ * @example
268
+ * ```typescript
269
+ * task.on(TASK_EVENTS.TASK_WRAPUP, (task: ITask) => {
270
+ * console.log('Task in wrap-up:', task.data.interactionId);
271
+ * // Begin wrap-up process
272
+ * });
273
+ * ```
274
+ */
275
+ TASK_WRAPUP = "task:wrapup",
276
+ /**
277
+ * Triggered when task wrap-up is completed
278
+ * @example
279
+ * ```typescript
280
+ * task.on(TASK_EVENTS.TASK_WRAPPEDUP, (task: ITask) => {
281
+ * console.log('Task wrapped up:', task.data.interactionId);
282
+ * // Finalize task completion
283
+ * });
284
+ * ```
285
+ */
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",
297
+ /**
298
+ * Triggered when recording is paused
299
+ * @example
300
+ * ```typescript
301
+ * task.on(TASK_EVENTS.TASK_RECORDING_PAUSED, (task: ITask) => {
302
+ * console.log('Recording paused:', task.data.interactionId);
303
+ * // Update recording state
304
+ * });
305
+ * ```
306
+ */
307
+ TASK_RECORDING_PAUSED = "task:recordingPaused",
308
+ /**
309
+ * Triggered when recording pause attempt fails
310
+ * @example
311
+ * ```typescript
312
+ * task.on(TASK_EVENTS.TASK_RECORDING_PAUSE_FAILED, (task: ITask) => {
313
+ * console.log('Recording pause failed:', task.data.interactionId);
314
+ * // Handle pause failure
315
+ * });
316
+ * ```
317
+ */
318
+ TASK_RECORDING_PAUSE_FAILED = "task:recordingPauseFailed",
319
+ /**
320
+ * Triggered when recording is resumed
321
+ * @example
322
+ * ```typescript
323
+ * task.on(TASK_EVENTS.TASK_RECORDING_RESUMED, (task: ITask) => {
324
+ * console.log('Recording resumed:', task.data.interactionId);
325
+ * // Update recording state
326
+ * });
327
+ * ```
328
+ */
329
+ TASK_RECORDING_RESUMED = "task:recordingResumed",
330
+ /**
331
+ * Triggered when recording resume attempt fails
332
+ * @example
333
+ * ```typescript
334
+ * task.on(TASK_EVENTS.TASK_RECORDING_RESUME_FAILED, (task: ITask) => {
335
+ * console.log('Recording resume failed:', task.data.interactionId);
336
+ * // Handle resume failure
337
+ * });
338
+ * ```
339
+ */
340
+ TASK_RECORDING_RESUME_FAILED = "task:recordingResumeFailed",
341
+ /**
342
+ * Triggered when a task is rejected/unanswered
343
+ * @example
344
+ * ```typescript
345
+ * task.on(TASK_EVENTS.TASK_REJECT, (task: ITask) => {
346
+ * console.log('Task rejected:', task.data.interactionId);
347
+ * // Handle task rejection
348
+ * });
349
+ * ```
350
+ */
351
+ TASK_REJECT = "task:rejected",
352
+ /**
353
+ * Triggered when an outdial call fails
354
+ * @example
355
+ * ```typescript
356
+ * task.on(TASK_EVENTS.TASK_OUTDIAL_FAILED, (reason: string) => {
357
+ * console.log('Outdial failed:', reason);
358
+ * // Handle outdial failure
359
+ * });
360
+ * ```
361
+ */
362
+ TASK_OUTDIAL_FAILED = "task:outdialFailed",
363
+ /**
364
+ * Triggered when a task is populated with data
365
+ * @example
366
+ * ```typescript
367
+ * task.on(TASK_EVENTS.TASK_HYDRATE, (task: ITask) => {
368
+ * console.log('Task hydrated:', task.data.interactionId);
369
+ * // Process task data
370
+ * });
371
+ * ```
372
+ */
373
+ TASK_HYDRATE = "task:hydrate",
374
+ /**
375
+ * Triggered when a new contact is offered
376
+ * @example
377
+ * ```typescript
378
+ * task.on(TASK_EVENTS.TASK_OFFER_CONTACT, (task: ITask) => {
379
+ * console.log('Contact offered:', task.data.interactionId);
380
+ * // Handle contact offer
381
+ * });
382
+ * ```
383
+ */
384
+ TASK_OFFER_CONTACT = "task:offerContact",
385
+ /**
386
+ * Triggered when a task has been successfully auto-answered
387
+ * This event is emitted after the SDK automatically accepts a task due to:
388
+ * - WebRTC calls with auto-answer enabled
389
+ * - Agent-initiated outdial calls
390
+ * - Other auto-answer scenarios
391
+ * @example
392
+ * ```typescript
393
+ * task.on(TASK_EVENTS.TASK_AUTO_ANSWERED, (task: ITask) => {
394
+ * console.log('Task auto-answered:', task.data.interactionId);
395
+ * // Update UI - enable cancel button, etc.
396
+ * });
397
+ * ```
398
+ */
399
+ TASK_AUTO_ANSWERED = "task:autoAnswered",
400
+ /**
401
+ * Triggered when a conference is being established
402
+ * @example
403
+ * ```typescript
404
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_ESTABLISHING, (task: ITask) => {
405
+ * console.log('Conference establishing:', task.data.interactionId);
406
+ * // Handle conference setup in progress
407
+ * });
408
+ * ```
409
+ */
410
+ TASK_CONFERENCE_ESTABLISHING = "task:conferenceEstablishing",
411
+ /**
412
+ * Triggered when a conference is started successfully
413
+ * @example
414
+ * ```typescript
415
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_STARTED, (task: ITask) => {
416
+ * console.log('Conference started:', task.data.interactionId);
417
+ * // Handle conference start
418
+ * });
419
+ * ```
420
+ */
421
+ TASK_CONFERENCE_STARTED = "task:conferenceStarted",
422
+ /**
423
+ * Triggered when a conference fails to start
424
+ * @example
425
+ * ```typescript
426
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_FAILED, (task: ITask) => {
427
+ * console.log('Conference failed:', task.data.interactionId);
428
+ * // Handle conference failure
429
+ * });
430
+ * ```
431
+ */
432
+ TASK_CONFERENCE_FAILED = "task:conferenceFailed",
433
+ /**
434
+ * Triggered when a conference is ended successfully
435
+ * @example
436
+ * ```typescript
437
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_ENDED, (task: ITask) => {
438
+ * console.log('Conference ended:', task.data.interactionId);
439
+ * // Handle conference end
440
+ * });
441
+ * ```
442
+ */
443
+ TASK_CONFERENCE_ENDED = "task:conferenceEnded",
444
+ /**
445
+ * Triggered when a participant joins the conference
446
+ * @example
447
+ * ```typescript
448
+ * task.on(TASK_EVENTS.TASK_PARTICIPANT_JOINED, (task: ITask) => {
449
+ * console.log('Participant joined conference:', task.data.interactionId);
450
+ * // Handle participant joining
451
+ * });
452
+ * ```
453
+ */
454
+ TASK_PARTICIPANT_JOINED = "task:participantJoined",
455
+ /**
456
+ * Triggered when a participant leaves the conference
457
+ * @example
458
+ * ```typescript
459
+ * task.on(TASK_EVENTS.TASK_PARTICIPANT_LEFT, (task: ITask) => {
460
+ * console.log('Participant left conference:', task.data.interactionId);
461
+ * // Handle participant leaving
462
+ * });
463
+ * ```
464
+ */
465
+ TASK_PARTICIPANT_LEFT = "task:participantLeft",
466
+ /**
467
+ * Triggered when conference transfer is successful
468
+ * @example
469
+ * ```typescript
470
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_TRANSFERRED, (task: ITask) => {
471
+ * console.log('Conference transferred:', task.data.interactionId);
472
+ * // Handle successful conference transfer
473
+ * });
474
+ * ```
475
+ */
476
+ TASK_CONFERENCE_TRANSFERRED = "task:conferenceTransferred",
477
+ /**
478
+ * Triggered when conference transfer fails
479
+ * @example
480
+ * ```typescript
481
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_TRANSFER_FAILED, (task: ITask) => {
482
+ * console.log('Conference transfer failed:', task.data.interactionId);
483
+ * // Handle failed conference transfer
484
+ * });
485
+ * ```
486
+ */
487
+ TASK_CONFERENCE_TRANSFER_FAILED = "task:conferenceTransferFailed",
488
+ /**
489
+ * Triggered when ending a conference fails
490
+ * @example
491
+ * ```typescript
492
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_END_FAILED, (task: ITask) => {
493
+ * console.log('Conference end failed:', task.data.interactionId);
494
+ * // Handle failed conference end
495
+ * });
496
+ * ```
497
+ */
498
+ TASK_CONFERENCE_END_FAILED = "task:conferenceEndFailed",
499
+ /**
500
+ * Triggered when participant exit from conference fails
501
+ * @example
502
+ * ```typescript
503
+ * task.on(TASK_EVENTS.TASK_PARTICIPANT_LEFT_FAILED, (task: ITask) => {
504
+ * console.log('Participant failed to leave conference:', task.data.interactionId);
505
+ * // Handle failed participant exit
506
+ * });
507
+ * ```
508
+ */
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",
544
+ /**
545
+ * Triggered when a contact is merged
546
+ * @example
547
+ * ```typescript
548
+ * task.on(TASK_EVENTS.TASK_MERGED, (task: ITask) => {
549
+ * console.log('Contact merged:', task.data.interactionId);
550
+ * // Handle contact merge
551
+ * });
552
+ * ```
553
+ */
554
+ TASK_MERGED = "task:merged",
555
+ /**
556
+ * Triggered when a participant enters post-call activity state
557
+ * @example
558
+ * ```typescript
559
+ * task.on(TASK_EVENTS.TASK_POST_CALL_ACTIVITY, (task: ITask) => {
560
+ * console.log('Participant in post-call activity:', task.data.interactionId);
561
+ * // Handle post-call activity
562
+ * });
563
+ * ```
564
+ */
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",
576
+ /**
577
+ * Triggered when a campaign preview contact is offered to the agent
578
+ * @example
579
+ * ```typescript
580
+ * task.on(TASK_EVENTS.TASK_CAMPAIGN_PREVIEW_RESERVATION, (data: AgentContact) => {
581
+ * console.log('Campaign preview contact received:', data.interactionId);
582
+ * // Handle campaign preview reservation
583
+ * });
584
+ * ```
585
+ */
586
+ TASK_CAMPAIGN_PREVIEW_RESERVATION = "task:campaignPreviewReservation",
587
+ /**
588
+ * Triggered when accepting a campaign preview contact fails
589
+ * @example
590
+ * ```typescript
591
+ * task.on(TASK_EVENTS.TASK_CAMPAIGN_PREVIEW_ACCEPT_FAILED, (task: ITask) => {
592
+ * console.log('Campaign preview accept failed:', task.data.interactionId);
593
+ * // Handle accept failure
594
+ * });
595
+ * ```
596
+ */
597
+ TASK_CAMPAIGN_PREVIEW_ACCEPT_FAILED = "task:campaignPreviewAcceptFailed",
598
+ /**
599
+ * Triggered when skipping a campaign preview contact fails
600
+ * @example
601
+ * ```typescript
602
+ * task.on(TASK_EVENTS.TASK_CAMPAIGN_PREVIEW_SKIP_FAILED, (task: ITask) => {
603
+ * console.log('Campaign preview skip failed:', task.data.interactionId);
604
+ * // Handle skip failure
605
+ * });
606
+ * ```
607
+ */
608
+ TASK_CAMPAIGN_PREVIEW_SKIP_FAILED = "task:campaignPreviewSkipFailed",
609
+ /**
610
+ * Triggered when removing a campaign preview contact fails
611
+ * @example
612
+ * ```typescript
613
+ * task.on(TASK_EVENTS.TASK_CAMPAIGN_PREVIEW_REMOVE_FAILED, (task: ITask) => {
614
+ * console.log('Campaign preview remove failed:', task.data.interactionId);
615
+ * // Handle remove failure
616
+ * });
617
+ * ```
618
+ */
619
+ TASK_CAMPAIGN_PREVIEW_REMOVE_FAILED = "task:campaignPreviewRemoveFailed",
620
+ /**
621
+ * Triggered when a campaign contact is updated (e.g., after skip or remove, when the next contact is offered)
622
+ * @example
623
+ * ```typescript
624
+ * task.on(TASK_EVENTS.TASK_CAMPAIGN_CONTACT_UPDATED, (task: ITask) => {
625
+ * console.log('Campaign contact updated:', task.data.interactionId);
626
+ * // Handle updated campaign contact (e.g., display next contact)
627
+ * });
628
+ * ```
629
+ */
630
+ TASK_CAMPAIGN_CONTACT_UPDATED = "task:campaignContactUpdated"
631
+ }
632
+ /**
633
+ * Represents a customer interaction within the contact center system
634
+ * Contains comprehensive details about an ongoing customer interaction
635
+ * @public
636
+ */
637
+ export interface CallAssociatedDatum {
638
+ /** Whether the field can be edited by the agent */
639
+ agentEditable: boolean;
640
+ /** Whether the field is visible to the agent */
641
+ agentViewable: boolean;
642
+ /** Display name for the field */
643
+ displayName: string;
644
+ /** Whether the field is global */
645
+ global: boolean;
646
+ /** Whether the field is secure */
647
+ isSecure: boolean;
648
+ /** Internal field name */
649
+ name: string;
650
+ /** Whether the field is reportable */
651
+ reportable: boolean;
652
+ /** Secure key identifier */
653
+ secureKeyId: string;
654
+ /** Secure key version */
655
+ secureKeyVersion: number;
656
+ /** Data type of the field */
657
+ type: string;
658
+ /** Field value */
659
+ value: string;
660
+ }
661
+ export type CallAssociatedData = Record<string, CallAssociatedDatum>;
662
+ export type CallAssociatedDetails = Record<string, string>;
663
+ export interface FlowParameter {
664
+ /** Parameter name */
665
+ name?: string;
666
+ /** Additional qualifier */
667
+ qualifier?: string;
668
+ /** Description of the parameter */
669
+ description?: string;
670
+ /** Data type of the value */
671
+ valueDataType?: string;
672
+ /** Value associated with the parameter */
673
+ value?: string;
674
+ }
675
+ export interface InteractionParticipant {
676
+ /** Unique participant identifier */
677
+ id: string;
678
+ /** Participant type label used by backend */
679
+ pType: string;
680
+ /** Friendly participant type */
681
+ type: string;
682
+ /** Whether the participant has joined */
683
+ hasJoined: boolean;
684
+ /** Whether the participant has left */
685
+ hasLeft: boolean;
686
+ /** Whether the participant is still in pre-dial */
687
+ isInPredial: boolean;
688
+ /** Optional caller identifier */
689
+ callerId?: string | null;
690
+ /** Whether auto-answer is enabled */
691
+ autoAnswerEnabled?: boolean;
692
+ /** Backchannel/bnr details */
693
+ bnrDetails?: unknown;
694
+ /** Channel identifier for the participant */
695
+ channelId?: string;
696
+ /** Current consult state */
697
+ consultState?: string | null;
698
+ /** Timestamp when consult started */
699
+ consultTimestamp?: number | null;
700
+ /** Current participant state */
701
+ currentState?: string | null;
702
+ /** Timestamp of the current state */
703
+ currentStateTimestamp?: number | null;
704
+ /** Device call identifier */
705
+ deviceCallId?: string | null;
706
+ /** Device identifier */
707
+ deviceId?: string | null;
708
+ /** Device type (AGENT_DN, BROWSER, etc.) */
709
+ deviceType?: string | null;
710
+ /** Dial number associated with participant */
711
+ dn?: string | null;
712
+ /** Whether participant is currently consulted */
713
+ isConsulted?: boolean;
714
+ /** Whether participant offer is active */
715
+ isOffered?: boolean;
716
+ /** Whether participant is in wrap-up */
717
+ isWrapUp?: boolean;
718
+ /** Whether participant completed wrap-up */
719
+ isWrappedUp?: boolean;
720
+ /** Timestamp of when participant joined */
721
+ joinTimestamp?: number | null;
722
+ /** Last updated timestamp */
723
+ lastUpdated?: number | null;
724
+ /** Friendly name of participant */
725
+ name?: string | null;
726
+ /** Queue identifier associated with participant */
727
+ queueId?: string;
728
+ /** Queue manager identifier */
729
+ queueMgrId?: string;
730
+ /** Session identifier */
731
+ sessionId?: string;
732
+ /** Site identifier */
733
+ siteId?: string;
734
+ /** Skill identifier */
735
+ skillId?: string | null;
736
+ /** Skill name */
737
+ skillName?: string | null;
738
+ /** Skill list for participant */
739
+ skills?: string[];
740
+ /** Team identifier */
741
+ teamId?: string;
742
+ /** Team name */
743
+ teamName?: string;
744
+ /** Timestamp for wrap-up */
745
+ wrapUpTimestamp?: number | null;
746
+ /** Additional metadata */
747
+ [key: string]: unknown;
748
+ }
749
+ export type InteractionParticipants = Record<string, InteractionParticipant>;
750
+ /**
751
+ * Media entry type from interaction.media
752
+ * Used for media state tracking in consult and conference scenarios
753
+ */
754
+ export type MediaEntry = {
755
+ /** Unique identifier for the media resource */
756
+ mediaResourceId: string;
757
+ /** Type of media channel */
758
+ mediaType: MEDIA_CHANNEL;
759
+ /** Media manager handling this media */
760
+ mediaMgr: string;
761
+ /** List of participant identifiers */
762
+ participants: string[];
763
+ /** Type of media (e.g., 'mainCall', 'consult') */
764
+ mType: string;
765
+ /** Indicates if media is on hold */
766
+ isHold: boolean;
767
+ /** Timestamp when media was put on hold */
768
+ holdTimestamp: number | null;
769
+ };
770
+ export type Interaction = {
771
+ /** Indicates if the interaction is managed by Flow Control */
772
+ isFcManaged: boolean;
773
+ /** Indicates if the interaction has been terminated */
774
+ isTerminated: boolean;
775
+ /** The type of media channel for this interaction */
776
+ mediaType: MEDIA_CHANNEL;
777
+ /** List of previous virtual teams that handled this interaction */
778
+ previousVTeams: string[];
779
+ /** Current state of the interaction */
780
+ state: string;
781
+ /** Current virtual team handling the interaction */
782
+ currentVTeam: string;
783
+ /** List of participants in the interaction */
784
+ participants: InteractionParticipants;
785
+ /** Detailed call associated data */
786
+ callAssociatedData?: CallAssociatedData;
787
+ /** Simplified call associated key/value pairs */
788
+ callAssociatedDetails?: CallAssociatedDetails;
789
+ /** Unique identifier for the interaction */
790
+ interactionId: string;
791
+ /** Organization identifier */
792
+ orgId: string;
793
+ /** Timestamp when the interaction was created */
794
+ createdTimestamp?: number;
795
+ /** Indicates if wrap-up assistance is enabled */
796
+ isWrapUpAssist?: boolean;
797
+ /** Identifier of parent interaction if applicable */
798
+ parentInteractionId?: string;
799
+ /** Indicates if media is forked for this interaction */
800
+ isMediaForked?: boolean;
801
+ /** Retroactive flow properties returned by backend */
802
+ flowProperties?: Record<string, unknown> | null;
803
+ /** Media specific properties returned by backend */
804
+ mediaProperties?: Record<string, unknown> | null;
805
+ /**
806
+ * Detailed call processing information and metadata.
807
+ * Mirrors the callProcessingDetails section described in Webex Contact Center Agent Contact payloads.
808
+ */
809
+ callProcessingDetails: {
810
+ /** Name of the Queue Manager handling this interaction */
811
+ QMgrName: string;
812
+ /** Indicates if the task should be self-serviced */
813
+ taskToBeSelfServiced: string;
814
+ /** Automatic Number Identification (caller's number) */
815
+ ani: string;
816
+ /** Display version of the ANI */
817
+ displayAni: string;
818
+ /** Dialed Number Identification Service number */
819
+ dnis: string;
820
+ /** Tenant identifier */
821
+ tenantId: string;
822
+ /** Queue identifier */
823
+ QueueId: string;
824
+ /** Virtual team identifier */
825
+ vteamId: string;
826
+ /** Agent capability for pause/resume on this interaction */
827
+ pauseResumeEnabled?: boolean;
828
+ /** Duration of pause in seconds */
829
+ pauseDuration?: string;
830
+ /** Legacy pause indicator (recordInProgress=false is the active pause signal) */
831
+ isPaused?: boolean;
832
+ /** Recording is actively capturing audio right now */
833
+ recordInProgress?: boolean;
834
+ /** Recording was started for this interaction (may be paused) */
835
+ recordingStarted?: boolean;
836
+ /** Customer geographic region */
837
+ customerRegion?: string;
838
+ /** Flow tag identifier */
839
+ flowTagId?: string;
840
+ /** Indicates if Consult to Queue is in progress */
841
+ ctqInProgress?: boolean;
842
+ /** Indicates if outdial transfer to queue is enabled */
843
+ outdialTransferToQueueEnabled?: boolean;
844
+ /** IVR conversation transcript */
845
+ convIvrTranscript?: string;
846
+ /** Customer's name */
847
+ customerName: string;
848
+ /** Name of the virtual team */
849
+ virtualTeamName: string;
850
+ /** RONA (Redirection on No Answer) timeout in seconds */
851
+ ronaTimeout: string;
852
+ /** Category of the interaction */
853
+ category: string;
854
+ /** Reason for the interaction */
855
+ reason: string;
856
+ /** Source number for the interaction */
857
+ sourceNumber: string;
858
+ /** Source page that initiated the interaction */
859
+ sourcePage: string;
860
+ /** Application user identifier */
861
+ appUser: string;
862
+ /** Customer's contact number */
863
+ customerNumber: string;
864
+ /** Code indicating the reason for interaction */
865
+ reasonCode: string;
866
+ /** Path taken through the IVR system */
867
+ IvrPath: string;
868
+ /** Identifier for the IVR path */
869
+ pathId: string;
870
+ /** Email address or contact point that initiated the interaction */
871
+ fromAddress: string;
872
+ /** Identifier of the parent interaction for related interactions */
873
+ parentInteractionId?: string;
874
+ /** Identifier of the child interaction for related interactions */
875
+ childInteractionId?: string;
876
+ /** Type of relationship between parent and child interactions */
877
+ relationshipType?: string;
878
+ /** ANI of the parent interaction */
879
+ parent_ANI?: string;
880
+ /** DNIS of the parent interaction */
881
+ parent_DNIS?: string;
882
+ /** Indicates if the consulted destination agent has joined */
883
+ consultDestinationAgentJoined?: boolean | string;
884
+ /** Name of the destination agent for consultation */
885
+ consultDestinationAgentName?: string;
886
+ /** DN of the parent interaction's agent */
887
+ parent_Agent_DN?: string;
888
+ /** Name of the parent interaction's agent */
889
+ parent_Agent_Name?: string;
890
+ /** Team name of the parent interaction's agent */
891
+ parent_Agent_TeamName?: string;
892
+ /** Indicates if the interaction is in conference mode */
893
+ isConferencing?: string;
894
+ /** Type of monitoring being performed */
895
+ monitorType?: string;
896
+ /** Name of the workflow being executed */
897
+ workflowName?: string;
898
+ /** Identifier of the workflow */
899
+ workflowId?: string;
900
+ /** Indicates if monitoring is in invisible mode */
901
+ monitoringInvisibleMode?: string;
902
+ /** Identifier for the monitoring request */
903
+ monitoringRequestId?: string;
904
+ /** Timeout for participant invitation */
905
+ participantInviteTimeout?: string;
906
+ /** Filename for music on hold */
907
+ mohFileName?: string;
908
+ /** Flag for continuing recording during transfer */
909
+ CONTINUE_RECORDING_ON_TRANSFER?: string;
910
+ /** Entry point identifier */
911
+ EP_ID?: string;
912
+ /** Type of routing being used */
913
+ ROUTING_TYPE?: string;
914
+ /** Events registered with Flow Control Engine */
915
+ fceRegisteredEvents?: string;
916
+ /** Indicates if the interaction is parked */
917
+ isParked?: string;
918
+ /** Priority level of the interaction */
919
+ priority?: string;
920
+ /** Identifier for the routing strategy */
921
+ routingStrategyId?: string;
922
+ /** Current state of monitoring */
923
+ monitoringState?: string;
924
+ /** Indicates if blind transfer is in progress */
925
+ BLIND_TRANSFER_IN_PROGRESS?: boolean;
926
+ /** Desktop view configuration for Flow Control */
927
+ fcDesktopView?: string;
928
+ /** Agent ID who initiated the outdial call */
929
+ outdialAgentId?: string;
930
+ /** Indicates if the customer has left the call during an active consult */
931
+ hasCustomerLeft?: string;
932
+ /** Indicates if the skip action is disabled for campaign preview contacts */
933
+ campaignPreviewSkipDisabled?: string;
934
+ /** Indicates if the remove action is disabled for campaign preview contacts */
935
+ campaignPreviewRemoveDisabled?: string;
936
+ /** Auto-action to perform when campaign preview offer times out (ACCEPT, SKIP, REMOVE) */
937
+ campaignPreviewAutoAction?: string;
938
+ /** Timestamp (ms) when the campaign preview offer expires */
939
+ campaignPreviewOfferTimeout?: string;
940
+ };
941
+ /** Main interaction identifier for related interactions */
942
+ mainInteractionId?: string;
943
+ /** Timestamp when interaction entered queue */
944
+ queuedTimestamp?: number | null;
945
+ /** Media-specific information for the interaction */
946
+ media: Record<string, MediaEntry>;
947
+ /** Owner of the interaction */
948
+ owner: string;
949
+ /** Primary media channel for the interaction */
950
+ mediaChannel: string;
951
+ /** Direction information for the contact */
952
+ contactDirection: {
953
+ type: string;
954
+ };
955
+ /** Type of outbound interaction */
956
+ outboundType?: string;
957
+ /** Optional workflow manager identifier */
958
+ workflowManager?: string | null;
959
+ /** Parameters passed through the call flow */
960
+ callFlowParams?: Record<string, FlowParameter>;
961
+ };
962
+ /**
963
+ * Task payload mirroring the Agent Contact event payload from Webex Contact Center
964
+ * (developer.webex.com). Arrives on AGENT_* websocket events and is the source of truth
965
+ * for UI/state machine updates.
966
+ * @public
967
+ */
968
+ export type RealtimeTranscription = {
969
+ agentId: string;
970
+ orgId: string;
971
+ notifType: string;
972
+ notifDetails: {
973
+ actionEvent: string;
974
+ };
975
+ data: {
976
+ role: 'AGENT' | 'CALLER';
977
+ utteranceId: string;
978
+ conversationId: string;
979
+ publishTimestamp: number;
980
+ messageId: string;
981
+ isFinal: boolean;
982
+ languageCode: string;
983
+ orgId: string;
984
+ content: string;
985
+ };
986
+ };
987
+ export type TaskData = {
988
+ /** Primary media resource identifier for the active leg (matches interaction.media[].mediaResourceId) */
989
+ mediaResourceId: string;
990
+ /** Agent event name from the websocket stream (e.g., AGENT_CONTACT_ASSIGNED) */
991
+ eventType: string;
992
+ /** Timestamp when the event occurred */
993
+ eventTime?: number;
994
+ /** Identifier of the agent handling the task */
995
+ agentId: string;
996
+ /** Identifier of the destination agent for transfers/consults */
997
+ destAgentId: string;
998
+ /** Unique tracking identifier for the task */
999
+ trackingId: string;
1000
+ /** Media resource identifier for consultation leg when present */
1001
+ consultMediaResourceId: string;
1002
+ /** Detailed interaction information */
1003
+ interaction: Interaction;
1004
+ /** Unique identifier for the participant */
1005
+ participantId?: string;
1006
+ /** Indicates if the task is from the owner */
1007
+ fromOwner?: boolean;
1008
+ /** Indicates if the task is to the owner */
1009
+ toOwner?: boolean;
1010
+ /** Identifier for child interaction in consult/transfer scenarios */
1011
+ childInteractionId?: string;
1012
+ /** Interaction/contact identifier from backend (same as interaction.interactionId) */
1013
+ interactionId: string;
1014
+ /** Organization identifier */
1015
+ orgId: string;
1016
+ /** Current owner of the task */
1017
+ owner: string;
1018
+ /** Queue manager handling the task */
1019
+ queueMgr: string;
1020
+ /** Name of the queue where task is queued */
1021
+ queueName?: string;
1022
+ /** Task/interaction type returned by the platform (routing/monitoring/etc.) */
1023
+ type: string;
1024
+ /** Timeout value for RONA (Redirection on No Answer) in seconds */
1025
+ ronaTimeout?: number;
1026
+ /** Indicates if the task is in consultation state */
1027
+ isConsulted?: boolean;
1028
+ /** Indicates if the task is in conference state */
1029
+ isConferencing: boolean;
1030
+ /** Indicates if a conference is currently in progress (2+ active agents) */
1031
+ isConferenceInProgress?: boolean;
1032
+ /** Identifier of agent who last updated the task */
1033
+ updatedBy?: string;
1034
+ /** Type of destination for transfer/consult */
1035
+ destinationType?: string;
1036
+ /** Indicates if the task was automatically resumed */
1037
+ autoResumed?: boolean;
1038
+ /** Code indicating the reason for an action */
1039
+ reasonCode?: string | number;
1040
+ /** Description of the reason for an action */
1041
+ reason?: string;
1042
+ /** Identifier of the consulting agent */
1043
+ consultingAgentId?: string;
1044
+ /** Unique identifier for the task */
1045
+ taskId?: string;
1046
+ /** Task details including state and media information */
1047
+ task?: Interaction;
1048
+ /** Unique identifier for monitoring offered events */
1049
+ id?: string;
1050
+ /** Indicates if the web call is muted */
1051
+ isWebCallMute?: boolean;
1052
+ /** Identifier for reservation interaction */
1053
+ reservationInteractionId?: string;
1054
+ /** Identifier for the reserved agent channel (used for campaign tasks) */
1055
+ reservedAgentChannelId?: string;
1056
+ /** Indicates if wrap-up is required for this task */
1057
+ wrapUpRequired?: boolean;
1058
+ /** SDK-internal: skip task:outdialFailed when non-wxApp agent-terminated outdial still needs wrapup */
1059
+ suppressOutdialFailedPopup?: boolean;
1060
+ /**
1061
+ * Current consultation status derived from state machine
1062
+ * Values: CONSULT_INITIATED, CONSULT_ACCEPTED, BEING_CONSULTED,
1063
+ * BEING_CONSULTED_ACCEPTED, CONNECTED, CONFERENCE, CONSULT_COMPLETED
1064
+ */
1065
+ consultStatus?: string;
1066
+ /**
1067
+ * Indicates if consultation is in progress (state machine: CONSULTING)
1068
+ */
1069
+ isConsultInProgress?: boolean;
1070
+ /**
1071
+ * Indicates if the task is incoming for the active agent
1072
+ */
1073
+ isIncomingTask?: boolean;
1074
+ /**
1075
+ * Indicates if the task is on hold (state machine: HELD)
1076
+ */
1077
+ isOnHold?: boolean;
1078
+ /**
1079
+ * Indicates if customer is currently in the call
1080
+ * Derived from participants in main media
1081
+ */
1082
+ isCustomerInCall?: boolean;
1083
+ /**
1084
+ * Count of conference participants (agents only)
1085
+ * Used for determining if max participants reached
1086
+ */
1087
+ conferenceParticipantsCount?: number;
1088
+ /**
1089
+ * Indicates if this is a secondary agent (consulted party)
1090
+ */
1091
+ isSecondaryAgent?: boolean;
1092
+ /**
1093
+ * Indicates if this is a secondary EP-DN agent (telephony consult to external)
1094
+ */
1095
+ isSecondaryEpDnAgent?: boolean;
1096
+ /**
1097
+ * Task state for MPC (Multi-Party Conference) scenarios
1098
+ * Maps participant consultState to task state
1099
+ */
1100
+ mpcState?: string;
1101
+ /** Indicates if auto-answer is in progress for this task */
1102
+ isAutoAnswering?: boolean;
1103
+ /** Indicates if wrap-up is required for this task */
1104
+ agentsPendingWrapUp?: string[];
1105
+ };
1106
+ export type TaskUIControlState = {
1107
+ isVisible: boolean;
1108
+ isEnabled: boolean;
1109
+ };
1110
+ /**
1111
+ * UI control representation for a single interaction leg.
1112
+ */
1113
+ export type InteractionUIControls = {
1114
+ accept: TaskUIControlState;
1115
+ decline: TaskUIControlState;
1116
+ hold: TaskUIControlState;
1117
+ transfer: TaskUIControlState;
1118
+ consult: TaskUIControlState;
1119
+ end: TaskUIControlState;
1120
+ recording: TaskUIControlState;
1121
+ mute: TaskUIControlState;
1122
+ consultTransfer: TaskUIControlState;
1123
+ endConsult: TaskUIControlState;
1124
+ conference: TaskUIControlState;
1125
+ exitConference: TaskUIControlState;
1126
+ transferConference: TaskUIControlState;
1127
+ mergeToConference: TaskUIControlState;
1128
+ wrapup: TaskUIControlState;
1129
+ switch: TaskUIControlState;
1130
+ keypad?: TaskUIControlState;
1131
+ };
1132
+ /** Options for {@link ITask.toggleMute} — wxApp engaged calls use `muted` for target state. */
1133
+ export type TaskToggleMuteOptions = {
1134
+ muted?: boolean;
1135
+ lineOwnerId?: string;
1136
+ };
1137
+ /** Options for {@link ITask.transmitDtmf} — wxApp engaged in-call DTMF. */
1138
+ export type TaskTransmitDtmfOptions = {
1139
+ dtmf: string;
1140
+ lineOwnerId?: string;
1141
+ };
1142
+ export type TaskUILeg = 'main' | 'consult';
1143
+ /**
1144
+ * UI controls surfaced to task consumers.
1145
+ * Consumers should read controls from the per-leg surfaces and use `activeLeg`
1146
+ * to determine which one is currently interactive.
1147
+ */
1148
+ export type TaskUIControls = {
1149
+ main: InteractionUIControls;
1150
+ consult: InteractionUIControls;
1151
+ activeLeg: TaskUILeg;
1152
+ /**
1153
+ * Ordered destination categories available for each action.
1154
+ * The first category is the default for consumers that render a destination picker.
1155
+ */
1156
+ consultTransferDestinations: {
1157
+ consult: ConsultTransferDestinationType[];
1158
+ transfer: ConsultTransferDestinationType[];
1159
+ };
1160
+ };
1161
+ /**
1162
+ * Helper class for managing task action control state
1163
+ * Tracks visibility and enabled state for task actions that can be executed
1164
+ * @public
1165
+ */
1166
+ /**
1167
+ * Type representing an agent contact message within the contact center system
1168
+ * Contains comprehensive interaction and task related details for agent operations
1169
+ * @public
1170
+ */
1171
+ export type AgentContact = Msg<{
1172
+ /** Unique identifier for the media resource */
1173
+ mediaResourceId: string;
1174
+ /** Type of the event (e.g., 'AgentDesktopMessage') */
1175
+ eventType: string;
1176
+ /** Timestamp when the event occurred */
1177
+ eventTime?: number;
1178
+ /** Unique identifier of the agent handling the contact */
1179
+ agentId: string;
1180
+ /** Identifier of the destination agent for transfers/consults */
1181
+ destAgentId: string;
1182
+ /** Unique tracking identifier for the contact */
1183
+ trackingId: string;
1184
+ /** Media resource identifier for consult operations */
1185
+ consultMediaResourceId: string;
1186
+ /** Detailed interaction information including media and participant data */
1187
+ interaction: Interaction;
1188
+ /** Unique identifier for the participant */
1189
+ participantId?: string;
1190
+ /** Indicates if the message is from the owner of the interaction */
1191
+ fromOwner?: boolean;
1192
+ /** Indicates if the message is to the owner of the interaction */
1193
+ toOwner?: boolean;
1194
+ /** Identifier for child interaction in case of consult/transfer */
1195
+ childInteractionId?: string;
1196
+ /** Unique identifier for the interaction */
1197
+ interactionId: string;
1198
+ /** Organization identifier */
1199
+ orgId: string;
1200
+ /** Current owner of the interaction */
1201
+ owner: string;
1202
+ /** Queue manager handling the interaction */
1203
+ queueMgr: string;
1204
+ /** Name of the queue where interaction is queued */
1205
+ queueName?: string;
1206
+ /** Type of the contact/interaction */
1207
+ type: string;
1208
+ /** Timeout value for RONA (Redirection on No Answer) in seconds */
1209
+ ronaTimeout?: number;
1210
+ /** Indicates if the interaction is in consult state */
1211
+ isConsulted?: boolean;
1212
+ /** Indicates if the interaction is in conference state */
1213
+ isConferencing: boolean;
1214
+ /** Identifier of the agent who last updated the interaction */
1215
+ updatedBy?: string;
1216
+ /** Type of destination for transfer/consult */
1217
+ destinationType?: string;
1218
+ /** Indicates if the interaction was automatically resumed */
1219
+ autoResumed?: boolean;
1220
+ /** Code indicating the reason for an action */
1221
+ reasonCode?: string | number;
1222
+ /** Description of the reason for an action */
1223
+ reason?: string;
1224
+ /** Identifier of the consulting agent */
1225
+ consultingAgentId?: string;
1226
+ /** Unique identifier for the task */
1227
+ taskId?: string;
1228
+ /** Task details including media and state information */
1229
+ task?: Interaction;
1230
+ /** Identifier of the supervisor monitoring the interaction */
1231
+ supervisorId?: string;
1232
+ /** Type of monitoring (e.g., 'SILENT', 'BARGE_IN') */
1233
+ monitorType?: string;
1234
+ /** Dial number of the supervisor */
1235
+ supervisorDN?: string;
1236
+ /** Unique identifier for monitoring offered events */
1237
+ id?: string;
1238
+ /** Indicates if the web call is muted */
1239
+ isWebCallMute?: boolean;
1240
+ /** Identifier for reservation interaction */
1241
+ reservationInteractionId?: string;
1242
+ /** Identifier for the reserved agent channel */
1243
+ reservedAgentChannelId?: string;
1244
+ /** Current monitoring state information */
1245
+ monitoringState?: {
1246
+ /** Type of monitoring state */
1247
+ type: string;
1248
+ };
1249
+ /** Name of the supervisor monitoring the interaction */
1250
+ supervisorName?: string;
1251
+ }>;
1252
+ /**
1253
+ * Information about a virtual team in the contact center
1254
+ * @ignore
1255
+ */
1256
+ export type VTeam = {
1257
+ /** Profile ID of the agent in the virtual team */
1258
+ agentProfileId: string;
1259
+ /** Session ID of the agent in the virtual team */
1260
+ agentSessionId: string;
1261
+ /** Type of channel handled by the virtual team */
1262
+ channelType: string;
1263
+ /** Type of the virtual team */
1264
+ type: string;
1265
+ /** Optional tracking identifier */
1266
+ trackingId?: string;
1267
+ };
1268
+ /**
1269
+ * Detailed information about a virtual team configuration
1270
+ * @ignore
1271
+ */
1272
+ export type VteamDetails = {
1273
+ /** Name of the virtual team */
1274
+ name: string;
1275
+ /** Type of channel handled by the virtual team */
1276
+ channelType: string;
1277
+ /** Unique identifier for the virtual team */
1278
+ id: string;
1279
+ /** Type of the virtual team */
1280
+ type: string;
1281
+ /** ID of the analyzer associated with the team */
1282
+ analyzerId: string;
1283
+ };
1284
+ /**
1285
+ * Response type for successful virtual team operations
1286
+ * Contains details about virtual teams and their capabilities
1287
+ * @ignore
1288
+ */
1289
+ export type VTeamSuccess = Msg<{
1290
+ /** Response data containing team information */
1291
+ data: {
1292
+ /** List of virtual team details */
1293
+ vteamList: Array<VteamDetails>;
1294
+ /** Whether queue consultation is allowed */
1295
+ allowConsultToQueue: boolean;
1296
+ };
1297
+ /** Method name from JavaScript */
1298
+ jsMethod: string;
1299
+ /** Data related to the call */
1300
+ callData: string;
1301
+ /** Session ID of the agent */
1302
+ agentSessionId: string;
1303
+ }>;
1304
+ /**
1305
+ * Parameters for putting a task on hold or resuming from hold
1306
+ * @public
1307
+ */
1308
+ export type HoldResumePayload = {
1309
+ /** Unique identifier for the media resource to hold/resume */
1310
+ mediaResourceId: string;
1311
+ };
1312
+ /**
1313
+ * Parameters for resuming a task's recording
1314
+ * @public
1315
+ */
1316
+ export type ResumeRecordingPayload = {
1317
+ /** Indicates if the recording was automatically resumed */
1318
+ autoResumed: boolean;
1319
+ };
1320
+ /**
1321
+ * Parameters for transferring a task to another destination
1322
+ * @public
1323
+ */
1324
+ export type TransferPayLoad = {
1325
+ /** Destination identifier where the task will be transferred to */
1326
+ to: string;
1327
+ /** Type of the destination (queue, agent, etc.) */
1328
+ destinationType: DestinationType;
1329
+ };
1330
+ /**
1331
+ * Parameters for initiating a consultative transfer
1332
+ * @public
1333
+ */
1334
+ export type ConsultTransferPayLoad = {
1335
+ /** Destination identifier for the consultation transfer */
1336
+ to: string;
1337
+ /** Type of the consultation transfer destination */
1338
+ destinationType: ConsultTransferDestinationType;
1339
+ };
1340
+ /**
1341
+ * Parameters for initiating a consultation with another agent or queue
1342
+ * @public
1343
+ */
1344
+ export type ConsultPayload = {
1345
+ /** Destination identifier for the consultation */
1346
+ to: string | undefined;
1347
+ /** Type of the consultation destination (agent, queue, etc.) */
1348
+ destinationType: DestinationType;
1349
+ /** Whether to hold other participants during consultation (always true) */
1350
+ holdParticipants?: boolean;
1351
+ };
1352
+ /**
1353
+ * Parameters for ending a consultation task
1354
+ * @public
1355
+ */
1356
+ export type ConsultEndPayload = {
1357
+ /** Indicates if this is a consultation operation */
1358
+ isConsult: boolean;
1359
+ /** Indicates if this involves a secondary entry point or DN agent */
1360
+ isSecondaryEpDnAgent?: boolean;
1361
+ /** Optional queue identifier for the consultation */
1362
+ queueId?: string;
1363
+ /** Identifier of the task being consulted */
1364
+ taskId: string;
1365
+ };
1366
+ /**
1367
+ * Parameters for transferring a task to another destination
1368
+ * @public
1369
+ */
1370
+ export type TransferPayload = {
1371
+ /** Destination identifier where the task will be transferred */
1372
+ to: string | undefined;
1373
+ /** Type of the transfer destination */
1374
+ destinationType: DestinationType;
1375
+ };
1376
+ /**
1377
+ * Options for configuring transfer behavior
1378
+ * @public
1379
+ */
1380
+ export type TransferOptions = {
1381
+ /** Additional transfer configuration options */
1382
+ [key: string]: unknown;
1383
+ };
1384
+ /**
1385
+ * API payload for ending a consultation
1386
+ * This is the actual payload that is sent to the developer API
1387
+ * @public
1388
+ */
1389
+ export type ConsultEndAPIPayload = {
1390
+ /** Optional identifier of the queue involved in the consultation */
1391
+ queueId?: string;
1392
+ };
1393
+ /**
1394
+ * Data required for consulting and conferencing operations
1395
+ * @public
1396
+ */
1397
+ export type ConsultConferenceData = {
1398
+ /** Identifier of the agent initiating consult/conference */
1399
+ agentId?: string;
1400
+ /** Target destination for the consult/conference */
1401
+ to: string | undefined;
1402
+ /** Type of destination (e.g., 'agent', 'queue') */
1403
+ destinationType: string;
1404
+ };
1405
+ /**
1406
+ * Parameters required for cancelling a consult to queue operation
1407
+ * @public
1408
+ */
1409
+ export type cancelCtq = {
1410
+ /** Identifier of the agent cancelling the CTQ */
1411
+ agentId: string;
1412
+ /** Identifier of the queue where consult was initiated */
1413
+ queueId: string;
1414
+ };
1415
+ /**
1416
+ * Parameters required for declining a task
1417
+ * @public
1418
+ */
1419
+ export type declinePayload = {
1420
+ /** Identifier of the media resource to decline */
1421
+ mediaResourceId: string;
1422
+ };
1423
+ /**
1424
+ * Parameters for wrapping up a task with relevant completion details
1425
+ * @public
1426
+ */
1427
+ export type WrapupPayLoad = {
1428
+ /** The reason provided for wrapping up the task */
1429
+ wrapUpReason: string;
1430
+ /** Auxiliary code identifier associated with the wrap-up state */
1431
+ auxCodeId: string;
1432
+ };
1433
+ /**
1434
+ * Configuration parameters for initiating outbound dialer tasks
1435
+ * @public
1436
+ */
1437
+ export type DialerPayload = {
1438
+ /** An entryPointId for respective task */
1439
+ entryPointId: string;
1440
+ /** A valid customer DN, on which the response is expected, maximum length 36 characters */
1441
+ destination: string;
1442
+ /** The direction of the call */
1443
+ direction: 'OUTBOUND';
1444
+ /** Schema-free data tuples to pass specific data based on outboundType (max 30 tuples) */
1445
+ attributes: {
1446
+ [key: string]: string;
1447
+ };
1448
+ /** The media type for the request */
1449
+ mediaType: 'telephony' | 'chat' | 'social' | 'email';
1450
+ /** The outbound type for the task */
1451
+ outboundType: 'OUTDIAL' | 'CALLBACK' | 'EXECUTE_FLOW';
1452
+ /** The Outdial ANI number that will be used while making a call to the customer. */
1453
+ origin: string;
1454
+ };
1455
+ /**
1456
+ * Payload for campaign preview contact operations (accept, skip, remove)
1457
+ * @public
1458
+ */
1459
+ export type PreviewContactPayload = {
1460
+ /** The interaction ID from the campaign reservation */
1461
+ interactionId: string;
1462
+ /** The campaign name (not a UUID). Available from the reservation event at
1463
+ * `task.data.interaction.callProcessingDetails.campaignId` or `task.data.campaignId`. */
1464
+ campaignId: string;
1465
+ };
1466
+ /**
1467
+ * Data structure for cleaning up contact resources
1468
+ * @public
1469
+ */
1470
+ export type ContactCleanupData = {
1471
+ /** Type of cleanup operation being performed */
1472
+ type: string;
1473
+ /** Organization identifier where cleanup is occurring */
1474
+ orgId: string;
1475
+ /** Identifier of the agent associated with the contacts */
1476
+ agentId: string;
1477
+ /** Detailed data about the cleanup operation */
1478
+ data: {
1479
+ /** Type of event that triggered the cleanup */
1480
+ eventType: string;
1481
+ /** Identifier of the interaction being cleaned up */
1482
+ interactionId: string;
1483
+ /** Organization identifier */
1484
+ orgId: string;
1485
+ /** Media manager handling the cleanup */
1486
+ mediaMgr: string;
1487
+ /** Tracking identifier for the cleanup operation */
1488
+ trackingId: string;
1489
+ /** Type of media being cleaned up */
1490
+ mediaType: string;
1491
+ /** Optional destination information */
1492
+ destination?: string;
1493
+ /** Whether this is a broadcast cleanup */
1494
+ broadcast: boolean;
1495
+ /** Type of cleanup being performed */
1496
+ type: string;
1497
+ };
1498
+ };
1499
+ /**
1500
+ * Boolean-like fields in callProcessingDetails that may arrive as strings.
1501
+ * Used by taskDataNormalizer to coerce payloads to actual booleans.
1502
+ */
1503
+ export type CallProcessingBooleanKey = 'recordingStarted' | 'recordInProgress' | 'isPaused' | 'pauseResumeEnabled' | 'ctqInProgress' | 'outdialTransferToQueueEnabled' | 'taskToBeSelfServiced' | 'CONTINUE_RECORDING_ON_TRANSFER' | 'isParked' | 'participantInviteTimeout' | 'checkAgentAvailability';
1504
+ /**
1505
+ * Interaction-level boolean fields that may arrive as strings from backend payloads.
1506
+ */
1507
+ export type InteractionBooleanKey = 'isFcManaged' | 'isMediaForked' | 'isTerminated';
1508
+ /**
1509
+ * Participant boolean fields that may arrive as strings and need normalization.
1510
+ */
1511
+ export type ParticipantBooleanKey = 'autoAnswerEnabled' | 'hasJoined' | 'hasLeft' | 'isConsulted' | 'isInPredial' | 'isOffered' | 'isWrapUp' | 'isWrappedUp';
1512
+ /**
1513
+ * Response type for task public methods
1514
+ * Can be an {@link AgentContact} object containing updated task state,
1515
+ * an Error in case of failure, or void for operations that don't return data
1516
+ * @public
1517
+ */
1518
+ export type TaskResponse = AgentContact | Error | void;
1519
+ /**
1520
+ * Request payload for removing a supported participant from an active conference.
1521
+ * @public
1522
+ */
1523
+ export type DropConferenceParticipantPayload = {
1524
+ /** Participant identifier supplied by the current task roster. */
1525
+ participantId: string;
1526
+ };
1527
+ /**
1528
+ * Payload shape used by consult conference helper utilities.
1529
+ */
1530
+ export type consultConferencePayloadData = {
1531
+ agentId?: string;
1532
+ destinationType?: string;
1533
+ destAgentId?: string;
1534
+ };
1535
+ /**
1536
+ * Minimal event-emitter contract exposed to SDK consumers.
1537
+ * Defined here so that consumers do NOT need `@types/node` in their tsconfig.
1538
+ * The runtime Task class still extends Node's EventEmitter (via ampersand-events),
1539
+ * which satisfies this interface at runtime.
1540
+ * @public
1541
+ */
1542
+ export interface IEventEmitter {
1543
+ on(event: string, listener: (...args: any[]) => void): this;
1544
+ off(event: string, listener: (...args: any[]) => void): this;
1545
+ once(event: string, listener: (...args: any[]) => void): this;
1546
+ emit(event: string, ...args: any[]): boolean;
1547
+ }
1548
+ /**
1549
+ * Interface for managing task-related operations in the contact center
1550
+ * Extends IEventEmitter to support event-driven task updates
1551
+ */
1552
+ export interface ITask extends IEventEmitter {
1553
+ /**
1554
+ * Event data received in the Contact Center events.
1555
+ * Contains detailed task information including interaction details, media resources,
1556
+ * and participant data as defined in {@link TaskData}
1557
+ */
1558
+ data: TaskData;
1559
+ /**
1560
+ * Map associating tasks with their corresponding call identifiers.
1561
+ */
1562
+ webCallMap: Record<TaskId, CallId>;
1563
+ /**
1564
+ * Auto-wrapup timer for the task
1565
+ * This is used to automatically wrap up tasks after a specified duration
1566
+ * as defined in {@link AutoWrapup}
1567
+ */
1568
+ autoWrapup?: AutoWrapup;
1569
+ /**
1570
+ * Latest UI controls derived from the state machine.
1571
+ * Each control has `isVisible` and `isEnabled` flags computed from current task state.
1572
+ * Subscribe to {@link TASK_EVENTS.TASK_UI_CONTROLS_UPDATED} for change notifications.
1573
+ */
1574
+ readonly uiControls: TaskUIControls;
1575
+ /**
1576
+ * Current wxApp mute state for engaged telephony (Voice tasks only).
1577
+ */
1578
+ getWxAppMuted?(): boolean;
1579
+ /**
1580
+ * Re-seed wxApp mute from GET telephony/calls/{callId}. Resolves to muted state when known.
1581
+ */
1582
+ syncWxAppMuteFromCallDetails?(): Promise<boolean | undefined>;
1583
+ state?: any;
1584
+ /**
1585
+ * Cancels the auto-wrapup timer for the task.
1586
+ * This method stops the auto-wrapup process if it is currently active.
1587
+ * Note: This is supported only in single session mode. Not supported in multi-session mode.
1588
+ * @returns void
1589
+ */
1590
+ cancelAutoWrapupTimer(): void;
1591
+ /**
1592
+ * Deregisters all web call event listeners.
1593
+ * Used when cleaning up task resources.
1594
+ * @ignore
1595
+ */
1596
+ unregisterWebCallListeners(): void;
1597
+ /**
1598
+ * Updates the task data with new information
1599
+ * @param newData - Updated task data to apply, must conform to {@link TaskData} structure
1600
+ * @returns Updated task instance
1601
+ * @ignore
1602
+ */
1603
+ updateTaskData(newData: TaskData): void;
1604
+ /**
1605
+ * Answers or accepts an incoming task.
1606
+ * Once accepted, the task will be assigned to the agent and trigger a {@link TASK_EVENTS.TASK_ASSIGNED} event.
1607
+ * The response will contain updated agent contact information as defined in {@link AgentContact}.
1608
+ * @returns Promise<TaskResponse>
1609
+ * @example
1610
+ * ```typescript
1611
+ * await task.accept();
1612
+ * ```
1613
+ */
1614
+ accept(): Promise<TaskResponse>;
1615
+ /**
1616
+ * Declines an incoming task for Browser Login
1617
+ * @returns Promise<TaskResponse>
1618
+ * @example
1619
+ * ```typescript
1620
+ * await task.decline();
1621
+ * ```
1622
+ */
1623
+ decline(): Promise<TaskResponse>;
1624
+ /**
1625
+ * Places the current task on hold.
1626
+ * @param mediaResourceId - Optional media resource ID to use for the hold operation. If not provided, uses the task's current mediaResourceId
1627
+ * @returns Promise<TaskResponse>
1628
+ * @example
1629
+ * ```typescript
1630
+ * // Hold with default mediaResourceId
1631
+ * await task.hold();
1632
+ *
1633
+ * // Hold with custom mediaResourceId
1634
+ * await task.hold('custom-media-resource-id');
1635
+ * ```
1636
+ */
1637
+ hold(mediaResourceId?: string): Promise<TaskResponse>;
1638
+ /**
1639
+ * Resumes a task that was previously on hold.
1640
+ * @param mediaResourceId - Optional media resource ID to use for the resume operation. If not provided, uses the task's current mediaResourceId from interaction media
1641
+ * @returns Promise<TaskResponse>
1642
+ * @example
1643
+ * ```typescript
1644
+ * // Resume with default mediaResourceId
1645
+ * await task.resume();
1646
+ *
1647
+ * // Resume with custom mediaResourceId
1648
+ * await task.resume('custom-media-resource-id');
1649
+ * ```
1650
+ */
1651
+ resume(mediaResourceId?: string): Promise<TaskResponse>;
1652
+ /**
1653
+ * Ends/terminates the current task.
1654
+ * @returns Promise<TaskResponse>
1655
+ * @example
1656
+ * ```typescript
1657
+ * await task.end();
1658
+ * ```
1659
+ */
1660
+ end(): Promise<TaskResponse>;
1661
+ /**
1662
+ * Initiates wrap-up process for the task with specified details.
1663
+ * @param wrapupPayload - Wrap-up details including reason and auxiliary code
1664
+ * @returns Promise<TaskResponse>
1665
+ * @example
1666
+ * ```typescript
1667
+ * await task.wrapup({
1668
+ * wrapUpReason: "Customer issue resolved",
1669
+ * auxCodeId: "RESOLVED"
1670
+ * });
1671
+ * ```
1672
+ */
1673
+ wrapup(wrapupPayload: WrapupPayLoad): Promise<TaskResponse>;
1674
+ /**
1675
+ * Pauses the recording for current task.
1676
+ * @returns Promise<TaskResponse>
1677
+ * @example
1678
+ * ```typescript
1679
+ * await task.pauseRecording();
1680
+ * ```
1681
+ */
1682
+ pauseRecording(): Promise<TaskResponse>;
1683
+ /**
1684
+ * Resumes a previously paused recording.
1685
+ * @param resumeRecordingPayload - Parameters for resuming the recording
1686
+ * @returns Promise<TaskResponse>
1687
+ * @example
1688
+ * ```typescript
1689
+ * await task.resumeRecording({
1690
+ * autoResumed: false
1691
+ * });
1692
+ * ```
1693
+ */
1694
+ resumeRecording(resumeRecordingPayload: ResumeRecordingPayload): Promise<TaskResponse>;
1695
+ /**
1696
+ * Initiates a consultation with another agent or queue.
1697
+ * @param consultPayload - Consultation details including destination and type
1698
+ * @returns Promise<TaskResponse>
1699
+ * @example
1700
+ * ```typescript
1701
+ * await task.consult({ to: "agentId", destinationType: "agent" });
1702
+ * ```
1703
+ */
1704
+ consult(consultPayload: ConsultPayload): Promise<TaskResponse>;
1705
+ /**
1706
+ * Ends an ongoing consultation.
1707
+ * @param consultEndPayload - Details for ending the consultation
1708
+ * @returns Promise<TaskResponse>
1709
+ * @example
1710
+ * ```typescript
1711
+ * await task.endConsult({ isConsult: true, taskId: "taskId" });
1712
+ * ```
1713
+ */
1714
+ endConsult(consultEndPayload: ConsultEndPayload): Promise<TaskResponse>;
1715
+ /**
1716
+ * Transfers the task to another agent or queue.
1717
+ * @param transferPayload - Transfer details including destination and type
1718
+ * @returns Promise<TaskResponse>
1719
+ * @example
1720
+ * ```typescript
1721
+ * await task.transfer({ to: "queueId", destinationType: "queue" });
1722
+ * ```
1723
+ */
1724
+ transfer(transferPayload: TransferPayLoad, options?: TransferOptions): Promise<TaskResponse>;
1725
+ /**
1726
+ * Initiates a consult conference (merge consult call with main call).
1727
+ * @returns Promise<TaskResponse>
1728
+ * @example
1729
+ * ```typescript
1730
+ * await task.consultConference();
1731
+ * ```
1732
+ */
1733
+ consultConference(): Promise<TaskResponse>;
1734
+ /**
1735
+ * Removes a supported participant from the active conference.
1736
+ * Resolves after the correlated ParticipantLeftConference routing event.
1737
+ * @param payload - Participant identifier to remove
1738
+ * @returns Promise<TaskResponse>
1739
+ * @example
1740
+ * ```typescript
1741
+ * await task.dropConferenceParticipant({participantId: 'participant-id'});
1742
+ * ```
1743
+ */
1744
+ dropConferenceParticipant(payload: DropConferenceParticipantPayload): Promise<TaskResponse>;
1745
+ /**
1746
+ * Exits from an ongoing conference.
1747
+ * @returns Promise<TaskResponse>
1748
+ * @example
1749
+ * ```typescript
1750
+ * await task.exitConference();
1751
+ * ```
1752
+ */
1753
+ exitConference(): Promise<TaskResponse>;
1754
+ /**
1755
+ * Transfers the conference to another participant.
1756
+ * @returns Promise<TaskResponse>
1757
+ * @example
1758
+ * ```typescript
1759
+ * await task.transferConference();
1760
+ * ```
1761
+ */
1762
+ transferConference(): Promise<TaskResponse>;
1763
+ /**
1764
+ * Toggles between consult call and main call during consulting.
1765
+ * If on consult leg, switches to main call (holds consult).
1766
+ * If on main call, switches to consult (resumes consult).
1767
+ * Only available when in CONSULTING state.
1768
+ * @returns Promise<TaskResponse>
1769
+ * @example
1770
+ * ```typescript
1771
+ * await task.switchCall();
1772
+ * ```
1773
+ */
1774
+ switchCall(): Promise<TaskResponse>;
1775
+ /**
1776
+ * Toggles mute/unmute for the active call.
1777
+ * WebRTC tasks toggle the local stream; wxApp engaged tasks route to telephony mute REST when
1778
+ * `enableWxBetterTogether` is active.
1779
+ * @param options - Optional target mute state (`muted`) for wxApp; ignored for WebRTC toggle.
1780
+ * @returns Promise<void>
1781
+ * @example
1782
+ * ```typescript
1783
+ * await task.toggleMute();
1784
+ * await task.toggleMute({ muted: true });
1785
+ * ```
1786
+ */
1787
+ toggleMute(options?: TaskToggleMuteOptions): Promise<void>;
1788
+ /**
1789
+ * Sends in-call DTMF tones for wxApp engaged telephony tasks when `enableWxBetterTogether` is active.
1790
+ * @param options - DTMF digit(s) and optional shared-line owner id.
1791
+ * @returns Promise<void>
1792
+ * @example
1793
+ * ```typescript
1794
+ * await task.transmitDtmf({ dtmf: '5' });
1795
+ * ```
1796
+ */
1797
+ transmitDtmf(options: TaskTransmitDtmfOptions): Promise<void>;
1798
+ }
1799
+ /**
1800
+ * Interface for managing digital channel task operations in the contact center
1801
+ * Digital channels (chat, email, social, SMS) have a simpler interface than voice
1802
+ * Extends ITask but overrides updateTaskData to return IDigital
1803
+ * @public
1804
+ */
1805
+ export interface IDigital extends Omit<ITask, 'updateTaskData'> {
1806
+ /**
1807
+ * Updates the task data
1808
+ * @param newData - Updated task data
1809
+ * @param shouldOverwrite - Whether to completely replace existing data
1810
+ * @returns Updated Digital task instance
1811
+ */
1812
+ updateTaskData(newData: TaskData, shouldOverwrite?: boolean): IDigital;
1813
+ }
1814
+ /**
1815
+ * Interface for managing voice/telephony task operations in the contact center
1816
+ * Extends ITask with voice-specific functionality for hold/resume operations
1817
+ * @public
1818
+ */
1819
+ export interface IVoice extends ITask {
1820
+ /**
1821
+ * Toggles hold/resume state for a voice task.
1822
+ * If the task is currently on hold, it will be resumed.
1823
+ * If the task is active, it will be placed on hold.
1824
+ * @returns Promise<TaskResponse>
1825
+ * @example
1826
+ * ```typescript
1827
+ * await voiceTask.holdResume();
1828
+ * ```
1829
+ */
1830
+ holdResume(): Promise<TaskResponse>;
1831
+ /** @see wxAppVoiceMethods — WXCC-6026 */
1832
+ isWebexAppCallingOffer(): boolean;
1833
+ /** @see wxAppVoiceMethods — WXCC-6026 */
1834
+ getCallingDeviceDetails(): import('./WebexCallingUtils').WebexCallingDeviceDetails | undefined;
1835
+ /** @see wxAppVoiceMethods — WXCC-6026 */
1836
+ getWebexCallingCallId(): string | null;
1837
+ }
1838
+ /**
1839
+ * Configuration options for voice task UI controls
1840
+ */
1841
+ export type VoiceUIControlOptions = {
1842
+ isEndTaskEnabled?: boolean;
1843
+ isEndConsultEnabled?: boolean;
1844
+ voiceVariant?: VoiceVariant;
1845
+ isRecordingEnabled?: boolean;
1846
+ enableWxBetterTogether?: boolean;
1847
+ consultTransferConfig?: ConsultTransferDestinationConfig;
1848
+ answerCallOnWebexService?: import('../AnswerCallOnWebexService').default;
1849
+ };
1850
+ /**
1851
+ * Participant information for UI display
1852
+ */
1853
+ export type Participant = {
1854
+ id: string;
1855
+ name?: string;
1856
+ pType?: string;
1857
+ };
1858
+ /**
1859
+ * @deprecated Use Participant instead
1860
+ */
1861
+ export type TaskAccessorParticipant = Participant;
1862
+ export interface IWebRTC extends IVoice {
1863
+ /**
1864
+ * This method is used to mute/unmute the call.
1865
+ * @returns Promise<void>
1866
+ * @example
1867
+ * ```typescript
1868
+ * task.toggleMute();
1869
+ * ```
1870
+ */
1871
+ toggleMute(options?: TaskToggleMuteOptions): Promise<void>;
1872
+ /**
1873
+ * Decline the incoming task for Browser Login
1874
+ *
1875
+ * @example
1876
+ * ```
1877
+ * task.decline();
1878
+ * ```
1879
+ */
1880
+ decline(): Promise<TaskResponse>;
1881
+ /**
1882
+ * This method is used to unregister the web call listeners.
1883
+ * @returns void
1884
+ * @example
1885
+ * ```typescript
1886
+ * task.unregisterWebCallListeners();
1887
+ * ```
1888
+ */
1889
+ unregisterWebCallListeners(): void;
1890
+ }
1891
+ export type WebSocketPayload = TaskData & {
1892
+ type: string;
1893
+ mediaResourceId?: string;
1894
+ reason?: string;
1895
+ /** ContactEnded: party that ended the contact (e.g. 'Agent', 'Customer') */
1896
+ terminatingParty?: string;
1897
+ /**
1898
+ * Optional real-time transcript chunk payload.
1899
+ * Present on REAL_TIME_TRANSCRIPTION notifications.
1900
+ */
1901
+ data?: RealtimeTranscription['data'];
1902
+ };
1903
+ export type WebSocketMessage = {
1904
+ keepalive?: 'true' | 'false' | boolean;
1905
+ type?: string;
1906
+ data: WebSocketPayload;
1907
+ };
1908
+ /**
1909
+ * Actions to be performed after handling an event
1910
+ *
1911
+ * These actions represent TaskManager-level concerns (task collection lifecycle,
1912
+ * resource cleanup) rather than task-level state machine concerns. The separation
1913
+ * ensures proper responsibility:
1914
+ * - TaskManager: Collection management, metrics, cleanup
1915
+ * - State Machine: Task state transitions, event emissions, UI controls
1916
+ */
1917
+ export interface TaskEventActions {
1918
+ task?: ITask;
1919
+ }
1920
+ /**
1921
+ * Context for processing an event
1922
+ *
1923
+ * Contains all information needed to process a WebSocket event:
1924
+ * - Event type and payload from the backend
1925
+ * - Task instance (if exists)
1926
+ * - Pre-mapped state machine event (if applicable)
1927
+ */
1928
+ export interface EventContext {
1929
+ eventType: string;
1930
+ payload: WebSocketPayload;
1931
+ task?: ITask;
1932
+ stateMachineEvent?: TaskEventPayload | null;
1933
+ }