@webex/contact-center 3.12.0-next.9 → 3.12.0-next.90
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.
- package/.sdd/manifest.json +876 -0
- package/AGENTS.md +94 -0
- package/ai-docs/ARCHITECTURE.md +168 -0
- package/ai-docs/CONTRACTS.md +46 -0
- package/ai-docs/GETTING_STARTED.md +168 -0
- package/ai-docs/GLOSSARY.md +43 -0
- package/ai-docs/README.md +138 -0
- package/ai-docs/REVIEW_CHECKLIST.md +41 -0
- package/ai-docs/RULES.md +444 -0
- package/ai-docs/SECURITY.md +52 -0
- package/ai-docs/SERVICE_STATE.md +48 -0
- package/ai-docs/SPEC_INDEX.md +65 -0
- package/ai-docs/adr/0001-spec-source-policy.md +55 -0
- package/ai-docs/adr/README.md +8 -0
- package/ai-docs/adr/_adr-template.md +31 -0
- package/ai-docs/contact-center-spec.md +341 -0
- package/ai-docs/features/generated-spec-conformance-fidelity-remediation/spec/feature-spec.md +117 -0
- package/ai-docs/features/residual-warning-coverage-completion/spec/feature-spec.md +203 -0
- package/ai-docs/features/validator-code-fidelity-drift-fix/spec/feature-spec.md +315 -0
- package/ai-docs/patterns/event-driven-patterns.md +485 -0
- package/ai-docs/patterns/testing-patterns.md +480 -0
- package/ai-docs/patterns/typescript-patterns.md +365 -0
- package/ai-docs/templates/README.md +102 -0
- package/ai-docs/templates/documentation/create-agents-md.md +240 -0
- package/ai-docs/templates/documentation/create-architecture-md.md +295 -0
- package/ai-docs/templates/existing-service/bug-fix.md +254 -0
- package/ai-docs/templates/existing-service/feature-enhancement.md +450 -0
- package/ai-docs/templates/new-method/00-master.md +80 -0
- package/ai-docs/templates/new-method/01-requirements.md +232 -0
- package/ai-docs/templates/new-method/02-implementation.md +295 -0
- package/ai-docs/templates/new-method/03-tests.md +201 -0
- package/ai-docs/templates/new-method/04-validation.md +141 -0
- package/ai-docs/templates/new-service/00-master.md +109 -0
- package/ai-docs/templates/new-service/01-pre-questions.md +159 -0
- package/ai-docs/templates/new-service/02-code-generation.md +346 -0
- package/ai-docs/templates/new-service/03-integration.md +178 -0
- package/ai-docs/templates/new-service/04-test-generation.md +205 -0
- package/ai-docs/templates/new-service/05-validation.md +145 -0
- package/dist/cc.js +265 -29
- package/dist/cc.js.map +1 -1
- package/dist/config.js +6 -0
- package/dist/config.js.map +1 -1
- package/dist/constants.js +17 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.js +20 -5
- package/dist/index.js.map +1 -1
- package/dist/metrics/behavioral-events.js +101 -0
- package/dist/metrics/behavioral-events.js.map +1 -1
- package/dist/metrics/constants.js +25 -4
- package/dist/metrics/constants.js.map +1 -1
- package/dist/services/ApiAiAssistant.js +153 -8
- package/dist/services/ApiAiAssistant.js.map +1 -1
- package/dist/services/UserPreference.js +427 -0
- package/dist/services/UserPreference.js.map +1 -0
- package/dist/services/config/Util.js +3 -3
- package/dist/services/config/Util.js.map +1 -1
- package/dist/services/config/constants.js +23 -2
- package/dist/services/config/constants.js.map +1 -1
- package/dist/services/config/types.js +49 -9
- package/dist/services/config/types.js.map +1 -1
- package/dist/services/core/Err.js.map +1 -1
- package/dist/services/core/Utils.js +107 -32
- package/dist/services/core/Utils.js.map +1 -1
- package/dist/services/core/websocket/WebSocketManager.js +2 -1
- package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
- package/dist/services/core/websocket/types.js.map +1 -1
- package/dist/services/index.js +1 -1
- package/dist/services/index.js.map +1 -1
- package/dist/services/task/Task.js +688 -0
- package/dist/services/task/Task.js.map +1 -0
- package/dist/services/task/TaskFactory.js +45 -0
- package/dist/services/task/TaskFactory.js.map +1 -0
- package/dist/services/task/TaskManager.js +728 -527
- package/dist/services/task/TaskManager.js.map +1 -1
- package/dist/services/task/TaskUtils.js +162 -26
- package/dist/services/task/TaskUtils.js.map +1 -1
- package/dist/services/task/constants.js +9 -2
- package/dist/services/task/constants.js.map +1 -1
- package/dist/services/task/dialer.js +78 -0
- package/dist/services/task/dialer.js.map +1 -1
- package/dist/services/task/digital/Digital.js +77 -0
- package/dist/services/task/digital/Digital.js.map +1 -0
- package/dist/services/task/state-machine/TaskStateMachine.js +837 -0
- package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -0
- package/dist/services/task/state-machine/actions.js +543 -0
- package/dist/services/task/state-machine/actions.js.map +1 -0
- package/dist/services/task/state-machine/constants.js +161 -0
- package/dist/services/task/state-machine/constants.js.map +1 -0
- package/dist/services/task/state-machine/guards.js +340 -0
- package/dist/services/task/state-machine/guards.js.map +1 -0
- package/dist/services/task/state-machine/index.js +53 -0
- package/dist/services/task/state-machine/index.js.map +1 -0
- package/dist/services/task/state-machine/types.js +54 -0
- package/dist/services/task/state-machine/types.js.map +1 -0
- package/dist/services/task/state-machine/uiControlsComputer.js +553 -0
- package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -0
- package/dist/services/task/taskDataNormalizer.js +99 -0
- package/dist/services/task/taskDataNormalizer.js.map +1 -0
- package/dist/services/task/types.js +212 -4
- package/dist/services/task/types.js.map +1 -1
- package/dist/services/task/voice/Voice.js +1042 -0
- package/dist/services/task/voice/Voice.js.map +1 -0
- package/dist/services/task/voice/WebRTC.js +149 -0
- package/dist/services/task/voice/WebRTC.js.map +1 -0
- package/dist/types/cc.d.ts +94 -1
- package/dist/types/config.d.ts +6 -0
- package/dist/types/constants.d.ts +17 -1
- package/dist/types/index.d.ts +21 -6
- package/dist/types/metrics/constants.d.ts +21 -1
- package/dist/types/services/ApiAiAssistant.d.ts +22 -4
- package/dist/types/services/UserPreference.d.ts +118 -0
- package/dist/types/services/config/constants.d.ts +21 -0
- package/dist/types/services/config/types.d.ts +171 -10
- package/dist/types/services/core/Err.d.ts +4 -0
- package/dist/types/services/core/Utils.d.ts +33 -13
- package/dist/types/services/core/websocket/WebSocketManager.d.ts +1 -0
- package/dist/types/services/core/websocket/types.d.ts +1 -1
- package/dist/types/services/index.d.ts +1 -1
- package/dist/types/services/task/Task.d.ts +157 -0
- package/dist/types/services/task/TaskFactory.d.ts +12 -0
- package/dist/types/services/task/TaskUtils.d.ts +46 -2
- package/dist/types/services/task/constants.d.ts +7 -0
- package/dist/types/services/task/dialer.d.ts +30 -0
- package/dist/types/services/task/digital/Digital.d.ts +22 -0
- package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +1144 -0
- package/dist/types/services/task/state-machine/actions.d.ts +10 -0
- package/dist/types/services/task/state-machine/constants.d.ts +107 -0
- package/dist/types/services/task/state-machine/guards.d.ts +90 -0
- package/dist/types/services/task/state-machine/index.d.ts +13 -0
- package/dist/types/services/task/state-machine/types.d.ts +267 -0
- package/dist/types/services/task/state-machine/uiControlsComputer.d.ts +9 -0
- package/dist/types/services/task/taskDataNormalizer.d.ts +10 -0
- package/dist/types/services/task/types.d.ts +603 -66
- package/dist/types/services/task/voice/Voice.d.ts +184 -0
- package/dist/types/services/task/voice/WebRTC.d.ts +53 -0
- package/dist/types/types.d.ts +135 -0
- package/dist/types/webex.d.ts +1 -0
- package/dist/types.js +118 -2
- package/dist/types.js.map +1 -1
- package/dist/webex.js +14 -2
- package/dist/webex.js.map +1 -1
- package/package.json +15 -12
- package/src/cc.ts +329 -30
- package/src/config.ts +6 -0
- package/src/constants.ts +17 -1
- package/src/index.ts +23 -5
- package/src/metrics/ai-docs/AGENTS.md +350 -0
- package/src/metrics/ai-docs/ARCHITECTURE.md +338 -0
- package/src/metrics/ai-docs/metrics-spec.md +854 -0
- package/src/metrics/behavioral-events.ts +106 -0
- package/src/metrics/constants.ts +27 -4
- package/src/services/ApiAiAssistant.ts +203 -8
- package/src/services/UserPreference.ts +509 -0
- package/src/services/agent/ai-docs/AGENTS.md +240 -0
- package/src/services/agent/ai-docs/ARCHITECTURE.md +304 -0
- package/src/services/agent/ai-docs/agent-spec.md +504 -0
- package/src/services/ai-docs/AGENTS.md +386 -0
- package/src/services/ai-docs/services-spec.md +492 -0
- package/src/services/config/Util.ts +3 -3
- package/src/services/config/ai-docs/AGENTS.md +255 -0
- package/src/services/config/ai-docs/ARCHITECTURE.md +426 -0
- package/src/services/config/ai-docs/config-spec.md +669 -0
- package/src/services/config/constants.ts +25 -1
- package/src/services/config/types.ts +174 -11
- package/src/services/core/Err.ts +2 -0
- package/src/services/core/Utils.ts +123 -37
- package/src/services/core/ai-docs/AGENTS.md +381 -0
- package/src/services/core/ai-docs/ARCHITECTURE.md +698 -0
- package/src/services/core/ai-docs/core-spec.md +783 -0
- package/src/services/core/websocket/WebSocketManager.ts +2 -0
- package/src/services/core/websocket/types.ts +1 -1
- package/src/services/index.ts +1 -1
- package/src/services/task/Task.ts +837 -0
- package/src/services/task/TaskFactory.ts +55 -0
- package/src/services/task/TaskManager.ts +739 -614
- package/src/services/task/TaskUtils.ts +205 -25
- package/src/services/task/ai-docs/AGENTS.md +457 -0
- package/src/services/task/ai-docs/ARCHITECTURE.md +594 -0
- package/src/services/task/ai-docs/task-spec.md +1319 -0
- package/src/services/task/constants.ts +7 -0
- package/src/services/task/dialer.ts +80 -0
- package/src/services/task/digital/Digital.ts +95 -0
- package/src/services/task/state-machine/TaskStateMachine.ts +1077 -0
- package/src/services/task/state-machine/actions.ts +685 -0
- package/src/services/task/state-machine/ai-docs/AGENTS.md +458 -0
- package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +1137 -0
- package/src/services/task/state-machine/ai-docs/task-state-machine-spec.md +2115 -0
- package/src/services/task/state-machine/constants.ts +172 -0
- package/src/services/task/state-machine/guards.ts +406 -0
- package/src/services/task/state-machine/index.ts +28 -0
- package/src/services/task/state-machine/types.ts +241 -0
- package/src/services/task/state-machine/uiControlsComputer.ts +867 -0
- package/src/services/task/taskDataNormalizer.ts +137 -0
- package/src/services/task/types.ts +710 -71
- package/src/services/task/voice/Voice.ts +1267 -0
- package/src/services/task/voice/WebRTC.ts +187 -0
- package/src/types.ts +166 -2
- package/src/utils/AGENTS.md +278 -0
- package/src/utils/ai-docs/utils-spec.md +381 -0
- package/src/webex.js +2 -0
- package/test/unit/spec/cc.ts +343 -23
- package/test/unit/spec/logger-proxy.ts +70 -0
- package/test/unit/spec/services/ApiAiAssistant.ts +178 -20
- package/test/unit/spec/services/UserPreference.ts +401 -0
- package/test/unit/spec/services/WebCallingService.ts +7 -1
- package/test/unit/spec/services/config/index.ts +30 -30
- package/test/unit/spec/services/core/Utils.ts +425 -8
- package/test/unit/spec/services/core/websocket/WebSocketManager.ts +66 -40
- package/test/unit/spec/services/task/AutoWrapup.ts +63 -0
- package/test/unit/spec/services/task/Task.ts +477 -0
- package/test/unit/spec/services/task/TaskFactory.ts +62 -0
- package/test/unit/spec/services/task/TaskManager.ts +834 -1704
- package/test/unit/spec/services/task/TaskUtils.ts +206 -0
- package/test/unit/spec/services/task/dialer.ts +190 -0
- package/test/unit/spec/services/task/digital/Digital.ts +105 -0
- package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +1825 -0
- package/test/unit/spec/services/task/state-machine/guards.ts +479 -0
- package/test/unit/spec/services/task/state-machine/types.ts +18 -0
- package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +2020 -0
- package/test/unit/spec/services/task/taskTestUtils.ts +87 -0
- package/test/unit/spec/services/task/voice/Voice.ts +631 -0
- package/test/unit/spec/services/task/voice/WebRTC.ts +235 -0
- package/umd/contact-center.min.js +2 -2
- package/umd/contact-center.min.js.map +1 -1
- package/dist/services/task/index.js +0 -1525
- package/dist/services/task/index.js.map +0 -1
- package/dist/types/services/task/index.d.ts +0 -650
- package/src/services/task/index.ts +0 -1801
- package/test/unit/spec/services/task/index.ts +0 -2184
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import routingContact from '../contact';
|
|
2
|
+
import { ConsultPayload, ConsultEndPayload, ResumeRecordingPayload, TaskData, TaskResponse, IVoice, VoiceUIControlOptions, TransferPayLoad } from '../types';
|
|
3
|
+
import Task from '../Task';
|
|
4
|
+
import { TaskActionArgs } from '../state-machine';
|
|
5
|
+
import { WrapupData } from '../../config/types';
|
|
6
|
+
export default class Voice extends Task implements IVoice {
|
|
7
|
+
constructor(contact: ReturnType<typeof routingContact>, data: TaskData, callOptions?: VoiceUIControlOptions, wrapupData?: WrapupData, agentId?: string);
|
|
8
|
+
private getStateMachineSnapshot;
|
|
9
|
+
/**
|
|
10
|
+
* This method is used to accept the task.
|
|
11
|
+
* It is expected to be overridden by child classes.
|
|
12
|
+
* @returns Promise<TaskResponse>
|
|
13
|
+
* @throws Error
|
|
14
|
+
*/
|
|
15
|
+
accept(): Promise<TaskResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* This method is used to decline the task.
|
|
18
|
+
* It is expected to be overridden by child classes.
|
|
19
|
+
* @returns Promise<TaskResponse>
|
|
20
|
+
* @throws Error
|
|
21
|
+
*/
|
|
22
|
+
decline(): Promise<TaskResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* This is used to hold the task.
|
|
25
|
+
* @returns Promise<TaskResponse>
|
|
26
|
+
* @throws Error
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* task.hold().then(()=>{}).catch(()=>{})
|
|
30
|
+
* ```
|
|
31
|
+
* */
|
|
32
|
+
hold(): Promise<TaskResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* This is used to resume the task.
|
|
35
|
+
* @returns Promise<TaskResponse>
|
|
36
|
+
* @throws Error
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* task.resume().then(()=>{}).catch(()=>{})
|
|
40
|
+
* ```
|
|
41
|
+
* */
|
|
42
|
+
resume(): Promise<TaskResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* This is used to hold or resume the task.
|
|
45
|
+
* @param isHeld: boolean - true to hold the task, false to resume it
|
|
46
|
+
* @returns Promise<TaskResponse>
|
|
47
|
+
* @throws Error
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* task.holdResume(isHeld: true).then(()=>{}).catch(()=>{})
|
|
51
|
+
* ```
|
|
52
|
+
* */
|
|
53
|
+
holdResume(): Promise<TaskResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* This is used to pause the call recording
|
|
56
|
+
* @returns Promise<TaskResponse>
|
|
57
|
+
* @throws Error
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* task.pauseRecording().then(()=>{}).catch(()=>{});
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
pauseRecording(): Promise<TaskResponse>;
|
|
64
|
+
/**
|
|
65
|
+
* This is used to pause the call recording
|
|
66
|
+
* @param resumeRecordingPayload
|
|
67
|
+
* @returns Promise<TaskResponse>
|
|
68
|
+
* @throws Error
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* task.resumeRecording(resumeRecordingPayload).then(()=>{}).catch(()=>{});
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
resumeRecording(resumeRecordingPayload?: ResumeRecordingPayload): Promise<TaskResponse>;
|
|
75
|
+
/**
|
|
76
|
+
* This is used to consult the task
|
|
77
|
+
* @param consultPayload
|
|
78
|
+
* @returns Promise<TaskResponse>
|
|
79
|
+
* @throws Error
|
|
80
|
+
* @example
|
|
81
|
+
* ```typescript
|
|
82
|
+
* const consultPayload = {
|
|
83
|
+
* destination: 'myBuddyAgentId',
|
|
84
|
+
* destinationType: DESTINATION_TYPE.AGENT,
|
|
85
|
+
* }
|
|
86
|
+
* task.consult(consultPayload).then(()=>{}).catch(()=>{});
|
|
87
|
+
* ```
|
|
88
|
+
* */
|
|
89
|
+
consult(consultPayload?: ConsultPayload): Promise<TaskResponse>;
|
|
90
|
+
/**
|
|
91
|
+
* This is used to end the consult session on the task.
|
|
92
|
+
* @param consultEndPayload - Payload indicating consult end flags and identifiers
|
|
93
|
+
* @returns Promise<TaskResponse>
|
|
94
|
+
* @throws Error
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* task.endConsult({
|
|
98
|
+
* isConsult: true,
|
|
99
|
+
* queueId: 'myQueueId',
|
|
100
|
+
* taskId: 'taskId',
|
|
101
|
+
* });
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
endConsult(consultEndPayload?: ConsultEndPayload): Promise<TaskResponse>;
|
|
105
|
+
/**
|
|
106
|
+
* This is used to transfer the task.
|
|
107
|
+
* @param payload - Transfer payload
|
|
108
|
+
* @returns Promise<TaskResponse>
|
|
109
|
+
* @throws Error
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* task.transfer({
|
|
113
|
+
* to: 'destinationId',
|
|
114
|
+
* destinationType: DESTINATION_TYPE.AGENT,
|
|
115
|
+
* consult: true, // Optional, if true will perform a consult transfer else blind transfer
|
|
116
|
+
* });
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
transfer(payload: TransferPayLoad): Promise<TaskResponse>;
|
|
120
|
+
/**
|
|
121
|
+
* Start a consult conference, merging main and consult calls.
|
|
122
|
+
*/
|
|
123
|
+
consultConference(): Promise<TaskResponse>;
|
|
124
|
+
/**
|
|
125
|
+
* Exit from a conference call.
|
|
126
|
+
* Per conference-spec.md:
|
|
127
|
+
* - Primary agent exits to wrapup
|
|
128
|
+
* - Non-primary agent exits to available/connected
|
|
129
|
+
* - Other participants continue the call
|
|
130
|
+
*
|
|
131
|
+
* @returns Promise<TaskResponse>
|
|
132
|
+
* @throws Error if not in conference or exit fails
|
|
133
|
+
* @example
|
|
134
|
+
* ```typescript
|
|
135
|
+
* task.exitConference().then(() => {}).catch(() => {});
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
exitConference(): Promise<TaskResponse>;
|
|
139
|
+
/**
|
|
140
|
+
* Transfer the conference to another participant.
|
|
141
|
+
* Per conference-spec.md: Only primary agent can transfer conference.
|
|
142
|
+
* After transfer, the transferring agent exits to wrapup.
|
|
143
|
+
*
|
|
144
|
+
* @returns Promise<TaskResponse>
|
|
145
|
+
* @throws Error if not in conference or transfer fails
|
|
146
|
+
* @example
|
|
147
|
+
* ```typescript
|
|
148
|
+
* task.transferConference().then(() => {}).catch(() => {});
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
transferConference(): Promise<TaskResponse>;
|
|
152
|
+
/**
|
|
153
|
+
* Toggle between consult call and main call during consulting.
|
|
154
|
+
* If on consult leg (consultCallHeld = false), switches to main call by holding consult.
|
|
155
|
+
* If on main call (consultCallHeld = true), switches to consult by resuming consult.
|
|
156
|
+
*
|
|
157
|
+
* @returns Promise<TaskResponse>
|
|
158
|
+
* @throws Error if not in CONSULTING state or no consult media resource
|
|
159
|
+
* @example
|
|
160
|
+
* ```typescript
|
|
161
|
+
* await task.switchCall();
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
switchCall(): Promise<TaskResponse>;
|
|
165
|
+
protected getChannelSpecificActionOverrides(): {
|
|
166
|
+
emitTaskHold: ({ event }: TaskActionArgs) => void;
|
|
167
|
+
emitTaskResume: ({ event }: TaskActionArgs) => void;
|
|
168
|
+
emitTaskRecordingStarted: ({ event }: TaskActionArgs) => void;
|
|
169
|
+
emitTaskRecordingPaused: ({ event }: TaskActionArgs) => void;
|
|
170
|
+
emitTaskRecordingPauseFailed: ({ event }: TaskActionArgs) => void;
|
|
171
|
+
emitTaskRecordingResumed: ({ event }: TaskActionArgs) => void;
|
|
172
|
+
emitTaskRecordingResumeFailed: ({ event }: TaskActionArgs) => void;
|
|
173
|
+
emitTaskParticipantJoined: ({ event }: TaskActionArgs) => void;
|
|
174
|
+
emitTaskParticipantLeft: ({ event }: TaskActionArgs) => void;
|
|
175
|
+
emitTaskConferenceStarted: ({ event }: TaskActionArgs) => void;
|
|
176
|
+
emitTaskConferenceEnded: ({ event }: TaskActionArgs) => void;
|
|
177
|
+
emitTaskConferenceFailed: ({ event }: TaskActionArgs) => void;
|
|
178
|
+
emitTaskExitConference: ({ event }: TaskActionArgs) => void;
|
|
179
|
+
emitTaskTransferConference: ({ event }: TaskActionArgs) => void;
|
|
180
|
+
emitTaskSwitchCall: ({ event }: TaskActionArgs) => void;
|
|
181
|
+
emitTaskTransferConferenceFailed: ({ event }: TaskActionArgs) => void;
|
|
182
|
+
emitTaskOutdialFailed: ({ event }: TaskActionArgs) => void;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import routingContact from '../contact';
|
|
2
|
+
import { TaskData, TaskResponse, IWebRTC, VoiceUIControlOptions } from '../types';
|
|
3
|
+
import Voice from './Voice';
|
|
4
|
+
import WebCallingService from '../../WebCallingService';
|
|
5
|
+
import { WrapupData } from '../../config/types';
|
|
6
|
+
export default class WebRTC extends Voice implements IWebRTC {
|
|
7
|
+
private localAudioStream;
|
|
8
|
+
private webCallingService;
|
|
9
|
+
constructor(contact: ReturnType<typeof routingContact>, webCallingService: WebCallingService, data: TaskData, callOptions?: VoiceUIControlOptions, wrapupData?: WrapupData, agentId?: string);
|
|
10
|
+
private registerWebCallListeners;
|
|
11
|
+
private handleRemoteMedia;
|
|
12
|
+
/**
|
|
13
|
+
* This method is used to unregister the web call listeners.
|
|
14
|
+
* @returns void
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* task.unregisterWebCallListeners();
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
unregisterWebCallListeners(): void;
|
|
21
|
+
/**
|
|
22
|
+
* This is used for incoming task accept by agent.
|
|
23
|
+
*
|
|
24
|
+
* @returns Promise<TaskResponse>
|
|
25
|
+
* @throws Error
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* task.accept().then(()=>{}).catch(()=>{})
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
accept(): Promise<TaskResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* This is used for the incoming task decline by agent.
|
|
34
|
+
*
|
|
35
|
+
* @returns Promise<TaskResponse>
|
|
36
|
+
* @throws Error
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* task.decline().then(()=>{}).catch(()=>{})
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
decline(): Promise<TaskResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* This is used for the placing the call in mute or unmute by the agent.
|
|
45
|
+
*
|
|
46
|
+
* @throws Error
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* task.toggleMute().then(()=>{}).catch(()=>{})
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
toggleMute(): Promise<void>;
|
|
53
|
+
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -106,6 +106,8 @@ export interface CCPluginConfig {
|
|
|
106
106
|
};
|
|
107
107
|
/** Configuration for the calling client */
|
|
108
108
|
callingClientConfig: CallingClientConfig;
|
|
109
|
+
/** Whether to skip Mobius/WebRTC registration for browser login flows */
|
|
110
|
+
disableWebRTCRegistration?: boolean;
|
|
109
111
|
}
|
|
110
112
|
/**
|
|
111
113
|
* Logger interface for standardized logging throughout the plugin.
|
|
@@ -384,6 +386,7 @@ export type BuddyAgents = {
|
|
|
384
386
|
state?: 'Available' | 'Idle';
|
|
385
387
|
};
|
|
386
388
|
/**
|
|
389
|
+
|
|
387
390
|
* Generic error structure for Contact Center SDK errors.
|
|
388
391
|
* Contains detailed information about the error context.
|
|
389
392
|
* @public
|
|
@@ -612,32 +615,164 @@ export type BuddyAgentsResponse = Agent.BuddyAgentsSuccess | Error;
|
|
|
612
615
|
* function handleUpdateDeviceType(resp: UpdateDeviceTypeResponse) { ... }
|
|
613
616
|
*/
|
|
614
617
|
export type UpdateDeviceTypeResponse = Agent.DeviceTypeUpdateSuccess | Error;
|
|
618
|
+
/**
|
|
619
|
+
* Supported transcript control actions for AI Assistant events.
|
|
620
|
+
* @public
|
|
621
|
+
* @example
|
|
622
|
+
* const action: TranscriptAction = 'START';
|
|
623
|
+
* @ignore
|
|
624
|
+
*/
|
|
615
625
|
export type TranscriptAction = 'START' | 'STOP';
|
|
626
|
+
/**
|
|
627
|
+
* Parameters used to request AI Assistant real-time assistance.
|
|
628
|
+
* @public
|
|
629
|
+
* @example
|
|
630
|
+
* const params: RealTimeAssistanceParams = {
|
|
631
|
+
* interactionId: 'interaction-123',
|
|
632
|
+
* context: 'Need help with credit card payment due date',
|
|
633
|
+
* };
|
|
634
|
+
*/
|
|
635
|
+
export type RealTimeAssistanceParams = {
|
|
636
|
+
/** Agent identifier */
|
|
637
|
+
agentId: string;
|
|
638
|
+
/** Interaction identifier for which assistance should be generated */
|
|
639
|
+
interactionId: string;
|
|
640
|
+
/** Optional additional context that should refine the assistance */
|
|
641
|
+
context?: string;
|
|
642
|
+
/** Optional language code for assistance (for example, 'en'). Defaults to 'en'. */
|
|
643
|
+
languageCode?: string;
|
|
644
|
+
};
|
|
645
|
+
/**
|
|
646
|
+
* Supported user actions on an AI Assistant real-time assistance adaptive card.
|
|
647
|
+
* @public
|
|
648
|
+
*/
|
|
649
|
+
export declare const RealTimeAssistanceUserActionId: {
|
|
650
|
+
/** User liked the real-time assistance response */
|
|
651
|
+
readonly LIKE: "likeButton";
|
|
652
|
+
/** User disliked the real-time assistance response */
|
|
653
|
+
readonly DISLIKE: "dislikeButton";
|
|
654
|
+
/** User copied the real-time assistance response */
|
|
655
|
+
readonly COPY: "copyButton";
|
|
656
|
+
};
|
|
657
|
+
/**
|
|
658
|
+
* Union type of supported real-time assistance user actions.
|
|
659
|
+
* @public
|
|
660
|
+
*/
|
|
661
|
+
export type RealTimeAssistanceUserActionId = Enum<typeof RealTimeAssistanceUserActionId>;
|
|
662
|
+
/**
|
|
663
|
+
* Parameters used to send user action feedback for a real-time assistance adaptive card.
|
|
664
|
+
* @public
|
|
665
|
+
* @example
|
|
666
|
+
* const params: RealTimeAssistanceUserActionParams = {
|
|
667
|
+
* agentId: 'agent-123',
|
|
668
|
+
* interactionId: 'interaction-123',
|
|
669
|
+
* adaptiveCardId: 'adaptive-card-123',
|
|
670
|
+
* actionId: RealTimeAssistanceUserActionId.LIKE,
|
|
671
|
+
* };
|
|
672
|
+
*/
|
|
673
|
+
export type RealTimeAssistanceUserActionParams = {
|
|
674
|
+
/** Agent identifier */
|
|
675
|
+
agentId: string;
|
|
676
|
+
/** Interaction identifier associated with the real-time assistance response */
|
|
677
|
+
interactionId: string;
|
|
678
|
+
/** Adaptive card identifier from the real-time assistance payload */
|
|
679
|
+
adaptiveCardId: string;
|
|
680
|
+
/** User action performed on the adaptive card */
|
|
681
|
+
actionId: RealTimeAssistanceUserActionId;
|
|
682
|
+
/** Optional language code. Defaults to 'en'. */
|
|
683
|
+
languageCode?: string;
|
|
684
|
+
};
|
|
685
|
+
/**
|
|
686
|
+
* Supported AI Assistant event categories.
|
|
687
|
+
* @public
|
|
688
|
+
* @example
|
|
689
|
+
* const eventType: AIAssistantEventType = AIAssistantEventType.CUSTOM_EVENT;
|
|
690
|
+
* @ignore
|
|
691
|
+
*/
|
|
616
692
|
export declare const AIAssistantEventType: {
|
|
693
|
+
/** Custom AI Assistant event */
|
|
617
694
|
readonly CUSTOM_EVENT: "CUSTOM_EVENT";
|
|
695
|
+
/** CTI-backed AI Assistant event */
|
|
618
696
|
readonly CTI_EVENT: "CTI_EVENT";
|
|
619
697
|
};
|
|
698
|
+
/**
|
|
699
|
+
* Union type of AI Assistant event categories.
|
|
700
|
+
* @public
|
|
701
|
+
* @example
|
|
702
|
+
* function send(type: AIAssistantEventType) { ... }
|
|
703
|
+
* @ignore
|
|
704
|
+
*/
|
|
620
705
|
export type AIAssistantEventType = Enum<typeof AIAssistantEventType>;
|
|
706
|
+
/**
|
|
707
|
+
* Supported AI Assistant event names.
|
|
708
|
+
* @public
|
|
709
|
+
* @example
|
|
710
|
+
* const name: AIAssistantEventName = AIAssistantEventName.GET_TRANSCRIPTS;
|
|
711
|
+
* @ignore
|
|
712
|
+
*/
|
|
621
713
|
export declare const AIAssistantEventName: {
|
|
714
|
+
/** Request transcript streaming for an interaction */
|
|
622
715
|
readonly GET_TRANSCRIPTS: "GET_TRANSCRIPTS";
|
|
716
|
+
/** Request a suggested response for an interaction */
|
|
717
|
+
readonly GET_SUGGESTIONS: "GET_SUGGESTIONS";
|
|
718
|
+
/** Add extra context to refine a suggested response */
|
|
719
|
+
readonly ADD_SUGGESTIONS_EXTRA_CONTEXT: "ADD_SUGGESTIONS_EXTRA_CONTEXT";
|
|
720
|
+
/** Request mid-call summary generation */
|
|
623
721
|
readonly GET_MID_CALL_SUMMARY: "GET_MID_CALL_SUMMARY";
|
|
722
|
+
/** Request post-call summary generation */
|
|
624
723
|
readonly GET_POST_CALL_SUMMARY: "GET_POST_CALL_SUMMARY";
|
|
724
|
+
/** Mid-call summary response event */
|
|
625
725
|
readonly MID_CALL_SUMMARY_RESPONSE: "MID_CALL_SUMMARY_RESPONSE";
|
|
726
|
+
/** Post-call summary response event */
|
|
626
727
|
readonly POST_CALL_SUMMARY_RESPONSE: "POST_CALL_SUMMARY_RESPONSE";
|
|
728
|
+
/** Suggested digital response event */
|
|
627
729
|
readonly SUGGESTED_RESPONSES_DIGITAL: "SUGGESTED_RESPONSES_DIGITAL";
|
|
730
|
+
/** User action on a suggested response adaptive card */
|
|
731
|
+
readonly SUGGESTED_RESPONSES_USER_ACTION: "SUGGESTED_RESPONSES_USER_ACTION";
|
|
628
732
|
};
|
|
733
|
+
/**
|
|
734
|
+
* Union type of AI Assistant event names.
|
|
735
|
+
* @public
|
|
736
|
+
* @example
|
|
737
|
+
* function handle(name: AIAssistantEventName) { ... }
|
|
738
|
+
* @ignore
|
|
739
|
+
*/
|
|
629
740
|
export type AIAssistantEventName = Enum<typeof AIAssistantEventName>;
|
|
741
|
+
/**
|
|
742
|
+
* A single transcript message entry returned by AI Assistant APIs.
|
|
743
|
+
* @public
|
|
744
|
+
* @example
|
|
745
|
+
* const message: TranscriptMessage = { role: 'AGENT', content: 'Hello', messageId: '1', publishTimestamp: Date.now() };
|
|
746
|
+
*
|
|
747
|
+
*/
|
|
630
748
|
export type TranscriptMessage = {
|
|
749
|
+
/** Speaker role for this message */
|
|
631
750
|
role: string;
|
|
751
|
+
/** Transcript chunk content */
|
|
632
752
|
content: string;
|
|
753
|
+
/** Unique message identifier */
|
|
633
754
|
messageId: string;
|
|
755
|
+
/** Message publish timestamp (epoch milliseconds) */
|
|
634
756
|
publishTimestamp: number;
|
|
635
757
|
};
|
|
758
|
+
/**
|
|
759
|
+
* Response payload for historic transcripts API.
|
|
760
|
+
* @public
|
|
761
|
+
* @example
|
|
762
|
+
* const resp: HistoricTranscriptsResponse = { orgId: 'org', agentId: 'agent', conversationId: null, interactionId: 'int', source: 'AI', data: [] };
|
|
763
|
+
*
|
|
764
|
+
*/
|
|
636
765
|
export type HistoricTranscriptsResponse = {
|
|
766
|
+
/** Organization identifier */
|
|
637
767
|
orgId: string;
|
|
768
|
+
/** Agent identifier */
|
|
638
769
|
agentId: string;
|
|
770
|
+
/** Conversation identifier when available */
|
|
639
771
|
conversationId: string | null;
|
|
772
|
+
/** Interaction identifier */
|
|
640
773
|
interactionId: string;
|
|
774
|
+
/** Data source identifier */
|
|
641
775
|
source: string;
|
|
776
|
+
/** Transcript messages */
|
|
642
777
|
data: TranscriptMessage[];
|
|
643
778
|
};
|
package/dist/types/webex.d.ts
CHANGED
package/dist/types.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.LoginOption = exports.LOGGING_LEVEL = exports.HTTP_METHODS = exports.AIAssistantEventType = exports.AIAssistantEventName = void 0;
|
|
6
|
+
exports.RealTimeAssistanceUserActionId = exports.LoginOption = exports.LOGGING_LEVEL = exports.HTTP_METHODS = exports.AIAssistantEventType = exports.AIAssistantEventName = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Generic type for converting a const enum object into a union type of its values.
|
|
9
9
|
* @template T The enum object type
|
|
@@ -236,6 +236,13 @@ const LoginOption = exports.LoginOption = {
|
|
|
236
236
|
*/
|
|
237
237
|
|
|
238
238
|
/**
|
|
239
|
+
* Holds the configuration flags for the Agent.
|
|
240
|
+
* These flags determine the availability of certain features in the Agent UI.
|
|
241
|
+
* @internal
|
|
242
|
+
*/
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
|
|
239
246
|
* Generic error structure for Contact Center SDK errors.
|
|
240
247
|
* Contains detailed information about the error context.
|
|
241
248
|
* @public
|
|
@@ -312,16 +319,125 @@ const LoginOption = exports.LoginOption = {
|
|
|
312
319
|
* function handleUpdateDeviceType(resp: UpdateDeviceTypeResponse) { ... }
|
|
313
320
|
*/
|
|
314
321
|
|
|
322
|
+
/**
|
|
323
|
+
* Supported transcript control actions for AI Assistant events.
|
|
324
|
+
* @public
|
|
325
|
+
* @example
|
|
326
|
+
* const action: TranscriptAction = 'START';
|
|
327
|
+
* @ignore
|
|
328
|
+
*/
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Parameters used to request AI Assistant real-time assistance.
|
|
332
|
+
* @public
|
|
333
|
+
* @example
|
|
334
|
+
* const params: RealTimeAssistanceParams = {
|
|
335
|
+
* interactionId: 'interaction-123',
|
|
336
|
+
* context: 'Need help with credit card payment due date',
|
|
337
|
+
* };
|
|
338
|
+
*/
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Supported user actions on an AI Assistant real-time assistance adaptive card.
|
|
342
|
+
* @public
|
|
343
|
+
*/
|
|
344
|
+
const RealTimeAssistanceUserActionId = exports.RealTimeAssistanceUserActionId = {
|
|
345
|
+
/** User liked the real-time assistance response */
|
|
346
|
+
LIKE: 'likeButton',
|
|
347
|
+
/** User disliked the real-time assistance response */
|
|
348
|
+
DISLIKE: 'dislikeButton',
|
|
349
|
+
/** User copied the real-time assistance response */
|
|
350
|
+
COPY: 'copyButton'
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Union type of supported real-time assistance user actions.
|
|
355
|
+
* @public
|
|
356
|
+
*/
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Parameters used to send user action feedback for a real-time assistance adaptive card.
|
|
360
|
+
* @public
|
|
361
|
+
* @example
|
|
362
|
+
* const params: RealTimeAssistanceUserActionParams = {
|
|
363
|
+
* agentId: 'agent-123',
|
|
364
|
+
* interactionId: 'interaction-123',
|
|
365
|
+
* adaptiveCardId: 'adaptive-card-123',
|
|
366
|
+
* actionId: RealTimeAssistanceUserActionId.LIKE,
|
|
367
|
+
* };
|
|
368
|
+
*/
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Supported AI Assistant event categories.
|
|
372
|
+
* @public
|
|
373
|
+
* @example
|
|
374
|
+
* const eventType: AIAssistantEventType = AIAssistantEventType.CUSTOM_EVENT;
|
|
375
|
+
* @ignore
|
|
376
|
+
*/
|
|
315
377
|
const AIAssistantEventType = exports.AIAssistantEventType = {
|
|
378
|
+
/** Custom AI Assistant event */
|
|
316
379
|
CUSTOM_EVENT: 'CUSTOM_EVENT',
|
|
380
|
+
/** CTI-backed AI Assistant event */
|
|
317
381
|
CTI_EVENT: 'CTI_EVENT'
|
|
318
382
|
};
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Union type of AI Assistant event categories.
|
|
386
|
+
* @public
|
|
387
|
+
* @example
|
|
388
|
+
* function send(type: AIAssistantEventType) { ... }
|
|
389
|
+
* @ignore
|
|
390
|
+
*/
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Supported AI Assistant event names.
|
|
394
|
+
* @public
|
|
395
|
+
* @example
|
|
396
|
+
* const name: AIAssistantEventName = AIAssistantEventName.GET_TRANSCRIPTS;
|
|
397
|
+
* @ignore
|
|
398
|
+
*/
|
|
319
399
|
const AIAssistantEventName = exports.AIAssistantEventName = {
|
|
400
|
+
/** Request transcript streaming for an interaction */
|
|
320
401
|
GET_TRANSCRIPTS: 'GET_TRANSCRIPTS',
|
|
402
|
+
/** Request a suggested response for an interaction */
|
|
403
|
+
GET_SUGGESTIONS: 'GET_SUGGESTIONS',
|
|
404
|
+
/** Add extra context to refine a suggested response */
|
|
405
|
+
ADD_SUGGESTIONS_EXTRA_CONTEXT: 'ADD_SUGGESTIONS_EXTRA_CONTEXT',
|
|
406
|
+
/** Request mid-call summary generation */
|
|
321
407
|
GET_MID_CALL_SUMMARY: 'GET_MID_CALL_SUMMARY',
|
|
408
|
+
/** Request post-call summary generation */
|
|
322
409
|
GET_POST_CALL_SUMMARY: 'GET_POST_CALL_SUMMARY',
|
|
410
|
+
/** Mid-call summary response event */
|
|
323
411
|
MID_CALL_SUMMARY_RESPONSE: 'MID_CALL_SUMMARY_RESPONSE',
|
|
412
|
+
/** Post-call summary response event */
|
|
324
413
|
POST_CALL_SUMMARY_RESPONSE: 'POST_CALL_SUMMARY_RESPONSE',
|
|
325
|
-
|
|
414
|
+
/** Suggested digital response event */
|
|
415
|
+
SUGGESTED_RESPONSES_DIGITAL: 'SUGGESTED_RESPONSES_DIGITAL',
|
|
416
|
+
/** User action on a suggested response adaptive card */
|
|
417
|
+
SUGGESTED_RESPONSES_USER_ACTION: 'SUGGESTED_RESPONSES_USER_ACTION'
|
|
326
418
|
};
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Union type of AI Assistant event names.
|
|
422
|
+
* @public
|
|
423
|
+
* @example
|
|
424
|
+
* function handle(name: AIAssistantEventName) { ... }
|
|
425
|
+
* @ignore
|
|
426
|
+
*/
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* A single transcript message entry returned by AI Assistant APIs.
|
|
430
|
+
* @public
|
|
431
|
+
* @example
|
|
432
|
+
* const message: TranscriptMessage = { role: 'AGENT', content: 'Hello', messageId: '1', publishTimestamp: Date.now() };
|
|
433
|
+
*
|
|
434
|
+
*/
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Response payload for historic transcripts API.
|
|
438
|
+
* @public
|
|
439
|
+
* @example
|
|
440
|
+
* const resp: HistoricTranscriptsResponse = { orgId: 'org', agentId: 'agent', conversationId: null, interactionId: 'int', source: 'AI', data: [] };
|
|
441
|
+
*
|
|
442
|
+
*/
|
|
327
443
|
//# sourceMappingURL=types.js.map
|