@webex/contact-center 3.12.0-next.9 → 3.12.0-task-refactor.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 (200) hide show
  1. package/AGENTS.md +438 -0
  2. package/ai-docs/README.md +131 -0
  3. package/ai-docs/RULES.md +455 -0
  4. package/ai-docs/patterns/event-driven-patterns.md +485 -0
  5. package/ai-docs/patterns/testing-patterns.md +480 -0
  6. package/ai-docs/patterns/typescript-patterns.md +365 -0
  7. package/ai-docs/templates/README.md +102 -0
  8. package/ai-docs/templates/documentation/create-agents-md.md +240 -0
  9. package/ai-docs/templates/documentation/create-architecture-md.md +295 -0
  10. package/ai-docs/templates/existing-service/bug-fix.md +254 -0
  11. package/ai-docs/templates/existing-service/feature-enhancement.md +450 -0
  12. package/ai-docs/templates/new-method/00-master.md +80 -0
  13. package/ai-docs/templates/new-method/01-requirements.md +232 -0
  14. package/ai-docs/templates/new-method/02-implementation.md +295 -0
  15. package/ai-docs/templates/new-method/03-tests.md +201 -0
  16. package/ai-docs/templates/new-method/04-validation.md +141 -0
  17. package/ai-docs/templates/new-service/00-master.md +109 -0
  18. package/ai-docs/templates/new-service/01-pre-questions.md +159 -0
  19. package/ai-docs/templates/new-service/02-code-generation.md +346 -0
  20. package/ai-docs/templates/new-service/03-integration.md +178 -0
  21. package/ai-docs/templates/new-service/04-test-generation.md +205 -0
  22. package/ai-docs/templates/new-service/05-validation.md +145 -0
  23. package/dist/cc.js +65 -123
  24. package/dist/cc.js.map +1 -1
  25. package/dist/constants.js +13 -2
  26. package/dist/constants.js.map +1 -1
  27. package/dist/index.js +13 -5
  28. package/dist/index.js.map +1 -1
  29. package/dist/metrics/behavioral-events.js +26 -13
  30. package/dist/metrics/behavioral-events.js.map +1 -1
  31. package/dist/metrics/constants.js +7 -6
  32. package/dist/metrics/constants.js.map +1 -1
  33. package/dist/services/ApiAiAssistant.js +0 -3
  34. package/dist/services/ApiAiAssistant.js.map +1 -1
  35. package/dist/services/config/Util.js +2 -3
  36. package/dist/services/config/Util.js.map +1 -1
  37. package/dist/services/config/types.js +16 -14
  38. package/dist/services/config/types.js.map +1 -1
  39. package/dist/services/constants.js +0 -1
  40. package/dist/services/constants.js.map +1 -1
  41. package/dist/services/core/Err.js.map +1 -1
  42. package/dist/services/core/Utils.js +79 -55
  43. package/dist/services/core/Utils.js.map +1 -1
  44. package/dist/services/core/aqm-reqs.js +17 -92
  45. package/dist/services/core/aqm-reqs.js.map +1 -1
  46. package/dist/services/core/websocket/WebSocketManager.js +5 -25
  47. package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
  48. package/dist/services/core/websocket/types.js.map +1 -1
  49. package/dist/services/index.js +1 -2
  50. package/dist/services/index.js.map +1 -1
  51. package/dist/services/task/Task.js +644 -0
  52. package/dist/services/task/Task.js.map +1 -0
  53. package/dist/services/task/TaskFactory.js +45 -0
  54. package/dist/services/task/TaskFactory.js.map +1 -0
  55. package/dist/services/task/TaskManager.js +556 -532
  56. package/dist/services/task/TaskManager.js.map +1 -1
  57. package/dist/services/task/TaskUtils.js +132 -28
  58. package/dist/services/task/TaskUtils.js.map +1 -1
  59. package/dist/services/task/constants.js +7 -6
  60. package/dist/services/task/constants.js.map +1 -1
  61. package/dist/services/task/dialer.js +0 -51
  62. package/dist/services/task/dialer.js.map +1 -1
  63. package/dist/services/task/digital/Digital.js +77 -0
  64. package/dist/services/task/digital/Digital.js.map +1 -0
  65. package/dist/services/task/state-machine/TaskStateMachine.js +634 -0
  66. package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -0
  67. package/dist/services/task/state-machine/actions.js +366 -0
  68. package/dist/services/task/state-machine/actions.js.map +1 -0
  69. package/dist/services/task/state-machine/constants.js +139 -0
  70. package/dist/services/task/state-machine/constants.js.map +1 -0
  71. package/dist/services/task/state-machine/guards.js +256 -0
  72. package/dist/services/task/state-machine/guards.js.map +1 -0
  73. package/dist/services/task/state-machine/index.js +53 -0
  74. package/dist/services/task/state-machine/index.js.map +1 -0
  75. package/dist/services/task/state-machine/types.js +54 -0
  76. package/dist/services/task/state-machine/types.js.map +1 -0
  77. package/dist/services/task/state-machine/uiControlsComputer.js +369 -0
  78. package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -0
  79. package/dist/services/task/taskDataNormalizer.js +99 -0
  80. package/dist/services/task/taskDataNormalizer.js.map +1 -0
  81. package/dist/services/task/types.js +157 -18
  82. package/dist/services/task/types.js.map +1 -1
  83. package/dist/services/task/voice/Voice.js +1031 -0
  84. package/dist/services/task/voice/Voice.js.map +1 -0
  85. package/dist/services/task/voice/WebRTC.js +149 -0
  86. package/dist/services/task/voice/WebRTC.js.map +1 -0
  87. package/dist/types/cc.d.ts +4 -33
  88. package/dist/types/constants.d.ts +13 -2
  89. package/dist/types/index.d.ts +11 -5
  90. package/dist/types/metrics/constants.d.ts +5 -3
  91. package/dist/types/services/ApiAiAssistant.d.ts +1 -1
  92. package/dist/types/services/config/types.d.ts +97 -25
  93. package/dist/types/services/core/Err.d.ts +0 -2
  94. package/dist/types/services/core/Utils.d.ts +25 -23
  95. package/dist/types/services/core/aqm-reqs.d.ts +0 -49
  96. package/dist/types/services/core/websocket/WebSocketManager.d.ts +1 -1
  97. package/dist/types/services/core/websocket/connection-service.d.ts +0 -1
  98. package/dist/types/services/core/websocket/types.d.ts +1 -1
  99. package/dist/types/services/index.d.ts +1 -1
  100. package/dist/types/services/task/Task.d.ts +146 -0
  101. package/dist/types/services/task/TaskFactory.d.ts +12 -0
  102. package/dist/types/services/task/TaskUtils.d.ts +39 -8
  103. package/dist/types/services/task/constants.d.ts +5 -4
  104. package/dist/types/services/task/dialer.d.ts +0 -15
  105. package/dist/types/services/task/digital/Digital.d.ts +22 -0
  106. package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +906 -0
  107. package/dist/types/services/task/state-machine/actions.d.ts +8 -0
  108. package/dist/types/services/task/state-machine/constants.d.ts +91 -0
  109. package/dist/types/services/task/state-machine/guards.d.ts +78 -0
  110. package/dist/types/services/task/state-machine/index.d.ts +13 -0
  111. package/dist/types/services/task/state-machine/types.d.ts +256 -0
  112. package/dist/types/services/task/state-machine/uiControlsComputer.d.ts +9 -0
  113. package/dist/types/services/task/taskDataNormalizer.d.ts +10 -0
  114. package/dist/types/services/task/types.d.ts +539 -88
  115. package/dist/types/services/task/voice/Voice.d.ts +183 -0
  116. package/dist/types/services/task/voice/WebRTC.d.ts +53 -0
  117. package/dist/types/types.d.ts +68 -0
  118. package/dist/types/webex.d.ts +1 -0
  119. package/dist/types.js +70 -0
  120. package/dist/types.js.map +1 -1
  121. package/dist/webex.js +14 -2
  122. package/dist/webex.js.map +1 -1
  123. package/package.json +14 -11
  124. package/src/cc.ts +91 -177
  125. package/src/constants.ts +13 -2
  126. package/src/index.ts +14 -5
  127. package/src/metrics/ai-docs/AGENTS.md +348 -0
  128. package/src/metrics/ai-docs/ARCHITECTURE.md +336 -0
  129. package/src/metrics/behavioral-events.ts +28 -14
  130. package/src/metrics/constants.ts +7 -8
  131. package/src/services/ApiAiAssistant.ts +2 -4
  132. package/src/services/agent/ai-docs/AGENTS.md +238 -0
  133. package/src/services/agent/ai-docs/ARCHITECTURE.md +302 -0
  134. package/src/services/ai-docs/AGENTS.md +384 -0
  135. package/src/services/config/Util.ts +2 -3
  136. package/src/services/config/ai-docs/AGENTS.md +253 -0
  137. package/src/services/config/ai-docs/ARCHITECTURE.md +424 -0
  138. package/src/services/config/types.ts +108 -20
  139. package/src/services/constants.ts +0 -1
  140. package/src/services/core/Err.ts +0 -1
  141. package/src/services/core/Utils.ts +90 -67
  142. package/src/services/core/ai-docs/AGENTS.md +379 -0
  143. package/src/services/core/ai-docs/ARCHITECTURE.md +696 -0
  144. package/src/services/core/aqm-reqs.ts +22 -100
  145. package/src/services/core/websocket/WebSocketManager.ts +4 -23
  146. package/src/services/core/websocket/types.ts +1 -1
  147. package/src/services/index.ts +1 -2
  148. package/src/services/task/Task.ts +785 -0
  149. package/src/services/task/TaskFactory.ts +55 -0
  150. package/src/services/task/TaskManager.ts +567 -633
  151. package/src/services/task/TaskUtils.ts +175 -31
  152. package/src/services/task/ai-docs/AGENTS.md +448 -0
  153. package/src/services/task/ai-docs/ARCHITECTURE.md +573 -0
  154. package/src/services/task/constants.ts +5 -4
  155. package/src/services/task/dialer.ts +1 -56
  156. package/src/services/task/digital/Digital.ts +95 -0
  157. package/src/services/task/state-machine/TaskStateMachine.ts +793 -0
  158. package/src/services/task/state-machine/actions.ts +409 -0
  159. package/src/services/task/state-machine/ai-docs/AGENTS.md +495 -0
  160. package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +1135 -0
  161. package/src/services/task/state-machine/constants.ts +150 -0
  162. package/src/services/task/state-machine/guards.ts +295 -0
  163. package/src/services/task/state-machine/index.ts +28 -0
  164. package/src/services/task/state-machine/types.ts +228 -0
  165. package/src/services/task/state-machine/uiControlsComputer.ts +529 -0
  166. package/src/services/task/taskDataNormalizer.ts +137 -0
  167. package/src/services/task/types.ts +641 -95
  168. package/src/services/task/voice/Voice.ts +1255 -0
  169. package/src/services/task/voice/WebRTC.ts +187 -0
  170. package/src/types.ts +88 -5
  171. package/src/utils/AGENTS.md +276 -0
  172. package/src/webex.js +2 -0
  173. package/test/unit/spec/cc.ts +59 -142
  174. package/test/unit/spec/logger-proxy.ts +70 -0
  175. package/test/unit/spec/services/ApiAiAssistant.ts +17 -0
  176. package/test/unit/spec/services/config/index.ts +26 -55
  177. package/test/unit/spec/services/core/Utils.ts +103 -52
  178. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +48 -112
  179. package/test/unit/spec/services/core/websocket/connection-service.ts +5 -4
  180. package/test/unit/spec/services/task/AutoWrapup.ts +63 -0
  181. package/test/unit/spec/services/task/Task.ts +416 -0
  182. package/test/unit/spec/services/task/TaskFactory.ts +62 -0
  183. package/test/unit/spec/services/task/TaskManager.ts +781 -1735
  184. package/test/unit/spec/services/task/TaskUtils.ts +125 -0
  185. package/test/unit/spec/services/task/dialer.ts +112 -198
  186. package/test/unit/spec/services/task/digital/Digital.ts +105 -0
  187. package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +473 -0
  188. package/test/unit/spec/services/task/state-machine/guards.ts +288 -0
  189. package/test/unit/spec/services/task/state-machine/types.ts +18 -0
  190. package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +147 -0
  191. package/test/unit/spec/services/task/taskTestUtils.ts +87 -0
  192. package/test/unit/spec/services/task/voice/Voice.ts +587 -0
  193. package/test/unit/spec/services/task/voice/WebRTC.ts +242 -0
  194. package/umd/contact-center.min.js +2 -2
  195. package/umd/contact-center.min.js.map +1 -1
  196. package/dist/services/task/index.js +0 -1525
  197. package/dist/services/task/index.js.map +0 -1
  198. package/dist/types/services/task/index.d.ts +0 -650
  199. package/src/services/task/index.ts +0 -1801
  200. package/test/unit/spec/services/task/index.ts +0 -2184
@@ -3,12 +3,18 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.TASK_EVENTS = exports.MEDIA_CHANNEL = exports.DESTINATION_TYPE = exports.CONSULT_TRANSFER_DESTINATION_TYPE = void 0;
6
+ exports.VOICE_VARIANT = exports.TASK_EVENTS = exports.TASK_CHANNEL_TYPE = exports.MEDIA_CHANNEL = exports.DESTINATION_TYPE = exports.CONSULT_TRANSFER_DESTINATION_TYPE = void 0;
7
+ /* eslint-disable import/no-cycle */
8
+
7
9
  /**
8
10
  * Unique identifier for a task in the contact center system
9
11
  * @public
10
12
  */
11
13
 
14
+ /**
15
+ * Unique identifier for a call in the Webex calling system
16
+ */
17
+
12
18
  /**
13
19
  * Helper type for creating enum-like objects with type safety
14
20
  * @internal
@@ -85,6 +91,21 @@ const MEDIA_CHANNEL = exports.MEDIA_CHANNEL = {
85
91
  * Derived from the MEDIA_CHANNEL constant
86
92
  * @public
87
93
  */
94
+
95
+ /**
96
+ * Supported task channel types for UI control configuration
97
+ */
98
+ const TASK_CHANNEL_TYPE = exports.TASK_CHANNEL_TYPE = {
99
+ VOICE: 'voice',
100
+ DIGITAL: 'digital'
101
+ };
102
+ /**
103
+ * Voice channel variants that toggle PSTN/WebRTC specific behaviors
104
+ */
105
+ const VOICE_VARIANT = exports.VOICE_VARIANT = {
106
+ PSTN: 'pstn',
107
+ WEBRTC: 'webrtc'
108
+ };
88
109
  /**
89
110
  * Enumeration of all task-related events that can occur in the contact center system
90
111
  * These events represent different states and actions in the task lifecycle
@@ -189,6 +210,10 @@ let TASK_EVENTS = exports.TASK_EVENTS = /*#__PURE__*/function (TASK_EVENTS) {
189
210
  * ```
190
211
  */
191
212
  TASK_EVENTS["TASK_CONSULT_QUEUE_FAILED"] = "task:consultQueueFailed";
213
+ /**
214
+ * Triggered whenever task UI controls are recalculated
215
+ */
216
+ TASK_EVENTS["TASK_UI_CONTROLS_UPDATED"] = "task:ui-controls-updated";
192
217
  /**
193
218
  * Triggered when a consultation request is accepted
194
219
  * @example
@@ -266,6 +291,22 @@ let TASK_EVENTS = exports.TASK_EVENTS = /*#__PURE__*/function (TASK_EVENTS) {
266
291
  * ```
267
292
  */
268
293
  TASK_EVENTS["TASK_WRAPPEDUP"] = "task:wrappedup";
294
+ /**
295
+ * Triggered when the task state machine reaches a final state and resources should be cleaned up.
296
+ * Used internally by TaskManager to perform collection/call cleanup.
297
+ * @internal
298
+ */
299
+ TASK_EVENTS["TASK_CLEANUP"] = "task:cleanup";
300
+ /**
301
+ * Triggered when recording is started
302
+ * @example
303
+ * ```typescript
304
+ * task.on(TASK_EVENTS.TASK_RECORDING_STARTED, (task: ITask) => {
305
+ * console.log('Recording started:', task.data.interactionId);
306
+ * });
307
+ * ```
308
+ */
309
+ TASK_EVENTS["TASK_RECORDING_STARTED"] = "task:recordingStarted";
269
310
  /**
270
311
  * Triggered when recording is paused
271
312
  * @example
@@ -479,6 +520,40 @@ let TASK_EVENTS = exports.TASK_EVENTS = /*#__PURE__*/function (TASK_EVENTS) {
479
520
  * ```
480
521
  */
481
522
  TASK_EVENTS["TASK_PARTICIPANT_LEFT_FAILED"] = "task:participantLeftFailed";
523
+ /**
524
+ * Triggered when agent initiates exit from conference
525
+ * @example
526
+ * ```typescript
527
+ * task.on(TASK_EVENTS.TASK_EXIT_CONFERENCE, (task: ITask) => {
528
+ * console.log('Exiting conference:', task.data.interactionId);
529
+ * // Handle conference exit initiation
530
+ * });
531
+ * ```
532
+ */
533
+ TASK_EVENTS["TASK_EXIT_CONFERENCE"] = "task:exitConference";
534
+ /**
535
+ * Triggered when agent initiates conference transfer
536
+ * @example
537
+ * ```typescript
538
+ * task.on(TASK_EVENTS.TASK_TRANSFER_CONFERENCE, (task: ITask) => {
539
+ * console.log('Transferring conference:', task.data.interactionId);
540
+ * // Handle conference transfer initiation
541
+ * });
542
+ * ```
543
+ */
544
+ TASK_EVENTS["TASK_TRANSFER_CONFERENCE"] = "task:transferConference";
545
+ /**
546
+ * Triggered when agent switches between consult call and main call.
547
+ * Use task.uiControls to determine current state and button visibility.
548
+ * @example
549
+ * ```typescript
550
+ * task.on(TASK_EVENTS.TASK_SWITCH_CALL, (task: ITask) => {
551
+ * console.log('Call switched:', task.data.interactionId);
552
+ * // Update UI based on task.uiControls.main.switch / task.uiControls.consult.switch
553
+ * });
554
+ * ```
555
+ */
556
+ TASK_EVENTS["TASK_SWITCH_CALL"] = "task:switchCall";
482
557
  /**
483
558
  * Triggered when a contact is merged
484
559
  * @example
@@ -501,17 +576,6 @@ let TASK_EVENTS = exports.TASK_EVENTS = /*#__PURE__*/function (TASK_EVENTS) {
501
576
  * ```
502
577
  */
503
578
  TASK_EVENTS["TASK_POST_CALL_ACTIVITY"] = "task:postCallActivity";
504
- /**
505
- * Triggered when a campaign preview contact is offered to the agent
506
- * @example
507
- * ```typescript
508
- * task.on(TASK_EVENTS.TASK_CAMPAIGN_PREVIEW_RESERVATION, (data: AgentContact) => {
509
- * console.log('Campaign preview contact received:', data.interactionId);
510
- * // Handle campaign preview reservation
511
- * });
512
- * ```
513
- */
514
- TASK_EVENTS["TASK_CAMPAIGN_PREVIEW_RESERVATION"] = "task:campaignPreviewReservation";
515
579
  return TASK_EVENTS;
516
580
  }({});
517
581
  /**
@@ -520,8 +584,26 @@ let TASK_EVENTS = exports.TASK_EVENTS = /*#__PURE__*/function (TASK_EVENTS) {
520
584
  * @public
521
585
  */
522
586
  /**
523
- * Task payload containing detailed information about a contact center task
524
- * This structure encapsulates all relevant data for task management
587
+ * Media entry type from interaction.media
588
+ * Used for media state tracking in consult and conference scenarios
589
+ */
590
+ /**
591
+ * Task payload mirroring the Agent Contact event payload from Webex Contact Center
592
+ * (developer.webex.com). Arrives on AGENT_* websocket events and is the source of truth
593
+ * for UI/state machine updates.
594
+ * @public
595
+ */
596
+ /**
597
+ * UI control representation for a single interaction leg.
598
+ */
599
+ /**
600
+ * UI controls surfaced to task consumers.
601
+ * Consumers should read controls from the per-leg surfaces and use `activeLeg`
602
+ * to determine which one is currently interactive.
603
+ */
604
+ /**
605
+ * Helper class for managing task action control state
606
+ * Tracks visibility and enabled state for task actions that can be executed
525
607
  * @public
526
608
  */
527
609
  /**
@@ -570,6 +652,10 @@ let TASK_EVENTS = exports.TASK_EVENTS = /*#__PURE__*/function (TASK_EVENTS) {
570
652
  * Parameters for transferring a task to another destination
571
653
  * @public
572
654
  */
655
+ /**
656
+ * Options for configuring transfer behavior
657
+ * @public
658
+ */
573
659
  /**
574
660
  * API payload for ending a consultation
575
661
  * This is the actual payload that is sent to the developer API
@@ -596,12 +682,18 @@ let TASK_EVENTS = exports.TASK_EVENTS = /*#__PURE__*/function (TASK_EVENTS) {
596
682
  * @public
597
683
  */
598
684
  /**
599
- * Payload for campaign preview contact operations (accept, skip, remove)
685
+ * Data structure for cleaning up contact resources
600
686
  * @public
601
687
  */
602
688
  /**
603
- * Data structure for cleaning up contact resources
604
- * @public
689
+ * Boolean-like fields in callProcessingDetails that may arrive as strings.
690
+ * Used by taskDataNormalizer to coerce payloads to actual booleans.
691
+ */
692
+ /**
693
+ * Interaction-level boolean fields that may arrive as strings from backend payloads.
694
+ */
695
+ /**
696
+ * Participant boolean fields that may arrive as strings and need normalization.
605
697
  */
606
698
  /**
607
699
  * Response type for task public methods
@@ -609,8 +701,55 @@ let TASK_EVENTS = exports.TASK_EVENTS = /*#__PURE__*/function (TASK_EVENTS) {
609
701
  * an Error in case of failure, or void for operations that don't return data
610
702
  * @public
611
703
  */
704
+ /**
705
+ * Payload shape used by consult conference helper utilities.
706
+ */
707
+ /**
708
+ * Minimal event-emitter contract exposed to SDK consumers.
709
+ * Defined here so that consumers do NOT need `@types/node` in their tsconfig.
710
+ * The runtime Task class still extends Node's EventEmitter (via ampersand-events),
711
+ * which satisfies this interface at runtime.
712
+ * @public
713
+ */
612
714
  /**
613
715
  * Interface for managing task-related operations in the contact center
614
- * Extends EventEmitter to support event-driven task updates
716
+ * Extends IEventEmitter to support event-driven task updates
717
+ */
718
+ /**
719
+ * Interface for managing digital channel task operations in the contact center
720
+ * Digital channels (chat, email, social, SMS) have a simpler interface than voice
721
+ * Extends ITask but overrides updateTaskData to return IDigital
722
+ * @public
723
+ */
724
+ /**
725
+ * Interface for managing voice/telephony task operations in the contact center
726
+ * Extends ITask with voice-specific functionality for hold/resume operations
727
+ * @public
728
+ */
729
+ /**
730
+ * Configuration options for voice task UI controls
731
+ */
732
+ /**
733
+ * Participant information for UI display
734
+ */
735
+ /**
736
+ * @deprecated Use Participant instead
737
+ */
738
+ /**
739
+ * Actions to be performed after handling an event
740
+ *
741
+ * These actions represent TaskManager-level concerns (task collection lifecycle,
742
+ * resource cleanup) rather than task-level state machine concerns. The separation
743
+ * ensures proper responsibility:
744
+ * - TaskManager: Collection management, metrics, cleanup
745
+ * - State Machine: Task state transitions, event emissions, UI controls
746
+ */
747
+ /**
748
+ * Context for processing an event
749
+ *
750
+ * Contains all information needed to process a WebSocket event:
751
+ * - Event type and payload from the backend
752
+ * - Task instance (if exists)
753
+ * - Pre-mapped state machine event (if applicable)
615
754
  */
616
755
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["DESTINATION_TYPE","exports","QUEUE","DIALNUMBER","AGENT","ENTRYPOINT","CONSULT_TRANSFER_DESTINATION_TYPE","MEDIA_CHANNEL","EMAIL","CHAT","TELEPHONY","SOCIAL","SMS","FACEBOOK","WHATSAPP","TASK_EVENTS"],"sources":["types.ts"],"sourcesContent":["import {CallId} from '@webex/calling/dist/types/common/types';\nimport EventEmitter from 'events';\nimport {Msg} from '../core/GlobalTypes';\nimport AutoWrapup from './AutoWrapup';\n\n/**\n * Unique identifier for a task in the contact center system\n * @public\n */\nexport type TaskId = string;\n\n/**\n * Helper type for creating enum-like objects with type safety\n * @internal\n */\ntype Enum<T extends Record<string, unknown>> = T[keyof T];\n\n/**\n * Defines the valid destination types for routing tasks within the contact center\n * Used to specify where a task should be directed\n * @public\n */\nexport const DESTINATION_TYPE = {\n /** Route task to a specific queue */\n QUEUE: 'queue',\n /** Route task to a specific dial number */\n DIALNUMBER: 'dialNumber',\n /** Route task to a specific agent */\n AGENT: 'agent',\n /** Route task to an entry point (supported only for consult operations) */\n ENTRYPOINT: 'entryPoint',\n};\n\n/**\n * Type representing valid destination types for task routing\n * Derived from the DESTINATION_TYPE constant\n * @public\n */\nexport type DestinationType = Enum<typeof DESTINATION_TYPE>;\n\n/**\n * Defines the valid destination types for consult transfer operations\n * Used when transferring a task after consultation\n * @public\n */\nexport const CONSULT_TRANSFER_DESTINATION_TYPE = {\n /** Transfer to a specific agent */\n AGENT: 'agent',\n /** Transfer to an entry point */\n ENTRYPOINT: 'entryPoint',\n /** Transfer to a dial number */\n DIALNUMBER: 'dialNumber',\n /** Transfer to a queue */\n QUEUE: 'queue',\n};\n\n/**\n * Type representing valid destination types for consult transfers\n * Derived from the CONSULT_TRANSFER_DESTINATION_TYPE constant\n * @public\n */\nexport type ConsultTransferDestinationType = Enum<typeof CONSULT_TRANSFER_DESTINATION_TYPE>;\n\n/**\n * Defines all supported media channel types for customer interactions\n * These represent the different ways customers can communicate with agents\n * @public\n */\nexport const MEDIA_CHANNEL = {\n /** Email-based communication channel */\n EMAIL: 'email',\n /** Web-based chat communication channel */\n CHAT: 'chat',\n /** Voice/phone communication channel */\n TELEPHONY: 'telephony',\n /** Social media platform communication channel */\n SOCIAL: 'social',\n /** SMS text messaging communication channel */\n SMS: 'sms',\n /** Facebook Messenger communication channel */\n FACEBOOK: 'facebook',\n /** WhatsApp messaging communication channel */\n WHATSAPP: 'whatsapp',\n} as const;\n\n/**\n * Type representing valid media channels\n * Derived from the MEDIA_CHANNEL constant\n * @public\n */\nexport type MEDIA_CHANNEL = Enum<typeof MEDIA_CHANNEL>;\n\n/**\n * Enumeration of all task-related events that can occur in the contact center system\n * These events represent different states and actions in the task lifecycle\n * @public\n */\nexport enum TASK_EVENTS {\n /**\n * Triggered when a new task is received by the system\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_INCOMING, (task: ITask) => {\n * console.log('New task received:', task.data.interactionId);\n * // Handle incoming task\n * });\n * ```\n */\n TASK_INCOMING = 'task:incoming',\n\n /**\n * Triggered when a task is successfully assigned to an agent\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_ASSIGNED, (task: ITask) => {\n * console.log('Task assigned:', task.data.interactionId);\n * // Begin handling the assigned task\n * });\n * ```\n */\n TASK_ASSIGNED = 'task:assigned',\n\n /**\n * Triggered when the media state of a task changes\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_MEDIA, (track: MediaStreamTrack) => {\n * // Handle media track updates\n * });\n * ```\n */\n TASK_MEDIA = 'task:media',\n\n /**\n * Triggered when a task is removed from an agent\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_UNASSIGNED, (task: ITask) => {\n * console.log('Task unassigned:', task.data.interactionId);\n * // Clean up task resources\n * });\n * ```\n */\n TASK_UNASSIGNED = 'task:unassigned',\n\n /**\n * Triggered when a task is placed on hold\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_HOLD, (task: ITask) => {\n * console.log('Task placed on hold:', task.data.interactionId);\n * // Update UI to show hold state\n * });\n * ```\n */\n TASK_HOLD = 'task:hold',\n\n /**\n * Triggered when a task is resumed from hold\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_RESUME, (task: ITask) => {\n * console.log('Task resumed from hold:', task.data.interactionId);\n * // Update UI to show active state\n * });\n * ```\n */\n TASK_RESUME = 'task:resume',\n\n /**\n * Triggered when a consultation session ends\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONSULT_END, (task: ITask) => {\n * console.log('Consultation ended:', task.data.interactionId);\n * // Clean up consultation resources\n * });\n * ```\n */\n TASK_CONSULT_END = 'task:consultEnd',\n\n /**\n * Triggered when a queue consultation is cancelled\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONSULT_QUEUE_CANCELLED, (task: ITask) => {\n * console.log('Queue consultation cancelled:', task.data.interactionId);\n * // Handle consultation cancellation\n * });\n * ```\n */\n TASK_CONSULT_QUEUE_CANCELLED = 'task:consultQueueCancelled',\n\n /**\n * Triggered when a queue consultation fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONSULT_QUEUE_FAILED, (task: ITask) => {\n * console.log('Queue consultation failed:', task.data.interactionId);\n * // Handle consultation failure\n * });\n * ```\n */\n TASK_CONSULT_QUEUE_FAILED = 'task:consultQueueFailed',\n\n /**\n * Triggered when a consultation request is accepted\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONSULT_ACCEPTED, (task: ITask) => {\n * console.log('Consultation accepted:', task.data.interactionId);\n * // Begin consultation\n * });\n * ```\n */\n TASK_CONSULT_ACCEPTED = 'task:consultAccepted',\n\n /**\n * Triggered when consultation is in progress\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONSULTING, (task: ITask) => {\n * console.log('Consulting in progress:', task.data.interactionId);\n * // Handle ongoing consultation\n * });\n * ```\n */\n TASK_CONSULTING = 'task:consulting',\n\n /**\n * Triggered when a new consultation is created\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONSULT_CREATED, (task: ITask) => {\n * console.log('Consultation created:', task.data.interactionId);\n * // Initialize consultation\n * });\n * ```\n */\n TASK_CONSULT_CREATED = 'task:consultCreated',\n\n /**\n * Triggered when a consultation is offered\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_OFFER_CONSULT, (task: ITask) => {\n * console.log('Consultation offered:', task.data.interactionId);\n * // Handle consultation offer\n * });\n * ```\n */\n TASK_OFFER_CONSULT = 'task:offerConsult',\n\n /**\n * Triggered when a task is completed/terminated\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_END, (task: ITask) => {\n * console.log('Task ended:', task.data.interactionId);\n * // Clean up and finalize task\n * });\n * ```\n */\n TASK_END = 'task:end',\n\n /**\n * Triggered when a task enters wrap-up state\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_WRAPUP, (task: ITask) => {\n * console.log('Task in wrap-up:', task.data.interactionId);\n * // Begin wrap-up process\n * });\n * ```\n */\n TASK_WRAPUP = 'task:wrapup',\n\n /**\n * Triggered when task wrap-up is completed\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_WRAPPEDUP, (task: ITask) => {\n * console.log('Task wrapped up:', task.data.interactionId);\n * // Finalize task completion\n * });\n * ```\n */\n TASK_WRAPPEDUP = 'task:wrappedup',\n\n /**\n * Triggered when recording is paused\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_RECORDING_PAUSED, (task: ITask) => {\n * console.log('Recording paused:', task.data.interactionId);\n * // Update recording state\n * });\n * ```\n */\n TASK_RECORDING_PAUSED = 'task:recordingPaused',\n\n /**\n * Triggered when recording pause attempt fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_RECORDING_PAUSE_FAILED, (task: ITask) => {\n * console.log('Recording pause failed:', task.data.interactionId);\n * // Handle pause failure\n * });\n * ```\n */\n TASK_RECORDING_PAUSE_FAILED = 'task:recordingPauseFailed',\n\n /**\n * Triggered when recording is resumed\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_RECORDING_RESUMED, (task: ITask) => {\n * console.log('Recording resumed:', task.data.interactionId);\n * // Update recording state\n * });\n * ```\n */\n TASK_RECORDING_RESUMED = 'task:recordingResumed',\n\n /**\n * Triggered when recording resume attempt fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_RECORDING_RESUME_FAILED, (task: ITask) => {\n * console.log('Recording resume failed:', task.data.interactionId);\n * // Handle resume failure\n * });\n * ```\n */\n TASK_RECORDING_RESUME_FAILED = 'task:recordingResumeFailed',\n\n /**\n * Triggered when a task is rejected/unanswered\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_REJECT, (task: ITask) => {\n * console.log('Task rejected:', task.data.interactionId);\n * // Handle task rejection\n * });\n * ```\n */\n TASK_REJECT = 'task:rejected',\n\n /**\n * Triggered when an outdial call fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_OUTDIAL_FAILED, (reason: string) => {\n * console.log('Outdial failed:', reason);\n * // Handle outdial failure\n * });\n * ```\n */\n TASK_OUTDIAL_FAILED = 'task:outdialFailed',\n\n /**\n * Triggered when a task is populated with data\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_HYDRATE, (task: ITask) => {\n * console.log('Task hydrated:', task.data.interactionId);\n * // Process task data\n * });\n * ```\n */\n TASK_HYDRATE = 'task:hydrate',\n\n /**\n * Triggered when a new contact is offered\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_OFFER_CONTACT, (task: ITask) => {\n * console.log('Contact offered:', task.data.interactionId);\n * // Handle contact offer\n * });\n * ```\n */\n TASK_OFFER_CONTACT = 'task:offerContact',\n\n /**\n * Triggered when a task has been successfully auto-answered\n * This event is emitted after the SDK automatically accepts a task due to:\n * - WebRTC calls with auto-answer enabled\n * - Agent-initiated outdial calls\n * - Other auto-answer scenarios\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_AUTO_ANSWERED, (task: ITask) => {\n * console.log('Task auto-answered:', task.data.interactionId);\n * // Update UI - enable cancel button, etc.\n * });\n * ```\n */\n TASK_AUTO_ANSWERED = 'task:autoAnswered',\n\n /**\n * Triggered when a conference is being established\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_ESTABLISHING, (task: ITask) => {\n * console.log('Conference establishing:', task.data.interactionId);\n * // Handle conference setup in progress\n * });\n * ```\n */\n TASK_CONFERENCE_ESTABLISHING = 'task:conferenceEstablishing',\n\n /**\n * Triggered when a conference is started successfully\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_STARTED, (task: ITask) => {\n * console.log('Conference started:', task.data.interactionId);\n * // Handle conference start\n * });\n * ```\n */\n TASK_CONFERENCE_STARTED = 'task:conferenceStarted',\n\n /**\n * Triggered when a conference fails to start\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_FAILED, (task: ITask) => {\n * console.log('Conference failed:', task.data.interactionId);\n * // Handle conference failure\n * });\n * ```\n */\n TASK_CONFERENCE_FAILED = 'task:conferenceFailed',\n\n /**\n * Triggered when a conference is ended successfully\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_ENDED, (task: ITask) => {\n * console.log('Conference ended:', task.data.interactionId);\n * // Handle conference end\n * });\n * ```\n */\n TASK_CONFERENCE_ENDED = 'task:conferenceEnded',\n\n /**\n * Triggered when a participant joins the conference\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_PARTICIPANT_JOINED, (task: ITask) => {\n * console.log('Participant joined conference:', task.data.interactionId);\n * // Handle participant joining\n * });\n * ```\n */\n TASK_PARTICIPANT_JOINED = 'task:participantJoined',\n\n /**\n * Triggered when a participant leaves the conference\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_PARTICIPANT_LEFT, (task: ITask) => {\n * console.log('Participant left conference:', task.data.interactionId);\n * // Handle participant leaving\n * });\n * ```\n */\n TASK_PARTICIPANT_LEFT = 'task:participantLeft',\n\n /**\n * Triggered when conference transfer is successful\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_TRANSFERRED, (task: ITask) => {\n * console.log('Conference transferred:', task.data.interactionId);\n * // Handle successful conference transfer\n * });\n * ```\n */\n TASK_CONFERENCE_TRANSFERRED = 'task:conferenceTransferred',\n\n /**\n * Triggered when conference transfer fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_TRANSFER_FAILED, (task: ITask) => {\n * console.log('Conference transfer failed:', task.data.interactionId);\n * // Handle failed conference transfer\n * });\n * ```\n */\n TASK_CONFERENCE_TRANSFER_FAILED = 'task:conferenceTransferFailed',\n\n /**\n * Triggered when ending a conference fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_END_FAILED, (task: ITask) => {\n * console.log('Conference end failed:', task.data.interactionId);\n * // Handle failed conference end\n * });\n * ```\n */\n TASK_CONFERENCE_END_FAILED = 'task:conferenceEndFailed',\n\n /**\n * Triggered when participant exit from conference fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_PARTICIPANT_LEFT_FAILED, (task: ITask) => {\n * console.log('Participant failed to leave conference:', task.data.interactionId);\n * // Handle failed participant exit\n * });\n * ```\n */\n TASK_PARTICIPANT_LEFT_FAILED = 'task:participantLeftFailed',\n\n /**\n * Triggered when a contact is merged\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_MERGED, (task: ITask) => {\n * console.log('Contact merged:', task.data.interactionId);\n * // Handle contact merge\n * });\n * ```\n */\n TASK_MERGED = 'task:merged',\n\n /**\n * Triggered when a participant enters post-call activity state\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_POST_CALL_ACTIVITY, (task: ITask) => {\n * console.log('Participant in post-call activity:', task.data.interactionId);\n * // Handle post-call activity\n * });\n * ```\n */\n TASK_POST_CALL_ACTIVITY = 'task:postCallActivity',\n\n /**\n * Triggered when a campaign preview contact is offered to the agent\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CAMPAIGN_PREVIEW_RESERVATION, (data: AgentContact) => {\n * console.log('Campaign preview contact received:', data.interactionId);\n * // Handle campaign preview reservation\n * });\n * ```\n */\n TASK_CAMPAIGN_PREVIEW_RESERVATION = 'task:campaignPreviewReservation',\n}\n\n/**\n * Represents a customer interaction within the contact center system\n * Contains comprehensive details about an ongoing customer interaction\n * @public\n */\nexport type Interaction = {\n /** Indicates if the interaction is managed by Flow Control */\n isFcManaged: boolean;\n /** Indicates if the interaction has been terminated */\n isTerminated: boolean;\n /** The type of media channel for this interaction */\n mediaType: MEDIA_CHANNEL;\n /** List of previous virtual teams that handled this interaction */\n previousVTeams: string[];\n /** Current state of the interaction */\n state: string;\n /** Current virtual team handling the interaction */\n currentVTeam: string;\n /** List of participants in the interaction */\n participants: any; // TODO: Define specific participant type\n /** Unique identifier for the interaction */\n interactionId: string;\n /** Organization identifier */\n orgId: string;\n /** Timestamp when the interaction was created */\n createdTimestamp?: number;\n /** Indicates if wrap-up assistance is enabled */\n isWrapUpAssist?: boolean;\n /** Detailed call processing information and metadata */\n callProcessingDetails: {\n /** Name of the Queue Manager handling this interaction */\n QMgrName: string;\n /** Indicates if the task should be self-serviced */\n taskToBeSelfServiced: string;\n /** Automatic Number Identification (caller's number) */\n ani: string;\n /** Display version of the ANI */\n displayAni: string;\n /** Dialed Number Identification Service number */\n dnis: string;\n /** Tenant identifier */\n tenantId: string;\n /** Queue identifier */\n QueueId: string;\n /** Virtual team identifier */\n vteamId: string;\n /** Indicates if pause/resume functionality is enabled */\n pauseResumeEnabled?: string;\n /** Duration of pause in seconds */\n pauseDuration?: string;\n /** Indicates if the interaction is currently paused */\n isPaused?: string;\n /** Indicates if recording is in progress */\n recordInProgress?: string;\n /** Indicates if recording has started */\n recordingStarted?: string;\n /** Indicates if Consult to Queue is in progress */\n ctqInProgress?: string;\n /** Indicates if outdial transfer to queue is enabled */\n outdialTransferToQueueEnabled?: string;\n /** IVR conversation transcript */\n convIvrTranscript?: string;\n /** Customer's name */\n customerName: string;\n /** Name of the virtual team */\n virtualTeamName: string;\n /** RONA (Redirection on No Answer) timeout in seconds */\n ronaTimeout: string;\n /** Category of the interaction */\n category: string;\n /** Reason for the interaction */\n reason: string;\n /** Source number for the interaction */\n sourceNumber: string;\n /** Source page that initiated the interaction */\n sourcePage: string;\n /** Application user identifier */\n appUser: string;\n /** Customer's contact number */\n customerNumber: string;\n /** Code indicating the reason for interaction */\n reasonCode: string;\n /** Path taken through the IVR system */\n IvrPath: string;\n /** Identifier for the IVR path */\n pathId: string;\n /** Email address or contact point that initiated the interaction */\n fromAddress: string;\n /** Identifier of the parent interaction for related interactions */\n parentInteractionId?: string;\n /** Identifier of the child interaction for related interactions */\n childInteractionId?: string;\n /** Type of relationship between parent and child interactions */\n relationshipType?: string;\n /** ANI of the parent interaction */\n parent_ANI?: string;\n /** DNIS of the parent interaction */\n parent_DNIS?: string;\n /** Indicates if the consulted destination agent has joined */\n consultDestinationAgentJoined?: boolean | string;\n /** Name of the destination agent for consultation */\n consultDestinationAgentName?: string;\n /** DN of the parent interaction's agent */\n parent_Agent_DN?: string;\n /** Name of the parent interaction's agent */\n parent_Agent_Name?: string;\n /** Team name of the parent interaction's agent */\n parent_Agent_TeamName?: string;\n /** Indicates if the interaction is in conference mode */\n isConferencing?: string;\n /** Type of monitoring being performed */\n monitorType?: string;\n /** Name of the workflow being executed */\n workflowName?: string;\n /** Identifier of the workflow */\n workflowId?: string;\n /** Indicates if monitoring is in invisible mode */\n monitoringInvisibleMode?: string;\n /** Identifier for the monitoring request */\n monitoringRequestId?: string;\n /** Timeout for participant invitation */\n participantInviteTimeout?: string;\n /** Filename for music on hold */\n mohFileName?: string;\n /** Flag for continuing recording during transfer */\n CONTINUE_RECORDING_ON_TRANSFER?: string;\n /** Entry point identifier */\n EP_ID?: string;\n /** Type of routing being used */\n ROUTING_TYPE?: string;\n /** Events registered with Flow Control Engine */\n fceRegisteredEvents?: string;\n /** Indicates if the interaction is parked */\n isParked?: string;\n /** Priority level of the interaction */\n priority?: string;\n /** Identifier for the routing strategy */\n routingStrategyId?: string;\n /** Current state of monitoring */\n monitoringState?: string;\n /** Indicates if blind transfer is in progress */\n BLIND_TRANSFER_IN_PROGRESS?: boolean;\n /** Desktop view configuration for Flow Control */\n fcDesktopView?: string;\n /** Agent ID who initiated the outdial call */\n outdialAgentId?: string;\n };\n /** Main interaction identifier for related interactions */\n mainInteractionId?: string;\n /** Media-specific information for the interaction */\n media: Record<\n string,\n {\n /** Unique identifier for the media resource */\n mediaResourceId: string;\n /** Type of media channel */\n mediaType: MEDIA_CHANNEL;\n /** Media manager handling this media */\n mediaMgr: string;\n /** List of participant identifiers */\n participants: string[];\n /** Type of media */\n mType: string;\n /** Indicates if media is on hold */\n isHold: boolean;\n /** Timestamp when media was put on hold */\n holdTimestamp: number | null;\n }\n >;\n /** Owner of the interaction */\n owner: string;\n /** Primary media channel for the interaction */\n mediaChannel: MEDIA_CHANNEL;\n /** Direction information for the contact */\n contactDirection: {type: string};\n /** Type of outbound interaction */\n outboundType?: string;\n /** Parameters passed through the call flow */\n callFlowParams: Record<\n string,\n {\n /** Name of the parameter */\n name: string;\n /** Qualifier for the parameter */\n qualifier: string;\n /** Description of the parameter */\n description: string;\n /** Data type of the parameter value */\n valueDataType: string;\n /** Value of the parameter */\n value: string;\n }\n >;\n};\n\n/**\n * Task payload containing detailed information about a contact center task\n * This structure encapsulates all relevant data for task management\n * @public\n */\nexport type TaskData = {\n /** Unique identifier for the media resource handling this task */\n mediaResourceId: string;\n /** Type of event that triggered this task data */\n eventType: string;\n /** Timestamp when the event occurred */\n eventTime?: number;\n /** Identifier of the agent handling the task */\n agentId: string;\n /** Identifier of the destination agent for transfers/consults */\n destAgentId: string;\n /** Unique tracking identifier for the task */\n trackingId: string;\n /** Media resource identifier for consultation operations */\n consultMediaResourceId: string;\n /** Detailed interaction information */\n interaction: Interaction;\n /** Unique identifier for the participant */\n participantId?: string;\n /** Indicates if the task is from the owner */\n fromOwner?: boolean;\n /** Indicates if the task is to the owner */\n toOwner?: boolean;\n /** Identifier for child interaction in consult/transfer scenarios */\n childInteractionId?: string;\n /** Unique identifier for the interaction */\n interactionId: string;\n /** Organization identifier */\n orgId: string;\n /** Current owner of the task */\n owner: string;\n /** Queue manager handling the task */\n queueMgr: string;\n /** Name of the queue where task is queued */\n queueName?: string;\n /** Type of the task */\n type: string;\n /** Timeout value for RONA (Redirection on No Answer) in seconds */\n ronaTimeout?: number;\n /** Indicates if the task is in consultation state */\n isConsulted?: boolean;\n /** Indicates if the task is in conference state */\n isConferencing: boolean;\n /** Indicates if a conference is currently in progress (2+ active agents) */\n isConferenceInProgress?: boolean;\n /** Identifier of agent who last updated the task */\n updatedBy?: string;\n /** Type of destination for transfer/consult */\n destinationType?: string;\n /** Indicates if the task was automatically resumed */\n autoResumed?: boolean;\n /** Code indicating the reason for an action */\n reasonCode?: string | number;\n /** Description of the reason for an action */\n reason?: string;\n /** Identifier of the consulting agent */\n consultingAgentId?: string;\n /** Unique identifier for the task */\n taskId?: string;\n /** Task details including state and media information */\n task?: Interaction;\n /** Unique identifier for monitoring offered events */\n id?: string;\n /** Indicates if the web call is muted */\n isWebCallMute?: boolean;\n /** Identifier for reservation interaction */\n reservationInteractionId?: string;\n /** Identifier for the reserved agent channel (used for campaign tasks) */\n reservedAgentChannelId?: string;\n /** Indicates if wrap-up is required for this task */\n wrapUpRequired?: boolean;\n /** Indicates if auto-answer is in progress for this task */\n isAutoAnswering?: boolean;\n /** Indicates if wrap-up is required for this task */\n agentsPendingWrapUp?: string[];\n};\n\n/**\n * Type representing an agent contact message within the contact center system\n * Contains comprehensive interaction and task related details for agent operations\n * @public\n */\nexport type AgentContact = Msg<{\n /** Unique identifier for the media resource */\n mediaResourceId: string;\n /** Type of the event (e.g., 'AgentDesktopMessage') */\n eventType: string;\n /** Timestamp when the event occurred */\n eventTime?: number;\n /** Unique identifier of the agent handling the contact */\n agentId: string;\n /** Identifier of the destination agent for transfers/consults */\n destAgentId: string;\n /** Unique tracking identifier for the contact */\n trackingId: string;\n /** Media resource identifier for consult operations */\n consultMediaResourceId: string;\n /** Detailed interaction information including media and participant data */\n interaction: Interaction;\n /** Unique identifier for the participant */\n participantId?: string;\n /** Indicates if the message is from the owner of the interaction */\n fromOwner?: boolean;\n /** Indicates if the message is to the owner of the interaction */\n toOwner?: boolean;\n /** Identifier for child interaction in case of consult/transfer */\n childInteractionId?: string;\n /** Unique identifier for the interaction */\n interactionId: string;\n /** Organization identifier */\n orgId: string;\n /** Current owner of the interaction */\n owner: string;\n /** Queue manager handling the interaction */\n queueMgr: string;\n /** Name of the queue where interaction is queued */\n queueName?: string;\n /** Type of the contact/interaction */\n type: string;\n /** Timeout value for RONA (Redirection on No Answer) in seconds */\n ronaTimeout?: number;\n /** Indicates if the interaction is in consult state */\n isConsulted?: boolean;\n /** Indicates if the interaction is in conference state */\n isConferencing: boolean;\n /** Identifier of the agent who last updated the interaction */\n updatedBy?: string;\n /** Type of destination for transfer/consult */\n destinationType?: string;\n /** Indicates if the interaction was automatically resumed */\n autoResumed?: boolean;\n /** Code indicating the reason for an action */\n reasonCode?: string | number;\n /** Description of the reason for an action */\n reason?: string;\n /** Identifier of the consulting agent */\n consultingAgentId?: string;\n /** Unique identifier for the task */\n taskId?: string;\n /** Task details including media and state information */\n task?: Interaction;\n /** Identifier of the supervisor monitoring the interaction */\n supervisorId?: string;\n /** Type of monitoring (e.g., 'SILENT', 'BARGE_IN') */\n monitorType?: string;\n /** Dial number of the supervisor */\n supervisorDN?: string;\n /** Unique identifier for monitoring offered events */\n id?: string;\n /** Indicates if the web call is muted */\n isWebCallMute?: boolean;\n /** Identifier for reservation interaction */\n reservationInteractionId?: string;\n /** Identifier for the reserved agent channel */\n reservedAgentChannelId?: string;\n /** Current monitoring state information */\n monitoringState?: {\n /** Type of monitoring state */\n type: string;\n };\n /** Name of the supervisor monitoring the interaction */\n supervisorName?: string;\n}>;\n\n/**\n * Information about a virtual team in the contact center\n * @ignore\n */\nexport type VTeam = {\n /** Profile ID of the agent in the virtual team */\n agentProfileId: string;\n /** Session ID of the agent in the virtual team */\n agentSessionId: string;\n /** Type of channel handled by the virtual team */\n channelType: string;\n /** Type of the virtual team */\n type: string;\n /** Optional tracking identifier */\n trackingId?: string;\n};\n\n/**\n * Detailed information about a virtual team configuration\n * @ignore\n */\nexport type VteamDetails = {\n /** Name of the virtual team */\n name: string;\n /** Type of channel handled by the virtual team */\n channelType: string;\n /** Unique identifier for the virtual team */\n id: string;\n /** Type of the virtual team */\n type: string;\n /** ID of the analyzer associated with the team */\n analyzerId: string;\n};\n\n/**\n * Response type for successful virtual team operations\n * Contains details about virtual teams and their capabilities\n * @ignore\n */\nexport type VTeamSuccess = Msg<{\n /** Response data containing team information */\n data: {\n /** List of virtual team details */\n vteamList: Array<VteamDetails>;\n /** Whether queue consultation is allowed */\n allowConsultToQueue: boolean;\n };\n /** Method name from JavaScript */\n jsMethod: string;\n /** Data related to the call */\n callData: string;\n /** Session ID of the agent */\n agentSessionId: string;\n}>;\n\n/**\n * Parameters for putting a task on hold or resuming from hold\n * @public\n */\nexport type HoldResumePayload = {\n /** Unique identifier for the media resource to hold/resume */\n mediaResourceId: string;\n};\n\n/**\n * Parameters for resuming a task's recording\n * @public\n */\nexport type ResumeRecordingPayload = {\n /** Indicates if the recording was automatically resumed */\n autoResumed: boolean;\n};\n\n/**\n * Parameters for transferring a task to another destination\n * @public\n */\nexport type TransferPayLoad = {\n /** Destination identifier where the task will be transferred to */\n to: string;\n /** Type of the destination (queue, agent, etc.) */\n destinationType: DestinationType;\n};\n\n/**\n * Parameters for initiating a consultative transfer\n * @public\n */\nexport type ConsultTransferPayLoad = {\n /** Destination identifier for the consultation transfer */\n to: string;\n /** Type of the consultation transfer destination */\n destinationType: ConsultTransferDestinationType;\n};\n\n/**\n * Parameters for initiating a consultation with another agent or queue\n * @public\n */\nexport type ConsultPayload = {\n /** Destination identifier for the consultation */\n to: string | undefined;\n /** Type of the consultation destination (agent, queue, etc.) */\n destinationType: DestinationType;\n /** Whether to hold other participants during consultation (always true) */\n holdParticipants?: boolean;\n};\n\n/**\n * Parameters for ending a consultation task\n * @public\n */\nexport type ConsultEndPayload = {\n /** Indicates if this is a consultation operation */\n isConsult: boolean;\n /** Indicates if this involves a secondary entry point or DN agent */\n isSecondaryEpDnAgent?: boolean;\n /** Optional queue identifier for the consultation */\n queueId?: string;\n /** Identifier of the task being consulted */\n taskId: string;\n};\n\n/**\n * Parameters for transferring a task to another destination\n * @public\n */\nexport type TransferPayload = {\n /** Destination identifier where the task will be transferred */\n to: string | undefined;\n /** Type of the transfer destination */\n destinationType: DestinationType;\n};\n\n/**\n * API payload for ending a consultation\n * This is the actual payload that is sent to the developer API\n * @public\n */\nexport type ConsultEndAPIPayload = {\n /** Optional identifier of the queue involved in the consultation */\n queueId?: string;\n};\n\n/**\n * Data required for consulting and conferencing operations\n * @public\n */\nexport type ConsultConferenceData = {\n /** Identifier of the agent initiating consult/conference */\n agentId?: string;\n /** Target destination for the consult/conference */\n to: string | undefined;\n /** Type of destination (e.g., 'agent', 'queue') */\n destinationType: string;\n};\n\n/**\n * Parameters required for cancelling a consult to queue operation\n * @public\n */\nexport type cancelCtq = {\n /** Identifier of the agent cancelling the CTQ */\n agentId: string;\n /** Identifier of the queue where consult was initiated */\n queueId: string;\n};\n\n/**\n * Parameters required for declining a task\n * @public\n */\nexport type declinePayload = {\n /** Identifier of the media resource to decline */\n mediaResourceId: string;\n};\n\n/**\n * Parameters for wrapping up a task with relevant completion details\n * @public\n */\nexport type WrapupPayLoad = {\n /** The reason provided for wrapping up the task */\n wrapUpReason: string;\n /** Auxiliary code identifier associated with the wrap-up state */\n auxCodeId: string;\n};\n\n/**\n * Configuration parameters for initiating outbound dialer tasks\n * @public\n */\nexport type DialerPayload = {\n /** An entryPointId for respective task */\n entryPointId: string;\n /** A valid customer DN, on which the response is expected, maximum length 36 characters */\n destination: string;\n /** The direction of the call */\n direction: 'OUTBOUND';\n /** Schema-free data tuples to pass specific data based on outboundType (max 30 tuples) */\n attributes: {[key: string]: string};\n /** The media type for the request */\n mediaType: 'telephony' | 'chat' | 'social' | 'email';\n /** The outbound type for the task */\n outboundType: 'OUTDIAL' | 'CALLBACK' | 'EXECUTE_FLOW';\n /** The Outdial ANI number that will be used while making a call to the customer. */\n origin: string;\n};\n\n/**\n * Payload for campaign preview contact operations (accept, skip, remove)\n * @public\n */\nexport type PreviewContactPayload = {\n /** The interaction ID from the campaign reservation */\n interactionId: string;\n /** The campaign name (not a UUID). Available from the reservation event at\n * `task.data.interaction.callProcessingDetails.campaignId` or `task.data.campaignId`. */\n campaignId: string;\n};\n\n/**\n * Data structure for cleaning up contact resources\n * @public\n */\nexport type ContactCleanupData = {\n /** Type of cleanup operation being performed */\n type: string;\n /** Organization identifier where cleanup is occurring */\n orgId: string;\n /** Identifier of the agent associated with the contacts */\n agentId: string;\n /** Detailed data about the cleanup operation */\n data: {\n /** Type of event that triggered the cleanup */\n eventType: string;\n /** Identifier of the interaction being cleaned up */\n interactionId: string;\n /** Organization identifier */\n orgId: string;\n /** Media manager handling the cleanup */\n mediaMgr: string;\n /** Tracking identifier for the cleanup operation */\n trackingId: string;\n /** Type of media being cleaned up */\n mediaType: string;\n /** Optional destination information */\n destination?: string;\n /** Whether this is a broadcast cleanup */\n broadcast: boolean;\n /** Type of cleanup being performed */\n type: string;\n };\n};\n\n/**\n * Response type for task public methods\n * Can be an {@link AgentContact} object containing updated task state,\n * an Error in case of failure, or void for operations that don't return data\n * @public\n */\nexport type TaskResponse = AgentContact | Error | void;\n\n/**\n * Interface for managing task-related operations in the contact center\n * Extends EventEmitter to support event-driven task updates\n */\nexport interface ITask extends EventEmitter {\n /**\n * Event data received in the Contact Center events.\n * Contains detailed task information including interaction details, media resources,\n * and participant data as defined in {@link TaskData}\n */\n data: TaskData;\n\n /**\n * Map associating tasks with their corresponding call identifiers.\n */\n webCallMap: Record<TaskId, CallId>;\n\n /**\n * Auto-wrapup timer for the task\n * This is used to automatically wrap up tasks after a specified duration\n * as defined in {@link AutoWrapup}\n */\n autoWrapup?: AutoWrapup;\n\n /**\n * Cancels the auto-wrapup timer for the task.\n * This method stops the auto-wrapup process if it is currently active.\n * Note: This is supported only in single session mode. Not supported in multi-session mode.\n * @returns void\n */\n cancelAutoWrapupTimer(): void;\n\n /**\n * Deregisters all web call event listeners.\n * Used when cleaning up task resources.\n * @ignore\n */\n unregisterWebCallListeners(): void;\n\n /**\n * Updates the task data with new information\n * @param newData - Updated task data to apply, must conform to {@link TaskData} structure\n * @returns Updated task instance\n * @ignore\n */\n updateTaskData(newData: TaskData): ITask;\n\n /**\n * Answers or accepts an incoming task.\n * Once accepted, the task will be assigned to the agent and trigger a {@link TASK_EVENTS.TASK_ASSIGNED} event.\n * The response will contain updated agent contact information as defined in {@link AgentContact}.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.accept();\n * ```\n */\n accept(): Promise<TaskResponse>;\n\n /**\n * Declines an incoming task for Browser Login\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.decline();\n * ```\n */\n decline(): Promise<TaskResponse>;\n\n /**\n * Places the current task on hold.\n * @param mediaResourceId - Optional media resource ID to use for the hold operation. If not provided, uses the task's current mediaResourceId\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * // Hold with default mediaResourceId\n * await task.hold();\n *\n * // Hold with custom mediaResourceId\n * await task.hold('custom-media-resource-id');\n * ```\n */\n hold(mediaResourceId?: string): Promise<TaskResponse>;\n\n /**\n * Resumes a task that was previously on hold.\n * @param mediaResourceId - Optional media resource ID to use for the resume operation. If not provided, uses the task's current mediaResourceId from interaction media\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * // Resume with default mediaResourceId\n * await task.resume();\n *\n * // Resume with custom mediaResourceId\n * await task.resume('custom-media-resource-id');\n * ```\n */\n resume(mediaResourceId?: string): Promise<TaskResponse>;\n\n /**\n * Ends/terminates the current task.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.end();\n * ```\n */\n end(): Promise<TaskResponse>;\n\n /**\n * Initiates wrap-up process for the task with specified details.\n * @param wrapupPayload - Wrap-up details including reason and auxiliary code\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.wrapup({\n * wrapUpReason: \"Customer issue resolved\",\n * auxCodeId: \"RESOLVED\"\n * });\n * ```\n */\n wrapup(wrapupPayload: WrapupPayLoad): Promise<TaskResponse>;\n\n /**\n * Pauses the recording for current task.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.pauseRecording();\n * ```\n */\n pauseRecording(): Promise<TaskResponse>;\n\n /**\n * Resumes a previously paused recording.\n * @param resumeRecordingPayload - Parameters for resuming the recording\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.resumeRecording({\n * autoResumed: false\n * });\n * ```\n */\n resumeRecording(resumeRecordingPayload: ResumeRecordingPayload): Promise<TaskResponse>;\n\n /**\n * Initiates a consultation with another agent or queue.\n * @param consultPayload - Consultation details including destination and type\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.consult({ to: \"agentId\", destinationType: \"agent\" });\n * ```\n */\n consult(consultPayload: ConsultPayload): Promise<TaskResponse>;\n\n /**\n * Ends an ongoing consultation.\n * @param consultEndPayload - Details for ending the consultation\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.endConsult({ isConsult: true, taskId: \"taskId\" });\n * ```\n */\n endConsult(consultEndPayload: ConsultEndPayload): Promise<TaskResponse>;\n\n /**\n * Transfers the task to another agent or queue.\n * @param transferPayload - Transfer details including destination and type\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.transfer({ to: \"queueId\", destinationType: \"queue\" });\n * ```\n */\n transfer(transferPayload: TransferPayLoad): Promise<TaskResponse>;\n\n /**\n * Transfers the task after consultation.\n * @param consultTransferPayload - Details for consult transfer (optional)\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.consultTransfer({ to: \"agentId\", destinationType: \"agent\" });\n * ```\n */\n consultTransfer(consultTransferPayload?: ConsultTransferPayLoad): Promise<TaskResponse>;\n\n /**\n * Initiates a consult conference (merge consult call with main call).\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.consultConference();\n * ```\n */\n consultConference(): Promise<TaskResponse>;\n\n /**\n * Exits from an ongoing conference.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.exitConference();\n * ```\n */\n exitConference(): Promise<TaskResponse>;\n\n /**\n * Transfers the conference to another participant.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.transferConference();\n * ```\n */\n transferConference(): Promise<TaskResponse>;\n\n /**\n * Toggles mute/unmute for the local audio stream during a WebRTC task.\n * @returns Promise<void>\n * @example\n * ```typescript\n * await task.toggleMute();\n * ```\n */\n toggleMute(): Promise<void>;\n}\n"],"mappings":";;;;;;AAKA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG;EAC9B;EACAE,KAAK,EAAE,OAAO;EACd;EACAC,UAAU,EAAE,YAAY;EACxB;EACAC,KAAK,EAAE,OAAO;EACd;EACAC,UAAU,EAAE;AACd,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMC,iCAAiC,GAAAL,OAAA,CAAAK,iCAAA,GAAG;EAC/C;EACAF,KAAK,EAAE,OAAO;EACd;EACAC,UAAU,EAAE,YAAY;EACxB;EACAF,UAAU,EAAE,YAAY;EACxB;EACAD,KAAK,EAAE;AACT,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMK,aAAa,GAAAN,OAAA,CAAAM,aAAA,GAAG;EAC3B;EACAC,KAAK,EAAE,OAAO;EACd;EACAC,IAAI,EAAE,MAAM;EACZ;EACAC,SAAS,EAAE,WAAW;EACtB;EACAC,MAAM,EAAE,QAAQ;EAChB;EACAC,GAAG,EAAE,KAAK;EACV;EACAC,QAAQ,EAAE,UAAU;EACpB;EACAC,QAAQ,EAAE;AACZ,CAAU;;AAEV;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAJA,IAKYC,WAAW,GAAAd,OAAA,CAAAc,WAAA,0BAAXA,WAAW;EACrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAVYA,WAAW;EAarB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAtBYA,WAAW;EAyBrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAjCYA,WAAW;EAoCrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA7CYA,WAAW;EAgDrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAzDYA,WAAW;EA4DrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EArEYA,WAAW;EAwErB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAjFYA,WAAW;EAoFrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA7FYA,WAAW;EAgGrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAzGYA,WAAW;EA4GrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EArHYA,WAAW;EAwHrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAjIYA,WAAW;EAoIrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA7IYA,WAAW;EAgJrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAzJYA,WAAW;EA4JrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EArKYA,WAAW;EAwKrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAjLYA,WAAW;EAoLrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA7LYA,WAAW;EAgMrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAzMYA,WAAW;EA4MrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EArNYA,WAAW;EAwNrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAjOYA,WAAW;EAoOrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA7OYA,WAAW;EAgPrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAzPYA,WAAW;EA4PrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EArQYA,WAAW;EAwQrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAjRYA,WAAW;EAoRrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA7RYA,WAAW;EAgSrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA7SYA,WAAW;EAgTrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAzTYA,WAAW;EA4TrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EArUYA,WAAW;EAwUrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAjVYA,WAAW;EAoVrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA7VYA,WAAW;EAgWrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAzWYA,WAAW;EA4WrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EArXYA,WAAW;EAwXrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAjYYA,WAAW;EAoYrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA7YYA,WAAW;EAgZrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAzZYA,WAAW;EA4ZrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAraYA,WAAW;EAwarB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAjbYA,WAAW;EAobrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA7bYA,WAAW;EAgcrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAzcYA,WAAW;EAAA,OAAXA,WAAW;AAAA;AA6cvB;AACA;AACA;AACA;AACA;AA+LA;AACA;AACA;AACA;AACA;AA8EA;AACA;AACA;AACA;AACA;AAmFA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AAYA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAkBA;AACA;AACA;AACA;AASA;AACA;AACA;AACA;AA+BA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["DESTINATION_TYPE","exports","QUEUE","DIALNUMBER","AGENT","ENTRYPOINT","CONSULT_TRANSFER_DESTINATION_TYPE","MEDIA_CHANNEL","EMAIL","CHAT","TELEPHONY","SOCIAL","SMS","FACEBOOK","WHATSAPP","TASK_CHANNEL_TYPE","VOICE","DIGITAL","VOICE_VARIANT","PSTN","WEBRTC","TASK_EVENTS"],"sources":["types.ts"],"sourcesContent":["/* eslint-disable import/no-cycle */\nimport type {AnyActorRef} from 'xstate';\nimport {TaskEventPayload} from './state-machine';\nimport {Msg} from '../core/GlobalTypes';\nimport AutoWrapup from './AutoWrapup';\n\n/**\n * Unique identifier for a task in the contact center system\n * @public\n */\nexport type TaskId = string;\n\n/**\n * Unique identifier for a call in the Webex calling system\n */\nexport type CallId = string;\n\n/**\n * Helper type for creating enum-like objects with type safety\n * @internal\n */\ntype Enum<T extends Record<string, unknown>> = T[keyof T];\n\n/**\n * Defines the valid destination types for routing tasks within the contact center\n * Used to specify where a task should be directed\n * @public\n */\nexport const DESTINATION_TYPE = {\n /** Route task to a specific queue */\n QUEUE: 'queue',\n /** Route task to a specific dial number */\n DIALNUMBER: 'dialNumber',\n /** Route task to a specific agent */\n AGENT: 'agent',\n /** Route task to an entry point (supported only for consult operations) */\n ENTRYPOINT: 'entryPoint',\n};\n\n/**\n * Type representing valid destination types for task routing\n * Derived from the DESTINATION_TYPE constant\n * @public\n */\nexport type DestinationType = Enum<typeof DESTINATION_TYPE>;\n\n/**\n * Defines the valid destination types for consult transfer operations\n * Used when transferring a task after consultation\n * @public\n */\nexport const CONSULT_TRANSFER_DESTINATION_TYPE = {\n /** Transfer to a specific agent */\n AGENT: 'agent',\n /** Transfer to an entry point */\n ENTRYPOINT: 'entryPoint',\n /** Transfer to a dial number */\n DIALNUMBER: 'dialNumber',\n /** Transfer to a queue */\n QUEUE: 'queue',\n};\n\n/**\n * Type representing valid destination types for consult transfers\n * Derived from the CONSULT_TRANSFER_DESTINATION_TYPE constant\n * @public\n */\nexport type ConsultTransferDestinationType = Enum<typeof CONSULT_TRANSFER_DESTINATION_TYPE>;\n\n/**\n * Defines all supported media channel types for customer interactions\n * These represent the different ways customers can communicate with agents\n * @public\n */\nexport const MEDIA_CHANNEL = {\n /** Email-based communication channel */\n EMAIL: 'email',\n /** Web-based chat communication channel */\n CHAT: 'chat',\n /** Voice/phone communication channel */\n TELEPHONY: 'telephony',\n /** Social media platform communication channel */\n SOCIAL: 'social',\n /** SMS text messaging communication channel */\n SMS: 'sms',\n /** Facebook Messenger communication channel */\n FACEBOOK: 'facebook',\n /** WhatsApp messaging communication channel */\n WHATSAPP: 'whatsapp',\n} as const;\n\n/**\n * Type representing valid media channels\n * Derived from the MEDIA_CHANNEL constant\n * @public\n */\nexport type MEDIA_CHANNEL = Enum<typeof MEDIA_CHANNEL>;\n\n/**\n * Supported task channel types for UI control configuration\n */\nexport const TASK_CHANNEL_TYPE = {\n VOICE: 'voice',\n DIGITAL: 'digital',\n} as const;\n\nexport type TaskChannelType = Enum<typeof TASK_CHANNEL_TYPE>;\n\n/**\n * Voice channel variants that toggle PSTN/WebRTC specific behaviors\n */\nexport const VOICE_VARIANT = {\n PSTN: 'pstn',\n WEBRTC: 'webrtc',\n} as const;\n\nexport type VoiceVariant = Enum<typeof VOICE_VARIANT>;\n\n/**\n * Enumeration of all task-related events that can occur in the contact center system\n * These events represent different states and actions in the task lifecycle\n * @public\n */\nexport enum TASK_EVENTS {\n /**\n * Triggered when a new task is received by the system\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_INCOMING, (task: ITask) => {\n * console.log('New task received:', task.data.interactionId);\n * // Handle incoming task\n * });\n * ```\n */\n TASK_INCOMING = 'task:incoming',\n\n /**\n * Triggered when a task is successfully assigned to an agent\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_ASSIGNED, (task: ITask) => {\n * console.log('Task assigned:', task.data.interactionId);\n * // Begin handling the assigned task\n * });\n * ```\n */\n TASK_ASSIGNED = 'task:assigned',\n\n /**\n * Triggered when the media state of a task changes\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_MEDIA, (track: MediaStreamTrack) => {\n * // Handle media track updates\n * });\n * ```\n */\n TASK_MEDIA = 'task:media',\n\n /**\n * Triggered when a task is removed from an agent\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_UNASSIGNED, (task: ITask) => {\n * console.log('Task unassigned:', task.data.interactionId);\n * // Clean up task resources\n * });\n * ```\n */\n TASK_UNASSIGNED = 'task:unassigned',\n\n /**\n * Triggered when a task is placed on hold\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_HOLD, (task: ITask) => {\n * console.log('Task placed on hold:', task.data.interactionId);\n * // Update UI to show hold state\n * });\n * ```\n */\n TASK_HOLD = 'task:hold',\n\n /**\n * Triggered when a task is resumed from hold\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_RESUME, (task: ITask) => {\n * console.log('Task resumed from hold:', task.data.interactionId);\n * // Update UI to show active state\n * });\n * ```\n */\n TASK_RESUME = 'task:resume',\n\n /**\n * Triggered when a consultation session ends\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONSULT_END, (task: ITask) => {\n * console.log('Consultation ended:', task.data.interactionId);\n * // Clean up consultation resources\n * });\n * ```\n */\n TASK_CONSULT_END = 'task:consultEnd',\n\n /**\n * Triggered when a queue consultation is cancelled\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONSULT_QUEUE_CANCELLED, (task: ITask) => {\n * console.log('Queue consultation cancelled:', task.data.interactionId);\n * // Handle consultation cancellation\n * });\n * ```\n */\n TASK_CONSULT_QUEUE_CANCELLED = 'task:consultQueueCancelled',\n\n /**\n * Triggered when a queue consultation fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONSULT_QUEUE_FAILED, (task: ITask) => {\n * console.log('Queue consultation failed:', task.data.interactionId);\n * // Handle consultation failure\n * });\n * ```\n */\n TASK_CONSULT_QUEUE_FAILED = 'task:consultQueueFailed',\n\n /**\n * Triggered whenever task UI controls are recalculated\n */\n TASK_UI_CONTROLS_UPDATED = 'task:ui-controls-updated',\n\n /**\n * Triggered when a consultation request is accepted\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONSULT_ACCEPTED, (task: ITask) => {\n * console.log('Consultation accepted:', task.data.interactionId);\n * // Begin consultation\n * });\n * ```\n */\n TASK_CONSULT_ACCEPTED = 'task:consultAccepted',\n\n /**\n * Triggered when consultation is in progress\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONSULTING, (task: ITask) => {\n * console.log('Consulting in progress:', task.data.interactionId);\n * // Handle ongoing consultation\n * });\n * ```\n */\n TASK_CONSULTING = 'task:consulting',\n\n /**\n * Triggered when a new consultation is created\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONSULT_CREATED, (task: ITask) => {\n * console.log('Consultation created:', task.data.interactionId);\n * // Initialize consultation\n * });\n * ```\n */\n TASK_CONSULT_CREATED = 'task:consultCreated',\n\n /**\n * Triggered when a consultation is offered\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_OFFER_CONSULT, (task: ITask) => {\n * console.log('Consultation offered:', task.data.interactionId);\n * // Handle consultation offer\n * });\n * ```\n */\n TASK_OFFER_CONSULT = 'task:offerConsult',\n\n /**\n * Triggered when a task is completed/terminated\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_END, (task: ITask) => {\n * console.log('Task ended:', task.data.interactionId);\n * // Clean up and finalize task\n * });\n * ```\n */\n TASK_END = 'task:end',\n\n /**\n * Triggered when a task enters wrap-up state\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_WRAPUP, (task: ITask) => {\n * console.log('Task in wrap-up:', task.data.interactionId);\n * // Begin wrap-up process\n * });\n * ```\n */\n TASK_WRAPUP = 'task:wrapup',\n\n /**\n * Triggered when task wrap-up is completed\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_WRAPPEDUP, (task: ITask) => {\n * console.log('Task wrapped up:', task.data.interactionId);\n * // Finalize task completion\n * });\n * ```\n */\n TASK_WRAPPEDUP = 'task:wrappedup',\n\n /**\n * Triggered when the task state machine reaches a final state and resources should be cleaned up.\n * Used internally by TaskManager to perform collection/call cleanup.\n * @internal\n */\n TASK_CLEANUP = 'task:cleanup',\n\n /**\n * Triggered when recording is started\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_RECORDING_STARTED, (task: ITask) => {\n * console.log('Recording started:', task.data.interactionId);\n * });\n * ```\n */\n TASK_RECORDING_STARTED = 'task:recordingStarted',\n\n /**\n * Triggered when recording is paused\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_RECORDING_PAUSED, (task: ITask) => {\n * console.log('Recording paused:', task.data.interactionId);\n * // Update recording state\n * });\n * ```\n */\n TASK_RECORDING_PAUSED = 'task:recordingPaused',\n\n /**\n * Triggered when recording pause attempt fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_RECORDING_PAUSE_FAILED, (task: ITask) => {\n * console.log('Recording pause failed:', task.data.interactionId);\n * // Handle pause failure\n * });\n * ```\n */\n TASK_RECORDING_PAUSE_FAILED = 'task:recordingPauseFailed',\n\n /**\n * Triggered when recording is resumed\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_RECORDING_RESUMED, (task: ITask) => {\n * console.log('Recording resumed:', task.data.interactionId);\n * // Update recording state\n * });\n * ```\n */\n TASK_RECORDING_RESUMED = 'task:recordingResumed',\n\n /**\n * Triggered when recording resume attempt fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_RECORDING_RESUME_FAILED, (task: ITask) => {\n * console.log('Recording resume failed:', task.data.interactionId);\n * // Handle resume failure\n * });\n * ```\n */\n TASK_RECORDING_RESUME_FAILED = 'task:recordingResumeFailed',\n\n /**\n * Triggered when a task is rejected/unanswered\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_REJECT, (task: ITask) => {\n * console.log('Task rejected:', task.data.interactionId);\n * // Handle task rejection\n * });\n * ```\n */\n TASK_REJECT = 'task:rejected',\n\n /**\n * Triggered when an outdial call fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_OUTDIAL_FAILED, (reason: string) => {\n * console.log('Outdial failed:', reason);\n * // Handle outdial failure\n * });\n * ```\n */\n TASK_OUTDIAL_FAILED = 'task:outdialFailed',\n\n /**\n * Triggered when a task is populated with data\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_HYDRATE, (task: ITask) => {\n * console.log('Task hydrated:', task.data.interactionId);\n * // Process task data\n * });\n * ```\n */\n TASK_HYDRATE = 'task:hydrate',\n\n /**\n * Triggered when a new contact is offered\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_OFFER_CONTACT, (task: ITask) => {\n * console.log('Contact offered:', task.data.interactionId);\n * // Handle contact offer\n * });\n * ```\n */\n TASK_OFFER_CONTACT = 'task:offerContact',\n\n /**\n * Triggered when a task has been successfully auto-answered\n * This event is emitted after the SDK automatically accepts a task due to:\n * - WebRTC calls with auto-answer enabled\n * - Agent-initiated outdial calls\n * - Other auto-answer scenarios\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_AUTO_ANSWERED, (task: ITask) => {\n * console.log('Task auto-answered:', task.data.interactionId);\n * // Update UI - enable cancel button, etc.\n * });\n * ```\n */\n TASK_AUTO_ANSWERED = 'task:autoAnswered',\n\n /**\n * Triggered when a conference is being established\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_ESTABLISHING, (task: ITask) => {\n * console.log('Conference establishing:', task.data.interactionId);\n * // Handle conference setup in progress\n * });\n * ```\n */\n TASK_CONFERENCE_ESTABLISHING = 'task:conferenceEstablishing',\n\n /**\n * Triggered when a conference is started successfully\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_STARTED, (task: ITask) => {\n * console.log('Conference started:', task.data.interactionId);\n * // Handle conference start\n * });\n * ```\n */\n TASK_CONFERENCE_STARTED = 'task:conferenceStarted',\n\n /**\n * Triggered when a conference fails to start\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_FAILED, (task: ITask) => {\n * console.log('Conference failed:', task.data.interactionId);\n * // Handle conference failure\n * });\n * ```\n */\n TASK_CONFERENCE_FAILED = 'task:conferenceFailed',\n\n /**\n * Triggered when a conference is ended successfully\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_ENDED, (task: ITask) => {\n * console.log('Conference ended:', task.data.interactionId);\n * // Handle conference end\n * });\n * ```\n */\n TASK_CONFERENCE_ENDED = 'task:conferenceEnded',\n\n /**\n * Triggered when a participant joins the conference\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_PARTICIPANT_JOINED, (task: ITask) => {\n * console.log('Participant joined conference:', task.data.interactionId);\n * // Handle participant joining\n * });\n * ```\n */\n TASK_PARTICIPANT_JOINED = 'task:participantJoined',\n\n /**\n * Triggered when a participant leaves the conference\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_PARTICIPANT_LEFT, (task: ITask) => {\n * console.log('Participant left conference:', task.data.interactionId);\n * // Handle participant leaving\n * });\n * ```\n */\n TASK_PARTICIPANT_LEFT = 'task:participantLeft',\n\n /**\n * Triggered when conference transfer is successful\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_TRANSFERRED, (task: ITask) => {\n * console.log('Conference transferred:', task.data.interactionId);\n * // Handle successful conference transfer\n * });\n * ```\n */\n TASK_CONFERENCE_TRANSFERRED = 'task:conferenceTransferred',\n\n /**\n * Triggered when conference transfer fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_TRANSFER_FAILED, (task: ITask) => {\n * console.log('Conference transfer failed:', task.data.interactionId);\n * // Handle failed conference transfer\n * });\n * ```\n */\n TASK_CONFERENCE_TRANSFER_FAILED = 'task:conferenceTransferFailed',\n\n /**\n * Triggered when ending a conference fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_CONFERENCE_END_FAILED, (task: ITask) => {\n * console.log('Conference end failed:', task.data.interactionId);\n * // Handle failed conference end\n * });\n * ```\n */\n TASK_CONFERENCE_END_FAILED = 'task:conferenceEndFailed',\n\n /**\n * Triggered when participant exit from conference fails\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_PARTICIPANT_LEFT_FAILED, (task: ITask) => {\n * console.log('Participant failed to leave conference:', task.data.interactionId);\n * // Handle failed participant exit\n * });\n * ```\n */\n TASK_PARTICIPANT_LEFT_FAILED = 'task:participantLeftFailed',\n\n /**\n * Triggered when agent initiates exit from conference\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_EXIT_CONFERENCE, (task: ITask) => {\n * console.log('Exiting conference:', task.data.interactionId);\n * // Handle conference exit initiation\n * });\n * ```\n */\n TASK_EXIT_CONFERENCE = 'task:exitConference',\n\n /**\n * Triggered when agent initiates conference transfer\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_TRANSFER_CONFERENCE, (task: ITask) => {\n * console.log('Transferring conference:', task.data.interactionId);\n * // Handle conference transfer initiation\n * });\n * ```\n */\n TASK_TRANSFER_CONFERENCE = 'task:transferConference',\n\n /**\n * Triggered when agent switches between consult call and main call.\n * Use task.uiControls to determine current state and button visibility.\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_SWITCH_CALL, (task: ITask) => {\n * console.log('Call switched:', task.data.interactionId);\n * // Update UI based on task.uiControls.main.switch / task.uiControls.consult.switch\n * });\n * ```\n */\n TASK_SWITCH_CALL = 'task:switchCall',\n\n /**\n * Triggered when a contact is merged\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_MERGED, (task: ITask) => {\n * console.log('Contact merged:', task.data.interactionId);\n * // Handle contact merge\n * });\n * ```\n */\n TASK_MERGED = 'task:merged',\n\n /**\n * Triggered when a participant enters post-call activity state\n * @example\n * ```typescript\n * task.on(TASK_EVENTS.TASK_POST_CALL_ACTIVITY, (task: ITask) => {\n * console.log('Participant in post-call activity:', task.data.interactionId);\n * // Handle post-call activity\n * });\n * ```\n */\n TASK_POST_CALL_ACTIVITY = 'task:postCallActivity',\n}\n\n/**\n * Represents a customer interaction within the contact center system\n * Contains comprehensive details about an ongoing customer interaction\n * @public\n */\nexport interface CallAssociatedDatum {\n /** Whether the field can be edited by the agent */\n agentEditable: boolean;\n /** Whether the field is visible to the agent */\n agentViewable: boolean;\n /** Display name for the field */\n displayName: string;\n /** Whether the field is global */\n global: boolean;\n /** Whether the field is secure */\n isSecure: boolean;\n /** Internal field name */\n name: string;\n /** Whether the field is reportable */\n reportable: boolean;\n /** Secure key identifier */\n secureKeyId: string;\n /** Secure key version */\n secureKeyVersion: number;\n /** Data type of the field */\n type: string;\n /** Field value */\n value: string;\n}\n\nexport type CallAssociatedData = Record<string, CallAssociatedDatum>;\n\nexport type CallAssociatedDetails = Record<string, string>;\n\nexport interface FlowParameter {\n /** Parameter name */\n name?: string;\n /** Additional qualifier */\n qualifier?: string;\n /** Description of the parameter */\n description?: string;\n /** Data type of the value */\n valueDataType?: string;\n /** Value associated with the parameter */\n value?: string;\n}\n\nexport interface InteractionParticipant {\n /** Unique participant identifier */\n id: string;\n /** Participant type label used by backend */\n pType: string;\n /** Friendly participant type */\n type: string;\n /** Whether the participant has joined */\n hasJoined: boolean;\n /** Whether the participant has left */\n hasLeft: boolean;\n /** Whether the participant is still in pre-dial */\n isInPredial: boolean;\n /** Optional caller identifier */\n callerId?: string | null;\n /** Whether auto-answer is enabled */\n autoAnswerEnabled?: boolean;\n /** Backchannel/bnr details */\n bnrDetails?: unknown;\n /** Channel identifier for the participant */\n channelId?: string;\n /** Current consult state */\n consultState?: string | null;\n /** Timestamp when consult started */\n consultTimestamp?: number | null;\n /** Current participant state */\n currentState?: string | null;\n /** Timestamp of the current state */\n currentStateTimestamp?: number | null;\n /** Device call identifier */\n deviceCallId?: string | null;\n /** Device identifier */\n deviceId?: string | null;\n /** Device type (AGENT_DN, BROWSER, etc.) */\n deviceType?: string | null;\n /** Dial number associated with participant */\n dn?: string | null;\n /** Whether participant is currently consulted */\n isConsulted?: boolean;\n /** Whether participant offer is active */\n isOffered?: boolean;\n /** Whether participant is in wrap-up */\n isWrapUp?: boolean;\n /** Whether participant completed wrap-up */\n isWrappedUp?: boolean;\n /** Timestamp of when participant joined */\n joinTimestamp?: number | null;\n /** Last updated timestamp */\n lastUpdated?: number | null;\n /** Friendly name of participant */\n name?: string | null;\n /** Queue identifier associated with participant */\n queueId?: string;\n /** Queue manager identifier */\n queueMgrId?: string;\n /** Session identifier */\n sessionId?: string;\n /** Site identifier */\n siteId?: string;\n /** Skill identifier */\n skillId?: string | null;\n /** Skill name */\n skillName?: string | null;\n /** Skill list for participant */\n skills?: string[];\n /** Team identifier */\n teamId?: string;\n /** Team name */\n teamName?: string;\n /** Timestamp for wrap-up */\n wrapUpTimestamp?: number | null;\n /** Additional metadata */\n [key: string]: unknown;\n}\n\nexport type InteractionParticipants = Record<string, InteractionParticipant>;\n\n/**\n * Media entry type from interaction.media\n * Used for media state tracking in consult and conference scenarios\n */\nexport type MediaEntry = {\n /** Unique identifier for the media resource */\n mediaResourceId: string;\n /** Type of media channel */\n mediaType: MEDIA_CHANNEL;\n /** Media manager handling this media */\n mediaMgr: string;\n /** List of participant identifiers */\n participants: string[];\n /** Type of media (e.g., 'mainCall', 'consult') */\n mType: string;\n /** Indicates if media is on hold */\n isHold: boolean;\n /** Timestamp when media was put on hold */\n holdTimestamp: number | null;\n};\n\nexport type Interaction = {\n /** Indicates if the interaction is managed by Flow Control */\n isFcManaged: boolean;\n /** Indicates if the interaction has been terminated */\n isTerminated: boolean;\n /** The type of media channel for this interaction */\n mediaType: MEDIA_CHANNEL;\n /** List of previous virtual teams that handled this interaction */\n previousVTeams: string[];\n /** Current state of the interaction */\n state: string;\n /** Current virtual team handling the interaction */\n currentVTeam: string;\n /** List of participants in the interaction */\n participants: InteractionParticipants;\n /** Detailed call associated data */\n callAssociatedData?: CallAssociatedData;\n /** Simplified call associated key/value pairs */\n callAssociatedDetails?: CallAssociatedDetails;\n /** Unique identifier for the interaction */\n interactionId: string;\n /** Organization identifier */\n orgId: string;\n /** Timestamp when the interaction was created */\n createdTimestamp?: number;\n /** Indicates if wrap-up assistance is enabled */\n isWrapUpAssist?: boolean;\n /** Identifier of parent interaction if applicable */\n parentInteractionId?: string;\n /** Indicates if media is forked for this interaction */\n isMediaForked?: boolean;\n /** Retroactive flow properties returned by backend */\n flowProperties?: Record<string, unknown> | null;\n /** Media specific properties returned by backend */\n mediaProperties?: Record<string, unknown> | null;\n /**\n * Detailed call processing information and metadata.\n * Mirrors the callProcessingDetails section described in Webex Contact Center Agent Contact payloads.\n */\n callProcessingDetails: {\n /** Name of the Queue Manager handling this interaction */\n QMgrName: string;\n /** Indicates if the task should be self-serviced */\n taskToBeSelfServiced: string;\n /** Automatic Number Identification (caller's number) */\n ani: string;\n /** Display version of the ANI */\n displayAni: string;\n /** Dialed Number Identification Service number */\n dnis: string;\n /** Tenant identifier */\n tenantId: string;\n /** Queue identifier */\n QueueId: string;\n /** Virtual team identifier */\n vteamId: string;\n /** Agent capability for pause/resume on this interaction */\n pauseResumeEnabled?: boolean;\n /** Duration of pause in seconds */\n pauseDuration?: string;\n /** Legacy pause indicator (recordInProgress=false is the active pause signal) */\n isPaused?: boolean;\n /** Recording is actively capturing audio right now */\n recordInProgress?: boolean;\n /** Recording was started for this interaction (may be paused) */\n recordingStarted?: boolean;\n /** Customer geographic region */\n customerRegion?: string;\n /** Flow tag identifier */\n flowTagId?: string;\n /** Indicates if Consult to Queue is in progress */\n ctqInProgress?: boolean;\n /** Indicates if outdial transfer to queue is enabled */\n outdialTransferToQueueEnabled?: boolean;\n /** IVR conversation transcript */\n convIvrTranscript?: string;\n /** Customer's name */\n customerName: string;\n /** Name of the virtual team */\n virtualTeamName: string;\n /** RONA (Redirection on No Answer) timeout in seconds */\n ronaTimeout: string;\n /** Category of the interaction */\n category: string;\n /** Reason for the interaction */\n reason: string;\n /** Source number for the interaction */\n sourceNumber: string;\n /** Source page that initiated the interaction */\n sourcePage: string;\n /** Application user identifier */\n appUser: string;\n /** Customer's contact number */\n customerNumber: string;\n /** Code indicating the reason for interaction */\n reasonCode: string;\n /** Path taken through the IVR system */\n IvrPath: string;\n /** Identifier for the IVR path */\n pathId: string;\n /** Email address or contact point that initiated the interaction */\n fromAddress: string;\n /** Identifier of the parent interaction for related interactions */\n parentInteractionId?: string;\n /** Identifier of the child interaction for related interactions */\n childInteractionId?: string;\n /** Type of relationship between parent and child interactions */\n relationshipType?: string;\n /** ANI of the parent interaction */\n parent_ANI?: string;\n /** DNIS of the parent interaction */\n parent_DNIS?: string;\n /** Indicates if the consulted destination agent has joined */\n consultDestinationAgentJoined?: boolean | string;\n /** Name of the destination agent for consultation */\n consultDestinationAgentName?: string;\n /** DN of the parent interaction's agent */\n parent_Agent_DN?: string;\n /** Name of the parent interaction's agent */\n parent_Agent_Name?: string;\n /** Team name of the parent interaction's agent */\n parent_Agent_TeamName?: string;\n /** Indicates if the interaction is in conference mode */\n isConferencing?: string;\n /** Type of monitoring being performed */\n monitorType?: string;\n /** Name of the workflow being executed */\n workflowName?: string;\n /** Identifier of the workflow */\n workflowId?: string;\n /** Indicates if monitoring is in invisible mode */\n monitoringInvisibleMode?: string;\n /** Identifier for the monitoring request */\n monitoringRequestId?: string;\n /** Timeout for participant invitation */\n participantInviteTimeout?: string;\n /** Filename for music on hold */\n mohFileName?: string;\n /** Flag for continuing recording during transfer */\n CONTINUE_RECORDING_ON_TRANSFER?: string;\n /** Entry point identifier */\n EP_ID?: string;\n /** Type of routing being used */\n ROUTING_TYPE?: string;\n /** Events registered with Flow Control Engine */\n fceRegisteredEvents?: string;\n /** Indicates if the interaction is parked */\n isParked?: string;\n /** Priority level of the interaction */\n priority?: string;\n /** Identifier for the routing strategy */\n routingStrategyId?: string;\n /** Current state of monitoring */\n monitoringState?: string;\n /** Indicates if blind transfer is in progress */\n BLIND_TRANSFER_IN_PROGRESS?: boolean;\n /** Desktop view configuration for Flow Control */\n fcDesktopView?: string;\n /** Agent ID who initiated the outdial call */\n outdialAgentId?: string;\n };\n /** Main interaction identifier for related interactions */\n mainInteractionId?: string;\n /** Timestamp when interaction entered queue */\n queuedTimestamp?: number | null;\n /** Media-specific information for the interaction */\n media: Record<string, MediaEntry>;\n /** Owner of the interaction */\n owner: string;\n /** Primary media channel for the interaction */\n mediaChannel: string;\n /** Direction information for the contact */\n contactDirection: {type: string};\n /** Type of outbound interaction */\n outboundType?: string;\n /** Optional workflow manager identifier */\n workflowManager?: string | null;\n /** Parameters passed through the call flow */\n callFlowParams?: Record<string, FlowParameter>;\n};\n\n/**\n * Task payload mirroring the Agent Contact event payload from Webex Contact Center\n * (developer.webex.com). Arrives on AGENT_* websocket events and is the source of truth\n * for UI/state machine updates.\n * @public\n */\nexport type RealtimeTranscription = {\n agentId: string;\n orgId: string;\n notifType: string;\n notifDetails: {\n actionEvent: string;\n };\n data: {\n role: 'AGENT' | 'CALLER';\n utteranceId: string;\n conversationId: string;\n publishTimestamp: number;\n messageId: string;\n isFinal: boolean;\n languageCode: string;\n orgId: string;\n content: string;\n };\n};\n\nexport type TaskData = {\n /** Primary media resource identifier for the active leg (matches interaction.media[].mediaResourceId) */\n mediaResourceId: string;\n /** Agent event name from the websocket stream (e.g., AGENT_CONTACT_ASSIGNED) */\n eventType: string;\n /** Timestamp when the event occurred */\n eventTime?: number;\n /** Identifier of the agent handling the task */\n agentId: string;\n /** Identifier of the destination agent for transfers/consults */\n destAgentId: string;\n /** Unique tracking identifier for the task */\n trackingId: string;\n /** Media resource identifier for consultation leg when present */\n consultMediaResourceId: string;\n /** Detailed interaction information */\n interaction: Interaction;\n /** Unique identifier for the participant */\n participantId?: string;\n /** Indicates if the task is from the owner */\n fromOwner?: boolean;\n /** Indicates if the task is to the owner */\n toOwner?: boolean;\n /** Identifier for child interaction in consult/transfer scenarios */\n childInteractionId?: string;\n /** Interaction/contact identifier from backend (same as interaction.interactionId) */\n interactionId: string;\n /** Organization identifier */\n orgId: string;\n /** Current owner of the task */\n owner: string;\n /** Queue manager handling the task */\n queueMgr: string;\n /** Name of the queue where task is queued */\n queueName?: string;\n /** Task/interaction type returned by the platform (routing/monitoring/etc.) */\n type: string;\n /** Timeout value for RONA (Redirection on No Answer) in seconds */\n ronaTimeout?: number;\n /** Indicates if the task is in consultation state */\n isConsulted?: boolean;\n /** Indicates if the task is in conference state */\n isConferencing: boolean;\n /** Indicates if a conference is currently in progress (2+ active agents) */\n isConferenceInProgress?: boolean;\n /** Identifier of agent who last updated the task */\n updatedBy?: string;\n /** Type of destination for transfer/consult */\n destinationType?: string;\n /** Indicates if the task was automatically resumed */\n autoResumed?: boolean;\n /** Code indicating the reason for an action */\n reasonCode?: string | number;\n /** Description of the reason for an action */\n reason?: string;\n /** Identifier of the consulting agent */\n consultingAgentId?: string;\n /** Unique identifier for the task */\n taskId?: string;\n /** Task details including state and media information */\n task?: Interaction;\n /** Unique identifier for monitoring offered events */\n id?: string;\n /** Indicates if the web call is muted */\n isWebCallMute?: boolean;\n /** Identifier for reservation interaction */\n reservationInteractionId?: string;\n /** Identifier for the reserved agent channel (used for campaign tasks) */\n reservedAgentChannelId?: string;\n /** Indicates if wrap-up is required for this task */\n wrapUpRequired?: boolean;\n\n /**\n * Current consultation status derived from state machine\n * Values: CONSULT_INITIATED, CONSULT_ACCEPTED, BEING_CONSULTED,\n * BEING_CONSULTED_ACCEPTED, CONNECTED, CONFERENCE, CONSULT_COMPLETED\n */\n consultStatus?: string;\n\n /**\n * Indicates if consultation is in progress (state machine: CONSULTING)\n */\n isConsultInProgress?: boolean;\n\n /**\n * Indicates if the task is incoming for the active agent\n */\n isIncomingTask?: boolean;\n\n /**\n * Indicates if the task is on hold (state machine: HELD)\n */\n isOnHold?: boolean;\n\n /**\n * Indicates if customer is currently in the call\n * Derived from participants in main media\n */\n isCustomerInCall?: boolean;\n\n /**\n * Count of conference participants (agents only)\n * Used for determining if max participants reached\n */\n conferenceParticipantsCount?: number;\n\n /**\n * Indicates if this is a secondary agent (consulted party)\n */\n isSecondaryAgent?: boolean;\n\n /**\n * Indicates if this is a secondary EP-DN agent (telephony consult to external)\n */\n isSecondaryEpDnAgent?: boolean;\n\n /**\n * Task state for MPC (Multi-Party Conference) scenarios\n * Maps participant consultState to task state\n */\n mpcState?: string;\n /** Indicates if auto-answer is in progress for this task */\n isAutoAnswering?: boolean;\n /** Indicates if wrap-up is required for this task */\n agentsPendingWrapUp?: string[];\n};\n\nexport type TaskUIControlState = {\n isVisible: boolean;\n isEnabled: boolean;\n};\n\n/**\n * UI control representation for a single interaction leg.\n */\nexport type InteractionUIControls = {\n accept: TaskUIControlState;\n decline: TaskUIControlState;\n hold: TaskUIControlState;\n transfer: TaskUIControlState;\n consult: TaskUIControlState;\n end: TaskUIControlState;\n recording: TaskUIControlState;\n mute: TaskUIControlState;\n consultTransfer: TaskUIControlState;\n endConsult: TaskUIControlState;\n conference: TaskUIControlState;\n exitConference: TaskUIControlState;\n transferConference: TaskUIControlState;\n mergeToConference: TaskUIControlState;\n wrapup: TaskUIControlState;\n switch: TaskUIControlState;\n};\n\nexport type TaskUILeg = 'main' | 'consult';\n\n/**\n * UI controls surfaced to task consumers.\n * Consumers should read controls from the per-leg surfaces and use `activeLeg`\n * to determine which one is currently interactive.\n */\nexport type TaskUIControls = {\n main: InteractionUIControls;\n consult: InteractionUIControls;\n activeLeg: TaskUILeg;\n};\n\n/**\n * Helper class for managing task action control state\n * Tracks visibility and enabled state for task actions that can be executed\n * @public\n */\n/**\n * Type representing an agent contact message within the contact center system\n * Contains comprehensive interaction and task related details for agent operations\n * @public\n */\nexport type AgentContact = Msg<{\n /** Unique identifier for the media resource */\n mediaResourceId: string;\n /** Type of the event (e.g., 'AgentDesktopMessage') */\n eventType: string;\n /** Timestamp when the event occurred */\n eventTime?: number;\n /** Unique identifier of the agent handling the contact */\n agentId: string;\n /** Identifier of the destination agent for transfers/consults */\n destAgentId: string;\n /** Unique tracking identifier for the contact */\n trackingId: string;\n /** Media resource identifier for consult operations */\n consultMediaResourceId: string;\n /** Detailed interaction information including media and participant data */\n interaction: Interaction;\n /** Unique identifier for the participant */\n participantId?: string;\n /** Indicates if the message is from the owner of the interaction */\n fromOwner?: boolean;\n /** Indicates if the message is to the owner of the interaction */\n toOwner?: boolean;\n /** Identifier for child interaction in case of consult/transfer */\n childInteractionId?: string;\n /** Unique identifier for the interaction */\n interactionId: string;\n /** Organization identifier */\n orgId: string;\n /** Current owner of the interaction */\n owner: string;\n /** Queue manager handling the interaction */\n queueMgr: string;\n /** Name of the queue where interaction is queued */\n queueName?: string;\n /** Type of the contact/interaction */\n type: string;\n /** Timeout value for RONA (Redirection on No Answer) in seconds */\n ronaTimeout?: number;\n /** Indicates if the interaction is in consult state */\n isConsulted?: boolean;\n /** Indicates if the interaction is in conference state */\n isConferencing: boolean;\n /** Identifier of the agent who last updated the interaction */\n updatedBy?: string;\n /** Type of destination for transfer/consult */\n destinationType?: string;\n /** Indicates if the interaction was automatically resumed */\n autoResumed?: boolean;\n /** Code indicating the reason for an action */\n reasonCode?: string | number;\n /** Description of the reason for an action */\n reason?: string;\n /** Identifier of the consulting agent */\n consultingAgentId?: string;\n /** Unique identifier for the task */\n taskId?: string;\n /** Task details including media and state information */\n task?: Interaction;\n /** Identifier of the supervisor monitoring the interaction */\n supervisorId?: string;\n /** Type of monitoring (e.g., 'SILENT', 'BARGE_IN') */\n monitorType?: string;\n /** Dial number of the supervisor */\n supervisorDN?: string;\n /** Unique identifier for monitoring offered events */\n id?: string;\n /** Indicates if the web call is muted */\n isWebCallMute?: boolean;\n /** Identifier for reservation interaction */\n reservationInteractionId?: string;\n /** Identifier for the reserved agent channel */\n reservedAgentChannelId?: string;\n /** Current monitoring state information */\n monitoringState?: {\n /** Type of monitoring state */\n type: string;\n };\n /** Name of the supervisor monitoring the interaction */\n supervisorName?: string;\n}>;\n\n/**\n * Information about a virtual team in the contact center\n * @ignore\n */\nexport type VTeam = {\n /** Profile ID of the agent in the virtual team */\n agentProfileId: string;\n /** Session ID of the agent in the virtual team */\n agentSessionId: string;\n /** Type of channel handled by the virtual team */\n channelType: string;\n /** Type of the virtual team */\n type: string;\n /** Optional tracking identifier */\n trackingId?: string;\n};\n\n/**\n * Detailed information about a virtual team configuration\n * @ignore\n */\nexport type VteamDetails = {\n /** Name of the virtual team */\n name: string;\n /** Type of channel handled by the virtual team */\n channelType: string;\n /** Unique identifier for the virtual team */\n id: string;\n /** Type of the virtual team */\n type: string;\n /** ID of the analyzer associated with the team */\n analyzerId: string;\n};\n\n/**\n * Response type for successful virtual team operations\n * Contains details about virtual teams and their capabilities\n * @ignore\n */\nexport type VTeamSuccess = Msg<{\n /** Response data containing team information */\n data: {\n /** List of virtual team details */\n vteamList: Array<VteamDetails>;\n /** Whether queue consultation is allowed */\n allowConsultToQueue: boolean;\n };\n /** Method name from JavaScript */\n jsMethod: string;\n /** Data related to the call */\n callData: string;\n /** Session ID of the agent */\n agentSessionId: string;\n}>;\n\n/**\n * Parameters for putting a task on hold or resuming from hold\n * @public\n */\nexport type HoldResumePayload = {\n /** Unique identifier for the media resource to hold/resume */\n mediaResourceId: string;\n};\n\n/**\n * Parameters for resuming a task's recording\n * @public\n */\nexport type ResumeRecordingPayload = {\n /** Indicates if the recording was automatically resumed */\n autoResumed: boolean;\n};\n\n/**\n * Parameters for transferring a task to another destination\n * @public\n */\nexport type TransferPayLoad = {\n /** Destination identifier where the task will be transferred to */\n to: string;\n /** Type of the destination (queue, agent, etc.) */\n destinationType: DestinationType;\n};\n\n/**\n * Parameters for initiating a consultative transfer\n * @public\n */\nexport type ConsultTransferPayLoad = {\n /** Destination identifier for the consultation transfer */\n to: string;\n /** Type of the consultation transfer destination */\n destinationType: ConsultTransferDestinationType;\n};\n\n/**\n * Parameters for initiating a consultation with another agent or queue\n * @public\n */\nexport type ConsultPayload = {\n /** Destination identifier for the consultation */\n to: string | undefined;\n /** Type of the consultation destination (agent, queue, etc.) */\n destinationType: DestinationType;\n /** Whether to hold other participants during consultation (always true) */\n holdParticipants?: boolean;\n};\n\n/**\n * Parameters for ending a consultation task\n * @public\n */\nexport type ConsultEndPayload = {\n /** Indicates if this is a consultation operation */\n isConsult: boolean;\n /** Indicates if this involves a secondary entry point or DN agent */\n isSecondaryEpDnAgent?: boolean;\n /** Optional queue identifier for the consultation */\n queueId?: string;\n /** Identifier of the task being consulted */\n taskId: string;\n};\n\n/**\n * Parameters for transferring a task to another destination\n * @public\n */\nexport type TransferPayload = {\n /** Destination identifier where the task will be transferred */\n to: string | undefined;\n /** Type of the transfer destination */\n destinationType: DestinationType;\n};\n\n/**\n * Options for configuring transfer behavior\n * @public\n */\nexport type TransferOptions = {\n /** Additional transfer configuration options */\n [key: string]: unknown;\n};\n\n/**\n * API payload for ending a consultation\n * This is the actual payload that is sent to the developer API\n * @public\n */\nexport type ConsultEndAPIPayload = {\n /** Optional identifier of the queue involved in the consultation */\n queueId?: string;\n};\n\n/**\n * Data required for consulting and conferencing operations\n * @public\n */\nexport type ConsultConferenceData = {\n /** Identifier of the agent initiating consult/conference */\n agentId?: string;\n /** Target destination for the consult/conference */\n to: string | undefined;\n /** Type of destination (e.g., 'agent', 'queue') */\n destinationType: string;\n};\n\n/**\n * Parameters required for cancelling a consult to queue operation\n * @public\n */\nexport type cancelCtq = {\n /** Identifier of the agent cancelling the CTQ */\n agentId: string;\n /** Identifier of the queue where consult was initiated */\n queueId: string;\n};\n\n/**\n * Parameters required for declining a task\n * @public\n */\nexport type declinePayload = {\n /** Identifier of the media resource to decline */\n mediaResourceId: string;\n};\n\n/**\n * Parameters for wrapping up a task with relevant completion details\n * @public\n */\nexport type WrapupPayLoad = {\n /** The reason provided for wrapping up the task */\n wrapUpReason: string;\n /** Auxiliary code identifier associated with the wrap-up state */\n auxCodeId: string;\n};\n\n/**\n * Configuration parameters for initiating outbound dialer tasks\n * @public\n */\nexport type DialerPayload = {\n /** An entryPointId for respective task */\n entryPointId: string;\n /** A valid customer DN, on which the response is expected, maximum length 36 characters */\n destination: string;\n /** The direction of the call */\n direction: 'OUTBOUND';\n /** Schema-free data tuples to pass specific data based on outboundType (max 30 tuples) */\n attributes: {[key: string]: string};\n /** The media type for the request */\n mediaType: 'telephony' | 'chat' | 'social' | 'email';\n /** The outbound type for the task */\n outboundType: 'OUTDIAL' | 'CALLBACK' | 'EXECUTE_FLOW';\n /** The Outdial ANI number that will be used while making a call to the customer. */\n origin: string;\n};\n\n/**\n * Data structure for cleaning up contact resources\n * @public\n */\nexport type ContactCleanupData = {\n /** Type of cleanup operation being performed */\n type: string;\n /** Organization identifier where cleanup is occurring */\n orgId: string;\n /** Identifier of the agent associated with the contacts */\n agentId: string;\n /** Detailed data about the cleanup operation */\n data: {\n /** Type of event that triggered the cleanup */\n eventType: string;\n /** Identifier of the interaction being cleaned up */\n interactionId: string;\n /** Organization identifier */\n orgId: string;\n /** Media manager handling the cleanup */\n mediaMgr: string;\n /** Tracking identifier for the cleanup operation */\n trackingId: string;\n /** Type of media being cleaned up */\n mediaType: string;\n /** Optional destination information */\n destination?: string;\n /** Whether this is a broadcast cleanup */\n broadcast: boolean;\n /** Type of cleanup being performed */\n type: string;\n };\n};\n\n/**\n * Boolean-like fields in callProcessingDetails that may arrive as strings.\n * Used by taskDataNormalizer to coerce payloads to actual booleans.\n */\nexport type CallProcessingBooleanKey =\n | 'recordingStarted'\n | 'recordInProgress'\n | 'isPaused'\n | 'pauseResumeEnabled'\n | 'ctqInProgress'\n | 'outdialTransferToQueueEnabled'\n | 'taskToBeSelfServiced'\n | 'CONTINUE_RECORDING_ON_TRANSFER'\n | 'isParked'\n | 'participantInviteTimeout'\n | 'checkAgentAvailability';\n\n/**\n * Interaction-level boolean fields that may arrive as strings from backend payloads.\n */\nexport type InteractionBooleanKey = 'isFcManaged' | 'isMediaForked' | 'isTerminated';\n\n/**\n * Participant boolean fields that may arrive as strings and need normalization.\n */\nexport type ParticipantBooleanKey =\n | 'autoAnswerEnabled'\n | 'hasJoined'\n | 'hasLeft'\n | 'isConsulted'\n | 'isInPredial'\n | 'isOffered'\n | 'isWrapUp'\n | 'isWrappedUp';\n\n/**\n * Response type for task public methods\n * Can be an {@link AgentContact} object containing updated task state,\n * an Error in case of failure, or void for operations that don't return data\n * @public\n */\nexport type TaskResponse = AgentContact | Error | void;\n\n/**\n * Payload shape used by consult conference helper utilities.\n */\nexport type consultConferencePayloadData = {\n agentId?: string;\n destinationType?: string;\n destAgentId?: string;\n};\n\n/**\n * Minimal event-emitter contract exposed to SDK consumers.\n * Defined here so that consumers do NOT need `@types/node` in their tsconfig.\n * The runtime Task class still extends Node's EventEmitter (via ampersand-events),\n * which satisfies this interface at runtime.\n * @public\n */\nexport interface IEventEmitter {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n on(event: string, listener: (...args: any[]) => void): this;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n off(event: string, listener: (...args: any[]) => void): this;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n once(event: string, listener: (...args: any[]) => void): this;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n emit(event: string, ...args: any[]): boolean;\n}\n\n/**\n * Interface for managing task-related operations in the contact center\n * Extends IEventEmitter to support event-driven task updates\n */\nexport interface ITask extends IEventEmitter {\n /**\n * Event data received in the Contact Center events.\n * Contains detailed task information including interaction details, media resources,\n * and participant data as defined in {@link TaskData}\n */\n data: TaskData;\n\n /**\n * Map associating tasks with their corresponding call identifiers.\n */\n webCallMap: Record<TaskId, CallId>;\n\n /**\n * Auto-wrapup timer for the task\n * This is used to automatically wrap up tasks after a specified duration\n * as defined in {@link AutoWrapup}\n */\n autoWrapup?: AutoWrapup;\n\n /**\n * Latest UI controls derived from the state machine.\n * Each control has `isVisible` and `isEnabled` flags computed from current task state.\n * Subscribe to {@link TASK_EVENTS.TASK_UI_CONTROLS_UPDATED} for change notifications.\n */\n readonly uiControls: TaskUIControls;\n\n /**\n * State machine instance for managing task state transitions and derived properties.\n * The state machine handles:\n * - State transitions (IDLE → OFFERED → CONNECTED → HELD, etc.)\n * - Derived properties (canHold, canResume, isConsulted, etc.)\n * - Action availability based on current state\n *\n * This is part of the migration from manual state management to centralized state machine.\n * During the transition period, both the old setUIControls() and state machine coexist.\n *\n * @see createTaskStateMachine\n * @internal\n */\n stateMachineService?: AnyActorRef;\n state?: any;\n\n /**\n * Helper method to send events to the state machine.\n * This is part of the migration to XState.\n * @internal\n */\n sendStateMachineEvent: (event: TaskEventPayload) => void;\n\n /**\n * Cancels the auto-wrapup timer for the task.\n * This method stops the auto-wrapup process if it is currently active.\n * Note: This is supported only in single session mode. Not supported in multi-session mode.\n * @returns void\n */\n cancelAutoWrapupTimer(): void;\n\n /**\n * Deregisters all web call event listeners.\n * Used when cleaning up task resources.\n * @ignore\n */\n unregisterWebCallListeners(): void;\n\n /**\n * Updates the task data with new information\n * @param newData - Updated task data to apply, must conform to {@link TaskData} structure\n * @returns Updated task instance\n * @ignore\n */\n updateTaskData(newData: TaskData): void;\n\n /**\n * Answers or accepts an incoming task.\n * Once accepted, the task will be assigned to the agent and trigger a {@link TASK_EVENTS.TASK_ASSIGNED} event.\n * The response will contain updated agent contact information as defined in {@link AgentContact}.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.accept();\n * ```\n */\n accept(): Promise<TaskResponse>;\n\n /**\n * Declines an incoming task for Browser Login\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.decline();\n * ```\n */\n decline(): Promise<TaskResponse>;\n\n /**\n * Places the current task on hold.\n * @param mediaResourceId - Optional media resource ID to use for the hold operation. If not provided, uses the task's current mediaResourceId\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * // Hold with default mediaResourceId\n * await task.hold();\n *\n * // Hold with custom mediaResourceId\n * await task.hold('custom-media-resource-id');\n * ```\n */\n hold(mediaResourceId?: string): Promise<TaskResponse>;\n\n /**\n * Resumes a task that was previously on hold.\n * @param mediaResourceId - Optional media resource ID to use for the resume operation. If not provided, uses the task's current mediaResourceId from interaction media\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * // Resume with default mediaResourceId\n * await task.resume();\n *\n * // Resume with custom mediaResourceId\n * await task.resume('custom-media-resource-id');\n * ```\n */\n resume(mediaResourceId?: string): Promise<TaskResponse>;\n\n /**\n * Ends/terminates the current task.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.end();\n * ```\n */\n end(): Promise<TaskResponse>;\n\n /**\n * Initiates wrap-up process for the task with specified details.\n * @param wrapupPayload - Wrap-up details including reason and auxiliary code\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.wrapup({\n * wrapUpReason: \"Customer issue resolved\",\n * auxCodeId: \"RESOLVED\"\n * });\n * ```\n */\n wrapup(wrapupPayload: WrapupPayLoad): Promise<TaskResponse>;\n\n /**\n * Pauses the recording for current task.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.pauseRecording();\n * ```\n */\n pauseRecording(): Promise<TaskResponse>;\n\n /**\n * Resumes a previously paused recording.\n * @param resumeRecordingPayload - Parameters for resuming the recording\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.resumeRecording({\n * autoResumed: false\n * });\n * ```\n */\n resumeRecording(resumeRecordingPayload: ResumeRecordingPayload): Promise<TaskResponse>;\n\n /**\n * Initiates a consultation with another agent or queue.\n * @param consultPayload - Consultation details including destination and type\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.consult({ to: \"agentId\", destinationType: \"agent\" });\n * ```\n */\n consult(consultPayload: ConsultPayload): Promise<TaskResponse>;\n\n /**\n * Ends an ongoing consultation.\n * @param consultEndPayload - Details for ending the consultation\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.endConsult({ isConsult: true, taskId: \"taskId\" });\n * ```\n */\n endConsult(consultEndPayload: ConsultEndPayload): Promise<TaskResponse>;\n\n /**\n * Transfers the task to another agent or queue.\n * @param transferPayload - Transfer details including destination and type\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.transfer({ to: \"queueId\", destinationType: \"queue\" });\n * ```\n */\n transfer(transferPayload: TransferPayLoad, options?: TransferOptions): Promise<TaskResponse>;\n\n /**\n * Initiates a consult conference (merge consult call with main call).\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.consultConference();\n * ```\n */\n consultConference(): Promise<TaskResponse>;\n\n /**\n * Exits from an ongoing conference.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.exitConference();\n * ```\n */\n exitConference(): Promise<TaskResponse>;\n\n /**\n * Transfers the conference to another participant.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.transferConference();\n * ```\n */\n transferConference(): Promise<TaskResponse>;\n\n /**\n * Toggles between consult call and main call during consulting.\n * If on consult leg, switches to main call (holds consult).\n * If on main call, switches to consult (resumes consult).\n * Only available when in CONSULTING state.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await task.switchCall();\n * ```\n */\n switchCall(): Promise<TaskResponse>;\n\n /**\n * Toggles mute/unmute for the local audio stream during a WebRTC task.\n * @returns Promise<void>\n * @example\n * ```typescript\n * await task.toggleMute();\n * ```\n */\n toggleMute(): Promise<void>;\n}\n\n/**\n * Interface for managing digital channel task operations in the contact center\n * Digital channels (chat, email, social, SMS) have a simpler interface than voice\n * Extends ITask but overrides updateTaskData to return IDigital\n * @public\n */\nexport interface IDigital extends Omit<ITask, 'updateTaskData'> {\n /**\n * Updates the task data\n * @param newData - Updated task data\n * @param shouldOverwrite - Whether to completely replace existing data\n * @returns Updated Digital task instance\n */\n updateTaskData(newData: TaskData, shouldOverwrite?: boolean): IDigital;\n}\n\n/**\n * Interface for managing voice/telephony task operations in the contact center\n * Extends ITask with voice-specific functionality for hold/resume operations\n * @public\n */\nexport interface IVoice extends ITask {\n /**\n * Toggles hold/resume state for a voice task.\n * If the task is currently on hold, it will be resumed.\n * If the task is active, it will be placed on hold.\n * @returns Promise<TaskResponse>\n * @example\n * ```typescript\n * await voiceTask.holdResume();\n * ```\n */\n holdResume(): Promise<TaskResponse>;\n}\n\n/**\n * Configuration options for voice task UI controls\n */\nexport type VoiceUIControlOptions = {\n isEndTaskEnabled?: boolean;\n isEndConsultEnabled?: boolean;\n voiceVariant?: VoiceVariant;\n isRecordingEnabled?: boolean;\n};\n\n/**\n * Participant information for UI display\n */\nexport type Participant = {\n id: string;\n name?: string;\n pType?: string;\n};\n\n/**\n * @deprecated Use Participant instead\n */\nexport type TaskAccessorParticipant = Participant;\n\nexport interface IWebRTC extends IVoice {\n /**\n * This method is used to mute/unmute the call.\n * @returns Promise<void>\n * @example\n * ```typescript\n * task.toggleMute();\n * ```\n */\n toggleMute(): Promise<void>;\n /**\n * Decline the incoming task for Browser Login\n *\n * @example\n * ```\n * task.decline();\n * ```\n */\n decline(): Promise<TaskResponse>;\n /**\n * This method is used to unregister the web call listeners.\n * @returns void\n * @example\n * ```typescript\n * task.unregisterWebCallListeners();\n * ```\n */\n unregisterWebCallListeners(): void;\n}\n\nexport type WebSocketPayload = TaskData & {\n type: string;\n mediaResourceId?: string;\n reason?: string;\n /**\n * Optional real-time transcript chunk payload.\n * Present on REAL_TIME_TRANSCRIPTION notifications.\n */\n data?: RealtimeTranscription['data'];\n};\n\nexport type WebSocketMessage = {\n keepalive?: 'true' | 'false' | boolean;\n type?: string;\n data: WebSocketPayload;\n};\n\n/**\n * Actions to be performed after handling an event\n *\n * These actions represent TaskManager-level concerns (task collection lifecycle,\n * resource cleanup) rather than task-level state machine concerns. The separation\n * ensures proper responsibility:\n * - TaskManager: Collection management, metrics, cleanup\n * - State Machine: Task state transitions, event emissions, UI controls\n */\nexport interface TaskEventActions {\n task?: ITask;\n}\n\n/**\n * Context for processing an event\n *\n * Contains all information needed to process a WebSocket event:\n * - Event type and payload from the backend\n * - Task instance (if exists)\n * - Pre-mapped state machine event (if applicable)\n */\nexport interface EventContext {\n eventType: string;\n payload: WebSocketPayload;\n task?: ITask;\n stateMachineEvent?: TaskEventPayload | null;\n}\n"],"mappings":";;;;;;AAAA;;AAMA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG;EAC9B;EACAE,KAAK,EAAE,OAAO;EACd;EACAC,UAAU,EAAE,YAAY;EACxB;EACAC,KAAK,EAAE,OAAO;EACd;EACAC,UAAU,EAAE;AACd,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMC,iCAAiC,GAAAL,OAAA,CAAAK,iCAAA,GAAG;EAC/C;EACAF,KAAK,EAAE,OAAO;EACd;EACAC,UAAU,EAAE,YAAY;EACxB;EACAF,UAAU,EAAE,YAAY;EACxB;EACAD,KAAK,EAAE;AACT,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMK,aAAa,GAAAN,OAAA,CAAAM,aAAA,GAAG;EAC3B;EACAC,KAAK,EAAE,OAAO;EACd;EACAC,IAAI,EAAE,MAAM;EACZ;EACAC,SAAS,EAAE,WAAW;EACtB;EACAC,MAAM,EAAE,QAAQ;EAChB;EACAC,GAAG,EAAE,KAAK;EACV;EACAC,QAAQ,EAAE,UAAU;EACpB;EACAC,QAAQ,EAAE;AACZ,CAAU;;AAEV;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACO,MAAMC,iBAAiB,GAAAd,OAAA,CAAAc,iBAAA,GAAG;EAC/BC,KAAK,EAAE,OAAO;EACdC,OAAO,EAAE;AACX,CAAU;AAIV;AACA;AACA;AACO,MAAMC,aAAa,GAAAjB,OAAA,CAAAiB,aAAA,GAAG;EAC3BC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE;AACV,CAAU;AAIV;AACA;AACA;AACA;AACA;AAJA,IAKYC,WAAW,GAAApB,OAAA,CAAAoB,WAAA,0BAAXA,WAAW;EACrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAVYA,WAAW;EAarB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAtBYA,WAAW;EAyBrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAjCYA,WAAW;EAoCrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA7CYA,WAAW;EAgDrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAzDYA,WAAW;EA4DrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EArEYA,WAAW;EAwErB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAjFYA,WAAW;EAoFrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA7FYA,WAAW;EAgGrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAzGYA,WAAW;EA4GrB;AACF;AACA;EA9GYA,WAAW;EAiHrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA1HYA,WAAW;EA6HrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAtIYA,WAAW;EAyIrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAlJYA,WAAW;EAqJrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA9JYA,WAAW;EAiKrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA1KYA,WAAW;EA6KrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAtLYA,WAAW;EAyLrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAlMYA,WAAW;EAqMrB;AACF;AACA;AACA;AACA;EAzMYA,WAAW;EA4MrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EApNYA,WAAW;EAuNrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAhOYA,WAAW;EAmOrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA5OYA,WAAW;EA+OrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAxPYA,WAAW;EA2PrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EApQYA,WAAW;EAuQrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAhRYA,WAAW;EAmRrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA5RYA,WAAW;EA+RrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAxSYA,WAAW;EA2SrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EApTYA,WAAW;EAuTrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EApUYA,WAAW;EAuUrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAhVYA,WAAW;EAmVrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA5VYA,WAAW;EA+VrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAxWYA,WAAW;EA2WrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EApXYA,WAAW;EAuXrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAhYYA,WAAW;EAmYrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA5YYA,WAAW;EA+YrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAxZYA,WAAW;EA2ZrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EApaYA,WAAW;EAuarB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAhbYA,WAAW;EAmbrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA5bYA,WAAW;EA+brB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAxcYA,WAAW;EA2crB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EApdYA,WAAW;EAudrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAjeYA,WAAW;EAoerB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA7eYA,WAAW;EAgfrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAzfYA,WAAW;EAAA,OAAXA,WAAW;AAAA;AA6fvB;AACA;AACA;AACA;AACA;AAwHA;AACA;AACA;AACA;AAuMA;AACA;AACA;AACA;AACA;AACA;AAyJA;AACA;AACA;AAsBA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAmFA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AAYA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAkBA;AACA;AACA;AACA;AA+BA;AACA;AACA;AACA;AAcA;AACA;AACA;AAGA;AACA;AACA;AAWA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AAYA;AACA;AACA;AACA;AAoQA;AACA;AACA;AACA;AACA;AACA;AAWA;AACA;AACA;AACA;AACA;AAeA;AACA;AACA;AAQA;AACA;AACA;AAOA;AACA;AACA;AAkDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}