@webex/contact-center 3.11.0 → 3.12.0-llmrefactor.2

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 (267) hide show
  1. package/.sdd/manifest.json +882 -0
  2. package/AGENTS.md +94 -0
  3. package/ai-docs/ARCHITECTURE.md +168 -0
  4. package/ai-docs/CONTRACTS.md +46 -0
  5. package/ai-docs/GETTING_STARTED.md +168 -0
  6. package/ai-docs/GLOSSARY.md +43 -0
  7. package/ai-docs/README.md +138 -0
  8. package/ai-docs/REVIEW_CHECKLIST.md +41 -0
  9. package/ai-docs/RULES.md +444 -0
  10. package/ai-docs/SECURITY.md +52 -0
  11. package/ai-docs/SERVICE_STATE.md +48 -0
  12. package/ai-docs/SPEC_INDEX.md +65 -0
  13. package/ai-docs/adr/0001-spec-source-policy.md +55 -0
  14. package/ai-docs/adr/README.md +8 -0
  15. package/ai-docs/adr/_adr-template.md +31 -0
  16. package/ai-docs/contact-center-spec.md +341 -0
  17. package/ai-docs/features/generated-spec-conformance-fidelity-remediation/spec/feature-spec.md +117 -0
  18. package/ai-docs/features/residual-warning-coverage-completion/spec/feature-spec.md +203 -0
  19. package/ai-docs/features/validator-code-fidelity-drift-fix/spec/feature-spec.md +315 -0
  20. package/ai-docs/patterns/event-driven-patterns.md +485 -0
  21. package/ai-docs/patterns/testing-patterns.md +480 -0
  22. package/ai-docs/patterns/typescript-patterns.md +365 -0
  23. package/ai-docs/templates/README.md +102 -0
  24. package/ai-docs/templates/documentation/create-agents-md.md +240 -0
  25. package/ai-docs/templates/documentation/create-architecture-md.md +295 -0
  26. package/ai-docs/templates/existing-service/bug-fix.md +254 -0
  27. package/ai-docs/templates/existing-service/feature-enhancement.md +450 -0
  28. package/ai-docs/templates/new-method/00-master.md +80 -0
  29. package/ai-docs/templates/new-method/01-requirements.md +232 -0
  30. package/ai-docs/templates/new-method/02-implementation.md +295 -0
  31. package/ai-docs/templates/new-method/03-tests.md +201 -0
  32. package/ai-docs/templates/new-method/04-validation.md +141 -0
  33. package/ai-docs/templates/new-service/00-master.md +109 -0
  34. package/ai-docs/templates/new-service/01-pre-questions.md +159 -0
  35. package/ai-docs/templates/new-service/02-code-generation.md +346 -0
  36. package/ai-docs/templates/new-service/03-integration.md +178 -0
  37. package/ai-docs/templates/new-service/04-test-generation.md +205 -0
  38. package/ai-docs/templates/new-service/05-validation.md +145 -0
  39. package/dist/cc.js +379 -50
  40. package/dist/cc.js.map +1 -1
  41. package/dist/config.js +6 -0
  42. package/dist/config.js.map +1 -1
  43. package/dist/constants.js +22 -2
  44. package/dist/constants.js.map +1 -1
  45. package/dist/index.js +27 -5
  46. package/dist/index.js.map +1 -1
  47. package/dist/metrics/behavioral-events.js +114 -0
  48. package/dist/metrics/behavioral-events.js.map +1 -1
  49. package/dist/metrics/constants.js +32 -3
  50. package/dist/metrics/constants.js.map +1 -1
  51. package/dist/services/ApiAiAssistant.js +318 -0
  52. package/dist/services/ApiAiAssistant.js.map +1 -0
  53. package/dist/services/UserPreference.js +427 -0
  54. package/dist/services/UserPreference.js.map +1 -0
  55. package/dist/services/agent/types.js.map +1 -1
  56. package/dist/services/config/Util.js +8 -4
  57. package/dist/services/config/Util.js.map +1 -1
  58. package/dist/services/config/constants.js +35 -2
  59. package/dist/services/config/constants.js.map +1 -1
  60. package/dist/services/config/index.js +41 -2
  61. package/dist/services/config/index.js.map +1 -1
  62. package/dist/services/config/types.js +66 -8
  63. package/dist/services/config/types.js.map +1 -1
  64. package/dist/services/constants.js +27 -1
  65. package/dist/services/constants.js.map +1 -1
  66. package/dist/services/core/Err.js.map +1 -1
  67. package/dist/services/core/Utils.js +122 -25
  68. package/dist/services/core/Utils.js.map +1 -1
  69. package/dist/services/core/aqm-reqs.js +92 -17
  70. package/dist/services/core/aqm-reqs.js.map +1 -1
  71. package/dist/services/core/websocket/WebSocketManager.js +22 -6
  72. package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
  73. package/dist/services/core/websocket/connection-service.js +3 -1
  74. package/dist/services/core/websocket/connection-service.js.map +1 -1
  75. package/dist/services/core/websocket/types.js.map +1 -1
  76. package/dist/services/index.js +6 -0
  77. package/dist/services/index.js.map +1 -1
  78. package/dist/services/task/Task.js +688 -0
  79. package/dist/services/task/Task.js.map +1 -0
  80. package/dist/services/task/TaskFactory.js +45 -0
  81. package/dist/services/task/TaskFactory.js.map +1 -0
  82. package/dist/services/task/TaskManager.js +751 -457
  83. package/dist/services/task/TaskManager.js.map +1 -1
  84. package/dist/services/task/TaskUtils.js +220 -23
  85. package/dist/services/task/TaskUtils.js.map +1 -1
  86. package/dist/services/task/constants.js +23 -2
  87. package/dist/services/task/constants.js.map +1 -1
  88. package/dist/services/task/dialer.js +129 -0
  89. package/dist/services/task/dialer.js.map +1 -1
  90. package/dist/services/task/digital/Digital.js +77 -0
  91. package/dist/services/task/digital/Digital.js.map +1 -0
  92. package/dist/services/task/state-machine/TaskStateMachine.js +873 -0
  93. package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -0
  94. package/dist/services/task/state-machine/actions.js +567 -0
  95. package/dist/services/task/state-machine/actions.js.map +1 -0
  96. package/dist/services/task/state-machine/constants.js +161 -0
  97. package/dist/services/task/state-machine/constants.js.map +1 -0
  98. package/dist/services/task/state-machine/guards.js +382 -0
  99. package/dist/services/task/state-machine/guards.js.map +1 -0
  100. package/dist/services/task/state-machine/index.js +53 -0
  101. package/dist/services/task/state-machine/index.js.map +1 -0
  102. package/dist/services/task/state-machine/types.js +54 -0
  103. package/dist/services/task/state-machine/types.js.map +1 -0
  104. package/dist/services/task/state-machine/uiControlsComputer.js +603 -0
  105. package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -0
  106. package/dist/services/task/taskDataNormalizer.js +99 -0
  107. package/dist/services/task/taskDataNormalizer.js.map +1 -0
  108. package/dist/services/task/types.js +227 -4
  109. package/dist/services/task/types.js.map +1 -1
  110. package/dist/services/task/voice/Voice.js +1044 -0
  111. package/dist/services/task/voice/Voice.js.map +1 -0
  112. package/dist/services/task/voice/WebRTC.js +149 -0
  113. package/dist/services/task/voice/WebRTC.js.map +1 -0
  114. package/dist/types/cc.d.ts +894 -0
  115. package/dist/types/config.d.ts +72 -0
  116. package/dist/types/constants.d.ts +66 -0
  117. package/dist/types/index.d.ts +199 -0
  118. package/dist/types/logger-proxy.d.ts +71 -0
  119. package/dist/types/metrics/MetricsManager.d.ts +223 -0
  120. package/dist/types/metrics/behavioral-events.d.ts +29 -0
  121. package/dist/types/metrics/constants.d.ts +181 -0
  122. package/dist/types/services/AddressBook.d.ts +74 -0
  123. package/dist/types/services/ApiAiAssistant.d.ts +49 -0
  124. package/dist/types/services/EntryPoint.d.ts +67 -0
  125. package/dist/types/services/Queue.d.ts +76 -0
  126. package/dist/types/services/UserPreference.d.ts +118 -0
  127. package/dist/types/services/WebCallingService.d.ts +1 -0
  128. package/dist/types/services/agent/index.d.ts +46 -0
  129. package/dist/types/services/agent/types.d.ts +413 -0
  130. package/dist/types/services/config/Util.d.ts +20 -0
  131. package/dist/types/services/config/constants.d.ts +270 -0
  132. package/dist/types/services/config/index.d.ts +177 -0
  133. package/dist/types/services/config/types.d.ts +1368 -0
  134. package/dist/types/services/constants.d.ts +110 -0
  135. package/dist/types/services/core/Err.d.ts +125 -0
  136. package/dist/types/services/core/GlobalTypes.d.ts +58 -0
  137. package/dist/types/services/core/Utils.d.ts +121 -0
  138. package/dist/types/services/core/WebexRequest.d.ts +22 -0
  139. package/dist/types/services/core/aqm-reqs.d.ts +65 -0
  140. package/dist/types/services/core/constants.d.ts +99 -0
  141. package/dist/types/services/core/types.d.ts +47 -0
  142. package/dist/types/services/core/websocket/WebSocketManager.d.ts +36 -0
  143. package/dist/types/services/core/websocket/connection-service.d.ts +27 -0
  144. package/dist/types/services/core/websocket/keepalive.worker.d.ts +2 -0
  145. package/dist/types/services/core/websocket/types.d.ts +37 -0
  146. package/dist/types/services/index.d.ts +54 -0
  147. package/dist/types/services/task/AutoWrapup.d.ts +40 -0
  148. package/dist/types/services/task/Task.d.ts +157 -0
  149. package/dist/types/services/task/TaskFactory.d.ts +12 -0
  150. package/dist/types/services/task/TaskManager.d.ts +1 -0
  151. package/dist/types/services/task/TaskUtils.d.ts +138 -0
  152. package/dist/types/services/task/constants.d.ts +91 -0
  153. package/dist/types/services/task/contact.d.ts +69 -0
  154. package/dist/types/services/task/dialer.d.ts +73 -0
  155. package/dist/types/services/task/digital/Digital.d.ts +22 -0
  156. package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +1194 -0
  157. package/dist/types/services/task/state-machine/actions.d.ts +10 -0
  158. package/dist/types/services/task/state-machine/constants.d.ts +107 -0
  159. package/dist/types/services/task/state-machine/guards.d.ts +102 -0
  160. package/dist/types/services/task/state-machine/index.d.ts +13 -0
  161. package/dist/types/services/task/state-machine/types.d.ts +269 -0
  162. package/dist/types/services/task/state-machine/uiControlsComputer.d.ts +9 -0
  163. package/dist/types/services/task/taskDataNormalizer.d.ts +10 -0
  164. package/dist/types/services/task/types.d.ts +1856 -0
  165. package/dist/types/services/task/voice/Voice.d.ts +184 -0
  166. package/dist/types/services/task/voice/WebRTC.d.ts +53 -0
  167. package/dist/types/types.d.ts +778 -0
  168. package/dist/types/utils/PageCache.d.ts +173 -0
  169. package/dist/types/webex-config.d.ts +53 -0
  170. package/dist/types/webex.d.ts +8 -0
  171. package/dist/types.js +130 -1
  172. package/dist/types.js.map +1 -1
  173. package/dist/webex.js +14 -2
  174. package/dist/webex.js.map +1 -1
  175. package/package.json +16 -12
  176. package/src/cc.ts +477 -51
  177. package/src/config.ts +6 -0
  178. package/src/constants.ts +21 -1
  179. package/src/index.ts +24 -5
  180. package/src/metrics/ai-docs/AGENTS.md +350 -0
  181. package/src/metrics/ai-docs/ARCHITECTURE.md +338 -0
  182. package/src/metrics/ai-docs/metrics-spec.md +854 -0
  183. package/src/metrics/behavioral-events.ts +120 -0
  184. package/src/metrics/constants.ts +37 -3
  185. package/src/services/ApiAiAssistant.ts +412 -0
  186. package/src/services/UserPreference.ts +509 -0
  187. package/src/services/agent/ai-docs/AGENTS.md +240 -0
  188. package/src/services/agent/ai-docs/ARCHITECTURE.md +304 -0
  189. package/src/services/agent/ai-docs/agent-spec.md +504 -0
  190. package/src/services/agent/types.ts +1 -1
  191. package/src/services/ai-docs/AGENTS.md +386 -0
  192. package/src/services/ai-docs/services-spec.md +492 -0
  193. package/src/services/config/Util.ts +10 -2
  194. package/src/services/config/ai-docs/AGENTS.md +255 -0
  195. package/src/services/config/ai-docs/ARCHITECTURE.md +426 -0
  196. package/src/services/config/ai-docs/config-spec.md +669 -0
  197. package/src/services/config/constants.ts +37 -1
  198. package/src/services/config/index.ts +45 -1
  199. package/src/services/config/types.ts +241 -11
  200. package/src/services/constants.ts +29 -0
  201. package/src/services/core/Err.ts +3 -0
  202. package/src/services/core/Utils.ts +143 -30
  203. package/src/services/core/ai-docs/AGENTS.md +381 -0
  204. package/src/services/core/ai-docs/ARCHITECTURE.md +698 -0
  205. package/src/services/core/ai-docs/core-spec.md +783 -0
  206. package/src/services/core/aqm-reqs.ts +100 -22
  207. package/src/services/core/websocket/WebSocketManager.ts +23 -6
  208. package/src/services/core/websocket/connection-service.ts +5 -1
  209. package/src/services/core/websocket/types.ts +1 -1
  210. package/src/services/index.ts +4 -0
  211. package/src/services/task/Task.ts +837 -0
  212. package/src/services/task/TaskFactory.ts +55 -0
  213. package/src/services/task/TaskManager.ts +793 -521
  214. package/src/services/task/TaskUtils.ts +314 -24
  215. package/src/services/task/ai-docs/AGENTS.md +457 -0
  216. package/src/services/task/ai-docs/ARCHITECTURE.md +594 -0
  217. package/src/services/task/ai-docs/task-spec.md +1319 -0
  218. package/src/services/task/constants.ts +23 -0
  219. package/src/services/task/dialer.ts +136 -1
  220. package/src/services/task/digital/Digital.ts +95 -0
  221. package/src/services/task/state-machine/TaskStateMachine.ts +1166 -0
  222. package/src/services/task/state-machine/actions.ts +738 -0
  223. package/src/services/task/state-machine/ai-docs/AGENTS.md +458 -0
  224. package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +1137 -0
  225. package/src/services/task/state-machine/ai-docs/task-state-machine-spec.md +2177 -0
  226. package/src/services/task/state-machine/constants.ts +172 -0
  227. package/src/services/task/state-machine/guards.ts +445 -0
  228. package/src/services/task/state-machine/index.ts +28 -0
  229. package/src/services/task/state-machine/types.ts +243 -0
  230. package/src/services/task/state-machine/uiControlsComputer.ts +961 -0
  231. package/src/services/task/taskDataNormalizer.ts +137 -0
  232. package/src/services/task/types.ts +734 -71
  233. package/src/services/task/voice/Voice.ts +1270 -0
  234. package/src/services/task/voice/WebRTC.ts +187 -0
  235. package/src/types.ts +205 -2
  236. package/src/utils/AGENTS.md +278 -0
  237. package/src/utils/ai-docs/utils-spec.md +381 -0
  238. package/src/webex.js +2 -0
  239. package/test/unit/spec/cc.ts +503 -43
  240. package/test/unit/spec/logger-proxy.ts +70 -0
  241. package/test/unit/spec/services/ApiAiAssistant.ts +273 -0
  242. package/test/unit/spec/services/UserPreference.ts +401 -0
  243. package/test/unit/spec/services/WebCallingService.ts +7 -1
  244. package/test/unit/spec/services/config/index.ts +85 -29
  245. package/test/unit/spec/services/core/Utils.ts +481 -2
  246. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +137 -41
  247. package/test/unit/spec/services/core/websocket/connection-service.ts +3 -1
  248. package/test/unit/spec/services/task/AutoWrapup.ts +63 -0
  249. package/test/unit/spec/services/task/Task.ts +477 -0
  250. package/test/unit/spec/services/task/TaskFactory.ts +62 -0
  251. package/test/unit/spec/services/task/TaskManager.ts +1001 -1003
  252. package/test/unit/spec/services/task/TaskUtils.ts +235 -0
  253. package/test/unit/spec/services/task/dialer.ts +372 -96
  254. package/test/unit/spec/services/task/digital/Digital.ts +105 -0
  255. package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +2651 -0
  256. package/test/unit/spec/services/task/state-machine/guards.ts +637 -0
  257. package/test/unit/spec/services/task/state-machine/types.ts +18 -0
  258. package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +2663 -0
  259. package/test/unit/spec/services/task/taskTestUtils.ts +87 -0
  260. package/test/unit/spec/services/task/voice/Voice.ts +649 -0
  261. package/test/unit/spec/services/task/voice/WebRTC.ts +235 -0
  262. package/umd/contact-center.min.js +2 -2
  263. package/umd/contact-center.min.js.map +1 -1
  264. package/dist/services/task/index.js +0 -1525
  265. package/dist/services/task/index.js.map +0 -1
  266. package/src/services/task/index.ts +0 -1801
  267. package/test/unit/spec/services/task/index.ts +0 -2184
@@ -0,0 +1,778 @@
1
+ import { CallingClientConfig } from '@webex/calling';
2
+ import * as Agent from './services/agent/types';
3
+ import { Profile } from './services/config/types';
4
+ import { PaginatedResponse, BaseSearchParams } from './utils/PageCache';
5
+ /**
6
+ * HTTP methods supported by WebexRequest.
7
+ * @enum {string}
8
+ * @public
9
+ * @example
10
+ * const method: HTTP_METHODS = HTTP_METHODS.GET;
11
+ * @ignore
12
+ */
13
+ export declare const HTTP_METHODS: {
14
+ /** HTTP GET method for retrieving data */
15
+ readonly GET: "GET";
16
+ /** HTTP POST method for creating resources */
17
+ readonly POST: "POST";
18
+ /** HTTP PATCH method for partial updates */
19
+ readonly PATCH: "PATCH";
20
+ /** HTTP PUT method for complete updates */
21
+ readonly PUT: "PUT";
22
+ /** HTTP DELETE method for removing resources */
23
+ readonly DELETE: "DELETE";
24
+ };
25
+ /**
26
+ * Union type of HTTP methods.
27
+ * @public
28
+ * @example
29
+ * function makeRequest(method: HTTP_METHODS) { ... }
30
+ * @ignore
31
+ */
32
+ export type HTTP_METHODS = Enum<typeof HTTP_METHODS>;
33
+ /**
34
+ * Payload for making requests to Webex APIs.
35
+ * @public
36
+ * @example
37
+ * const payload: WebexRequestPayload = {
38
+ * service: 'identity',
39
+ * resource: '/users',
40
+ * method: HTTP_METHODS.GET
41
+ * };
42
+ * @ignore
43
+ */
44
+ export type WebexRequestPayload = {
45
+ /** Service name to target */
46
+ service?: string;
47
+ /** Resource path within the service */
48
+ resource?: string;
49
+ /** HTTP method to use */
50
+ method?: HTTP_METHODS;
51
+ /** Full URI if not using service/resource pattern */
52
+ uri?: string;
53
+ /** Whether to add authorization header */
54
+ addAuthHeader?: boolean;
55
+ /** Custom headers to include in request */
56
+ headers?: {
57
+ [key: string]: string | null;
58
+ };
59
+ /** Request body data */
60
+ body?: object;
61
+ /** Expected response status code */
62
+ statusCode?: number;
63
+ /** Whether to parse response as JSON */
64
+ json?: boolean;
65
+ };
66
+ /**
67
+ * Configuration options for the Contact Center Plugin.
68
+ * @interface CCPluginConfig
69
+ * @public
70
+ * @example
71
+ * const config: CCPluginConfig = {
72
+ * allowMultiLogin: true,
73
+ * allowAutomatedRelogin: false,
74
+ * clientType: 'browser',
75
+ * isKeepAliveEnabled: true,
76
+ * force: false,
77
+ * metrics: { clientName: 'myClient', clientType: 'browser' },
78
+ * logging: { enable: true, verboseEvents: false },
79
+ * callingClientConfig: { ... }
80
+ * };
81
+ */
82
+ export interface CCPluginConfig {
83
+ /** Whether to allow multiple logins from different devices */
84
+ allowMultiLogin: boolean;
85
+ /** Whether to automatically attempt relogin on connection loss */
86
+ allowAutomatedRelogin: boolean;
87
+ /** The type of client making the connection */
88
+ clientType: string;
89
+ /** Whether to enable keep-alive messages */
90
+ isKeepAliveEnabled: boolean;
91
+ /** Whether to force registration */
92
+ force: boolean;
93
+ /** Metrics configuration */
94
+ metrics: {
95
+ /** Name of the client for metrics */
96
+ clientName: string;
97
+ /** Type of client for metrics */
98
+ clientType: string;
99
+ };
100
+ /** Logging configuration */
101
+ logging: {
102
+ /** Whether to enable logging */
103
+ enable: boolean;
104
+ /** Whether to log verbose events */
105
+ verboseEvents: boolean;
106
+ };
107
+ /** Configuration for the calling client */
108
+ callingClientConfig: CallingClientConfig;
109
+ /** Whether to skip Mobius/WebRTC registration for browser login flows */
110
+ disableWebRTCRegistration?: boolean;
111
+ }
112
+ /**
113
+ * Logger interface for standardized logging throughout the plugin.
114
+ * @public
115
+ * @example
116
+ * logger.log('This is a log message');
117
+ * logger.error('This is an error message');
118
+ * @ignore
119
+ */
120
+ export type Logger = {
121
+ /** Log general messages */
122
+ log: (payload: string) => void;
123
+ /** Log error messages */
124
+ error: (payload: string) => void;
125
+ /** Log warning messages */
126
+ warn: (payload: string) => void;
127
+ /** Log informational messages */
128
+ info: (payload: string) => void;
129
+ /** Log detailed trace messages */
130
+ trace: (payload: string) => void;
131
+ /** Log debug messages */
132
+ debug: (payload: string) => void;
133
+ };
134
+ /**
135
+ * Contextual information for log entries.
136
+ * @public
137
+ * @ignore
138
+ */
139
+ export interface LogContext {
140
+ /** Module name where the log originated */
141
+ module?: string;
142
+ /** Method name where the log originated */
143
+ method?: string;
144
+ interactionId?: string;
145
+ trackingId?: string;
146
+ /** Additional structured data to include in logs */
147
+ data?: Record<string, any>;
148
+ /** Error object to include in logs */
149
+ error?: Error | unknown;
150
+ }
151
+ /**
152
+ * Available logging severity levels.
153
+ * @enum {string}
154
+ * @public
155
+ * @example
156
+ * const level: LOGGING_LEVEL = LOGGING_LEVEL.error;
157
+ * @ignore
158
+ */
159
+ export declare enum LOGGING_LEVEL {
160
+ /** Critical failures that require immediate attention */
161
+ error = "ERROR",
162
+ /** Important issues that don't prevent the system from working */
163
+ warn = "WARN",
164
+ /** General informational logs */
165
+ log = "LOG",
166
+ /** Detailed information about system operation */
167
+ info = "INFO",
168
+ /** Highly detailed diagnostic information */
169
+ trace = "TRACE"
170
+ }
171
+ /**
172
+ * Metadata for log uploads.
173
+ * @public
174
+ * @example
175
+ * const meta: LogsMetaData = { feedbackId: 'fb123', correlationId: 'corr456' };
176
+ * @ignore
177
+ */
178
+ export type LogsMetaData = {
179
+ /** Optional feedback ID to associate with logs */
180
+ feedbackId?: string;
181
+ /** Optional correlation ID to track related operations */
182
+ correlationId?: string;
183
+ };
184
+ /**
185
+ * Response from uploading logs to the server.
186
+ * @public
187
+ * @example
188
+ * const response: UploadLogsResponse = { trackingid: 'track123', url: 'https://...', userId: 'user1' };
189
+ */
190
+ export type UploadLogsResponse = {
191
+ /** Tracking ID for the upload request */
192
+ trackingid?: string;
193
+ /** URL where the logs can be accessed */
194
+ url?: string;
195
+ /** ID of the user who uploaded logs */
196
+ userId?: string;
197
+ /** Feedback ID associated with the logs */
198
+ feedbackId?: string;
199
+ /** Correlation ID for tracking related operations */
200
+ correlationId?: string;
201
+ };
202
+ /**
203
+ * Interface representing the WebexSDK core functionality.
204
+ * @interface WebexSDK
205
+ * @public
206
+ * @example
207
+ * const sdk: WebexSDK = ...;
208
+ * sdk.request({ service: 'identity', resource: '/users', method: HTTP_METHODS.GET });
209
+ * @ignore
210
+ */
211
+ export interface WebexSDK {
212
+ /** Version of the WebexSDK */
213
+ version: string;
214
+ /** Whether the SDK can authorize requests */
215
+ canAuthorize: boolean;
216
+ /** Credentials management */
217
+ credentials: {
218
+ /** Get the user token for authentication */
219
+ getUserToken: () => Promise<string>;
220
+ /** Get the organization ID */
221
+ getOrgId: () => string;
222
+ };
223
+ /** Whether the SDK is ready for use */
224
+ ready: boolean;
225
+ /** Make a request to the Webex APIs */
226
+ request: <T>(payload: WebexRequestPayload) => Promise<T>;
227
+ /** Register a one-time event handler */
228
+ once: (event: string, callBack: () => void) => void;
229
+ /** Internal plugins and services */
230
+ internal: IWebexInternal;
231
+ /** Logger instance */
232
+ logger: Logger;
233
+ }
234
+ /**
235
+ * An interface for the `ContactCenter` class.
236
+ * The `ContactCenter` package is designed to provide a set of APIs to perform various operations for the Agent flow within Webex Contact Center.
237
+ * @public
238
+ * @example
239
+ * const cc: IContactCenter = ...;
240
+ * cc.register().then(profile => { ... });
241
+ * @ignore
242
+ */
243
+ export interface IContactCenter {
244
+ /**
245
+ * Initialize the CC SDK by setting up the contact center mercury connection.
246
+ * This establishes WebSocket connectivity for real-time communication.
247
+ *
248
+ * @returns A Promise that resolves to the agent's profile upon successful registration
249
+ * @public
250
+ * @example
251
+ * cc.register().then(profile => { ... });
252
+ */
253
+ register(): Promise<Profile>;
254
+ }
255
+ /**
256
+ * Generic HTTP response structure.
257
+ * @public
258
+ * @example
259
+ * const response: IHttpResponse = { body: {}, statusCode: 200, method: 'GET', headers: {}, url: '...' };
260
+ * @ignore
261
+ */
262
+ export interface IHttpResponse {
263
+ /** Response body content */
264
+ body: any;
265
+ /** HTTP status code */
266
+ statusCode: number;
267
+ /** HTTP method used for the request */
268
+ method: string;
269
+ /** Response headers */
270
+ headers: Headers;
271
+ /** Request URL */
272
+ url: string;
273
+ }
274
+ /**
275
+ * Supported login options for agent authentication.
276
+ * @public
277
+ * @example
278
+ * const option: LoginOption = LoginOption.AGENT_DN;
279
+ * @ignore
280
+ */
281
+ export declare const LoginOption: {
282
+ /** Login using agent's direct number */
283
+ readonly AGENT_DN: "AGENT_DN";
284
+ /** Login using an extension number */
285
+ readonly EXTENSION: "EXTENSION";
286
+ /** Login using browser WebRTC capabilities */
287
+ readonly BROWSER: "BROWSER";
288
+ };
289
+ /**
290
+ * Union type of login options.
291
+ * @public
292
+ * @example
293
+ * function login(option: LoginOption) { ... }
294
+ * @ignore
295
+ */
296
+ export type LoginOption = Enum<typeof LoginOption>;
297
+ /**
298
+ * Request payload for subscribing to the contact center websocket.
299
+ * @public
300
+ * @example
301
+ * const req: SubscribeRequest = { force: true, isKeepAliveEnabled: true, clientType: 'browser', allowMultiLogin: false };
302
+ * @ignore
303
+ */
304
+ export type SubscribeRequest = {
305
+ /** Whether to force connection even if another exists */
306
+ force: boolean;
307
+ /** Whether to send keepalive messages */
308
+ isKeepAliveEnabled: boolean;
309
+ /** Type of client connecting */
310
+ clientType: string;
311
+ /** Whether to allow login from multiple devices */
312
+ allowMultiLogin: boolean;
313
+ };
314
+ /**
315
+ * Represents the response from getListOfTeams method.
316
+ * Teams are groups of agents that can be managed together.
317
+ * @public
318
+ * @example
319
+ * const team: Team = { id: 'team1', name: 'Support', desktopLayoutId: 'layout1' };
320
+ * @ignore
321
+ */
322
+ export type Team = {
323
+ /**
324
+ * Unique identifier of the team.
325
+ */
326
+ id: string;
327
+ /**
328
+ * Display name of the team.
329
+ */
330
+ name: string;
331
+ /**
332
+ * Associated desktop layout ID for the team.
333
+ * Controls how the agent desktop is displayed for team members.
334
+ */
335
+ desktopLayoutId?: string;
336
+ };
337
+ /**
338
+ * Represents the request to perform agent login.
339
+ * @public
340
+ * @example
341
+ * const login: AgentLogin = { dialNumber: '1234', teamId: 'team1', loginOption: LoginOption.AGENT_DN };
342
+ */
343
+ export type AgentLogin = {
344
+ /**
345
+ * A dialNumber field contains the number to dial such as a route point or extension.
346
+ * Required for AGENT_DN and EXTENSION login options.
347
+ */
348
+ dialNumber?: string;
349
+ /**
350
+ * The unique ID representing a team of users.
351
+ * The agent must belong to this team.
352
+ */
353
+ teamId: string;
354
+ /**
355
+ * The loginOption field specifies the type of login method.
356
+ * Controls how calls are delivered to the agent.
357
+ */
358
+ loginOption: LoginOption;
359
+ };
360
+ /**
361
+ * Represents the request to update agent profile settings.
362
+ * @public
363
+ * @example
364
+ * const update: AgentProfileUpdate = { loginOption: LoginOption.BROWSER, dialNumber: '5678' };
365
+ */
366
+ export type AgentProfileUpdate = Pick<AgentLogin, 'loginOption' | 'dialNumber' | 'teamId'>;
367
+ /**
368
+ * Represents the options to fetch buddy agents for the logged in agent.
369
+ * Buddy agents are other agents who can be consulted or transfered to.
370
+ * @public
371
+ * @example
372
+ * const opts: BuddyAgents = { mediaType: 'telephony', state: 'Available' };
373
+ * @ignore
374
+ */
375
+ export type BuddyAgents = {
376
+ /**
377
+ * The media type channel to filter buddy agents.
378
+ * Determines which channel capability the returned agents must have.
379
+ */
380
+ mediaType: 'telephony' | 'chat' | 'social' | 'email';
381
+ /**
382
+ * Optional filter for agent state.
383
+ * If specified, returns only agents in that state.
384
+ * If omitted, returns both available and idle agents.
385
+ */
386
+ state?: 'Available' | 'Idle';
387
+ };
388
+ /**
389
+
390
+ * Generic error structure for Contact Center SDK errors.
391
+ * Contains detailed information about the error context.
392
+ * @public
393
+ * @example
394
+ * const err: GenericError = new Error('Failed');
395
+ * err.details = { type: 'ERR', orgId: 'org1', trackingId: 'track1', data: {} };
396
+ * @ignore
397
+ */
398
+ export interface GenericError extends Error {
399
+ /** Structured details about the error */
400
+ details: {
401
+ /** Error type identifier */
402
+ type: string;
403
+ /** Organization ID where the error occurred */
404
+ orgId: string;
405
+ /** Unique tracking ID for the error */
406
+ trackingId: string;
407
+ /** Additional error context data */
408
+ data: Record<string, any>;
409
+ };
410
+ }
411
+ /**
412
+ * Response type for station login operations.
413
+ * Either a success response with agent details or an error.
414
+ * @public
415
+ * @example
416
+ * function handleLogin(resp: StationLoginResponse) { ... }
417
+ */
418
+ export type StationLoginResponse = Agent.StationLoginSuccessResponse | Error;
419
+ /**
420
+ * Response type for station logout operations.
421
+ * Either a success response with logout details or an error.
422
+ * @public
423
+ * @example
424
+ * function handleLogout(resp: StationLogoutResponse) { ... }
425
+ */
426
+ export type StationLogoutResponse = Agent.LogoutSuccess | Error;
427
+ /**
428
+ * Response type for station relogin operations.
429
+ * Either a success response with relogin details or an error.
430
+ * @public
431
+ * @example
432
+ * function handleReLogin(resp: StationReLoginResponse) { ... }
433
+ * @ignore
434
+ */
435
+ export type StationReLoginResponse = Agent.ReloginSuccess | Error;
436
+ /**
437
+ * Response type for agent state change operations.
438
+ * Either a success response with state change details or an error.
439
+ * @public
440
+ * @example
441
+ * function handleStateChange(resp: SetStateResponse) { ... }
442
+ * @ignore
443
+ */
444
+ export type SetStateResponse = Agent.StateChangeSuccess | Error;
445
+ /**
446
+ * AddressBook types
447
+ */
448
+ export interface AddressBookEntry {
449
+ id: string;
450
+ organizationId?: string;
451
+ version?: number;
452
+ name: string;
453
+ number: string;
454
+ createdTime?: number;
455
+ lastUpdatedTime?: number;
456
+ }
457
+ export type AddressBookEntriesResponse = PaginatedResponse<AddressBookEntry>;
458
+ export interface AddressBookEntrySearchParams extends BaseSearchParams {
459
+ addressBookId?: string;
460
+ }
461
+ /**
462
+ * EntryPointRecord types
463
+ */
464
+ export interface EntryPointRecord {
465
+ id: string;
466
+ name: string;
467
+ description?: string;
468
+ type: string;
469
+ isActive: boolean;
470
+ orgId: string;
471
+ createdAt?: string;
472
+ updatedAt?: string;
473
+ settings?: Record<string, any>;
474
+ }
475
+ export type EntryPointListResponse = PaginatedResponse<EntryPointRecord>;
476
+ export type EntryPointSearchParams = BaseSearchParams;
477
+ /**
478
+ * Queue types
479
+ */
480
+ export interface QueueSkillRequirement {
481
+ organizationId?: string;
482
+ id?: string;
483
+ version?: number;
484
+ skillId: string;
485
+ skillName?: string;
486
+ skillType?: string;
487
+ condition: string;
488
+ skillValue: string;
489
+ createdTime?: number;
490
+ lastUpdatedTime?: number;
491
+ }
492
+ export interface QueueAgent {
493
+ id: string;
494
+ ciUserId?: string;
495
+ }
496
+ export interface AgentGroup {
497
+ teamId: string;
498
+ }
499
+ export interface CallDistributionGroup {
500
+ agentGroups: AgentGroup[];
501
+ order: number;
502
+ duration?: number;
503
+ }
504
+ export interface AssistantSkillMapping {
505
+ assistantSkillId?: string;
506
+ assistantSkillUpdatedTime?: number;
507
+ }
508
+ /**
509
+ * Configuration for a contact service queue
510
+ * @public
511
+ */
512
+ export interface ContactServiceQueue {
513
+ /** Organization ID */
514
+ organizationId?: string;
515
+ /** Unique identifier for the queue */
516
+ id?: string;
517
+ /** Version of the queue */
518
+ version?: number;
519
+ /** Name of the Contact Service Queue */
520
+ name: string;
521
+ /** Description of the queue */
522
+ description?: string;
523
+ /** Queue type (INBOUND, OUTBOUND) */
524
+ queueType: 'INBOUND' | 'OUTBOUND';
525
+ /** Whether to check agent availability */
526
+ checkAgentAvailability: boolean;
527
+ /** Channel type (TELEPHONY, EMAIL, SOCIAL_CHANNEL, CHAT, etc.) */
528
+ channelType: 'TELEPHONY' | 'EMAIL' | 'FAX' | 'CHAT' | 'VIDEO' | 'OTHERS' | 'SOCIAL_CHANNEL';
529
+ /** Social channel type for SOCIAL_CHANNEL channelType */
530
+ socialChannelType?: 'MESSAGEBIRD' | 'MESSENGER' | 'WHATSAPP' | 'APPLE_BUSINESS_CHAT' | 'GOOGLE_BUSINESS_MESSAGES';
531
+ /** Service level threshold in seconds */
532
+ serviceLevelThreshold: number;
533
+ /** Maximum number of simultaneous contacts */
534
+ maxActiveContacts: number;
535
+ /** Maximum time in queue in seconds */
536
+ maxTimeInQueue: number;
537
+ /** Default music in queue media file ID */
538
+ defaultMusicInQueueMediaFileId: string;
539
+ /** Timezone for routing strategies */
540
+ timezone?: string;
541
+ /** Whether the queue is active */
542
+ active: boolean;
543
+ /** Whether outdial campaign is enabled */
544
+ outdialCampaignEnabled?: boolean;
545
+ /** Whether monitoring is permitted */
546
+ monitoringPermitted: boolean;
547
+ /** Whether parking is permitted */
548
+ parkingPermitted: boolean;
549
+ /** Whether recording is permitted */
550
+ recordingPermitted: boolean;
551
+ /** Whether recording all calls is permitted */
552
+ recordingAllCallsPermitted: boolean;
553
+ /** Whether pausing recording is permitted */
554
+ pauseRecordingPermitted: boolean;
555
+ /** Recording pause duration in seconds */
556
+ recordingPauseDuration?: number;
557
+ /** Control flow script URL */
558
+ controlFlowScriptUrl: string;
559
+ /** IVR requeue URL */
560
+ ivrRequeueUrl: string;
561
+ /** Overflow number for telephony */
562
+ overflowNumber?: string;
563
+ /** Vendor ID */
564
+ vendorId?: string;
565
+ /** Routing type */
566
+ routingType: 'LONGEST_AVAILABLE_AGENT' | 'SKILLS_BASED' | 'CIRCULAR' | 'LINEAR';
567
+ /** Skills-based routing type */
568
+ skillBasedRoutingType?: 'LONGEST_AVAILABLE_AGENT' | 'BEST_AVAILABLE_AGENT';
569
+ /** Queue routing type */
570
+ queueRoutingType: 'TEAM_BASED' | 'SKILL_BASED' | 'AGENT_BASED';
571
+ /** Queue skill requirements */
572
+ queueSkillRequirements?: QueueSkillRequirement[];
573
+ /** List of agents for agent-based queue */
574
+ agents?: QueueAgent[];
575
+ /** Call distribution groups */
576
+ callDistributionGroups: CallDistributionGroup[];
577
+ /** XSP version */
578
+ xspVersion?: string;
579
+ /** Subscription ID */
580
+ subscriptionId?: string;
581
+ /** Assistant skill mapping */
582
+ assistantSkill?: AssistantSkillMapping;
583
+ /** Whether this is a system default queue */
584
+ systemDefault?: boolean;
585
+ /** User who last updated agents list */
586
+ agentsLastUpdatedByUserName?: string;
587
+ /** Email of user who last updated agents list */
588
+ agentsLastUpdatedByUserEmailPrefix?: string;
589
+ /** When agents list was last updated */
590
+ agentsLastUpdatedTime?: number;
591
+ /** Creation timestamp in epoch millis */
592
+ createdTime?: number;
593
+ /** Last updated timestamp in epoch millis */
594
+ lastUpdatedTime?: number;
595
+ }
596
+ export type ContactServiceQueuesResponse = PaginatedResponse<ContactServiceQueue>;
597
+ export interface ContactServiceQueueSearchParams extends BaseSearchParams {
598
+ desktopProfileFilter?: boolean;
599
+ provisioningView?: boolean;
600
+ singleObjectResponse?: boolean;
601
+ }
602
+ /**
603
+ * Response type for buddy agents query operations.
604
+ * Either a success response with list of buddy agents or an error.
605
+ * @public
606
+ * @example
607
+ * function handleBuddyAgents(resp: BuddyAgentsResponse) { ... }
608
+ */
609
+ export type BuddyAgentsResponse = Agent.BuddyAgentsSuccess | Error;
610
+ /**
611
+ * Response type for device type update operations.
612
+ * Either a success response with update confirmation or an error.
613
+ * @public
614
+ * @example
615
+ * function handleUpdateDeviceType(resp: UpdateDeviceTypeResponse) { ... }
616
+ */
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
+ */
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
+ */
692
+ export declare const AIAssistantEventType: {
693
+ /** Custom AI Assistant event */
694
+ readonly CUSTOM_EVENT: "CUSTOM_EVENT";
695
+ /** CTI-backed AI Assistant event */
696
+ readonly CTI_EVENT: "CTI_EVENT";
697
+ };
698
+ /**
699
+ * Union type of AI Assistant event categories.
700
+ * @public
701
+ * @example
702
+ * function send(type: AIAssistantEventType) { ... }
703
+ * @ignore
704
+ */
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
+ */
713
+ export declare const AIAssistantEventName: {
714
+ /** Request transcript streaming for an interaction */
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 */
721
+ readonly GET_MID_CALL_SUMMARY: "GET_MID_CALL_SUMMARY";
722
+ /** Request post-call summary generation */
723
+ readonly GET_POST_CALL_SUMMARY: "GET_POST_CALL_SUMMARY";
724
+ /** Mid-call summary response event */
725
+ readonly MID_CALL_SUMMARY_RESPONSE: "MID_CALL_SUMMARY_RESPONSE";
726
+ /** Post-call summary response event */
727
+ readonly POST_CALL_SUMMARY_RESPONSE: "POST_CALL_SUMMARY_RESPONSE";
728
+ /** Suggested digital response event */
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";
732
+ };
733
+ /**
734
+ * Union type of AI Assistant event names.
735
+ * @public
736
+ * @example
737
+ * function handle(name: AIAssistantEventName) { ... }
738
+ * @ignore
739
+ */
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
+ */
748
+ export type TranscriptMessage = {
749
+ /** Speaker role for this message */
750
+ role: string;
751
+ /** Transcript chunk content */
752
+ content: string;
753
+ /** Unique message identifier */
754
+ messageId: string;
755
+ /** Message publish timestamp (epoch milliseconds) */
756
+ publishTimestamp: number;
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
+ */
765
+ export type HistoricTranscriptsResponse = {
766
+ /** Organization identifier */
767
+ orgId: string;
768
+ /** Agent identifier */
769
+ agentId: string;
770
+ /** Conversation identifier when available */
771
+ conversationId: string | null;
772
+ /** Interaction identifier */
773
+ interactionId: string;
774
+ /** Data source identifier */
775
+ source: string;
776
+ /** Transcript messages */
777
+ data: TranscriptMessage[];
778
+ };