@webex/contact-center 3.12.0-next.15 → 3.12.0-next.151

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 (322) 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 +382 -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 +1010 -47
  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 +40 -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 +211 -0
  52. package/dist/metrics/behavioral-events.js.map +1 -1
  53. package/dist/metrics/constants.js +58 -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 +351 -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/WebexCrossClientService.js +225 -0
  68. package/dist/services/WebexCrossClientService.js.map +1 -0
  69. package/dist/services/WxAppTelephonyMercurySync.js +111 -0
  70. package/dist/services/WxAppTelephonyMercurySync.js.map +1 -0
  71. package/dist/services/config/Util.js +48 -48
  72. package/dist/services/config/Util.js.map +1 -1
  73. package/dist/services/config/constants.js +56 -78
  74. package/dist/services/config/constants.js.map +1 -1
  75. package/dist/services/config/index.js +100 -226
  76. package/dist/services/config/index.js.map +1 -1
  77. package/dist/services/config/types.js +97 -24
  78. package/dist/services/config/types.js.map +1 -1
  79. package/dist/services/core/Err.js.map +1 -1
  80. package/dist/services/core/Utils.js +111 -32
  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 +28 -14
  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 +2 -1
  88. package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
  89. package/dist/services/core/websocket/types.js.map +1 -1
  90. package/dist/services/index.js +1 -1
  91. package/dist/services/index.js.map +1 -1
  92. package/dist/services/task/Task.js +955 -0
  93. package/dist/services/task/Task.js.map +1 -0
  94. package/dist/services/task/TaskFactory.js +50 -0
  95. package/dist/services/task/TaskFactory.js.map +1 -0
  96. package/dist/services/task/TaskManager.js +1272 -523
  97. package/dist/services/task/TaskManager.js.map +1 -1
  98. package/dist/services/task/TaskUtils.js +221 -27
  99. package/dist/services/task/TaskUtils.js.map +1 -1
  100. package/dist/services/task/WebexCallingUtils.js +70 -0
  101. package/dist/services/task/WebexCallingUtils.js.map +1 -0
  102. package/dist/services/task/constants.js +21 -2
  103. package/dist/services/task/constants.js.map +1 -1
  104. package/dist/services/task/contact.js +29 -0
  105. package/dist/services/task/contact.js.map +1 -1
  106. package/dist/services/task/dialer.js +78 -0
  107. package/dist/services/task/dialer.js.map +1 -1
  108. package/dist/services/task/digital/Digital.js +78 -0
  109. package/dist/services/task/digital/Digital.js.map +1 -0
  110. package/dist/services/task/state-machine/TaskStateMachine.js +982 -0
  111. package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -0
  112. package/dist/services/task/state-machine/actions.js +572 -0
  113. package/dist/services/task/state-machine/actions.js.map +1 -0
  114. package/dist/services/task/state-machine/constants.js +161 -0
  115. package/dist/services/task/state-machine/constants.js.map +1 -0
  116. package/dist/services/task/state-machine/guards.js +379 -0
  117. package/dist/services/task/state-machine/guards.js.map +1 -0
  118. package/dist/services/task/state-machine/index.js +53 -0
  119. package/dist/services/task/state-machine/index.js.map +1 -0
  120. package/dist/services/task/state-machine/types.js +54 -0
  121. package/dist/services/task/state-machine/types.js.map +1 -0
  122. package/dist/services/task/state-machine/uiControlsComputer.js +703 -0
  123. package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -0
  124. package/dist/services/task/taskDataNormalizer.js +99 -0
  125. package/dist/services/task/taskDataNormalizer.js.map +1 -0
  126. package/dist/services/task/types.js +259 -5
  127. package/dist/services/task/types.js.map +1 -1
  128. package/dist/services/task/voice/Voice.js +1504 -0
  129. package/dist/services/task/voice/Voice.js.map +1 -0
  130. package/dist/services/task/voice/WebRTC.js +152 -0
  131. package/dist/services/task/voice/WebRTC.js.map +1 -0
  132. package/dist/services/task/voice/wxAppOfferObservability.js +145 -0
  133. package/dist/services/task/voice/wxAppOfferObservability.js.map +1 -0
  134. package/dist/services/task/voice/wxAppVoiceMethods.js +395 -0
  135. package/dist/services/task/voice/wxAppVoiceMethods.js.map +1 -0
  136. package/dist/services/wxAppDiagnosticLogging.js +159 -0
  137. package/dist/services/wxAppDiagnosticLogging.js.map +1 -0
  138. package/dist/services/wxAppTelephonyUtils.js +19 -0
  139. package/dist/services/wxAppTelephonyUtils.js.map +1 -0
  140. package/dist/types/cc.d.ts +196 -9
  141. package/dist/types/config.d.ts +13 -0
  142. package/dist/types/constants.d.ts +38 -1
  143. package/dist/types/index.d.ts +54 -20
  144. package/dist/types/metrics/MetricsManager.d.ts +6 -0
  145. package/dist/types/metrics/constants.d.ts +52 -1
  146. package/dist/types/services/AddressBook.d.ts +2 -1
  147. package/dist/types/services/AnswerCallOnWebexService.d.ts +38 -0
  148. package/dist/types/services/ApiAiAssistant.d.ts +58 -5
  149. package/dist/types/services/EntryPoint.d.ts +7 -5
  150. package/dist/types/services/Queue.d.ts +5 -3
  151. package/dist/types/services/UserPreference.d.ts +118 -0
  152. package/dist/types/services/WebexCrossClientService.d.ts +32 -0
  153. package/dist/types/services/WxAppTelephonyMercurySync.d.ts +28 -0
  154. package/dist/types/services/config/Util.d.ts +4 -8
  155. package/dist/types/services/config/constants.d.ts +49 -76
  156. package/dist/types/services/config/index.d.ts +16 -64
  157. package/dist/types/services/config/types.d.ts +248 -114
  158. package/dist/types/services/core/Err.d.ts +6 -0
  159. package/dist/types/services/core/Utils.d.ts +35 -13
  160. package/dist/types/services/core/WebexRequest.d.ts +1 -0
  161. package/dist/types/services/core/types.d.ts +2 -0
  162. package/dist/types/services/core/websocket/WebSocketManager.d.ts +1 -0
  163. package/dist/types/services/core/websocket/types.d.ts +1 -1
  164. package/dist/types/services/index.d.ts +1 -1
  165. package/dist/types/services/task/Task.d.ts +186 -0
  166. package/dist/types/services/task/TaskFactory.d.ts +14 -0
  167. package/dist/types/services/task/TaskUtils.d.ts +54 -2
  168. package/dist/types/services/task/WebexCallingUtils.d.ts +11 -0
  169. package/dist/types/services/task/constants.d.ts +19 -0
  170. package/dist/types/services/task/contact.d.ts +4 -0
  171. package/dist/types/services/task/dialer.d.ts +30 -0
  172. package/dist/types/services/task/digital/Digital.d.ts +23 -0
  173. package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +1442 -0
  174. package/dist/types/services/task/state-machine/actions.d.ts +10 -0
  175. package/dist/types/services/task/state-machine/constants.d.ts +107 -0
  176. package/dist/types/services/task/state-machine/guards.d.ts +103 -0
  177. package/dist/types/services/task/state-machine/index.d.ts +13 -0
  178. package/dist/types/services/task/state-machine/types.d.ts +277 -0
  179. package/dist/types/services/task/state-machine/uiControlsComputer.d.ts +9 -0
  180. package/dist/types/services/task/taskDataNormalizer.d.ts +10 -0
  181. package/dist/types/services/task/types.d.ts +790 -66
  182. package/dist/types/services/task/voice/Voice.d.ts +241 -0
  183. package/dist/types/services/task/voice/WebRTC.d.ts +54 -0
  184. package/dist/types/services/task/voice/wxAppOfferObservability.d.ts +39 -0
  185. package/dist/types/services/task/voice/wxAppVoiceMethods.d.ts +68 -0
  186. package/dist/types/services/wxAppDiagnosticLogging.d.ts +63 -0
  187. package/dist/types/services/wxAppTelephonyUtils.d.ts +5 -0
  188. package/dist/types/types.d.ts +213 -11
  189. package/dist/types/utils/PageCache.d.ts +20 -3
  190. package/dist/types/webex.d.ts +1 -0
  191. package/dist/types.js +168 -6
  192. package/dist/types.js.map +1 -1
  193. package/dist/utils/PageCache.js +19 -5
  194. package/dist/utils/PageCache.js.map +1 -1
  195. package/dist/webex.js +22 -2
  196. package/dist/webex.js.map +1 -1
  197. package/package.json +16 -12
  198. package/src/cc.ts +1338 -121
  199. package/src/config.ts +13 -0
  200. package/src/constants.ts +41 -1
  201. package/src/index.ts +62 -15
  202. package/src/metrics/MetricsManager.ts +16 -0
  203. package/src/metrics/ai-docs/AGENTS.md +350 -0
  204. package/src/metrics/ai-docs/ARCHITECTURE.md +338 -0
  205. package/src/metrics/ai-docs/metrics-spec.md +971 -0
  206. package/src/metrics/behavioral-events.ts +218 -0
  207. package/src/metrics/constants.ts +63 -4
  208. package/src/services/AddressBook.ts +17 -6
  209. package/src/services/AnswerCallOnWebexService.ts +239 -0
  210. package/src/services/ApiAiAssistant.ts +470 -15
  211. package/src/services/EntryPoint.ts +59 -60
  212. package/src/services/Queue.ts +29 -12
  213. package/src/services/UserPreference.ts +509 -0
  214. package/src/services/WebexCrossClientService.ts +298 -0
  215. package/src/services/WxAppTelephonyMercurySync.ts +142 -0
  216. package/src/services/agent/ai-docs/AGENTS.md +240 -0
  217. package/src/services/agent/ai-docs/ARCHITECTURE.md +304 -0
  218. package/src/services/agent/ai-docs/agent-spec.md +505 -0
  219. package/src/services/ai-docs/AGENTS.md +386 -0
  220. package/src/services/ai-docs/services-spec.md +505 -0
  221. package/src/services/config/Util.ts +54 -84
  222. package/src/services/config/ai-docs/AGENTS.md +250 -0
  223. package/src/services/config/ai-docs/ARCHITECTURE.md +413 -0
  224. package/src/services/config/ai-docs/config-spec.md +669 -0
  225. package/src/services/config/constants.ts +63 -85
  226. package/src/services/config/index.ts +116 -277
  227. package/src/services/config/types.ts +233 -125
  228. package/src/services/core/Err.ts +3 -0
  229. package/src/services/core/Utils.ts +127 -37
  230. package/src/services/core/WebexRequest.ts +3 -1
  231. package/src/services/core/ai-docs/AGENTS.md +381 -0
  232. package/src/services/core/ai-docs/ARCHITECTURE.md +698 -0
  233. package/src/services/core/ai-docs/core-spec.md +787 -0
  234. package/src/services/core/aqm-reqs.ts +30 -15
  235. package/src/services/core/types.ts +33 -1
  236. package/src/services/core/websocket/WebSocketManager.ts +2 -0
  237. package/src/services/core/websocket/types.ts +1 -1
  238. package/src/services/index.ts +1 -1
  239. package/src/services/task/Task.ts +1211 -0
  240. package/src/services/task/TaskFactory.ts +82 -0
  241. package/src/services/task/TaskManager.ts +1584 -643
  242. package/src/services/task/TaskUtils.ts +316 -25
  243. package/src/services/task/WebexCallingUtils.ts +136 -0
  244. package/src/services/task/ai-docs/AGENTS.md +457 -0
  245. package/src/services/task/ai-docs/ARCHITECTURE.md +595 -0
  246. package/src/services/task/ai-docs/task-spec.md +1501 -0
  247. package/src/services/task/constants.ts +20 -0
  248. package/src/services/task/contact.ts +30 -0
  249. package/src/services/task/dialer.ts +80 -0
  250. package/src/services/task/digital/Digital.ts +102 -0
  251. package/src/services/task/state-machine/TaskStateMachine.ts +1320 -0
  252. package/src/services/task/state-machine/actions.ts +741 -0
  253. package/src/services/task/state-machine/ai-docs/AGENTS.md +460 -0
  254. package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +1156 -0
  255. package/src/services/task/state-machine/ai-docs/task-state-machine-spec.md +2247 -0
  256. package/src/services/task/state-machine/constants.ts +172 -0
  257. package/src/services/task/state-machine/guards.ts +442 -0
  258. package/src/services/task/state-machine/index.ts +28 -0
  259. package/src/services/task/state-machine/types.ts +258 -0
  260. package/src/services/task/state-machine/uiControlsComputer.ts +1135 -0
  261. package/src/services/task/taskDataNormalizer.ts +137 -0
  262. package/src/services/task/types.ts +974 -70
  263. package/src/services/task/voice/Voice.ts +1878 -0
  264. package/src/services/task/voice/WebRTC.ts +194 -0
  265. package/src/services/task/voice/wxAppOfferObservability.ts +204 -0
  266. package/src/services/task/voice/wxAppVoiceMethods.ts +575 -0
  267. package/src/services/wxAppDiagnosticLogging.ts +286 -0
  268. package/src/services/wxAppTelephonyUtils.ts +14 -0
  269. package/src/types.ts +272 -13
  270. package/src/utils/AGENTS.md +289 -0
  271. package/src/utils/PageCache.ts +38 -5
  272. package/src/utils/ai-docs/utils-spec.md +391 -0
  273. package/src/webex.js +10 -0
  274. package/test/unit/fixtures/aiSummaryTestUtils.ts +40 -0
  275. package/test/unit/spec/cc.ts +3705 -150
  276. package/test/unit/spec/index.ts +885 -0
  277. package/test/unit/spec/logger-proxy.ts +70 -0
  278. package/test/unit/spec/metrics/MetricsManager.ts +25 -0
  279. package/test/unit/spec/metrics/behavioral-events.ts +60 -0
  280. package/test/unit/spec/services/AddressBook.ts +37 -6
  281. package/test/unit/spec/services/AnswerCallOnWebexService.ts +264 -0
  282. package/test/unit/spec/services/ApiAiAssistant.ts +429 -23
  283. package/test/unit/spec/services/EntryPoint.ts +87 -40
  284. package/test/unit/spec/services/Queue.ts +123 -12
  285. package/test/unit/spec/services/UserPreference.ts +401 -0
  286. package/test/unit/spec/services/WebCallingService.ts +7 -1
  287. package/test/unit/spec/services/WebexCrossClientService.ts +509 -0
  288. package/test/unit/spec/services/WxAppTelephonyMercurySync.ts +136 -0
  289. package/test/unit/spec/services/config/Util.ts +501 -0
  290. package/test/unit/spec/services/config/index.ts +317 -547
  291. package/test/unit/spec/services/core/Utils.ts +425 -8
  292. package/test/unit/spec/services/core/WebexRequest.ts +8 -7
  293. package/test/unit/spec/services/core/aqm-reqs.ts +113 -1
  294. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +66 -40
  295. package/test/unit/spec/services/task/AutoWrapup.ts +63 -0
  296. package/test/unit/spec/services/task/Task.ts +2723 -0
  297. package/test/unit/spec/services/task/TaskFactory.ts +116 -0
  298. package/test/unit/spec/services/task/TaskManager.ts +4781 -1585
  299. package/test/unit/spec/services/task/TaskUtils.ts +307 -0
  300. package/test/unit/spec/services/task/WebexCallingUtils.ts +153 -0
  301. package/test/unit/spec/services/task/contact.ts +33 -0
  302. package/test/unit/spec/services/task/dialer.ts +190 -0
  303. package/test/unit/spec/services/task/digital/Digital.ts +105 -0
  304. package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +4060 -0
  305. package/test/unit/spec/services/task/state-machine/guards.ts +839 -0
  306. package/test/unit/spec/services/task/state-machine/types.ts +18 -0
  307. package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +3101 -0
  308. package/test/unit/spec/services/task/taskTestUtils.ts +87 -0
  309. package/test/unit/spec/services/task/voice/Voice.ts +2355 -0
  310. package/test/unit/spec/services/task/voice/WebRTC.ts +235 -0
  311. package/test/unit/spec/services/task/voice/wxAppOfferObservability.ts +361 -0
  312. package/test/unit/spec/services/task/voice/wxAppVoiceMethods.ts +719 -0
  313. package/test/unit/spec/services/wxAppDiagnosticLogging.ts +179 -0
  314. package/test/unit/spec/wellnessSampleUtils.ts +288 -0
  315. package/typedoc.md +1 -1
  316. package/umd/contact-center.min.js +2 -2
  317. package/umd/contact-center.min.js.map +1 -1
  318. package/dist/services/task/index.js +0 -1530
  319. package/dist/services/task/index.js.map +0 -1
  320. package/dist/types/services/task/index.d.ts +0 -650
  321. package/src/services/task/index.ts +0 -1806
  322. 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
@@ -503,13 +583,209 @@ export declare enum TASK_EVENTS {
503
583
  * });
504
584
  * ```
505
585
  */
506
- TASK_CAMPAIGN_PREVIEW_RESERVATION = "task:campaignPreviewReservation"
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
+ * 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"
507
650
  }
508
651
  /**
509
652
  * Represents a customer interaction within the contact center system
510
653
  * Contains comprehensive details about an ongoing customer interaction
511
654
  * @public
512
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
+ };
513
789
  export type Interaction = {
514
790
  /** Indicates if the interaction is managed by Flow Control */
515
791
  isFcManaged: boolean;
@@ -524,7 +800,11 @@ export type Interaction = {
524
800
  /** Current virtual team handling the interaction */
525
801
  currentVTeam: string;
526
802
  /** List of participants in the interaction */
527
- participants: any;
803
+ participants: InteractionParticipants;
804
+ /** Detailed call associated data */
805
+ callAssociatedData?: CallAssociatedData;
806
+ /** Simplified call associated key/value pairs */
807
+ callAssociatedDetails?: CallAssociatedDetails;
528
808
  /** Unique identifier for the interaction */
529
809
  interactionId: string;
530
810
  /** Organization identifier */
@@ -533,7 +813,18 @@ export type Interaction = {
533
813
  createdTimestamp?: number;
534
814
  /** Indicates if wrap-up assistance is enabled */
535
815
  isWrapUpAssist?: boolean;
536
- /** 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
+ */
537
828
  callProcessingDetails: {
538
829
  /** Name of the Queue Manager handling this interaction */
539
830
  QMgrName: string;
@@ -551,20 +842,24 @@ export type Interaction = {
551
842
  QueueId: string;
552
843
  /** Virtual team identifier */
553
844
  vteamId: string;
554
- /** Indicates if pause/resume functionality is enabled */
555
- pauseResumeEnabled?: string;
845
+ /** Agent capability for pause/resume on this interaction */
846
+ pauseResumeEnabled?: boolean;
556
847
  /** Duration of pause in seconds */
557
848
  pauseDuration?: string;
558
- /** Indicates if the interaction is currently paused */
559
- isPaused?: string;
560
- /** Indicates if recording is in progress */
561
- recordInProgress?: string;
562
- /** Indicates if recording has started */
563
- 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;
564
859
  /** Indicates if Consult to Queue is in progress */
565
- ctqInProgress?: string;
860
+ ctqInProgress?: boolean;
566
861
  /** Indicates if outdial transfer to queue is enabled */
567
- outdialTransferToQueueEnabled?: string;
862
+ outdialTransferToQueueEnabled?: boolean;
568
863
  /** IVR conversation transcript */
569
864
  convIvrTranscript?: string;
570
865
  /** Customer's name */
@@ -651,59 +946,67 @@ export type Interaction = {
651
946
  fcDesktopView?: string;
652
947
  /** Agent ID who initiated the outdial call */
653
948
  outdialAgentId?: string;
949
+ /** Indicates if the customer has left the call during an active consult */
950
+ hasCustomerLeft?: string;
951
+ /** Indicates if the skip action is disabled for campaign preview contacts */
952
+ campaignPreviewSkipDisabled?: string;
953
+ /** Indicates if the remove action is disabled for campaign preview contacts */
954
+ campaignPreviewRemoveDisabled?: string;
955
+ /** Auto-action to perform when campaign preview offer times out (ACCEPT, SKIP, REMOVE) */
956
+ campaignPreviewAutoAction?: string;
957
+ /** Timestamp (ms) when the campaign preview offer expires */
958
+ campaignPreviewOfferTimeout?: string;
654
959
  };
655
960
  /** Main interaction identifier for related interactions */
656
961
  mainInteractionId?: string;
962
+ /** Timestamp when interaction entered queue */
963
+ queuedTimestamp?: number | null;
657
964
  /** Media-specific information for the interaction */
658
- media: Record<string, {
659
- /** Unique identifier for the media resource */
660
- mediaResourceId: string;
661
- /** Type of media channel */
662
- mediaType: MEDIA_CHANNEL;
663
- /** Media manager handling this media */
664
- mediaMgr: string;
665
- /** List of participant identifiers */
666
- participants: string[];
667
- /** Type of media */
668
- mType: string;
669
- /** Indicates if media is on hold */
670
- isHold: boolean;
671
- /** Timestamp when media was put on hold */
672
- holdTimestamp: number | null;
673
- }>;
965
+ media: Record<string, MediaEntry>;
674
966
  /** Owner of the interaction */
675
967
  owner: string;
676
968
  /** Primary media channel for the interaction */
677
- mediaChannel: MEDIA_CHANNEL;
969
+ mediaChannel: string;
678
970
  /** Direction information for the contact */
679
971
  contactDirection: {
680
972
  type: string;
681
973
  };
682
974
  /** Type of outbound interaction */
683
975
  outboundType?: string;
976
+ /** Optional workflow manager identifier */
977
+ workflowManager?: string | null;
684
978
  /** Parameters passed through the call flow */
685
- callFlowParams: Record<string, {
686
- /** Name of the parameter */
687
- name: string;
688
- /** Qualifier for the parameter */
689
- qualifier: string;
690
- /** Description of the parameter */
691
- description: string;
692
- /** Data type of the parameter value */
693
- valueDataType: string;
694
- /** Value of the parameter */
695
- value: string;
696
- }>;
979
+ callFlowParams?: Record<string, FlowParameter>;
697
980
  };
698
981
  /**
699
- * Task payload containing detailed information about a contact center task
700
- * 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.
701
985
  * @public
702
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
+ };
703
1006
  export type TaskData = {
704
- /** Unique identifier for the media resource handling this task */
1007
+ /** Primary media resource identifier for the active leg (matches interaction.media[].mediaResourceId) */
705
1008
  mediaResourceId: string;
706
- /** Type of event that triggered this task data */
1009
+ /** Agent event name from the websocket stream (e.g., AGENT_CONTACT_ASSIGNED) */
707
1010
  eventType: string;
708
1011
  /** Timestamp when the event occurred */
709
1012
  eventTime?: number;
@@ -713,7 +1016,7 @@ export type TaskData = {
713
1016
  destAgentId: string;
714
1017
  /** Unique tracking identifier for the task */
715
1018
  trackingId: string;
716
- /** Media resource identifier for consultation operations */
1019
+ /** Media resource identifier for consultation leg when present */
717
1020
  consultMediaResourceId: string;
718
1021
  /** Detailed interaction information */
719
1022
  interaction: Interaction;
@@ -725,7 +1028,7 @@ export type TaskData = {
725
1028
  toOwner?: boolean;
726
1029
  /** Identifier for child interaction in consult/transfer scenarios */
727
1030
  childInteractionId?: string;
728
- /** Unique identifier for the interaction */
1031
+ /** Interaction/contact identifier from backend (same as interaction.interactionId) */
729
1032
  interactionId: string;
730
1033
  /** Organization identifier */
731
1034
  orgId: string;
@@ -735,7 +1038,7 @@ export type TaskData = {
735
1038
  queueMgr: string;
736
1039
  /** Name of the queue where task is queued */
737
1040
  queueName?: string;
738
- /** Type of the task */
1041
+ /** Task/interaction type returned by the platform (routing/monitoring/etc.) */
739
1042
  type: string;
740
1043
  /** Timeout value for RONA (Redirection on No Answer) in seconds */
741
1044
  ronaTimeout?: number;
@@ -771,11 +1074,114 @@ export type TaskData = {
771
1074
  reservedAgentChannelId?: string;
772
1075
  /** Indicates if wrap-up is required for this task */
773
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;
774
1120
  /** Indicates if auto-answer is in progress for this task */
775
1121
  isAutoAnswering?: boolean;
776
1122
  /** Indicates if wrap-up is required for this task */
777
1123
  agentsPendingWrapUp?: string[];
778
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
+ */
779
1185
  /**
780
1186
  * Type representing an agent contact message within the contact center system
781
1187
  * Contains comprehensive interaction and task related details for agent operations
@@ -986,6 +1392,14 @@ export type TransferPayload = {
986
1392
  /** Type of the transfer destination */
987
1393
  destinationType: DestinationType;
988
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
+ };
989
1403
  /**
990
1404
  * API payload for ending a consultation
991
1405
  * This is the actual payload that is sent to the developer API
@@ -1101,6 +1515,19 @@ export type ContactCleanupData = {
1101
1515
  type: string;
1102
1516
  };
1103
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';
1104
1531
  /**
1105
1532
  * Response type for task public methods
1106
1533
  * Can be an {@link AgentContact} object containing updated task state,
@@ -1108,17 +1535,111 @@ export type ContactCleanupData = {
1108
1535
  * @public
1109
1536
  */
1110
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
+ }
1111
1627
  /**
1112
1628
  * Interface for managing task-related operations in the contact center
1113
- * Extends EventEmitter to support event-driven task updates
1629
+ * Extends IEventEmitter to support event-driven task updates
1114
1630
  */
1115
- export interface ITask extends EventEmitter {
1631
+ export interface ITask extends IEventEmitter {
1116
1632
  /**
1117
1633
  * Event data received in the Contact Center events.
1118
1634
  * Contains detailed task information including interaction details, media resources,
1119
1635
  * and participant data as defined in {@link TaskData}
1120
1636
  */
1121
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>;
1122
1643
  /**
1123
1644
  * Map associating tasks with their corresponding call identifiers.
1124
1645
  */
@@ -1129,6 +1650,21 @@ export interface ITask extends EventEmitter {
1129
1650
  * as defined in {@link AutoWrapup}
1130
1651
  */
1131
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;
1132
1668
  /**
1133
1669
  * Cancels the auto-wrapup timer for the task.
1134
1670
  * This method stops the auto-wrapup process if it is currently active.
@@ -1136,6 +1672,30 @@ export interface ITask extends EventEmitter {
1136
1672
  * @returns void
1137
1673
  */
1138
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>;
1139
1699
  /**
1140
1700
  * Deregisters all web call event listeners.
1141
1701
  * Used when cleaning up task resources.
@@ -1148,7 +1708,7 @@ export interface ITask extends EventEmitter {
1148
1708
  * @returns Updated task instance
1149
1709
  * @ignore
1150
1710
  */
1151
- updateTaskData(newData: TaskData): ITask;
1711
+ updateTaskData(newData: TaskData): void;
1152
1712
  /**
1153
1713
  * Answers or accepts an incoming task.
1154
1714
  * Once accepted, the task will be assigned to the agent and trigger a {@link TASK_EVENTS.TASK_ASSIGNED} event.
@@ -1269,26 +1829,27 @@ export interface ITask extends EventEmitter {
1269
1829
  * await task.transfer({ to: "queueId", destinationType: "queue" });
1270
1830
  * ```
1271
1831
  */
1272
- transfer(transferPayload: TransferPayLoad): Promise<TaskResponse>;
1832
+ transfer(transferPayload: TransferPayLoad, options?: TransferOptions): Promise<TaskResponse>;
1273
1833
  /**
1274
- * Transfers the task after consultation.
1275
- * @param consultTransferPayload - Details for consult transfer (optional)
1834
+ * Initiates a consult conference (merge consult call with main call).
1276
1835
  * @returns Promise<TaskResponse>
1277
1836
  * @example
1278
1837
  * ```typescript
1279
- * await task.consultTransfer({ to: "agentId", destinationType: "agent" });
1838
+ * await task.consultConference();
1280
1839
  * ```
1281
1840
  */
1282
- consultTransfer(consultTransferPayload?: ConsultTransferPayLoad): Promise<TaskResponse>;
1841
+ consultConference(): Promise<TaskResponse>;
1283
1842
  /**
1284
- * 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
1285
1846
  * @returns Promise<TaskResponse>
1286
1847
  * @example
1287
1848
  * ```typescript
1288
- * await task.consultConference();
1849
+ * await task.dropConferenceParticipant({participantId: 'participant-id'});
1289
1850
  * ```
1290
1851
  */
1291
- consultConference(): Promise<TaskResponse>;
1852
+ dropConferenceParticipant(payload: DropConferenceParticipantPayload): Promise<TaskResponse>;
1292
1853
  /**
1293
1854
  * Exits from an ongoing conference.
1294
1855
  * @returns Promise<TaskResponse>
@@ -1308,12 +1869,175 @@ export interface ITask extends EventEmitter {
1308
1869
  */
1309
1870
  transferConference(): Promise<TaskResponse>;
1310
1871
  /**
1311
- * 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.
1312
1888
  * @returns Promise<void>
1313
1889
  * @example
1314
1890
  * ```typescript
1315
1891
  * await task.toggleMute();
1892
+ * await task.toggleMute({ muted: true });
1316
1893
  * ```
1317
1894
  */
1318
- toggleMute(): Promise<void>;
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' });
1903
+ * ```
1904
+ */
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;
1319
2043
  }