@webex/contact-center 3.12.0-next.16 → 3.12.0-next.161

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 (328) hide show
  1. package/.sdd/manifest.json +887 -0
  2. package/AGENTS.md +94 -0
  3. package/ai-docs/ARCHITECTURE.md +168 -0
  4. package/ai-docs/CONTRACTS.md +62 -0
  5. package/ai-docs/GETTING_STARTED.md +168 -0
  6. package/ai-docs/GLOSSARY.md +43 -0
  7. package/ai-docs/README.md +138 -0
  8. package/ai-docs/REVIEW_CHECKLIST.md +41 -0
  9. package/ai-docs/RULES.md +444 -0
  10. package/ai-docs/SECURITY.md +52 -0
  11. package/ai-docs/SERVICE_STATE.md +52 -0
  12. package/ai-docs/SPEC_INDEX.md +65 -0
  13. package/ai-docs/adr/0001-spec-source-policy.md +55 -0
  14. package/ai-docs/adr/README.md +8 -0
  15. package/ai-docs/adr/_adr-template.md +31 -0
  16. package/ai-docs/contact-center-spec.md +385 -0
  17. package/ai-docs/features/consult-transfer-list-policy/spec/feature-spec.md +362 -0
  18. package/ai-docs/features/contact-owner-change-refactor.md +78 -0
  19. package/ai-docs/features/generated-spec-conformance-fidelity-remediation/spec/feature-spec.md +117 -0
  20. package/ai-docs/features/residual-warning-coverage-completion/spec/feature-spec.md +203 -0
  21. package/ai-docs/features/validator-code-fidelity-drift-fix/spec/feature-spec.md +315 -0
  22. package/ai-docs/patterns/event-driven-patterns.md +485 -0
  23. package/ai-docs/patterns/testing-patterns.md +480 -0
  24. package/ai-docs/patterns/typescript-patterns.md +365 -0
  25. package/ai-docs/templates/README.md +102 -0
  26. package/ai-docs/templates/documentation/create-agents-md.md +240 -0
  27. package/ai-docs/templates/documentation/create-architecture-md.md +295 -0
  28. package/ai-docs/templates/existing-service/bug-fix.md +254 -0
  29. package/ai-docs/templates/existing-service/feature-enhancement.md +450 -0
  30. package/ai-docs/templates/new-method/00-master.md +80 -0
  31. package/ai-docs/templates/new-method/01-requirements.md +232 -0
  32. package/ai-docs/templates/new-method/02-implementation.md +295 -0
  33. package/ai-docs/templates/new-method/03-tests.md +201 -0
  34. package/ai-docs/templates/new-method/04-validation.md +141 -0
  35. package/ai-docs/templates/new-service/00-master.md +109 -0
  36. package/ai-docs/templates/new-service/01-pre-questions.md +159 -0
  37. package/ai-docs/templates/new-service/02-code-generation.md +346 -0
  38. package/ai-docs/templates/new-service/03-integration.md +178 -0
  39. package/ai-docs/templates/new-service/04-test-generation.md +205 -0
  40. package/ai-docs/templates/new-service/05-validation.md +145 -0
  41. package/dist/cc.js +888 -49
  42. package/dist/cc.js.map +1 -1
  43. package/dist/config.js +13 -0
  44. package/dist/config.js.map +1 -1
  45. package/dist/constants.js +38 -3
  46. package/dist/constants.js.map +1 -1
  47. package/dist/index.js +54 -17
  48. package/dist/index.js.map +1 -1
  49. package/dist/metrics/MetricsManager.js +16 -0
  50. package/dist/metrics/MetricsManager.js.map +1 -1
  51. package/dist/metrics/behavioral-events.js +185 -0
  52. package/dist/metrics/behavioral-events.js.map +1 -1
  53. package/dist/metrics/constants.js +54 -4
  54. package/dist/metrics/constants.js.map +1 -1
  55. package/dist/services/AddressBook.js +18 -15
  56. package/dist/services/AddressBook.js.map +1 -1
  57. package/dist/services/AnswerCallOnWebexService.js +202 -0
  58. package/dist/services/AnswerCallOnWebexService.js.map +1 -0
  59. package/dist/services/ApiAiAssistant.js +369 -14
  60. package/dist/services/ApiAiAssistant.js.map +1 -1
  61. package/dist/services/EntryPoint.js +46 -68
  62. package/dist/services/EntryPoint.js.map +1 -1
  63. package/dist/services/Queue.js +27 -22
  64. package/dist/services/Queue.js.map +1 -1
  65. package/dist/services/UserPreference.js +427 -0
  66. package/dist/services/UserPreference.js.map +1 -0
  67. package/dist/services/WebCallingService.js +10 -2
  68. package/dist/services/WebCallingService.js.map +1 -1
  69. package/dist/services/WebexCrossClientService.js +225 -0
  70. package/dist/services/WebexCrossClientService.js.map +1 -0
  71. package/dist/services/WxAppTelephonyMercurySync.js +111 -0
  72. package/dist/services/WxAppTelephonyMercurySync.js.map +1 -0
  73. package/dist/services/config/Util.js +48 -48
  74. package/dist/services/config/Util.js.map +1 -1
  75. package/dist/services/config/constants.js +56 -78
  76. package/dist/services/config/constants.js.map +1 -1
  77. package/dist/services/config/index.js +100 -226
  78. package/dist/services/config/index.js.map +1 -1
  79. package/dist/services/config/types.js +93 -24
  80. package/dist/services/config/types.js.map +1 -1
  81. package/dist/services/constants.js +11 -1
  82. package/dist/services/constants.js.map +1 -1
  83. package/dist/services/core/Err.js.map +1 -1
  84. package/dist/services/core/Utils.js +131 -32
  85. package/dist/services/core/Utils.js.map +1 -1
  86. package/dist/services/core/WebexRequest.js +6 -2
  87. package/dist/services/core/WebexRequest.js.map +1 -1
  88. package/dist/services/core/aqm-reqs.js +17 -11
  89. package/dist/services/core/aqm-reqs.js.map +1 -1
  90. package/dist/services/core/constants.js +9 -1
  91. package/dist/services/core/constants.js.map +1 -1
  92. package/dist/services/core/types.js.map +1 -1
  93. package/dist/services/core/websocket/WebSocketManager.js +19 -2
  94. package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
  95. package/dist/services/core/websocket/types.js.map +1 -1
  96. package/dist/services/index.js +1 -1
  97. package/dist/services/index.js.map +1 -1
  98. package/dist/services/task/Task.js +955 -0
  99. package/dist/services/task/Task.js.map +1 -0
  100. package/dist/services/task/TaskFactory.js +50 -0
  101. package/dist/services/task/TaskFactory.js.map +1 -0
  102. package/dist/services/task/TaskManager.js +1272 -605
  103. package/dist/services/task/TaskManager.js.map +1 -1
  104. package/dist/services/task/TaskUtils.js +221 -27
  105. package/dist/services/task/TaskUtils.js.map +1 -1
  106. package/dist/services/task/WebexCallingUtils.js +70 -0
  107. package/dist/services/task/WebexCallingUtils.js.map +1 -0
  108. package/dist/services/task/constants.js +19 -2
  109. package/dist/services/task/constants.js.map +1 -1
  110. package/dist/services/task/contact.js +29 -0
  111. package/dist/services/task/contact.js.map +1 -1
  112. package/dist/services/task/digital/Digital.js +78 -0
  113. package/dist/services/task/digital/Digital.js.map +1 -0
  114. package/dist/services/task/state-machine/TaskStateMachine.js +982 -0
  115. package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -0
  116. package/dist/services/task/state-machine/actions.js +572 -0
  117. package/dist/services/task/state-machine/actions.js.map +1 -0
  118. package/dist/services/task/state-machine/constants.js +161 -0
  119. package/dist/services/task/state-machine/constants.js.map +1 -0
  120. package/dist/services/task/state-machine/guards.js +379 -0
  121. package/dist/services/task/state-machine/guards.js.map +1 -0
  122. package/dist/services/task/state-machine/index.js +53 -0
  123. package/dist/services/task/state-machine/index.js.map +1 -0
  124. package/dist/services/task/state-machine/types.js +54 -0
  125. package/dist/services/task/state-machine/types.js.map +1 -0
  126. package/dist/services/task/state-machine/uiControlsComputer.js +703 -0
  127. package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -0
  128. package/dist/services/task/taskDataNormalizer.js +99 -0
  129. package/dist/services/task/taskDataNormalizer.js.map +1 -0
  130. package/dist/services/task/types.js +215 -5
  131. package/dist/services/task/types.js.map +1 -1
  132. package/dist/services/task/voice/Voice.js +1504 -0
  133. package/dist/services/task/voice/Voice.js.map +1 -0
  134. package/dist/services/task/voice/WebRTC.js +152 -0
  135. package/dist/services/task/voice/WebRTC.js.map +1 -0
  136. package/dist/services/task/voice/wxAppOfferObservability.js +145 -0
  137. package/dist/services/task/voice/wxAppOfferObservability.js.map +1 -0
  138. package/dist/services/task/voice/wxAppVoiceMethods.js +395 -0
  139. package/dist/services/task/voice/wxAppVoiceMethods.js.map +1 -0
  140. package/dist/services/wxAppDiagnosticLogging.js +159 -0
  141. package/dist/services/wxAppDiagnosticLogging.js.map +1 -0
  142. package/dist/services/wxAppTelephonyUtils.js +19 -0
  143. package/dist/services/wxAppTelephonyUtils.js.map +1 -0
  144. package/dist/types/cc.d.ts +152 -9
  145. package/dist/types/config.d.ts +13 -0
  146. package/dist/types/constants.d.ts +36 -1
  147. package/dist/types/index.d.ts +54 -20
  148. package/dist/types/metrics/MetricsManager.d.ts +6 -0
  149. package/dist/types/metrics/constants.d.ts +48 -1
  150. package/dist/types/services/AddressBook.d.ts +2 -1
  151. package/dist/types/services/AnswerCallOnWebexService.d.ts +38 -0
  152. package/dist/types/services/ApiAiAssistant.d.ts +67 -5
  153. package/dist/types/services/EntryPoint.d.ts +7 -5
  154. package/dist/types/services/Queue.d.ts +5 -3
  155. package/dist/types/services/UserPreference.d.ts +118 -0
  156. package/dist/types/services/WebexCrossClientService.d.ts +32 -0
  157. package/dist/types/services/WxAppTelephonyMercurySync.d.ts +28 -0
  158. package/dist/types/services/config/Util.d.ts +4 -8
  159. package/dist/types/services/config/constants.d.ts +49 -76
  160. package/dist/types/services/config/index.d.ts +16 -64
  161. package/dist/types/services/config/types.d.ts +240 -114
  162. package/dist/types/services/constants.d.ts +9 -0
  163. package/dist/types/services/core/Err.d.ts +2 -0
  164. package/dist/types/services/core/Utils.d.ts +43 -13
  165. package/dist/types/services/core/WebexRequest.d.ts +1 -0
  166. package/dist/types/services/core/constants.d.ts +7 -0
  167. package/dist/types/services/core/types.d.ts +2 -0
  168. package/dist/types/services/core/websocket/WebSocketManager.d.ts +1 -0
  169. package/dist/types/services/core/websocket/types.d.ts +1 -1
  170. package/dist/types/services/index.d.ts +1 -1
  171. package/dist/types/services/task/Task.d.ts +186 -0
  172. package/dist/types/services/task/TaskFactory.d.ts +14 -0
  173. package/dist/types/services/task/TaskUtils.d.ts +54 -2
  174. package/dist/types/services/task/WebexCallingUtils.d.ts +11 -0
  175. package/dist/types/services/task/constants.d.ts +17 -0
  176. package/dist/types/services/task/contact.d.ts +4 -0
  177. package/dist/types/services/task/digital/Digital.d.ts +23 -0
  178. package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +1442 -0
  179. package/dist/types/services/task/state-machine/actions.d.ts +10 -0
  180. package/dist/types/services/task/state-machine/constants.d.ts +107 -0
  181. package/dist/types/services/task/state-machine/guards.d.ts +103 -0
  182. package/dist/types/services/task/state-machine/index.d.ts +13 -0
  183. package/dist/types/services/task/state-machine/types.d.ts +277 -0
  184. package/dist/types/services/task/state-machine/uiControlsComputer.d.ts +9 -0
  185. package/dist/types/services/task/taskDataNormalizer.d.ts +10 -0
  186. package/dist/types/services/task/types.d.ts +738 -66
  187. package/dist/types/services/task/voice/Voice.d.ts +241 -0
  188. package/dist/types/services/task/voice/WebRTC.d.ts +54 -0
  189. package/dist/types/services/task/voice/wxAppOfferObservability.d.ts +39 -0
  190. package/dist/types/services/task/voice/wxAppVoiceMethods.d.ts +68 -0
  191. package/dist/types/services/wxAppDiagnosticLogging.d.ts +63 -0
  192. package/dist/types/services/wxAppTelephonyUtils.d.ts +5 -0
  193. package/dist/types/types.d.ts +213 -11
  194. package/dist/types/utils/PageCache.d.ts +20 -3
  195. package/dist/types/webex.d.ts +1 -0
  196. package/dist/types.js +168 -6
  197. package/dist/types.js.map +1 -1
  198. package/dist/utils/PageCache.js +19 -5
  199. package/dist/utils/PageCache.js.map +1 -1
  200. package/dist/webex.js +22 -2
  201. package/dist/webex.js.map +1 -1
  202. package/package.json +16 -12
  203. package/src/cc.ts +1137 -67
  204. package/src/config.ts +13 -0
  205. package/src/constants.ts +39 -1
  206. package/src/index.ts +62 -15
  207. package/src/metrics/MetricsManager.ts +16 -0
  208. package/src/metrics/ai-docs/AGENTS.md +350 -0
  209. package/src/metrics/ai-docs/ARCHITECTURE.md +338 -0
  210. package/src/metrics/ai-docs/metrics-spec.md +971 -0
  211. package/src/metrics/behavioral-events.ts +190 -0
  212. package/src/metrics/constants.ts +59 -4
  213. package/src/services/AddressBook.ts +17 -6
  214. package/src/services/AnswerCallOnWebexService.ts +239 -0
  215. package/src/services/ApiAiAssistant.ts +494 -15
  216. package/src/services/EntryPoint.ts +59 -60
  217. package/src/services/Queue.ts +29 -12
  218. package/src/services/UserPreference.ts +509 -0
  219. package/src/services/WebCallingService.ts +16 -2
  220. package/src/services/WebexCrossClientService.ts +298 -0
  221. package/src/services/WxAppTelephonyMercurySync.ts +142 -0
  222. package/src/services/agent/ai-docs/AGENTS.md +240 -0
  223. package/src/services/agent/ai-docs/ARCHITECTURE.md +304 -0
  224. package/src/services/agent/ai-docs/agent-spec.md +505 -0
  225. package/src/services/ai-docs/AGENTS.md +386 -0
  226. package/src/services/ai-docs/services-spec.md +512 -0
  227. package/src/services/config/Util.ts +54 -84
  228. package/src/services/config/ai-docs/AGENTS.md +250 -0
  229. package/src/services/config/ai-docs/ARCHITECTURE.md +413 -0
  230. package/src/services/config/ai-docs/config-spec.md +669 -0
  231. package/src/services/config/constants.ts +63 -85
  232. package/src/services/config/index.ts +116 -277
  233. package/src/services/config/types.ts +229 -125
  234. package/src/services/constants.ts +10 -0
  235. package/src/services/core/Err.ts +1 -0
  236. package/src/services/core/Utils.ts +151 -37
  237. package/src/services/core/WebexRequest.ts +3 -1
  238. package/src/services/core/ai-docs/AGENTS.md +381 -0
  239. package/src/services/core/ai-docs/ARCHITECTURE.md +698 -0
  240. package/src/services/core/ai-docs/core-spec.md +797 -0
  241. package/src/services/core/aqm-reqs.ts +18 -12
  242. package/src/services/core/constants.ts +8 -0
  243. package/src/services/core/types.ts +33 -1
  244. package/src/services/core/websocket/WebSocketManager.ts +28 -2
  245. package/src/services/core/websocket/types.ts +1 -1
  246. package/src/services/index.ts +1 -1
  247. package/src/services/task/Task.ts +1211 -0
  248. package/src/services/task/TaskFactory.ts +82 -0
  249. package/src/services/task/TaskManager.ts +1585 -724
  250. package/src/services/task/TaskUtils.ts +316 -25
  251. package/src/services/task/WebexCallingUtils.ts +136 -0
  252. package/src/services/task/ai-docs/AGENTS.md +457 -0
  253. package/src/services/task/ai-docs/ARCHITECTURE.md +595 -0
  254. package/src/services/task/ai-docs/task-spec.md +1501 -0
  255. package/src/services/task/constants.ts +18 -0
  256. package/src/services/task/contact.ts +30 -0
  257. package/src/services/task/digital/Digital.ts +102 -0
  258. package/src/services/task/state-machine/TaskStateMachine.ts +1320 -0
  259. package/src/services/task/state-machine/actions.ts +741 -0
  260. package/src/services/task/state-machine/ai-docs/AGENTS.md +460 -0
  261. package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +1156 -0
  262. package/src/services/task/state-machine/ai-docs/task-state-machine-spec.md +2247 -0
  263. package/src/services/task/state-machine/constants.ts +172 -0
  264. package/src/services/task/state-machine/guards.ts +442 -0
  265. package/src/services/task/state-machine/index.ts +28 -0
  266. package/src/services/task/state-machine/types.ts +258 -0
  267. package/src/services/task/state-machine/uiControlsComputer.ts +1135 -0
  268. package/src/services/task/taskDataNormalizer.ts +137 -0
  269. package/src/services/task/types.ts +918 -70
  270. package/src/services/task/voice/Voice.ts +1878 -0
  271. package/src/services/task/voice/WebRTC.ts +194 -0
  272. package/src/services/task/voice/wxAppOfferObservability.ts +204 -0
  273. package/src/services/task/voice/wxAppVoiceMethods.ts +575 -0
  274. package/src/services/wxAppDiagnosticLogging.ts +286 -0
  275. package/src/services/wxAppTelephonyUtils.ts +14 -0
  276. package/src/types.ts +272 -13
  277. package/src/utils/AGENTS.md +289 -0
  278. package/src/utils/PageCache.ts +38 -5
  279. package/src/utils/ai-docs/utils-spec.md +391 -0
  280. package/src/webex.js +10 -0
  281. package/test/unit/fixtures/aiSummaryTestUtils.ts +40 -0
  282. package/test/unit/spec/cc.ts +3553 -107
  283. package/test/unit/spec/index.ts +885 -0
  284. package/test/unit/spec/logger-proxy.ts +70 -0
  285. package/test/unit/spec/metrics/MetricsManager.ts +25 -0
  286. package/test/unit/spec/metrics/behavioral-events.ts +60 -0
  287. package/test/unit/spec/services/AddressBook.ts +37 -6
  288. package/test/unit/spec/services/AnswerCallOnWebexService.ts +264 -0
  289. package/test/unit/spec/services/ApiAiAssistant.ts +442 -23
  290. package/test/unit/spec/services/EntryPoint.ts +87 -40
  291. package/test/unit/spec/services/Queue.ts +123 -12
  292. package/test/unit/spec/services/UserPreference.ts +401 -0
  293. package/test/unit/spec/services/WebCallingService.ts +45 -1
  294. package/test/unit/spec/services/WebexCrossClientService.ts +509 -0
  295. package/test/unit/spec/services/WxAppTelephonyMercurySync.ts +136 -0
  296. package/test/unit/spec/services/config/Util.ts +501 -0
  297. package/test/unit/spec/services/config/index.ts +317 -547
  298. package/test/unit/spec/services/core/Utils.ts +447 -8
  299. package/test/unit/spec/services/core/WebexRequest.ts +8 -7
  300. package/test/unit/spec/services/core/aqm-reqs.ts +142 -1
  301. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +129 -53
  302. package/test/unit/spec/services/task/AutoWrapup.ts +63 -0
  303. package/test/unit/spec/services/task/Task.ts +2723 -0
  304. package/test/unit/spec/services/task/TaskFactory.ts +116 -0
  305. package/test/unit/spec/services/task/TaskManager.ts +4734 -1769
  306. package/test/unit/spec/services/task/TaskUtils.ts +307 -0
  307. package/test/unit/spec/services/task/WebexCallingUtils.ts +153 -0
  308. package/test/unit/spec/services/task/contact.ts +33 -0
  309. package/test/unit/spec/services/task/digital/Digital.ts +105 -0
  310. package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +4060 -0
  311. package/test/unit/spec/services/task/state-machine/guards.ts +839 -0
  312. package/test/unit/spec/services/task/state-machine/types.ts +18 -0
  313. package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +3101 -0
  314. package/test/unit/spec/services/task/taskTestUtils.ts +87 -0
  315. package/test/unit/spec/services/task/voice/Voice.ts +2355 -0
  316. package/test/unit/spec/services/task/voice/WebRTC.ts +235 -0
  317. package/test/unit/spec/services/task/voice/wxAppOfferObservability.ts +361 -0
  318. package/test/unit/spec/services/task/voice/wxAppVoiceMethods.ts +719 -0
  319. package/test/unit/spec/services/wxAppDiagnosticLogging.ts +179 -0
  320. package/test/unit/spec/wellnessSampleUtils.ts +288 -0
  321. package/typedoc.md +1 -1
  322. package/umd/contact-center.min.js +2 -2
  323. package/umd/contact-center.min.js.map +1 -1
  324. package/dist/services/task/index.js +0 -1530
  325. package/dist/services/task/index.js.map +0 -1
  326. package/dist/types/services/task/index.d.ts +0 -650
  327. package/src/services/task/index.ts +0 -1806
  328. package/test/unit/spec/services/task/index.ts +0 -2205
@@ -0,0 +1,286 @@
1
+ import LoggerProxy from '../logger-proxy';
2
+
3
+ export const WXAPP_LOG_FEATURE = 'wxApp';
4
+ export const WXAPP_LOG_PREFIX = '[CC wxApp]';
5
+
6
+ export type WxAppAcceptReason =
7
+ | 'wxApp_offer_ready'
8
+ | 'wxApp_answer_pending'
9
+ | 'wxApp_accept_in_flight'
10
+ | 'extension_non_wxApp_offer'
11
+ | 'browser_webrtc_offer'
12
+ | 'outdial_auto_answer';
13
+
14
+ export type WxAppSessionSkipReason =
15
+ | 'unsupported_browser_login'
16
+ | 'flag_disabled'
17
+ | 'mercury_subscribe_failed'
18
+ | 'publish_failed';
19
+
20
+ export type WxAppTelephonyAction = 'accept' | 'decline' | 'mute' | 'dtmf';
21
+ export type WxAppTelephonyPhase = 'started' | 'success' | 'failed';
22
+
23
+ type WxAppLogData = Record<string, string | boolean | number | undefined>;
24
+
25
+ /** Last 8 chars of callId for correlation without logging full id. */
26
+ export function callIdSuffix(callId: string | null | undefined): string | undefined {
27
+ if (!callId) {
28
+ return undefined;
29
+ }
30
+
31
+ return callId.length <= 8 ? callId : callId.slice(-8);
32
+ }
33
+
34
+ function formatLogSuffix(data: WxAppLogData, keys?: string[]): string {
35
+ const entries = keys
36
+ ? keys.map((key) => [key, data[key]] as const)
37
+ : Object.entries(data).filter(([key]) => key !== 'feature' && key !== 'event');
38
+
39
+ const parts = entries
40
+ .filter(([, value]) => value !== undefined && value !== null && value !== '')
41
+ .map(([key, value]) => `${key}=${String(value)}`);
42
+
43
+ return parts.length > 0 ? ` ${parts.join(' ')}` : '';
44
+ }
45
+
46
+ function logWxApp(
47
+ message: string,
48
+ method: string,
49
+ data: WxAppLogData,
50
+ suffixKeys?: string[]
51
+ ): void {
52
+ const suffix = formatLogSuffix(data, suffixKeys);
53
+ LoggerProxy.log(`${WXAPP_LOG_PREFIX} ${message}${suffix}`, {
54
+ module: 'wxAppDiagnosticLogging',
55
+ method,
56
+ data: {feature: WXAPP_LOG_FEATURE, ...data},
57
+ });
58
+ }
59
+
60
+ function logWxAppWarn(
61
+ message: string,
62
+ method: string,
63
+ data: WxAppLogData,
64
+ suffixKeys?: string[]
65
+ ): void {
66
+ const suffix = formatLogSuffix(data, suffixKeys);
67
+ LoggerProxy.warn(`${WXAPP_LOG_PREFIX} ${message}${suffix}`, {
68
+ module: 'wxAppDiagnosticLogging',
69
+ method,
70
+ data: {feature: WXAPP_LOG_FEATURE, ...data},
71
+ });
72
+ }
73
+
74
+ function logWxAppError(
75
+ message: string,
76
+ method: string,
77
+ data: WxAppLogData,
78
+ suffixKeys?: string[]
79
+ ): void {
80
+ const suffix = formatLogSuffix(data, suffixKeys);
81
+ LoggerProxy.error(`${WXAPP_LOG_PREFIX} ${message}${suffix}`, {
82
+ module: 'wxAppDiagnosticLogging',
83
+ method,
84
+ data: {feature: WXAPP_LOG_FEATURE, ...data},
85
+ });
86
+ }
87
+
88
+ export function logWxAppSessionReadiness(params: {
89
+ enableWxBetterTogether: boolean;
90
+ loginOption: string | undefined;
91
+ wxAppHooksApplied: boolean;
92
+ usersubPublished: boolean;
93
+ mercurySubscribed: boolean;
94
+ telephonyTaskType: 'Voice' | 'WebRTC' | 'unknown';
95
+ skipReason?: WxAppSessionSkipReason;
96
+ }): void {
97
+ const data: WxAppLogData = {
98
+ event: 'session_readiness',
99
+ enableWxBetterTogether: params.enableWxBetterTogether,
100
+ loginOption: params.loginOption,
101
+ wxAppHooksApplied: params.wxAppHooksApplied,
102
+ usersubPublished: params.usersubPublished,
103
+ mercurySubscribed: params.mercurySubscribed,
104
+ telephonyTaskType: params.telephonyTaskType,
105
+ skipReason: params.skipReason,
106
+ };
107
+
108
+ logWxApp('session readiness', 'logWxAppSessionReadiness', data, [
109
+ 'usersubPublished',
110
+ 'mercurySubscribed',
111
+ 'loginOption',
112
+ 'enableWxBetterTogether',
113
+ 'telephonyTaskType',
114
+ 'skipReason',
115
+ ]);
116
+ }
117
+
118
+ export function deriveWxAppAcceptReason(params: {
119
+ isWxAppInboundOffer: boolean;
120
+ isWxAppOutdialOffer: boolean;
121
+ isWebrtc: boolean;
122
+ isOutdial: boolean;
123
+ wxAppAcceptInFlight: boolean;
124
+ wxAppAnswerPending: boolean;
125
+ enableWxBetterTogether: boolean;
126
+ hasDeviceCallId: boolean;
127
+ }): WxAppAcceptReason {
128
+ if (params.isWxAppInboundOffer || params.isWxAppOutdialOffer) {
129
+ if (params.wxAppAcceptInFlight) {
130
+ return 'wxApp_accept_in_flight';
131
+ }
132
+ if (params.wxAppAnswerPending) {
133
+ return 'wxApp_answer_pending';
134
+ }
135
+
136
+ return 'wxApp_offer_ready';
137
+ }
138
+
139
+ if (params.isWebrtc && !params.isOutdial) {
140
+ return 'browser_webrtc_offer';
141
+ }
142
+
143
+ if (params.isOutdial) {
144
+ return 'outdial_auto_answer';
145
+ }
146
+
147
+ if (params.enableWxBetterTogether && !params.hasDeviceCallId) {
148
+ return 'extension_non_wxApp_offer';
149
+ }
150
+
151
+ return 'extension_non_wxApp_offer';
152
+ }
153
+
154
+ export function logWxAppOfferDecision(params: {
155
+ interactionId: string;
156
+ acceptVisible: boolean;
157
+ acceptEnabled: boolean;
158
+ acceptReason: WxAppAcceptReason;
159
+ wxAppParticipantDeviceType?: string;
160
+ hasDeviceCallId: boolean;
161
+ hasDeviceId?: boolean;
162
+ usersubPublished?: boolean;
163
+ }): void {
164
+ const data: WxAppLogData = {
165
+ event: 'offer_decision',
166
+ interactionId: params.interactionId,
167
+ acceptVisible: params.acceptVisible,
168
+ acceptEnabled: params.acceptEnabled,
169
+ acceptReason: params.acceptReason,
170
+ wxAppParticipantDeviceType: params.wxAppParticipantDeviceType,
171
+ hasDeviceCallId: params.hasDeviceCallId,
172
+ hasDeviceId: params.hasDeviceId,
173
+ usersubPublished: params.usersubPublished,
174
+ };
175
+
176
+ logWxApp('offer decision', 'logWxAppOfferDecision', data, [
177
+ 'acceptReason',
178
+ 'hasDeviceCallId',
179
+ 'hasDeviceId',
180
+ 'usersubPublished',
181
+ 'interactionId',
182
+ 'acceptVisible',
183
+ 'acceptEnabled',
184
+ ]);
185
+ }
186
+
187
+ export function logWxAppOfferParticipantMismatch(params: {
188
+ interactionId: string;
189
+ usersubPublished: boolean;
190
+ hasDeviceCallId: boolean;
191
+ hasDeviceId: boolean;
192
+ participantDeviceType?: string;
193
+ acceptVisible: boolean;
194
+ acceptEnabled: boolean;
195
+ acceptReason: WxAppAcceptReason;
196
+ }): void {
197
+ const data: WxAppLogData = {
198
+ event: 'participant_fields_mismatch',
199
+ interactionId: params.interactionId,
200
+ usersubPublished: params.usersubPublished,
201
+ hasDeviceCallId: params.hasDeviceCallId,
202
+ hasDeviceId: params.hasDeviceId,
203
+ participantDeviceType: params.participantDeviceType ?? 'missing',
204
+ acceptVisible: params.acceptVisible,
205
+ acceptEnabled: params.acceptEnabled,
206
+ acceptReason: params.acceptReason,
207
+ };
208
+
209
+ logWxAppWarn('participant fields mismatch', 'logWxAppOfferParticipantMismatch', data, [
210
+ 'usersubPublished',
211
+ 'hasDeviceCallId',
212
+ 'hasDeviceId',
213
+ 'acceptReason',
214
+ 'interactionId',
215
+ 'participantDeviceType',
216
+ ]);
217
+ }
218
+
219
+ export function logWxAppTelephonyAction(params: {
220
+ action: WxAppTelephonyAction;
221
+ phase: WxAppTelephonyPhase;
222
+ interactionId?: string;
223
+ trackingId?: string;
224
+ httpStatus?: number | string;
225
+ failureReason?: string;
226
+ }): void {
227
+ const payload: WxAppLogData = {
228
+ event: 'telephony_action',
229
+ action: params.action,
230
+ phase: params.phase,
231
+ interactionId: params.interactionId,
232
+ trackingId: params.trackingId,
233
+ httpStatus: params.httpStatus,
234
+ failureReason: params.failureReason,
235
+ };
236
+
237
+ if (params.phase === 'failed') {
238
+ logWxAppError(
239
+ `telephony ${params.action} ${params.phase}`,
240
+ 'logWxAppTelephonyAction',
241
+ payload,
242
+ ['interactionId', 'trackingId', 'httpStatus', 'failureReason']
243
+ );
244
+ } else {
245
+ logWxApp(`telephony ${params.action} ${params.phase}`, 'logWxAppTelephonyAction', payload, [
246
+ 'interactionId',
247
+ 'action',
248
+ 'phase',
249
+ ]);
250
+ }
251
+ }
252
+
253
+ export function logWxAppValidationFailure(reason: string, interactionId?: string): void {
254
+ logWxAppError(
255
+ 'validation failed',
256
+ 'logWxAppValidationFailure',
257
+ {
258
+ event: 'validation_failed',
259
+ reason,
260
+ interactionId,
261
+ },
262
+ ['reason', 'interactionId']
263
+ );
264
+ }
265
+
266
+ export function logWxAppMercuryMuteSync(params: {
267
+ phase: 'received' | 'applied' | 'dropped';
268
+ muted?: boolean;
269
+ callIdSuffix?: string;
270
+ interactionId?: string;
271
+ dropReason?: string;
272
+ }): void {
273
+ logWxApp(
274
+ `mercury mute sync ${params.phase}`,
275
+ 'logWxAppMercuryMuteSync',
276
+ {
277
+ event: 'mercury_mute_sync',
278
+ phase: params.phase,
279
+ muted: params.muted,
280
+ callIdSuffix: params.callIdSuffix,
281
+ interactionId: params.interactionId,
282
+ dropReason: params.dropReason,
283
+ },
284
+ ['phase', 'muted', 'callIdSuffix', 'interactionId', 'dropReason']
285
+ );
286
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Expected Hydra responses when mute backfill races call creation (WXCC-6026).
3
+ * These must not be logged as errors — see task-spec wxApp mute backfill guard.
4
+ */
5
+ export function isWxAppCallNotFoundError(error: unknown): boolean {
6
+ const err = error as {status?: number | string; message?: string};
7
+ if (err?.status === 400 || err?.status === '400') {
8
+ return true;
9
+ }
10
+
11
+ const message = String(err?.message ?? error ?? '');
12
+
13
+ return message.includes('Call not found') || message.includes('101002');
14
+ }
package/src/types.ts CHANGED
@@ -6,7 +6,13 @@ import {
6
6
  } from '@webex/internal-plugin-metrics/src/metrics.types';
7
7
  import * as Agent from './services/agent/types';
8
8
  import * as Contact from './services/task/types';
9
- import {Profile} from './services/config/types';
9
+ import {
10
+ AIFeatureFlags,
11
+ Entity,
12
+ Profile,
13
+ CreateUserPreferenceRequest,
14
+ UpdateUserPreferenceRequest,
15
+ } from './services/config/types';
10
16
  import {PaginatedResponse, BaseSearchParams} from './utils/PageCache';
11
17
 
12
18
  /**
@@ -69,6 +75,8 @@ export type WebexRequestPayload = {
69
75
  uri?: string;
70
76
  /** Whether to add authorization header */
71
77
  addAuthHeader?: boolean;
78
+ /** Request timeout in milliseconds */
79
+ timeout?: number;
72
80
  /** Custom headers to include in request */
73
81
  headers?: {
74
82
  [key: string]: string | null;
@@ -88,12 +96,19 @@ export type WebexRequestPayload = {
88
96
  */
89
97
  type Listener = (e: string, data?: unknown) => void;
90
98
 
99
+ /**
100
+ * Mercury event handler callback.
101
+ * @internal
102
+ * @ignore
103
+ */
104
+ type MercuryEventHandler = (data?: unknown) => void;
105
+
91
106
  /**
92
107
  * Event listener removal function type.
93
108
  * @internal
94
109
  * @ignore
95
110
  */
96
- type ListenerOff = (e: string) => void;
111
+ type ListenerOff = (e: string, handler?: MercuryEventHandler) => void;
97
112
 
98
113
  /**
99
114
  * Service host configuration.
@@ -156,6 +171,10 @@ export interface CCPluginConfig {
156
171
  };
157
172
  /** Configuration for the calling client */
158
173
  callingClientConfig: CallingClientConfig;
174
+ /** Whether to skip Mobius/WebRTC registration for browser login flows */
175
+ disableWebRTCRegistration?: boolean;
176
+ /** Whether wxApp Better Together (telephony REST + usersub) is enabled at init (WXCC-6026) */
177
+ enableWxBetterTogether?: boolean;
159
178
  }
160
179
 
161
180
  /**
@@ -286,6 +305,12 @@ interface IWebexInternal {
286
305
  version: string;
287
306
  /** Calling behavior configuration */
288
307
  callingBehavior: string;
308
+ /** Whether the device is registered with WDM */
309
+ registered?: boolean;
310
+ /** Register the device with WDM */
311
+ register?: () => Promise<void>;
312
+ /** Unregister the device from WDM */
313
+ unregister?: () => Promise<void>;
289
314
  };
290
315
  /** Presence service */
291
316
  presence: unknown;
@@ -397,6 +422,9 @@ export interface IContactCenter {
397
422
  * cc.register().then(profile => { ... });
398
423
  */
399
424
  register(): Promise<Profile>;
425
+
426
+ /** Returns the system-managed WellbeingBreak idle code for the registered session. */
427
+ getWellbeingBreakIdleCode(): Promise<Entity>;
400
428
  }
401
429
 
402
430
  /**
@@ -542,22 +570,22 @@ export type RequestBody =
542
570
  | Contact.cancelCtq
543
571
  | Contact.WrapupPayLoad
544
572
  | Contact.DialerPayload
545
- | Contact.PreviewContactPayload;
573
+ | Contact.PreviewContactPayload
574
+ | CreateUserPreferenceRequest
575
+ | UpdateUserPreferenceRequest;
546
576
 
547
577
  /**
548
578
  * Represents the options to fetch buddy agents for the logged in agent.
549
- * Buddy agents are other agents who can be consulted or transfered to.
579
+ * Buddy agents are other agents who can be consulted or transferred to.
550
580
  * @public
551
581
  * @example
552
582
  * const opts: BuddyAgents = { mediaType: 'telephony', state: 'Available' };
553
- * @ignore
554
583
  */
555
584
  export type BuddyAgents = {
556
585
  /**
557
- * The media type channel to filter buddy agents.
558
- * Determines which channel capability the returned agents must have.
586
+ * The media type channel to filter buddy agents. Defaults to telephony when omitted.
559
587
  */
560
- mediaType: 'telephony' | 'chat' | 'social' | 'email';
588
+ mediaType?: 'telephony' | 'chat' | 'social' | 'email';
561
589
 
562
590
  /**
563
591
  * Optional filter for agent state.
@@ -565,9 +593,39 @@ export type BuddyAgents = {
565
593
  * If omitted, returns both available and idle agents.
566
594
  */
567
595
  state?: 'Available' | 'Idle';
596
+
597
+ /**
598
+ * Applies the default state policy for the operation. An explicit state takes precedence.
599
+ */
600
+ action?: 'Consult' | 'Transfer';
568
601
  };
569
602
 
570
603
  /**
604
+ * Holds the configuration flags for the Agent.
605
+ * These flags determine the availability of certain features in the Agent UI.
606
+ * @internal
607
+ */
608
+ export type ConfigFlags = {
609
+ isEndTaskEnabled: boolean;
610
+ isEndConsultEnabled: boolean;
611
+ webRtcEnabled: boolean;
612
+ autoWrapup: boolean;
613
+ aiFeature?: AIFeatureFlags;
614
+ /** Agent-profile policy used to derive task consult/transfer destination controls. */
615
+ consultTransfer?: Contact.ConsultTransferDestinationConfig;
616
+ /**
617
+ * Optional toggle to globally enable/disable recording controls.
618
+ * Falls back to backend hints when omitted.
619
+ */
620
+ isRecordingEnabled?: boolean;
621
+ /** Whether wxApp thick-client answer controls/APIs are enabled (WXCC-6026) */
622
+ enableWxBetterTogether?: boolean;
623
+ /** Read-only observability: live usersub answer-calls-on-wxcc state for wxApp offer diagnostics. */
624
+ getWxAppUsersubPublished?: () => boolean;
625
+ };
626
+
627
+ /**
628
+
571
629
  * Generic error structure for Contact Center SDK errors.
572
630
  * Contains detailed information about the error context.
573
631
  * @public
@@ -653,10 +711,12 @@ export interface AddressBookEntrySearchParams extends BaseSearchParams {
653
711
  export interface EntryPointRecord {
654
712
  id: string;
655
713
  name: string;
714
+ /** Dialled number mapped to this entry point when included in the list response. */
715
+ number?: string;
656
716
  description?: string;
657
- type: string;
658
- isActive: boolean;
659
- orgId: string;
717
+ type?: string;
718
+ isActive?: boolean;
719
+ orgId?: string;
660
720
  createdAt?: string;
661
721
  updatedAt?: string;
662
722
  settings?: Record<string, any>;
@@ -821,38 +881,237 @@ export type BuddyAgentsResponse = Agent.BuddyAgentsSuccess | Error;
821
881
  */
822
882
  export type UpdateDeviceTypeResponse = Agent.DeviceTypeUpdateSuccess | Error;
823
883
 
884
+ /**
885
+ * Supported transcript control actions for AI Assistant events.
886
+ * @public
887
+ * @example
888
+ * const action: TranscriptAction = 'START';
889
+ * @ignore
890
+ */
824
891
  export type TranscriptAction = 'START' | 'STOP';
825
892
 
893
+ /**
894
+ * Parameters used to request AI Assistant real-time assistance.
895
+ * @public
896
+ * @example
897
+ * const params: RealTimeAssistanceParams = {
898
+ * interactionId: 'interaction-123',
899
+ * context: 'Need help with credit card payment due date',
900
+ * };
901
+ */
902
+ export type RealTimeAssistanceParams = {
903
+ /** Agent identifier */
904
+ agentId: string;
905
+ /** Interaction identifier for which assistance should be generated */
906
+ interactionId: string;
907
+ /** Optional additional context that should refine the assistance */
908
+ context?: string;
909
+ /** Optional language code for assistance (for example, 'en'). Defaults to 'en'. */
910
+ languageCode?: string;
911
+ };
912
+
913
+ /**
914
+ * Supported user actions on an AI Assistant real-time assistance adaptive card.
915
+ * @public
916
+ */
917
+ export const RealTimeAssistanceUserActionId = {
918
+ /** User liked the real-time assistance response */
919
+ LIKE: 'likeButton',
920
+ /** User disliked the real-time assistance response */
921
+ DISLIKE: 'dislikeButton',
922
+ /** User copied the real-time assistance response */
923
+ COPY: 'copyButton',
924
+ } as const;
925
+
926
+ /**
927
+ * Union type of supported real-time assistance user actions.
928
+ * @public
929
+ */
930
+ export type RealTimeAssistanceUserActionId = Enum<typeof RealTimeAssistanceUserActionId>;
931
+
932
+ /**
933
+ * Parameters used to send user action feedback for a real-time assistance adaptive card.
934
+ * @public
935
+ * @example
936
+ * const params: RealTimeAssistanceUserActionParams = {
937
+ * agentId: 'agent-123',
938
+ * interactionId: 'interaction-123',
939
+ * adaptiveCardId: 'adaptive-card-123',
940
+ * actionId: RealTimeAssistanceUserActionId.LIKE,
941
+ * };
942
+ */
943
+ export type RealTimeAssistanceUserActionParams = {
944
+ /** Agent identifier */
945
+ agentId: string;
946
+ /** Interaction identifier associated with the real-time assistance response */
947
+ interactionId: string;
948
+ /** Adaptive card identifier from the real-time assistance payload */
949
+ adaptiveCardId: string;
950
+ /** User action performed on the adaptive card */
951
+ actionId: RealTimeAssistanceUserActionId;
952
+ /** Optional language code. Defaults to 'en'. */
953
+ languageCode?: string;
954
+ };
955
+
956
+ /**
957
+ * Wellness notification actions delivered by the Contact Center notification service.
958
+ * @public
959
+ */
960
+ export const WELLNESS_BREAK_NOTIFICATION_ACTIONS = {
961
+ PROVIDE_WELLNESS_BREAK: 'PROVIDE_WELLNESS_BREAK',
962
+ SUGGEST_WELLNESS_BREAK: 'SUGGEST_WELLNESS_BREAK',
963
+ WELLNESS_BREAK_NOT_ALLOWED: 'WELLNESS_BREAK_NOT_ALLOWED',
964
+ } as const;
965
+
966
+ /** Union of supported wellness notification actions. @public */
967
+ export type WellnessBreakNotificationAction = Enum<typeof WELLNESS_BREAK_NOTIFICATION_ACTIONS>;
968
+
969
+ /**
970
+ * Agent actions accepted by the wellness action API.
971
+ * @public
972
+ */
973
+ export const WELLNESS_BREAK_USER_ACTIONS = {
974
+ REQUESTED: 'REQUESTED',
975
+ ACCEPTED: 'ACCEPTED',
976
+ REJECTED: 'REJECTED',
977
+ NO_RESPONSE: 'NO_RESPONSE',
978
+ } as const;
979
+
980
+ /** Union of supported wellness action API values. @public */
981
+ export type WellnessBreakUserAction = Enum<typeof WELLNESS_BREAK_USER_ACTIONS>;
982
+
983
+ /**
984
+ * Validated, agent-scoped wellness notification emitted by Contact Center.
985
+ * @public
986
+ */
987
+ export interface WellnessBreakEvent {
988
+ /** Agent identifier */
989
+ agentId: string;
990
+ /** Organization identifier */
991
+ orgId: string;
992
+ /** Session identifier supplied by the notification; it may differ from the consumer's active session */
993
+ agentSessionId: string;
994
+ /** Backend wellness action */
995
+ actionEvent: WellnessBreakNotificationAction;
996
+ /** Optional untrusted plain-text message supplied by the backend */
997
+ actionText?: string;
998
+ /** Optional normalized interaction diagnostic */
999
+ interactionId?: string;
1000
+ /** Notification diagnostic only; never an action-request correlation identifier */
1001
+ trackingId?: string;
1002
+ }
1003
+
1004
+ /**
1005
+ * Parameters for responding to a backend-provided wellness offer.
1006
+ * @public
1007
+ */
1008
+ export interface RespondToWellnessBreakParams {
1009
+ /** Agent response; REQUESTED is available only through requestWellnessBreak */
1010
+ action: Exclude<WellnessBreakUserAction, typeof WELLNESS_BREAK_USER_ACTIONS.REQUESTED>;
1011
+ }
1012
+
1013
+ /**
1014
+ * Supported AI Assistant event categories.
1015
+ * @public
1016
+ * @example
1017
+ * const eventType: AIAssistantEventType = AIAssistantEventType.CUSTOM_EVENT;
1018
+ * @ignore
1019
+ */
826
1020
  export const AIAssistantEventType = {
1021
+ /** Custom AI Assistant event */
827
1022
  CUSTOM_EVENT: 'CUSTOM_EVENT',
1023
+ /** CTI-backed AI Assistant event */
828
1024
  CTI_EVENT: 'CTI_EVENT',
829
1025
  } as const;
830
1026
 
1027
+ /**
1028
+ * Union type of AI Assistant event categories.
1029
+ * @public
1030
+ * @example
1031
+ * function send(type: AIAssistantEventType) { ... }
1032
+ * @ignore
1033
+ */
831
1034
  export type AIAssistantEventType = Enum<typeof AIAssistantEventType>;
832
1035
 
1036
+ /**
1037
+ * Supported AI Assistant event names.
1038
+ * @public
1039
+ * @example
1040
+ * const name: AIAssistantEventName = AIAssistantEventName.GET_TRANSCRIPTS;
1041
+ * @ignore
1042
+ */
833
1043
  export const AIAssistantEventName = {
1044
+ /** Request transcript streaming for an interaction */
834
1045
  GET_TRANSCRIPTS: 'GET_TRANSCRIPTS',
835
- GET_MID_CALL_SUMMARY: 'GET_MID_CALL_SUMMARY',
1046
+ /** Request a suggested response for an interaction */
1047
+ GET_SUGGESTIONS: 'GET_SUGGESTIONS',
1048
+ /** Add extra context to refine a suggested response */
1049
+ ADD_SUGGESTIONS_EXTRA_CONTEXT: 'ADD_SUGGESTIONS_EXTRA_CONTEXT',
1050
+ /** Request post-call summary generation */
836
1051
  GET_POST_CALL_SUMMARY: 'GET_POST_CALL_SUMMARY',
837
- MID_CALL_SUMMARY_RESPONSE: 'MID_CALL_SUMMARY_RESPONSE',
1052
+ /** Request consult mid-call summary generation */
1053
+ GET_MID_CALL_CONSULT_SUMMARY: 'GET_MID_CALL_CONSULT_SUMMARY',
1054
+ /** Request transfer mid-call summary generation */
1055
+ GET_MID_CALL_TRANSFER_SUMMARY: 'GET_MID_CALL_TRANSFER_SUMMARY',
1056
+ /** Post-call summary response event */
838
1057
  POST_CALL_SUMMARY_RESPONSE: 'POST_CALL_SUMMARY_RESPONSE',
1058
+ /** Consult mid-call summary response event */
1059
+ MID_CALL_CONSULT_SUMMARY_RESPONSE: 'MID_CALL_CONSULT_SUMMARY_RESPONSE',
1060
+ /** Transfer mid-call summary response event */
1061
+ MID_CALL_TRANSFER_SUMMARY_RESPONSE: 'MID_CALL_TRANSFER_SUMMARY_RESPONSE',
1062
+ /** Suggested digital response event */
839
1063
  SUGGESTED_RESPONSES_DIGITAL: 'SUGGESTED_RESPONSES_DIGITAL',
1064
+ /** User action on a suggested response adaptive card */
1065
+ SUGGESTED_RESPONSES_USER_ACTION: 'SUGGESTED_RESPONSES_USER_ACTION',
1066
+ /** Agent Wellness Break request/response action */
1067
+ WELLNESS_BREAK_ACTION: 'WellnessBreakAction',
840
1068
  } as const;
841
1069
 
1070
+ /**
1071
+ * Union type of AI Assistant event names.
1072
+ * @public
1073
+ * @example
1074
+ * function handle(name: AIAssistantEventName) { ... }
1075
+ * @ignore
1076
+ */
842
1077
  export type AIAssistantEventName = Enum<typeof AIAssistantEventName>;
843
1078
 
1079
+ /**
1080
+ * A single transcript message entry returned by AI Assistant APIs.
1081
+ * @public
1082
+ * @example
1083
+ * const message: TranscriptMessage = { role: 'AGENT', content: 'Hello', messageId: '1', publishTimestamp: Date.now() };
1084
+ *
1085
+ */
844
1086
  export type TranscriptMessage = {
1087
+ /** Speaker role for this message */
845
1088
  role: string;
1089
+ /** Transcript chunk content */
846
1090
  content: string;
1091
+ /** Unique message identifier */
847
1092
  messageId: string;
1093
+ /** Message publish timestamp (epoch milliseconds) */
848
1094
  publishTimestamp: number;
849
1095
  };
850
1096
 
1097
+ /**
1098
+ * Response payload for historic transcripts API.
1099
+ * @public
1100
+ * @example
1101
+ * const resp: HistoricTranscriptsResponse = { orgId: 'org', agentId: 'agent', conversationId: null, interactionId: 'int', source: 'AI', data: [] };
1102
+ *
1103
+ */
851
1104
  export type HistoricTranscriptsResponse = {
1105
+ /** Organization identifier */
852
1106
  orgId: string;
1107
+ /** Agent identifier */
853
1108
  agentId: string;
1109
+ /** Conversation identifier when available */
854
1110
  conversationId: string | null;
1111
+ /** Interaction identifier */
855
1112
  interactionId: string;
1113
+ /** Data source identifier */
856
1114
  source: string;
1115
+ /** Transcript messages */
857
1116
  data: TranscriptMessage[];
858
1117
  };