@webex/contact-center 3.12.0-next.17 → 3.12.0-next.170

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
@@ -1,56 +1,42 @@
1
1
  import {LOST_CONNECTION_RECOVERY_TIMEOUT} from '../core/constants';
2
+ import {WELLNESS_BREAK_REMINDERS_ENABLED} from './constants';
2
3
  import {
4
+ AgentProfile,
3
5
  AgentResponse,
4
6
  AuxCode,
5
7
  AuxCodeType,
6
- DesktopProfileResponse,
7
8
  DialPlanEntity,
8
9
  Entity,
9
10
  IDLE_CODE,
10
- OrgInfo,
11
- OrgSettings,
11
+ OrgDesktopLoginResponse,
12
12
  Profile,
13
- Team,
14
- TenantData,
15
- URLMapping,
13
+ TeamList,
14
+ MicrosoftConfig,
15
+ WebexConfig,
16
16
  WRAP_UP_CODE,
17
- AIFeatureFlagsResponse,
18
- AIFeatureFlags,
19
17
  } from './types';
20
18
 
21
19
  /**
22
- * Get the URL mapping for the given name
23
- * @param {Array<URLMapping>} urlMappings
24
- * @param {string} name
25
- * @returns {string}
26
- */
27
- const getUrlMapping = (urlMappings: Array<URLMapping>, name: string) => {
28
- const mappedUrl = urlMappings.find((mapping) => mapping.name === name)?.url;
29
-
30
- return mappedUrl || '';
31
- };
32
-
33
- /**
34
- * Get the MSFT and Webex configuration
35
- * @param {DesktopProfileResponse} agentProfileData
20
+ * Get the MSFT configuration
21
+ * @param {MicrosoftConfig} microsoftConfig
36
22
  * @returns {Object}
37
23
  */
38
- const getMsftConfig = (agentProfileData: DesktopProfileResponse) => {
24
+ const getMsftConfig = (microsoftConfig?: MicrosoftConfig) => {
39
25
  return {
40
- showUserDetailsMS: agentProfileData.showUserDetailsMS ?? false,
41
- stateSynchronizationMS: agentProfileData.stateSynchronizationMS ?? false,
26
+ showUserDetailsMS: microsoftConfig?.showUserDetails ?? false,
27
+ stateSynchronizationMS: microsoftConfig?.stateSynchronization ?? false,
42
28
  };
43
29
  };
44
30
 
45
31
  /**
46
32
  * Get the Webex configuration
47
- * @param {DesktopProfileResponse} agentProfileData
33
+ * @param {WebexConfig} webexConfig
48
34
  * @returns {Object}
49
35
  */
50
- const getWebexConfig = (agentProfileData: DesktopProfileResponse) => {
36
+ const getWebexConfig = (webexConfig?: WebexConfig) => {
51
37
  return {
52
- showUserDetailsWebex: agentProfileData.showUserDetailsWebex ?? false,
53
- stateSynchronizationWebex: agentProfileData.stateSynchronizationWebex ?? false,
38
+ showUserDetailsWebex: webexConfig?.showUserDetails ?? false,
39
+ stateSynchronizationWebex: webexConfig?.stateSynchronization ?? false,
54
40
  };
55
41
  };
56
42
 
@@ -64,15 +50,16 @@ const getDefaultAgentDN = (agentDNValidation: string) => {
64
50
  };
65
51
 
66
52
  /**
67
- * Get the filtered dialplan entries
53
+ * Get the dialplan entries for every active plan in the organization.
54
+ * The desktop-login aggregate does not carry the per-profile `dialPlans` selection, so all active
55
+ * plans apply.
68
56
  * @param {Array<DialPlanEntity>} dialPlanData
69
- * @param {Array<string>} profileDialPlans
70
57
  * @returns {Array<Entity>}
71
58
  */
72
- const getFilteredDialplanEntries = (dialPlanData: DialPlanEntity[], profileDialPlans: string[]) => {
59
+ const getFilteredDialplanEntries = (dialPlanData: DialPlanEntity[]) => {
73
60
  const dialPlanEntries = [];
74
61
  dialPlanData.forEach((dailPlan: DialPlanEntity) => {
75
- if (profileDialPlans.includes(dailPlan.id)) {
62
+ if (dailPlan.active) {
76
63
  const filteredPlan = {
77
64
  regex: dailPlan.regularExpression,
78
65
  prefix: dailPlan.prefix,
@@ -87,24 +74,17 @@ const getFilteredDialplanEntries = (dialPlanData: DialPlanEntity[], profileDialP
87
74
  };
88
75
 
89
76
  /**
90
- * Get the filtered aux codes
77
+ * Get the active aux codes of the given type.
78
+ * The desktop-login aggregate does not carry the per-agent restriction lists, so the whole pool
79
+ * returned by the aux-code API applies.
91
80
  * @param {Array<AuxCode>} auxCodes
92
81
  * @param {AuxCodeType} type
93
- * @param {Array<string>} specificCodes
94
82
  * @returns {Array<Entity>}
95
83
  */
96
- const getFilterAuxCodes = (
97
- auxCodes: Array<AuxCode>,
98
- type: AuxCodeType,
99
- specificCodes: string[]
100
- ) => {
84
+ const getFilterAuxCodes = (auxCodes: Array<AuxCode>, type: AuxCodeType) => {
101
85
  const filteredAuxCodes: Array<Entity> = [];
102
86
  auxCodes.forEach((auxCode: AuxCode) => {
103
- if (
104
- auxCode.workTypeCode === type &&
105
- auxCode.active &&
106
- (specificCodes.length === 0 || specificCodes.includes(auxCode.id))
107
- ) {
87
+ if (auxCode.workTypeCode === type && auxCode.active) {
108
88
  filteredAuxCodes.push({
109
89
  id: auxCode.id,
110
90
  name: auxCode.name,
@@ -132,30 +112,24 @@ function getDefaultWrapUpCode(wrapUpReasonList: Entity[]) {
132
112
  * @returns {Profile}
133
113
  */
134
114
  function parseAgentConfigs(profileData: {
115
+ orgConfig: OrgDesktopLoginResponse;
135
116
  userData: AgentResponse;
136
- teamData: Team[];
137
- tenantData: TenantData;
138
- orgInfoData: OrgInfo;
117
+ agentProfileData: AgentProfile;
118
+ teamData: TeamList[];
139
119
  auxCodes: AuxCode[];
140
- orgSettingsData: OrgSettings;
141
- agentProfileData: DesktopProfileResponse;
142
120
  dialPlanData: DialPlanEntity[];
143
- urlMapping: URLMapping[];
144
121
  multimediaProfileId: string;
145
- aiFeatureFlags: AIFeatureFlagsResponse;
146
122
  }): Profile {
123
+ const {orgConfig, userData, agentProfileData, teamData, auxCodes, dialPlanData} = profileData;
147
124
  const {
148
- userData,
149
- teamData,
150
- tenantData,
151
- orgInfoData,
152
- auxCodes,
153
- orgSettingsData,
154
- agentProfileData,
155
- dialPlanData,
156
- urlMapping,
157
- aiFeatureFlags,
158
- } = profileData;
125
+ organization: orgInfoData,
126
+ organizationSetting: orgSettingsData,
127
+ tenantConfiguration: tenantData,
128
+ urlMappings,
129
+ aiFeature,
130
+ microsoftConfig,
131
+ webexConfig,
132
+ } = orgConfig;
159
133
 
160
134
  const tenantDataTimeout = tenantData.timeoutDesktopInactivityEnabled
161
135
  ? tenantData.timeoutDesktopInactivityMins
@@ -164,17 +138,9 @@ function parseAgentConfigs(profileData: {
164
138
  ? agentProfileData.timeoutDesktopInactivityMins
165
139
  : tenantDataTimeout;
166
140
 
167
- const wrapupCodes = getFilterAuxCodes(
168
- auxCodes,
169
- WRAP_UP_CODE,
170
- agentProfileData.accessWrapUpCode === 'ALL' ? [] : agentProfileData.wrapUpCodes
171
- );
141
+ const wrapupCodes = getFilterAuxCodes(auxCodes, WRAP_UP_CODE);
172
142
 
173
- const idleCodes = getFilterAuxCodes(
174
- auxCodes,
175
- IDLE_CODE,
176
- agentProfileData.accessIdleCode === 'ALL' ? [] : agentProfileData.idleCodes
177
- );
143
+ const idleCodes = getFilterAuxCodes(auxCodes, IDLE_CODE);
178
144
 
179
145
  idleCodes.push({
180
146
  id: '0',
@@ -184,12 +150,14 @@ function parseAgentConfigs(profileData: {
184
150
  }); // pushing available state to idle codes
185
151
 
186
152
  const defaultWrapUpData = getDefaultWrapUpCode(wrapupCodes);
187
- const aiFeature: AIFeatureFlags | undefined =
188
- aiFeatureFlags?.data && aiFeatureFlags.data.length > 0 ? aiFeatureFlags.data[0] : undefined;
153
+ const isWellnessConfigured =
154
+ aiFeature?.agentWellbeing?.enable === true &&
155
+ aiFeature.agentWellbeing.wellnessBreakReminders === WELLNESS_BREAK_REMINDERS_ENABLED;
156
+ const hasAIAssistantLicense = (orgSettingsData.aiAssistantQuantity ?? 0) > 0;
189
157
 
190
158
  const finalData = {
191
159
  teams: teamData,
192
- defaultDn: userData.defaultDialledNumber,
160
+ defaultDn: userData.deafultDialledNumber,
193
161
  forceDefaultDn: tenantData.forceDefaultDn,
194
162
  forceDefaultDnForAgent: getDefaultAgentDN(agentProfileData.agentDNValidation),
195
163
  regexUS: tenantData.dnDefaultRegex,
@@ -198,11 +166,10 @@ function parseAgentConfigs(profileData: {
198
166
  agentName: `${userData.firstName} ${userData.lastName}`,
199
167
  agentMailId: userData.email,
200
168
  agentProfileID: userData.agentProfileId,
201
- autoAnswer: agentProfileData.autoAnswer,
202
169
  dialPlan: agentProfileData.dialPlanEnabled
203
170
  ? {
204
171
  type: 'adhocDial',
205
- dialPlanEntity: getFilteredDialplanEntries(dialPlanData, agentProfileData.dialPlans),
172
+ dialPlanEntity: getFilteredDialplanEntries(dialPlanData),
206
173
  }
207
174
  : undefined,
208
175
  multimediaProfileId: profileData.multimediaProfileId,
@@ -210,7 +177,6 @@ function parseAgentConfigs(profileData: {
210
177
  siteId: userData.siteId,
211
178
  enterpriseId: orgInfoData.tenantId,
212
179
  tenantTimezone: orgInfoData.timezone,
213
- environment: orgInfoData.environment,
214
180
  privacyShieldVisible: tenantData.privacyShieldVisible,
215
181
  organizationIdleCodes: [], // TODO: for supervisor, getOrgFilteredIdleCodes(auxCodes, false),
216
182
  idleCodesAccess: agentProfileData.accessIdleCode as 'ALL' | 'SPECIFIC',
@@ -233,11 +199,14 @@ function parseAgentConfigs(profileData: {
233
199
  isAgentAvailableAfterOutdial: agentProfileData.agentAvailableAfterOutdial,
234
200
  outDialEp: agentProfileData.outdialEntryPointId,
235
201
  isCampaignManagementEnabled: orgSettingsData.campaignManagerEnabled,
236
- isEndCallEnabled: tenantData.endCallEnabled,
202
+ isEndTaskEnabled: tenantData.endCallEnabled,
237
203
  isEndConsultEnabled: tenantData.endConsultEnabled,
238
204
  callVariablesSuppressed: tenantData.callVariablesSuppressed,
239
205
  agentDbId: userData.dbId,
240
206
  allowConsultToQueue: agentProfileData.consultToQueue,
207
+ accessQueue: agentProfileData.accessQueue,
208
+ accessEntryPoint: agentProfileData.accessEntryPoint,
209
+ accessBuddyTeam: agentProfileData.accessBuddyTeam,
241
210
  agentPersonalStatsEnabled: agentProfileData.viewableStatistics
242
211
  ? agentProfileData.viewableStatistics.agentStats
243
212
  : false,
@@ -246,8 +215,8 @@ function parseAgentConfigs(profileData: {
246
215
  analyserUserId: userData.id,
247
216
 
248
217
  urlMappings: {
249
- acqueonApiUrl: getUrlMapping(urlMapping, 'ACQUEON_API_URL'),
250
- acqueonConsoleUrl: getUrlMapping(urlMapping, 'ACQUEON_CONSOLE_URL'),
218
+ acqueonApiUrl: urlMappings?.ACQUEON_API_URL ?? '',
219
+ acqueonConsoleUrl: urlMappings?.ACQUEON_CONSOLE_URL ?? '',
251
220
  },
252
221
  isTimeoutDesktopInactivityEnabled: tenantData.timeoutDesktopInactivityEnabled,
253
222
  timeoutDesktopInactivityMins: inactivityTimeoutTimer,
@@ -256,11 +225,12 @@ function parseAgentConfigs(profileData: {
256
225
  maskSensitiveData: orgSettingsData.maskSensitiveData
257
226
  ? orgSettingsData.maskSensitiveData
258
227
  : false,
259
- microsoftConfig: getMsftConfig(agentProfileData),
260
- webexConfig: getWebexConfig(agentProfileData),
228
+ microsoftConfig: getMsftConfig(microsoftConfig),
229
+ webexConfig: getWebexConfig(webexConfig),
261
230
  lostConnectionRecoveryTimeout:
262
231
  tenantData.lostConnectionRecoveryTimeout || LOST_CONNECTION_RECOVERY_TIMEOUT,
263
232
  aiFeature,
233
+ isWellnessBreakEnabled: isWellnessConfigured && hasAIAssistantLicense,
264
234
  };
265
235
 
266
236
  return finalData;
@@ -0,0 +1,250 @@
1
+ # Config Service - AI Agent Guide
2
+
3
+ > **Legacy/reference-only.** Canonical SDD: [`config-spec.md`](config-spec.md). Use the package [manifest](../../../../.sdd/manifest.json) and [`SPEC_INDEX.md`](../../../../ai-docs/SPEC_INDEX.md) for routing; code and tests remain the behavioral referee.
4
+ >
5
+ > **Purpose**: Fetch and aggregate agent configuration data from multiple API endpoints to build the AgentProfile.
6
+ >
7
+ > **Legacy scope:** See [Root AGENTS.md](../../../../AGENTS.md) for the orchestrator and cross-scope rules.
8
+
9
+ ---
10
+
11
+ ## Overview
12
+
13
+ The Config Service is an **internal service** that builds the comprehensive AgentProfile (`Profile` type) by:
14
+ 1. Fetching the user desktop-login aggregate (agent identity plus `agentProfile`)
15
+ 2. Fetching the organization desktop-login aggregate (org info, org settings, tenant configuration, URL mappings, AI feature, Microsoft/Webex config)
16
+ 3. Fetching teams
17
+ 4. Fetching aux codes (idle/wrapup codes)
18
+ 5. Fetching site and, when the agent profile enables it, dial-plan data
19
+ 6. Aggregating all data into a single AgentProfile
20
+
21
+ The AgentProfile is the central configuration object required for an agent to operate within the contact center. It is built during the registration flow (`cc.register()`) and contains all the data an agent needs: identity, team assignments, dial plans, aux codes, login options, and feature flags. Once constructed, the AgentProfile is stored on the `ContactCenter` plugin instance as `this.agentConfig` and is used by other services (Agent, Task) throughout the session.
22
+
23
+
24
+ ---
25
+
26
+ ## File Structure
27
+
28
+ ```
29
+ services/config/
30
+ ├── index.ts # AgentConfigService class
31
+ ├── types.ts # Profile, CC_EVENTS, types
32
+ ├── constants.ts # API endpoints, defaults
33
+ ├── Util.ts # parseAgentConfigs helper
34
+ └── ai-docs/
35
+ ├── AGENTS.md # Usage documentation
36
+ └── ARCHITECTURE.md # This file
37
+ ```
38
+
39
+ ---
40
+
41
+ ## Quick Usage
42
+
43
+ ```typescript
44
+ // Config service is used internally during the registration flow.
45
+ // Inside cc.ts → connectWebsocket(), after WebSocket connection is established:
46
+ const agentId = data.agentId;
47
+ const orgId = this.$webex.credentials.getOrgId();
48
+ this.agentConfig = await this.services.config.getAgentConfig(orgId, agentId);
49
+
50
+ // The returned AgentProfile contains all agent configuration:
51
+ LoggerProxy.info(`Agent ID: ${this.agentConfig.agentId}`, {
52
+ module: 'cc',
53
+ method: 'connectWebsocket',
54
+ });
55
+ LoggerProxy.info(`Teams: ${this.agentConfig.teams}`, {
56
+ module: 'cc',
57
+ method: 'connectWebsocket',
58
+ });
59
+ ```
60
+
61
+ ---
62
+
63
+ ## Key Capabilities
64
+
65
+ - **AgentProfile Aggregation**: Combines data from 6 API endpoints (5 when the agent profile disables dial plans)
66
+ - **Aux Codes Fetching**: Gets all idle and wrapup codes with pagination
67
+ - **Team Data**: Retrieves agent's team assignments
68
+ - **Dial Plan**: Fetches number transformation rules
69
+ - **Outdial ANI**: Retrieves outbound caller ID options (standalone, publicly exposed via `cc.ts`)
70
+ - **Multimedia Profile**: Fetches channel capacity and blending config (standalone, not yet publicly exposed)
71
+ - **Paginated Data Access**: `getListOfTeams` and `getListOfAuxCodes` support custom pagination independent of profile building. `getListOfTeams` takes a `userDbId` — the `user.dbId` carried by the user desktop-login aggregate, not the CI user id — rather than a list of team ids
72
+
73
+ ---
74
+
75
+ ## AgentProfile Object (Key Fields)
76
+
77
+ The AgentProfile is defined as the [`Profile`](../types.ts) type. This is not an exhaustive list — see [`types.ts`](../types.ts) for the full 50+ field definition. Key fields:
78
+
79
+ | Field | Type | Description |
80
+ |-------|------|-------------|
81
+ | `agentId` | string | Unique agent identifier |
82
+ | `agentName` | string | Display name |
83
+ | `agentMailId` | string | Email address |
84
+ | `teams` | [`TeamList[]`](../types.ts) | Assigned teams (runtime data from `getAllTeams()` — `Profile` type declares `Team[]` but actual objects are `TeamList` with `id`, `name`, `teamType`, `siteId`, etc.) |
85
+ | `defaultDn` | string | Default dial number |
86
+ | `idleCodes` | [`Entity[]`](../types.ts) | Available idle codes |
87
+ | `wrapupCodes` | [`Entity[]`](../types.ts) | Available wrapup codes |
88
+ | `webRtcEnabled` | boolean | WebRTC calling enabled |
89
+ | `loginVoiceOptions` | [`LoginOption[]`](../types.ts) | Available login types |
90
+ | `dialPlan` | [`DialPlan`](../types.ts) | Number transformation rules |
91
+ | `isOutboundEnabledForAgent` | boolean | Outbound calling allowed |
92
+ | `outDialEp` | string | Outbound entry point ID |
93
+
94
+ ---
95
+
96
+ ## Data Aggregation Flow
97
+
98
+ The following diagram shows how `getAgentConfig` orchestrates six API calls and combines their results into the AgentProfile via `parseAgentConfigs()`:
99
+
100
+ ```
101
+ getUserDesktopLoginConfig ──┐ (awaited first; supplies dbId, siteId, dialPlanEnabled)
102
+ │
103
+ getOrgDesktopLoginConfig ───┤ (org info, org settings, tenant config, urlMappings,
104
+ │ aiFeature, microsoftConfig, webexConfig)
105
+ getAllAuxCodes ─────────────┼──► parseAgentConfigs() ──► AgentProfile
106
+ │
107
+ getAllTeams ────────────────┤ (filtered by userId == user.dbId)
108
+ │
109
+ getSiteInfo ────────────────┤ (team → site fallback for multimediaProfileId)
110
+ │
111
+ getDialPlanData ────────────┘ (only when agentProfile.dialPlanEnabled)
112
+ ```
113
+
114
+ ---
115
+
116
+ ## API Methods (Internal)
117
+
118
+ ### `getAgentConfig(orgId, agentId)`
119
+
120
+ Main method that aggregates all configuration data into the AgentProfile.
121
+
122
+ **Returns**: `Promise<Profile>`
123
+
124
+ **Flow**:
125
+ 1. Fire the user aggregate (`getUserDesktopLoginConfig`), the org aggregate (`getOrgDesktopLoginConfig`) and aux codes (`getAllAuxCodes`) in parallel
126
+ 2. Await the user aggregate — it supplies `user.dbId`, `user.siteId` and `agentProfile.dialPlanEnabled`
127
+ 3. Fetch site info (`getSiteInfo`) and teams filtered by `userId` (`getAllTeams`)
128
+ 4. Fetch dial plan if `agentProfile.dialPlanEnabled` (`getDialPlanData`)
129
+ 5. `Promise.all` the five remaining promises
130
+ 6. Resolve `multimediaProfileId` from the team value, falling back to the site value
131
+ 7. Parse and combine all data (`parseAgentConfigs`)
132
+
133
+ ---
134
+
135
+ ## Standalone APIs (Not Part of AgentProfile Building)
136
+
137
+ These methods exist in `AgentConfigService` but are **not** part of the `getAgentConfig()` aggregation flow. They can be used independently by applications.
138
+
139
+ | Method | Status | Returns | Description |
140
+ |--------|--------|---------|-------------|
141
+ | `getOutdialAniEntries(orgId, params)` | **Publicly exposed** via `cc.getOutdialAniEntries()` | `OutdialAniEntriesResponse` | Fetch outbound ANI entries for caller ID selection. Supports pagination and search via [`OutdialAniParams`](../types.ts). |
142
+ | `getMultimediaProfileById(orgId, multimediaProfileId)` | **Not exposed, never called** | `MultimediaProfileResponse` | Fetch channel capacities (chat, email, telephony, social) and blending config. Available but unused anywhere. |
143
+ | `getListOfTeams(orgId, page, pageSize, userDbId)` | Used internally by `getAllTeams()` | `ListTeamsResponse` | Single-page team fetch with pagination metadata, filtered by `user.dbId` (the wire field is `filter=userId==` but the value is the database id, not the CI user id). The filter value must stay unquoted — the quoted form returns HTTP 400. |
144
+ | `getListOfAuxCodes(orgId, page, pageSize, filter, attributes)` | Used internally by `getAllAuxCodes()` | `ListAuxCodesResponse` | Single-page aux code fetch with pagination metadata. Useful for custom pagination. |
145
+
146
+ Additionally, the following endpoints are defined in `constants.ts` `endPointMap` but are consumed by separate service classes, not by `AgentConfigService`:
147
+
148
+ | Endpoint | Used By | Description |
149
+ |----------|---------|-------------|
150
+ | `queueList` | [`Queue.ts`](../../Queue.ts) | Fetch contact service queues |
151
+ | `entryPointDialNumberList` | [`EntryPoint.ts`](../../EntryPoint.ts) | Fetch profile-scoped entry-point dial-number mappings |
152
+ | `addressBookEntries` | [`AddressBook.ts`](../../AddressBook.ts) | Fetch address book entries |
153
+
154
+ ---
155
+
156
+ ## Key Types
157
+
158
+ Types used by the config service, all defined in [`types.ts`](../types.ts):
159
+
160
+ | Type | Description |
161
+ |------|-------------|
162
+ | `Profile` | Final aggregated agent config returned by `getAgentConfig()` |
163
+ | `OrgDesktopLoginResponse` | Response from `getOrgDesktopLoginConfig()` — `organization`, `organizationSetting`, `tenantConfiguration`, `urlMappings`, `aiFeature`, `microsoftConfig`, `webexConfig` |
164
+ | `UserDesktopLoginResponse` | Response from `getUserDesktopLoginConfig()` — `user` and `agentProfile` sections |
165
+ | `AgentResponse` | `user` section of the user aggregate — agent metadata, `dbId`, `siteId`, `agentProfileId` |
166
+ | `AgentProfile` | `agentProfile` section of the user aggregate — layout, dial-plan enablement, login options |
167
+ | `TeamList` | Team record from API — `id`, `name`, `teamType`, `siteId`, `multiMediaProfileId` |
168
+ | `ListTeamsResponse` | Paginated wrapper around `TeamList[]` with `meta` for pagination |
169
+ | `OrgInfo` | Organization info — `tenantId`, timezone |
170
+ | `OrgSettings` | Org feature flags — `webRtcEnabled`, `sensitiveDataMaskingEnabled` |
171
+ | `TenantData` | Tenant-level config — inactivity timeout, `forceDefaultDn`, `outdialEnabled` |
172
+ | `SiteInfo` | Site config — `id`, `name`, `multimediaProfileId` |
173
+ | `OrgUrlMappings` | Keyed external URL mappings — `ACQUEON_API_URL`, `ACQUEON_CONSOLE_URL` |
174
+ | `MicrosoftConfig` | Org-level Microsoft presence config — `showUserDetails`, `stateSynchronization` |
175
+ | `WebexConfig` | Org-level Webex presence config — `showUserDetails`, `stateSynchronization` |
176
+ | `MultimediaProfileResponse` | Multimedia profile — channel capacities and settings |
177
+ | `AuxCode` | Auxiliary code record — `id`, `name`, `description`, `workTypeCode` |
178
+ | `ListAuxCodesResponse` | Paginated wrapper around `AuxCode[]` with `meta` |
179
+ | `DialPlanEntity` | Dial plan rule — regex pattern, prefix, strip digits, `active` |
180
+ | `Entity` | Basic entity info — `isSystem`, `name`, `id`, `description` |
181
+ | `WrapupData` | Wrap-up config — auto-wrapup settings, available wrapup codes |
182
+ | `OutdialAniParams` | Parameters for `getOutdialAniEntries()` — ANI ID, pagination, filtering |
183
+
184
+ ## Events (CC_EVENTS)
185
+
186
+ The config service defines event constants used throughout the SDK:
187
+
188
+ | Event Category | Examples |
189
+ |----------------|----------|
190
+ | Agent Events | WELCOME, AGENT_LOGOUT, AGENT_STATE_CHANGE |
191
+ | Task Events | AGENT_CONTACT, AGENT_OFFER_CONTACT, CONTACT_ENDED |
192
+ | Login Events | AGENT_STATION_LOGIN_SUCCESS, AGENT_STATION_LOGIN_FAILED |
193
+
194
+ See [`types.ts`](../types.ts) for complete list.
195
+
196
+ ---
197
+
198
+ ## Types Defined
199
+
200
+ Key types in `services/config/types.ts`:
201
+
202
+ | Type | Description |
203
+ |------|-------------|
204
+ | `Profile` | Complete AgentProfile |
205
+ | `CC_EVENTS` | All event constants |
206
+ | `CC_AGENT_EVENTS` | Agent-specific events |
207
+ | `CC_TASK_EVENTS` | Task-specific events |
208
+ | `AuxCode` | Idle/wrapup code definition |
209
+ | `Team` | Team configuration |
210
+ | `AgentProfile` | Agent profile settings from the user aggregate |
211
+ | `LoginOption` | Login types (BROWSER, EXTENSION, AGENT_DN) |
212
+
213
+ ---
214
+
215
+ ## Error Handling
216
+
217
+ All API methods within the config service throw errors on failure. Since `getAgentConfig` calls multiple sub-APIs (`getUserDesktopLoginConfig`, `getOrgDesktopLoginConfig`, `getAllAuxCodes`, `getAllTeams`, `getSiteInfo`, `getDialPlanData`) and awaits them via `Promise.all`, **a failure in any single sub-API will cause the entire AgentProfile fetch to fail**. There is no partial profile — either all data is successfully fetched and aggregated, or the operation throws.
218
+
219
+ ```typescript
220
+ try {
221
+ const profile = await this.services.config.getAgentConfig(orgId, agentId);
222
+ } catch (error) {
223
+ LoggerProxy.error(`Config fetch failed: ${error}`, {
224
+ module: 'ConfigService',
225
+ method: 'getAgentConfig',
226
+ });
227
+ throw error;
228
+ }
229
+ ```
230
+
231
+ ---
232
+
233
+ ## Usage in cc.ts
234
+
235
+ ```typescript
236
+ // In register() -> connectWebsocket()
237
+ const agentId = data.agentId;
238
+ const orgId = this.$webex.credentials.getOrgId();
239
+ this.agentConfig = await this.services.config.getAgentConfig(orgId, agentId);
240
+ ```
241
+
242
+ ---
243
+
244
+ ## Related
245
+
246
+ - [Root AGENTS.md](../../../../AGENTS.md) - Orchestrator and cross-scope rules
247
+ - [ARCHITECTURE.md](ARCHITECTURE.md) - Technical deep-dive
248
+ - [types.ts](../types.ts) - Type definitions
249
+ - [Util.ts](../Util.ts) - AgentProfile parsing utilities
250
+ - [constants.ts](../constants.ts) - API endpoints