@webex/contact-center 3.12.0-webex-services-ready.4 → 3.13.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/.sdd/manifest.json +24 -13
  2. package/ai-docs/ARCHITECTURE.md +1 -1
  3. package/ai-docs/CONTRACTS.md +21 -3
  4. package/ai-docs/SECURITY.md +1 -1
  5. package/ai-docs/SERVICE_STATE.md +4 -0
  6. package/ai-docs/contact-center-spec.md +53 -6
  7. package/ai-docs/features/consult-transfer-list-policy/spec/feature-spec.md +362 -0
  8. package/ai-docs/features/contact-owner-change-refactor.md +78 -0
  9. package/dist/cc.js +816 -26
  10. package/dist/cc.js.map +1 -1
  11. package/dist/config.js +7 -0
  12. package/dist/config.js.map +1 -1
  13. package/dist/constants.js +29 -2
  14. package/dist/constants.js.map +1 -1
  15. package/dist/index.js +66 -12
  16. package/dist/index.js.map +1 -1
  17. package/dist/metrics/MetricsManager.js +16 -0
  18. package/dist/metrics/MetricsManager.js.map +1 -1
  19. package/dist/metrics/behavioral-events.js +110 -0
  20. package/dist/metrics/behavioral-events.js.map +1 -1
  21. package/dist/metrics/constants.js +33 -0
  22. package/dist/metrics/constants.js.map +1 -1
  23. package/dist/services/AddressBook.js +18 -15
  24. package/dist/services/AddressBook.js.map +1 -1
  25. package/dist/services/AnswerCallOnWebexService.js +202 -0
  26. package/dist/services/AnswerCallOnWebexService.js.map +1 -0
  27. package/dist/services/ApiAiAssistant.js +221 -11
  28. package/dist/services/ApiAiAssistant.js.map +1 -1
  29. package/dist/services/EntryPoint.js +46 -68
  30. package/dist/services/EntryPoint.js.map +1 -1
  31. package/dist/services/Queue.js +27 -22
  32. package/dist/services/Queue.js.map +1 -1
  33. package/dist/services/WebCallingService.js +287 -37
  34. package/dist/services/WebCallingService.js.map +1 -1
  35. package/dist/services/WebexCrossClientService.js +225 -0
  36. package/dist/services/WebexCrossClientService.js.map +1 -0
  37. package/dist/services/WxAppTelephonyMercurySync.js +111 -0
  38. package/dist/services/WxAppTelephonyMercurySync.js.map +1 -0
  39. package/dist/services/config/Util.js +46 -46
  40. package/dist/services/config/Util.js.map +1 -1
  41. package/dist/services/config/constants.js +34 -77
  42. package/dist/services/config/constants.js.map +1 -1
  43. package/dist/services/config/index.js +100 -226
  44. package/dist/services/config/index.js.map +1 -1
  45. package/dist/services/config/types.js +55 -35
  46. package/dist/services/config/types.js.map +1 -1
  47. package/dist/services/constants.js +11 -1
  48. package/dist/services/constants.js.map +1 -1
  49. package/dist/services/core/Err.js.map +1 -1
  50. package/dist/services/core/Utils.js +25 -1
  51. package/dist/services/core/Utils.js.map +1 -1
  52. package/dist/services/core/WebexRequest.js +6 -2
  53. package/dist/services/core/WebexRequest.js.map +1 -1
  54. package/dist/services/core/aqm-reqs.js +17 -11
  55. package/dist/services/core/aqm-reqs.js.map +1 -1
  56. package/dist/services/core/constants.js +9 -1
  57. package/dist/services/core/constants.js.map +1 -1
  58. package/dist/services/core/types.js.map +1 -1
  59. package/dist/services/core/websocket/WebSocketManager.js +17 -1
  60. package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
  61. package/dist/services/task/Task.js +275 -8
  62. package/dist/services/task/Task.js.map +1 -1
  63. package/dist/services/task/TaskFactory.js +11 -6
  64. package/dist/services/task/TaskFactory.js.map +1 -1
  65. package/dist/services/task/TaskManager.js +590 -42
  66. package/dist/services/task/TaskManager.js.map +1 -1
  67. package/dist/services/task/TaskUtils.js +11 -1
  68. package/dist/services/task/TaskUtils.js.map +1 -1
  69. package/dist/services/task/WebexCallingUtils.js +70 -0
  70. package/dist/services/task/WebexCallingUtils.js.map +1 -0
  71. package/dist/services/task/constants.js +14 -2
  72. package/dist/services/task/constants.js.map +1 -1
  73. package/dist/services/task/contact.js +29 -0
  74. package/dist/services/task/contact.js.map +1 -1
  75. package/dist/services/task/digital/Digital.js +4 -3
  76. package/dist/services/task/digital/Digital.js.map +1 -1
  77. package/dist/services/task/state-machine/TaskStateMachine.js +162 -53
  78. package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -1
  79. package/dist/services/task/state-machine/actions.js +6 -1
  80. package/dist/services/task/state-machine/actions.js.map +1 -1
  81. package/dist/services/task/state-machine/guards.js +7 -10
  82. package/dist/services/task/state-machine/guards.js.map +1 -1
  83. package/dist/services/task/state-machine/types.js.map +1 -1
  84. package/dist/services/task/state-machine/uiControlsComputer.js +118 -18
  85. package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -1
  86. package/dist/services/task/types.js +47 -1
  87. package/dist/services/task/types.js.map +1 -1
  88. package/dist/services/task/voice/Voice.js +477 -17
  89. package/dist/services/task/voice/Voice.js.map +1 -1
  90. package/dist/services/task/voice/WebRTC.js +6 -3
  91. package/dist/services/task/voice/WebRTC.js.map +1 -1
  92. package/dist/services/task/voice/wxAppOfferObservability.js +145 -0
  93. package/dist/services/task/voice/wxAppOfferObservability.js.map +1 -0
  94. package/dist/services/task/voice/wxAppVoiceMethods.js +395 -0
  95. package/dist/services/task/voice/wxAppVoiceMethods.js.map +1 -0
  96. package/dist/services/wxAppDiagnosticLogging.js +159 -0
  97. package/dist/services/wxAppDiagnosticLogging.js.map +1 -0
  98. package/dist/services/wxAppTelephonyUtils.js +19 -0
  99. package/dist/services/wxAppTelephonyUtils.js.map +1 -0
  100. package/dist/types/cc.d.ts +127 -9
  101. package/dist/types/config.d.ts +7 -0
  102. package/dist/types/constants.d.ts +23 -0
  103. package/dist/types/index.d.ts +38 -17
  104. package/dist/types/metrics/MetricsManager.d.ts +6 -0
  105. package/dist/types/metrics/constants.d.ts +31 -0
  106. package/dist/types/services/AddressBook.d.ts +2 -1
  107. package/dist/types/services/AnswerCallOnWebexService.d.ts +38 -0
  108. package/dist/types/services/ApiAiAssistant.d.ts +48 -4
  109. package/dist/types/services/EntryPoint.d.ts +7 -5
  110. package/dist/types/services/Queue.d.ts +5 -3
  111. package/dist/types/services/WebexCrossClientService.d.ts +32 -0
  112. package/dist/types/services/WxAppTelephonyMercurySync.d.ts +28 -0
  113. package/dist/types/services/config/Util.d.ts +4 -8
  114. package/dist/types/services/config/constants.d.ts +28 -76
  115. package/dist/types/services/config/index.d.ts +16 -64
  116. package/dist/types/services/config/types.d.ts +150 -173
  117. package/dist/types/services/constants.d.ts +9 -0
  118. package/dist/types/services/core/Err.d.ts +2 -0
  119. package/dist/types/services/core/Utils.d.ts +10 -0
  120. package/dist/types/services/core/WebexRequest.d.ts +1 -0
  121. package/dist/types/services/core/constants.d.ts +7 -0
  122. package/dist/types/services/core/types.d.ts +2 -0
  123. package/dist/types/services/task/Task.d.ts +34 -5
  124. package/dist/types/services/task/TaskFactory.d.ts +4 -2
  125. package/dist/types/services/task/TaskUtils.d.ts +6 -0
  126. package/dist/types/services/task/WebexCallingUtils.d.ts +11 -0
  127. package/dist/types/services/task/constants.d.ts +12 -0
  128. package/dist/types/services/task/contact.d.ts +4 -0
  129. package/dist/types/services/task/digital/Digital.d.ts +4 -3
  130. package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +304 -56
  131. package/dist/types/services/task/state-machine/guards.d.ts +6 -5
  132. package/dist/types/services/task/state-machine/types.d.ts +9 -1
  133. package/dist/types/services/task/types.d.ts +192 -5
  134. package/dist/types/services/task/voice/Voice.d.ts +68 -11
  135. package/dist/types/services/task/voice/WebRTC.d.ts +5 -4
  136. package/dist/types/services/task/voice/wxAppOfferObservability.d.ts +39 -0
  137. package/dist/types/services/task/voice/wxAppVoiceMethods.d.ts +68 -0
  138. package/dist/types/services/wxAppDiagnosticLogging.d.ts +63 -0
  139. package/dist/types/services/wxAppTelephonyUtils.d.ts +5 -0
  140. package/dist/types/types.d.ts +125 -13
  141. package/dist/types/utils/PageCache.d.ts +20 -3
  142. package/dist/types.js +90 -8
  143. package/dist/types.js.map +1 -1
  144. package/dist/utils/PageCache.js +19 -5
  145. package/dist/utils/PageCache.js.map +1 -1
  146. package/dist/webex.js +9 -1
  147. package/dist/webex.js.map +1 -1
  148. package/package.json +10 -9
  149. package/src/cc.ts +1047 -48
  150. package/src/config.ts +7 -0
  151. package/src/constants.ts +36 -0
  152. package/src/index.ts +49 -11
  153. package/src/metrics/MetricsManager.ts +16 -0
  154. package/src/metrics/ai-docs/metrics-spec.md +138 -21
  155. package/src/metrics/behavioral-events.ts +112 -0
  156. package/src/metrics/constants.ts +36 -0
  157. package/src/services/AddressBook.ts +17 -6
  158. package/src/services/AnswerCallOnWebexService.ts +239 -0
  159. package/src/services/ApiAiAssistant.ts +297 -13
  160. package/src/services/EntryPoint.ts +59 -60
  161. package/src/services/Queue.ts +29 -12
  162. package/src/services/WebCallingService.ts +362 -40
  163. package/src/services/WebexCrossClientService.ts +298 -0
  164. package/src/services/WxAppTelephonyMercurySync.ts +142 -0
  165. package/src/services/agent/ai-docs/AGENTS.md +1 -1
  166. package/src/services/agent/ai-docs/agent-spec.md +1 -0
  167. package/src/services/ai-docs/AGENTS.md +11 -11
  168. package/src/services/ai-docs/services-spec.md +25 -5
  169. package/src/services/config/Util.ts +52 -82
  170. package/src/services/config/ai-docs/AGENTS.md +35 -40
  171. package/src/services/config/ai-docs/ARCHITECTURE.md +90 -103
  172. package/src/services/config/ai-docs/config-spec.md +132 -132
  173. package/src/services/config/constants.ts +39 -85
  174. package/src/services/config/index.ts +116 -277
  175. package/src/services/config/types.ts +145 -195
  176. package/src/services/constants.ts +10 -0
  177. package/src/services/core/Err.ts +1 -0
  178. package/src/services/core/Utils.ts +28 -0
  179. package/src/services/core/WebexRequest.ts +3 -1
  180. package/src/services/core/ai-docs/core-spec.md +25 -11
  181. package/src/services/core/aqm-reqs.ts +18 -12
  182. package/src/services/core/constants.ts +8 -0
  183. package/src/services/core/types.ts +33 -1
  184. package/src/services/core/websocket/WebSocketManager.ts +26 -2
  185. package/src/services/task/Task.ts +386 -12
  186. package/src/services/task/TaskFactory.ts +33 -6
  187. package/src/services/task/TaskManager.ts +857 -41
  188. package/src/services/task/TaskUtils.ts +13 -0
  189. package/src/services/task/WebexCallingUtils.ts +136 -0
  190. package/src/services/task/ai-docs/ARCHITECTURE.md +1 -0
  191. package/src/services/task/ai-docs/task-spec.md +190 -8
  192. package/src/services/task/constants.ts +13 -0
  193. package/src/services/task/contact.ts +30 -0
  194. package/src/services/task/digital/Digital.ts +11 -4
  195. package/src/services/task/state-machine/TaskStateMachine.ts +235 -81
  196. package/src/services/task/state-machine/actions.ts +5 -2
  197. package/src/services/task/state-machine/ai-docs/AGENTS.md +6 -4
  198. package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +35 -16
  199. package/src/services/task/state-machine/ai-docs/task-state-machine-spec.md +103 -33
  200. package/src/services/task/state-machine/guards.ts +7 -10
  201. package/src/services/task/state-machine/types.ts +16 -1
  202. package/src/services/task/state-machine/uiControlsComputer.ts +206 -32
  203. package/src/services/task/types.ts +269 -4
  204. package/src/services/task/voice/Voice.ts +625 -17
  205. package/src/services/task/voice/WebRTC.ts +11 -4
  206. package/src/services/task/voice/wxAppOfferObservability.ts +204 -0
  207. package/src/services/task/voice/wxAppVoiceMethods.ts +575 -0
  208. package/src/services/wxAppDiagnosticLogging.ts +286 -0
  209. package/src/services/wxAppTelephonyUtils.ts +14 -0
  210. package/src/types.ts +159 -13
  211. package/src/utils/AGENTS.md +21 -10
  212. package/src/utils/PageCache.ts +38 -5
  213. package/src/utils/ai-docs/utils-spec.md +21 -11
  214. package/src/webex.js +8 -0
  215. package/test/unit/fixtures/aiSummaryTestUtils.ts +40 -0
  216. package/test/unit/spec/cc.ts +3595 -120
  217. package/test/unit/spec/index.ts +891 -0
  218. package/test/unit/spec/metrics/MetricsManager.ts +25 -0
  219. package/test/unit/spec/metrics/behavioral-events.ts +60 -0
  220. package/test/unit/spec/services/AddressBook.ts +37 -6
  221. package/test/unit/spec/services/AnswerCallOnWebexService.ts +264 -0
  222. package/test/unit/spec/services/ApiAiAssistant.ts +269 -8
  223. package/test/unit/spec/services/EntryPoint.ts +87 -40
  224. package/test/unit/spec/services/Queue.ts +123 -12
  225. package/test/unit/spec/services/WebCallingService.ts +483 -54
  226. package/test/unit/spec/services/WebexCrossClientService.ts +509 -0
  227. package/test/unit/spec/services/WxAppTelephonyMercurySync.ts +136 -0
  228. package/test/unit/spec/services/config/Util.ts +501 -0
  229. package/test/unit/spec/services/config/index.ts +313 -543
  230. package/test/unit/spec/services/core/Utils.ts +22 -0
  231. package/test/unit/spec/services/core/WebexRequest.ts +8 -7
  232. package/test/unit/spec/services/core/aqm-reqs.ts +142 -1
  233. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +64 -14
  234. package/test/unit/spec/services/task/Task.ts +2257 -11
  235. package/test/unit/spec/services/task/TaskFactory.ts +56 -2
  236. package/test/unit/spec/services/task/TaskManager.ts +5559 -1493
  237. package/test/unit/spec/services/task/TaskUtils.ts +72 -0
  238. package/test/unit/spec/services/task/WebexCallingUtils.ts +153 -0
  239. package/test/unit/spec/services/task/contact.ts +33 -0
  240. package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +1501 -92
  241. package/test/unit/spec/services/task/state-machine/guards.ts +210 -8
  242. package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +445 -7
  243. package/test/unit/spec/services/task/voice/Voice.ts +1710 -4
  244. package/test/unit/spec/services/task/voice/wxAppOfferObservability.ts +361 -0
  245. package/test/unit/spec/services/task/voice/wxAppVoiceMethods.ts +719 -0
  246. package/test/unit/spec/services/wxAppDiagnosticLogging.ts +179 -0
  247. package/test/unit/spec/wellnessSampleUtils.ts +288 -0
  248. package/typedoc.md +1 -1
  249. package/umd/contact-center.min.js +2 -2
  250. package/umd/contact-center.min.js.map +1 -1
@@ -11,8 +11,8 @@
11
11
  | Doc kind | Module spec |
12
12
  | Coverage score | Partial (manifest-authoritative); 15/15 required document fields present |
13
13
  | Generated from | `module-spec` @ SDLC template library `0.2.1` |
14
- | generated_by / approved_by / updated_at | Codex generator / developer-approved follow-up review remediation / 2026-07-21 |
15
- | Validation status | Follow-up validation passed (independent Claude fallback, 2026-07-21); coverage remains Partial |
14
+ | generated_by / approved_by / updated_at | Codex generator / developer-approved desktop-login aggregate migration delta / 2026-10-05 |
15
+ | Validation status | Agent Wellness Break v0.4 delta independently validated by claude-code on 2026-09-07; coverage remains Partial until the remaining baseline promotion criteria are satisfied |
16
16
 
17
17
  ## Evidence Rules
18
18
  Every requirement cites stable source and test file paths. Code/tests are the behavioral referee; routed source text supplies explicit intent and rationale. Missing or contradictory evidence blocks promotion.
@@ -27,21 +27,21 @@ Config is one of nine confirmed Contact Center SDK modules. Own retrieval and ag
27
27
 
28
28
  The Config Service is an **internal service** that builds the comprehensive AgentProfile (`Profile` type) by:
29
29
 
30
- 1. Fetching user data
30
+ 1. Fetching the user desktop-login aggregate (agent identity plus `agentProfile`)
31
31
 
32
- 2. Fetching desktop profile
32
+ 2. Fetching the organization desktop-login aggregate (org info, org settings, tenant configuration, URL mappings, AI feature, Microsoft/Webex config)
33
33
 
34
34
  3. Fetching teams
35
35
 
36
36
  4. Fetching aux codes (idle/wrapup codes)
37
37
 
38
- 5. Fetching organization settings
38
+ 5. Fetching site and, when the agent profile enables it, dial-plan data
39
39
 
40
40
  6. Aggregating all data into a single AgentProfile
41
41
 
42
42
  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.
43
43
 
44
- - **AgentProfile Aggregation**: Combines data from 8+ API endpoints
44
+ - **AgentProfile Aggregation**: Combines data from 6 API endpoints (5 when the agent profile disables dial plans)
45
45
 
46
46
  - **Aux Codes Fetching**: Gets all idle and wrapup codes with pagination
47
47
 
@@ -53,7 +53,7 @@ The AgentProfile is the central configuration object required for an agent to op
53
53
 
54
54
  - **Multimedia Profile**: Fetches channel capacity and blending config (standalone, not yet publicly exposed)
55
55
 
56
- - **Paginated Data Access**: `getListOfTeams` and `getListOfAuxCodes` support custom pagination independent of profile building
56
+ - **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
57
57
 
58
58
  ## Purpose / Responsibility
59
59
  Own retrieval and aggregation of remote organization, agent, team, profile, auxiliary-code, dial-plan, and feature configuration.
@@ -94,12 +94,15 @@ services/config/
94
94
  |---|---|---|
95
95
  | `getAgentConfig(orgId, agentId)` | staged, all-or-nothing `Promise<Profile>` aggregation | `src/services/config/index.ts` |
96
96
  | User/profile/site/team/aux-code fetches | typed REST methods including pagination helpers | `src/services/config/index.ts`, `src/services/config/types.ts` |
97
- | `getAIFeatureFlags(orgId)` | `AIFeatureFlagsResponse` from `organization/{orgId}/v2/ai-feature?page=0&pageSize=100` | `src/services/config/index.ts`, `src/services/config/constants.ts` |
98
- | `Profile.aiFeature` | optional first AI-feature row mapped by `parseAgentConfigs` | `src/services/config/Util.ts`, `src/services/config/types.ts` |
97
+ | `getOrgDesktopLoginConfig(orgId)` | `OrgDesktopLoginResponse` from `organization/{orgId}/desktop-login` | `src/services/config/index.ts`, `src/services/config/constants.ts` |
98
+ | `getUserDesktopLoginConfig(orgId, ciUserId)` | `UserDesktopLoginResponse` from `organization/{orgId}/v2/user/by-ci-user-id/{ciUserId}/desktop-login` | `src/services/config/index.ts`, `src/services/config/constants.ts` |
99
+ | `Profile.aiFeature` | optional `aiFeature` section of the organization aggregate, mapped by `parseAgentConfigs` | `src/services/config/Util.ts`, `src/services/config/types.ts` |
99
100
  | Multimedia profile | `MultimediaProfileResponse` | `src/services/config/types.ts` |
100
101
  | Organization masking | `OrgSettings.maskSensitiveData` | `src/services/config/types.ts`, `src/services/config/Util.ts` |
101
102
  | Auxiliary-code list URL | includes `desktopProfileFilter=true` | `src/services/config/constants.ts` |
102
103
  | Outdial ANI entries | public wrapper through ContactCenter | `src/services/config/index.ts`, `src/cc.ts` |
104
+ | `Profile.isWellnessBreakEnabled` | required effective flag derived from backend AI feature configuration and organization license quantity | `src/services/config/Util.ts`, `src/services/config/types.ts` |
105
+ | `getWellbeingBreakIdleCode(orgId)` | paginated exact lookup for the active system idle code named `WellbeingBreak`, exposed and registration-cached by ContactCenter | `src/services/config/index.ts`, `src/services/config/constants.ts`, `src/cc.ts` |
103
106
 
104
107
  The service has no `TeamList.channelMap` contract. Exact package exports are indexed in root `CONTRACTS.md`.
105
108
 
@@ -111,11 +114,13 @@ The service has no `TeamList.channelMap` contract. Exact package exports are ind
111
114
  ## Requirements
112
115
  | ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
113
116
  |---|---|---|---|---|---|---|
114
- | CONFIG-R-001 | Fetch user config first, then aggregate ten dependent promises including AI feature flags, auxiliary codes, profile/site/team/dial-plan, organization, tenant, and URL data. | Dependent IDs and all-or-nothing consistency require staged orchestration. | `src/services/config/index.ts` | `test/unit/spec/services/config/index.ts` | None; source and test evidence rechecked during the 2026-07-09 remediation; independent document revalidation pending. | PRESENT |
115
- | CONFIG-R-002 | Include `getAIFeatureFlags` response in `parseAgentConfigs` so `Profile.aiFeature` reflects `/v2/ai-feature`. | ApiAIAssistant behavior is gated by the remote organization feature contract. | `src/services/config/index.ts` | `test/unit/spec/services/config/index.ts` | None; source and test evidence rechecked during the 2026-07-09 remediation; independent document revalidation pending. | PRESENT |
117
+ | CONFIG-R-001 | Fetch the user desktop-login aggregate first, then aggregate five dependent promises: the organization desktop-login aggregate, auxiliary codes, teams, site, and the conditional dial plan. | Dependent IDs and all-or-nothing consistency require staged orchestration. | `src/services/config/index.ts` | `test/unit/spec/services/config/index.ts` | None; source and test evidence rechecked during the 2026-07-09 remediation; independent document revalidation pending. | PRESENT |
118
+ | CONFIG-R-002 | Include the organization aggregate's `aiFeature` section in `parseAgentConfigs` so `Profile.aiFeature` reflects the organization feature contract. | ApiAIAssistant behavior is gated by the remote organization feature contract. | `src/services/config/index.ts` | `test/unit/spec/services/config/index.ts` | None; source and test evidence rechecked during the 2026-07-09 remediation; independent document revalidation pending. | PRESENT |
116
119
  | CONFIG-R-003 | Paginate teams and auxiliary codes until completion and include `desktopProfileFilter=true` for auxiliary-code requests. | A partial or unfiltered set yields invalid profile/team/auxiliary choices. | `src/services/config/constants.ts` | `test/unit/spec/services/config/index.ts` | None; source and test evidence rechecked during the 2026-07-09 remediation; independent document revalidation pending. | PRESENT |
117
120
  | CONFIG-R-004 | Expose current response/field names: `MultimediaProfileResponse`, `OrgSettings.maskSensitiveData`, and real TeamList fields only. | Type-name drift causes invalid consumer code and incorrect privacy behavior. | `src/services/config/types.ts` | `test/unit/spec/services/config/index.ts` | None; source and test evidence rechecked during the 2026-07-09 remediation; independent document revalidation pending. | PRESENT |
118
121
  | CONFIG-R-005 | Reject the entire profile aggregation when any required dependent request fails. | Consumers must never receive an internally inconsistent partial Profile. | `src/services/config/index.ts` | `test/unit/spec/services/config/index.ts` | None; source and test evidence rechecked during the 2026-07-09 remediation; independent document revalidation pending. | PRESENT |
122
+ | CONFIG-R-006 | Always populate `Profile.isWellnessBreakEnabled`; set it true only when `agentWellbeing.enable` is true, `wellnessBreakReminders` is `ENABLED`, and `OrgSettings.aiAssistantQuantity` is greater than zero. Missing or null inputs fail closed. | Hosts need one license-and-server-rollout-aware signal rather than reconstructing partial configuration. | `src/services/config/Util.ts`, `src/services/config/types.ts` | `test/unit/spec/services/config/Util.ts` | The supported SDK contracts expose no separate rollout response field; backend delivery of enabled `agentWellbeing` configuration is the rollout decision. | PRESENT |
123
+ | CONFIG-R-007 | Retrieve the wellness idle code from `/v2/auxiliary-code` using `workType=IDLE_CODE`, `customFilter=isSystemCode==true`, and `desktopProfileFilter=false`; follow pagination and accept only the exact active system code name `WellbeingBreak`. | The dedicated state must be independent of desktop-profile filtering and must never fall back to a similarly named or non-system code. | `src/services/config/index.ts`, `src/services/config/constants.ts` | `test/unit/spec/services/config/index.ts` | None. | PRESENT |
119
124
 
120
125
  ## Design Overview
121
126
  Config separates its stable consumption boundary from collaborators so ownership and failure behavior stay explicit. Profile creation is all-or-nothing across dependent API calls so consumers never receive internally inconsistent partial configuration.
@@ -158,31 +163,28 @@ The AgentProfile is defined as the [`Profile`](../types.ts) type. This is not an
158
163
  | `dialPlan` | [`DialPlan`](../types.ts) | Number transformation rules |
159
164
  | `isOutboundEnabledForAgent` | boolean | Outbound calling allowed |
160
165
  | `outDialEp` | string | Outbound entry point ID |
166
+ | `allowConsultToQueue` | boolean | Whether consult-to-queue is enabled on the Desktop Profile |
167
+ | `accessQueue` | `'ALL' \| 'SPECIFIC' \| 'NONE'` | Collaboration tab queue access scope from Desktop Profile |
168
+ | `accessEntryPoint` | `'ALL' \| 'SPECIFIC' \| 'NONE'` | Collaboration tab entry-point access scope from Desktop Profile |
169
+ | `accessBuddyTeam` | `'ALL' \| 'SPECIFIC' \| 'NONE'` | Collaboration tab buddy-team access scope from Desktop Profile |
170
+ | `isWellnessBreakEnabled` | boolean | Effective wellness gate derived from backend enablement/reminder configuration and positive AI Assistant license quantity |
161
171
 
162
- The following diagram shows how `getAgentConfig` orchestrates multiple API calls and combines their results into the AgentProfile via `parseAgentConfigs()`:
172
+ `parseAgentConfigs()` maps the three `access*` fields from the user aggregate's `AgentProfile` section onto the public `Profile` returned by `cc.register()`.
173
+
174
+ The following diagram shows how `getAgentConfig` orchestrates six API calls and combines their results into the AgentProfile via `parseAgentConfigs()`:
163
175
 
164
176
  ```text
165
- getUserUsingCI ────────────┐
166
- │
167
- getOrgInfo ────────────────┤
168
- │
169
- getOrganizationSetting ────┤
170
- │
171
- getTenantData ─────────────┤
172
- │
173
- getURLMapping ─────────────┼──► parseAgentConfigs() ──► AgentProfile
174
- │
175
- getAIFeatureFlags ─────────┤ (maps the first row to Profile.aiFeature)
176
- │
177
- getAllAuxCodes ─────────────┤
178
- │
179
- getDesktopProfileById ─────┤
180
- │
181
- getSiteInfo ───────────────┤ (computes multimediaProfileId)
182
- │
183
- getAllTeams ────────────────┤
184
- │
185
- getDialPlanData ───────────┘
177
+ getUserDesktopLoginConfig ──┐ (awaited first; supplies dbId, siteId, dialPlanEnabled)
178
+ │
179
+ getOrgDesktopLoginConfig ───┤ (org info, org settings, tenant config, urlMappings,
180
+ │ aiFeature, microsoftConfig, webexConfig)
181
+ getAllAuxCodes ─────────────┼──► parseAgentConfigs() ──► AgentProfile
182
+ │
183
+ getAllTeams ────────────────┤ (filtered by userId == user.dbId)
184
+ │
185
+ getSiteInfo ────────────────┤ (team → site fallback for multimediaProfileId)
186
+ │
187
+ getDialPlanData ────────────┘ (only when agentProfile.dialPlanEnabled)
186
188
  ```
187
189
 
188
190
  Types used by the config service, all defined in [`types.ts`](../types.ts):
@@ -190,23 +192,26 @@ Types used by the config service, all defined in [`types.ts`](../types.ts):
190
192
  | Type | Description |
191
193
  |---|---|
192
194
  | `Profile` | Final aggregated agent config returned by `getAgentConfig()` |
193
- | `AgentResponse` | Raw response from `getUserUsingCI()` — agent metadata, teamIds, siteId, agentProfileId |
194
- | `DesktopProfileResponse` | Desktop profile settings — layout, dial plan, login options |
195
+ | `OrgDesktopLoginResponse` | Response from `getOrgDesktopLoginConfig()` — `organization`, `organizationSetting`, `tenantConfiguration`, `urlMappings`, `aiFeature`, `microsoftConfig`, `webexConfig` |
196
+ | `UserDesktopLoginResponse` | Response from `getUserDesktopLoginConfig()` — `user` and `agentProfile` sections |
197
+ | `AgentResponse` | `user` section of the user aggregate — agent metadata, `dbId`, `siteId`, `agentProfileId` |
198
+ | `AgentProfile` | `agentProfile` section of the user aggregate — layout, dial-plan enablement, login options |
195
199
  | `TeamList` | Team record from API — `id`, `name`, `teamType`, `siteId`, `multiMediaProfileId` |
196
200
  | `ListTeamsResponse` | Paginated wrapper around `TeamList[]` with `meta` for pagination |
197
201
  | `OrgInfo` | Organization info — `tenantId`, timezone |
198
202
  | `OrgSettings` | Org feature flags — `webRtcEnabled`, `maskSensitiveData` |
199
203
  | `TenantData` | Tenant-level config — inactivity timeout, `forceDefaultDn`, `outdialEnabled` |
200
204
  | `SiteInfo` | Site config — `id`, `name`, `multimediaProfileId` |
201
- | `URLMapping` | External URL mapping — `id`, `name`, `url` |
205
+ | `OrgUrlMappings` | Keyed external URL mappings — `ACQUEON_API_URL`, `ACQUEON_CONSOLE_URL` |
206
+ | `MicrosoftConfig` | Org-level Microsoft presence config — `showUserDetails`, `stateSynchronization` |
207
+ | `WebexConfig` | Org-level Webex presence config — `showUserDetails`, `stateSynchronization` |
202
208
  | `MultimediaProfileResponse` | Multimedia profile — channel capacities and settings |
203
209
  | `AuxCode` | Auxiliary code record — `id`, `name`, `description`, `workTypeCode` |
204
210
  | `ListAuxCodesResponse` | Paginated wrapper around `AuxCode[]` with `meta` |
205
- | `DialPlanEntity` | Dial plan rule — regex pattern, prefix, strip digits |
211
+ | `DialPlanEntity` | Dial plan rule — regex pattern, prefix, strip digits, `active` |
206
212
  | `Entity` | Basic entity info — `isSystem`, `name`, `id`, `description` |
207
213
  | `WrapupData` | Wrap-up config — auto-wrapup settings, available wrapup codes |
208
214
  | `OutdialAniParams` | Parameters for `getOutdialAniEntries()` — ANI ID, pagination, filtering |
209
- | `Team` | Simplified team shape in `Profile` — `teamId`, `teamName`, `desktopLayoutId` |
210
215
 
211
216
  ```typescript
212
217
  // In register() -> connectWebsocket()
@@ -222,19 +227,19 @@ For endpoints with pagination (teams, aux codes):
222
227
  ```typescript
223
228
  import {DEFAULT_PAGE} from './constants'; // DEFAULT_PAGE = 0
224
229
 
225
- public async getAllTeams(orgId, pageSize, filter): Promise<TeamList[]> {
230
+ public async getAllTeams(orgId, pageSize, userDbId): Promise<TeamList[]> {
226
231
  let allTeams: TeamList[] = [];
227
232
  let page = DEFAULT_PAGE;
228
233
 
229
234
  // First request to get totalPages
230
- const firstResponse = await this.getListOfTeams(orgId, page, pageSize, filter);
235
+ const firstResponse = await this.getListOfTeams(orgId, page, pageSize, userDbId);
231
236
  allTeams = allTeams.concat(firstResponse.data);
232
237
  const totalPages = firstResponse.meta.totalPages;
233
238
 
234
239
  // Parallel requests for remaining pages
235
240
  const requests = [];
236
241
  for (page = DEFAULT_PAGE + 1; page < totalPages; page += 1) {
237
- requests.push(this.getListOfTeams(orgId, page, pageSize, filter));
242
+ requests.push(this.getListOfTeams(orgId, page, pageSize, userDbId));
238
243
  }
239
244
 
240
245
  const responses = await Promise.all(requests);
@@ -252,50 +257,44 @@ The service fetches data from multiple APIs with these response structures:
252
257
 
253
258
  | API Method | Response Type | Key Fields | Usage |
254
259
  |---|---|---|---|
255
- | `getUserUsingCI` | `AgentResponse` | `ciUserId`, `id`, `firstName`, `lastName`, `email`, `teamIds`, `agentProfileId`, `siteId` | Primary agent identity and profile references |
256
- | `getDesktopProfileById` | `DesktopProfileResponse` | `dialPlanEnabled`, `autoAnswer`, `accessWrapUpCode`, `wrapUpCodes`, `accessIdleCode`, `idleCodes`, `loginVoiceOptions` | Agent desktop settings and feature enablement |
260
+ | `getUserDesktopLoginConfig` | `UserDesktopLoginResponse` | `user`: `ciUserId`, `id`, `dbId`, `firstName`, `lastName`, `email`, `agentProfileId`, `siteId`. `agentProfile`: `dialPlanEnabled`, `accessWrapUpCode`, `accessIdleCode`, `loginVoiceOptions`, `viewableStatistics` | Agent identity, team-filter id, site reference, and desktop settings in one call |
261
+ | `getOrgDesktopLoginConfig` | `OrgDesktopLoginResponse` | `organization`: `tenantId`, `timezone`. `organizationSetting`: `webRtcEnabled`, `maskSensitiveData`, `campaignManagerEnabled`, `aiAssistantQuantity`. `tenantConfiguration`: `outdialEnabled`, `forceDefaultDn`, `privacyShieldVisible`, `timeoutDesktopInactivityEnabled`. Optional `urlMappings`, `aiFeature`, `microsoftConfig`, `webexConfig` | All organization-, tenant- and feature-scoped configuration in one call |
257
262
  | `getAllTeams` | `TeamList[]` | real `TeamList` fields from `src/services/config/types.ts` | Team identity, name, type, and site assignment; channel capacities belong to `MultimediaProfileResponse` |
258
- | `getTenantData` | `TenantData` | `outdialEnabled`, `forceDefaultDn`, `privacyShieldVisible`, `timeoutDesktopInactivityEnabled` | Tenant-level feature flags |
259
- | `getOrgInfo` | `OrgInfo` | `tenantId`, `timezone` | Organization metadata |
260
263
  | `getAllAuxCodes` | `AuxCode[]` | `id`, `name`, `workTypeCode`, `active`, `isSystemCode`, `defaultCode` | Auxiliary codes for idle/wrap-up states |
261
- | `getOrganizationSetting` | `OrgSettings` | `webRtcEnabled`, `maskSensitiveData`, `campaignManagerEnabled` | Organization-level feature flags |
262
- | `getDialPlanData` | `DialPlanEntity[]` | `id`, `name`, `regularExpression`, `prefix`, `strippedChars` | Dial plan rules for outbound calling |
263
- | `getURLMapping` | `URLMapping[]` | `name`, `url` | External service URL mappings |
264
- | `getSiteInfo` | `SiteInfo` | Site-specific configuration | Site details |
264
+ | `getDialPlanData` | `DialPlanEntity[]` | `id`, `name`, `regularExpression`, `prefix`, `strippedChars`, `active` | Dial plan rules for outbound calling |
265
+ | `getSiteInfo` | `SiteInfo` | Site-specific configuration | Site details, including the `multimediaProfileId` fallback |
265
266
 
266
267
  These responses are parsed and aggregated into a single `Profile` object by the `parseAgentConfigs` function.
267
268
 
268
269
  ```typescript
269
270
  // See full implementation in Util.ts
270
271
  function parseAgentConfigs(profileData: {
271
- userData: AgentResponse; // See types.ts:AgentResponse
272
- teamData: Team[]; // NOTE: Declared as Team[] (teamId, teamName) but receives TeamList[] (id, name, + 12 more fields) at runtime
273
- tenantData: TenantData; // See types.ts:TenantData
274
- orgInfoData: OrgInfo; // See types.ts:OrgInfo
275
- auxCodes: AuxCode[]; // See types.ts:AuxCode
276
- orgSettingsData: OrgSettings; // See types.ts:OrgSettings
277
- agentProfileData: DesktopProfileResponse; // See types.ts:DesktopProfileResponse
278
- dialPlanData: DialPlanEntity[]; // See types.ts:DialPlanEntity
279
- urlMapping: URLMapping[]; // See types.ts:URLMapping
272
+ orgConfig: OrgDesktopLoginResponse; // See types.ts:OrgDesktopLoginResponse
273
+ userData: AgentResponse; // `user` section; see types.ts:AgentResponse
274
+ agentProfileData: AgentProfile; // `agentProfile` section; see types.ts:AgentProfile
275
+ teamData: TeamList[]; // See types.ts:TeamList
276
+ auxCodes: AuxCode[]; // See types.ts:AuxCode
277
+ dialPlanData: DialPlanEntity[]; // See types.ts:DialPlanEntity
280
278
  multimediaProfileId: string;
281
- aiFeatureFlags: AIFeatureFlagsResponse;
282
- }): Profile { // See types.ts:Profile
283
- const { userData, teamData, tenantData, orgInfoData, auxCodes,
284
- orgSettingsData, agentProfileData, dialPlanData, urlMapping,
285
- aiFeatureFlags } = profileData;
286
-
287
- const aiFeature = aiFeatureFlags?.data?.length > 0
288
- ? aiFeatureFlags.data[0]
289
- : undefined;
279
+ }): Profile { // See types.ts:Profile
280
+ const { orgConfig, userData, agentProfileData, teamData, auxCodes,
281
+ dialPlanData } = profileData;
282
+ const {
283
+ organization: orgInfoData,
284
+ organizationSetting: orgSettingsData,
285
+ tenantConfiguration: tenantData,
286
+ urlMappings,
287
+ aiFeature,
288
+ microsoftConfig,
289
+ webexConfig,
290
+ } = orgConfig;
290
291
 
291
292
  // Aux code filtering via getFilterAuxCodes():
292
- // - checks auxCode.active
293
- // - checks specificCodes access level (ALL → no filter, SPECIFIC → include list)
293
+ // - checks auxCode.workTypeCode and auxCode.active
294
+ // - the aggregate returns the full org pool, so no per-agent restriction is applied
294
295
  // - maps to Entity {id, name, isSystem, isDefault}
295
- const wrapupCodes = getFilterAuxCodes(auxCodes, WRAP_UP_CODE,
296
- agentProfileData.accessWrapUpCode === 'ALL' ? [] : agentProfileData.wrapUpCodes);
297
- const idleCodes = getFilterAuxCodes(auxCodes, IDLE_CODE,
298
- agentProfileData.accessIdleCode === 'ALL' ? [] : agentProfileData.idleCodes);
296
+ const wrapupCodes = getFilterAuxCodes(auxCodes, WRAP_UP_CODE);
297
+ const idleCodes = getFilterAuxCodes(auxCodes, IDLE_CODE);
299
298
 
300
299
  // Hardcoded "Available" state always appended to idle codes
301
300
  idleCodes.push({ id: '0', name: 'Available', isSystem: false, isDefault: false });
@@ -304,7 +303,7 @@ function parseAgentConfigs(profileData: {
304
303
  agentId: userData.ciUserId, // NOTE: uses ciUserId for agent identification
305
304
  analyserUserId: userData.id, // NOTE: userData.id is used for analytics/reporting
306
305
  agentName: `${userData.firstName} ${userData.lastName}`,
307
- teams: teamData, // NOTE: Raw TeamList[] passed directly without mapping
306
+ teams: teamData, // TeamList[] straight from the team API; Profile.teams is TeamList[]
308
307
  idleCodes, // NOTE: Filtered via getFilterAuxCodes() + hardcoded "Available" state
309
308
  wrapupCodes, // NOTE: Filtered via getFilterAuxCodes()
310
309
  webRtcEnabled: orgSettingsData.webRtcEnabled,
@@ -321,31 +320,22 @@ function parseAgentConfigs(profileData: {
321
320
  ## Data Flow
322
321
  ```mermaid
323
322
  flowchart TD
324
- Start[getAgentConfig orgId + agentId] --> User[getUserUsingCI awaited first]
325
- Start --> Org[getOrgInfo]
326
- Start --> OrgSettings[getOrganizationSetting]
327
- Start --> Tenant[getTenantData]
328
- Start --> URL[getURLMapping]
329
- Start --> AI[getAIFeatureFlags]
323
+ Start[getAgentConfig orgId + agentId] --> User[getUserDesktopLoginConfig awaited first]
324
+ Start --> Org[getOrgDesktopLoginConfig]
330
325
  Start --> Aux[getAllAuxCodes]
331
- User --> Profile[getDesktopProfileById]
332
- User --> Site[getSiteInfo]
333
- User --> Teams[getAllTeams or empty]
334
- Profile --> Dial{dialPlanEnabled?}
326
+ User --> Site[getSiteInfo siteId]
327
+ User --> Teams[getAllTeams filtered by dbId]
328
+ User --> Dial{agentProfile.dialPlanEnabled?}
335
329
  Dial -->|yes| DialPlan[getDialPlanData]
336
330
  Dial -->|no| Empty[empty dial plan]
337
- Profile --> All[Promise.all of ten result promises]
338
- Site --> All
331
+ Site --> All[Promise.all of five result promises]
339
332
  Teams --> All
340
333
  DialPlan --> All
341
334
  Empty --> All
342
335
  Org --> All
343
- OrgSettings --> All
344
- Tenant --> All
345
- URL --> All
346
- AI --> All
347
336
  Aux --> All
348
- All --> Parse[parseAgentConfigs including aiFeatureFlags]
337
+ All --> Mm[multimediaProfileId: team value else site value]
338
+ Mm --> Parse[parseAgentConfigs with orgConfig + userData + agentProfileData]
349
339
  Parse --> Result[Profile with aiFeature + maskSensitiveData]
350
340
  ```
351
341
 
@@ -369,19 +359,19 @@ sequenceDiagram
369
359
  participant Util as parseAgentConfigs
370
360
  CC->>Cfg: getAgentConfig(orgId, agentId)
371
361
  par requests started before user data resolves
372
- Cfg->>API: getUserUsingCI
373
- Cfg->>API: org info + org settings + tenant + URL mapping
374
- Cfg->>API: ai-feature flags + all aux codes
362
+ Cfg->>API: getUserDesktopLoginConfig
363
+ Cfg->>API: getOrgDesktopLoginConfig
364
+ Cfg->>API: getAllAuxCodes
375
365
  end
376
- API-->>Cfg: user IDs/profile/site/team IDs
366
+ API-->>Cfg: user.dbId / user.siteId / agentProfile.dialPlanEnabled
377
367
  par user-dependent requests
378
- Cfg->>API: desktop profile + site + teams
379
- Cfg->>API: conditional dial plan chained from desktop profile
368
+ Cfg->>API: getSiteInfo + getAllTeams(filter userId==dbId)
369
+ Cfg->>API: conditional dial plan gated on agentProfile.dialPlanEnabled
380
370
  end
381
- Note over Cfg,API: Promise.all awaits 10 result promises in total
371
+ Note over Cfg,API: Promise.all awaits 5 result promises after the user aggregate
382
372
  alt all succeed
383
- API-->>Cfg: ten results
384
- Cfg->>Util: parseAgentConfigs(..., aiFeatureFlags)
373
+ API-->>Cfg: five results
374
+ Cfg->>Util: parseAgentConfigs(orgConfig, userData, agentProfileData, ...)
385
375
  Util-->>CC: Profile including aiFeature
386
376
  else any fails
387
377
  Cfg-->>CC: throw; no partial Profile
@@ -396,7 +386,7 @@ sequenceDiagram
396
386
  participant Cfg as AgentConfigService
397
387
  participant WR as WebexRequest
398
388
  participant API as WCC API
399
- Caller->>Cfg: getAllTeams/getAllAuxCodes(orgId, pageSize, filters)
389
+ Caller->>Cfg: getAllTeams(orgId, pageSize, userDbId) / getAllAuxCodes(orgId, pageSize, filters)
400
390
  Cfg->>WR: request page 0
401
391
  WR->>API: authenticated GET
402
392
  alt first page succeeds
@@ -426,7 +416,7 @@ classDiagram
426
416
  class parseAgentConfigs
427
417
  class Profile
428
418
  ContactCenter --> AgentConfigService : getAgentConfig
429
- AgentConfigService --> WebexRequest : ten dependent requests
419
+ AgentConfigService --> WebexRequest : six dependent requests
430
420
  AgentConfigService --> parseAgentConfigs : aggregate results
431
421
  parseAgentConfigs --> Profile : aiFeature + maskSensitiveData
432
422
  ```
@@ -439,28 +429,34 @@ classDiagram
439
429
  | `types` | `config/types.ts` | Types, events, interfaces |
440
430
 
441
431
  ## Use Cases
442
- - **UC-1 Two-wave profile aggregation:** retrieve the user first, run ten dependent promises including AI feature flags, then parse one complete Profile or reject the whole operation. Evidence: `src/services/config/index.ts`, `src/services/config/Util.ts`, `test/unit/spec/services/config/index.ts`.
432
+ - **UC-1 Two-wave profile aggregation:** retrieve the user desktop-login aggregate first, run five dependent promises including the organization aggregate, then parse one complete Profile or reject the whole operation. Evidence: `src/services/config/index.ts`, `src/services/config/Util.ts`, `test/unit/spec/services/config/index.ts`.
443
433
  - **UC-2 Paginated teams/aux codes:** follow backend page metadata to completion; auxiliary-code requests include `desktopProfileFilter=true`. Evidence: `src/services/config/index.ts`, `test/unit/spec/services/config/index.ts`.
444
- - **UC-3 Dial plan and URL mapping:** request dial-plan data only when the desktop profile enables it while always including URL mapping in profile aggregation. Evidence: `src/services/config/index.ts`, `test/unit/spec/services/config/index.ts`.
434
+ - **UC-3 Dial plan and URL mappings:** request dial-plan data only when the agent profile enables it, keep only `active` plans, and map the organization aggregate's `urlMappings` into the profile. Evidence: `src/services/config/index.ts`, `src/services/config/Util.ts`, `test/unit/spec/services/config/index.ts`.
445
435
  - **UC-4 Outdial ANI retrieval:** return the organization-scoped ANI list through authenticated WebexRequest and propagate failures without a partial substitute. Evidence: `src/services/config/index.ts`, `test/unit/spec/services/config/index.ts`.
436
+ - **UC-5 Wellness configuration:** produce one fail-closed effective profile flag and retrieve the exact system wellness idle code across pages. Evidence: `src/services/config/Util.ts`, `src/services/config/index.ts`, `test/unit/spec/services/config/Util.ts`, `test/unit/spec/services/config/index.ts`.
446
437
 
447
438
  ## Business Rules & Invariants
448
439
  - `getAgentConfig` rejects when any required dependent request rejects; it never returns a partial Profile.
449
440
  - `Profile.aiFeature` is derived from the AI-feature response, and sensitive-data masking uses the real `maskSensitiveData` field.
450
441
  - Team data has no `channelMap` contract; multimedia profile responses use `MultimediaProfileResponse`.
442
+ - `isWellnessBreakEnabled` is always boolean and defaults false when any gate is absent, disabled, or unlicensed.
443
+ - The system wellness code lookup is separate from profile auxiliary-code aggregation and uses `desktopProfileFilter=false`.
451
444
 
452
445
  ## Concurrency & Reactive Flow
453
- - The initial user lookup supplies identifiers for a ten-promise `Promise.all`; pagination loops await pages in order and stop from returned metadata.
446
+ - The initial user desktop-login lookup supplies identifiers for a five-promise `Promise.all`; pagination loops await pages in order and stop from returned metadata.
454
447
 
455
448
  ## Protocol / Wire Format
456
449
  All Config operations are authenticated REST calls through WebexRequest. Important current routes include:
457
450
 
458
451
  | Operation | Resource shape |
459
452
  |---|---|
460
- | AI feature flags | `organization/{orgId}/v2/ai-feature?page=0&pageSize=100` |
453
+ | Organization desktop-login aggregate | `organization/{orgId}/desktop-login` |
454
+ | User desktop-login aggregate | `organization/{orgId}/v2/user/by-ci-user-id/{ciUserId}/desktop-login` |
455
+ | Teams | `organization/{orgId}/v2/team?page={page}&pageSize={pageSize}&agentView=true&filter=userId=={userDbId}` — the wire field is `userId` but the value is the user's database id; filter value unquoted, no `attributes=` projection |
461
456
  | Auxiliary codes | pagination/filter/attributes plus `desktopProfileFilter=true` |
457
+ | Wellness system idle code | `organization/{orgId}/v2/auxiliary-code?page={page}&pageSize={pageSize}&workType=IDLE_CODE&customFilter=isSystemCode==true&desktopProfileFilter=false` |
462
458
  | Multimedia profile | organization-scoped multimedia-profile resource |
463
- | Dial plan | organization-scoped dial-plan resource when desktop profile enables it |
459
+ | Dial plan | organization-scoped dial-plan resource when the agent profile enables it |
464
460
 
465
461
  Exact resources live in `src/services/config/constants.ts`; response/profile fields live in `src/services/config/types.ts`.
466
462
 
@@ -470,7 +466,7 @@ Exact resources live in `src/services/config/constants.ts`; response/profile fie
470
466
  | Dependency rejection | Typed/rethrown error or failure event | Inspect structured details, preserve tracking id, and retry only when the operation is safe. |
471
467
  | Timeout or missing async completion | Timeout/recovery state | Follow the module-specific recovery path; never synthesize success. |
472
468
 
473
- All API methods within the config service throw errors on failure. After `getUserUsingCI`, `getAgentConfig` awaits ten dependent requests via `Promise.all`: desktop profile, site, teams, conditional dial plan, organization info, organization settings, tenant data, URL mapping, AI feature flags, and all auxiliary codes. A failure in any required request, including `getAIFeatureFlags`, causes the entire AgentProfile fetch to fail. There is no partial profile — either all data is successfully fetched and aggregated, or the operation throws.
469
+ All API methods within the config service throw errors on failure. After `getUserDesktopLoginConfig`, `getAgentConfig` awaits five dependent requests via `Promise.all`: site, conditional dial plan, teams, the organization desktop-login aggregate, and all auxiliary codes. A failure in any required request, including `getOrgDesktopLoginConfig`, causes the entire AgentProfile fetch to fail. There is no partial profile — either all data is successfully fetched and aggregated, or the operation throws.
474
470
 
475
471
  ```typescript
476
472
  try {
@@ -487,14 +483,17 @@ try {
487
483
  Each method follows consistent error handling:
488
484
 
489
485
  ```typescript
490
- public async getUserUsingCI(orgId: string, agentId: string): Promise<AgentResponse> {
491
- LoggerProxy.info('Fetching user data using CI', {
486
+ public async getUserDesktopLoginConfig(
487
+ orgId: string,
488
+ ciUserId: string
489
+ ): Promise<UserDesktopLoginResponse> {
490
+ LoggerProxy.info('Fetching user desktop-login configuration', {
492
491
  module: CONFIG_FILE_NAME,
493
- method: METHODS.GET_USER_USING_CI,
492
+ method: METHODS.GET_USER_DESKTOP_LOGIN_CONFIG,
494
493
  });
495
494
 
496
495
  try {
497
- const resource = endPointMap.userByCI(orgId, agentId);
496
+ const resource = endPointMap.userDesktopLogin(orgId, ciUserId);
498
497
  const response = await this.webexReq.request({
499
498
  service: WCC_API_GATEWAY,
500
499
  resource,
@@ -505,16 +504,16 @@ public async getUserUsingCI(orgId: string, agentId: string): Promise<AgentRespon
505
504
  throw new Error(`API call failed with ${response.statusCode}`);
506
505
  }
507
506
 
508
- LoggerProxy.log('getUserUsingCI api success.', {
507
+ LoggerProxy.log('getUserDesktopLoginConfig api success.', {
509
508
  module: CONFIG_FILE_NAME,
510
- method: METHODS.GET_USER_USING_CI,
509
+ method: METHODS.GET_USER_DESKTOP_LOGIN_CONFIG,
511
510
  });
512
511
 
513
512
  return Promise.resolve(response.body);
514
513
  } catch (error) {
515
- LoggerProxy.error(`getUserUsingCI API call failed with ${error}`, {
514
+ LoggerProxy.error(`getUserDesktopLoginConfig API call failed with ${error}`, {
516
515
  module: CONFIG_FILE_NAME,
517
- method: METHODS.GET_USER_USING_CI,
516
+ method: METHODS.GET_USER_DESKTOP_LOGIN_CONFIG,
518
517
  });
519
518
  throw error;
520
519
  }
@@ -531,8 +530,8 @@ public async getUserUsingCI(orgId: string, agentId: string): Promise<AgentRespon
531
530
  "module": "config/index.ts", "method": "getAgentConfig"
532
531
 
533
532
  // Specific API method failures
534
- "getUserUsingCI API call failed"
535
- "getDesktopProfileById API call failed"
533
+ "getUserDesktopLoginConfig API call failed"
534
+ "getOrgDesktopLoginConfig API call failed"
536
535
  "getAllTeams API call failed"
537
536
  "getAllAuxCodes API call failed"
538
537
 
@@ -568,7 +567,7 @@ public async getUserUsingCI(orgId: string, agentId: string): Promise<AgentRespon
568
567
 
569
568
  1. Check `totalPages` in first response
570
569
 
571
- 2. Verify filter array contains valid team/aux code IDs
570
+ 2. Verify the team filter carries a valid `userDbId` (`user.dbId`, not the CI user id) and that aux-code filters contain valid IDs
572
571
 
573
572
  3. Check if pageSize is appropriate (default: 100)
574
573
 
@@ -579,8 +578,8 @@ public async getUserUsingCI(orgId: string, agentId: string): Promise<AgentRespon
579
578
  **Log patterns:**
580
579
 
581
580
  ```typescript
582
- "getOrganizationSetting api success"
583
- "getTenantData api success"
581
+ "getOrgDesktopLoginConfig api success."
582
+ "getUserDesktopLoginConfig api success."
584
583
  ```
585
584
 
586
585
  **Solution**:
@@ -603,7 +602,7 @@ public async getUserUsingCI(orgId: string, agentId: string): Promise<AgentRespon
603
602
 
604
603
  3. Note: dial plan fetch only happens if `dialPlanEnabled === true`
605
604
 
606
- **Cause**: Access level set to 'SPECIFIC' but missing code IDs
605
+ **Cause**: Expected auxiliary codes missing from the returned pool
607
606
 
608
607
  **Log patterns:**
609
608
 
@@ -613,23 +612,22 @@ public async getUserUsingCI(orgId: string, agentId: string): Promise<AgentRespon
613
612
 
614
613
  **Solution**:
615
614
 
616
- 1. Check `agentProfileData.accessWrapUpCode` (should be 'ALL' or 'SPECIFIC')
617
-
618
- 2. Check `agentProfileData.accessIdleCode`
615
+ 1. `getFilterAuxCodes` no longer applies a per-agent restriction list — the full organization pool is returned for every agent
619
616
 
620
- 3. If 'SPECIFIC', verify `wrapUpCodes` and `idleCodes` arrays contain valid IDs
617
+ 2. `Profile.idleCodesAccess` / `wrapupCodesAccess` still report `ALL` or `SPECIFIC` from `agentProfileData`
621
618
 
622
- 4. Ensure aux codes have `active: true` status
619
+ 3. Ensure aux codes have `active: true` status and the expected `workTypeCode`
623
620
 
624
- 5. Note: "Available" state is always appended to idle codes
621
+ 4. Note: "Available" state is always appended to idle codes
625
622
 
626
623
  ## Pitfalls
627
- - `getUserUsingCI` must complete before profile/site/team-dependent requests are constructed, while the ten dependent promises remain all-or-nothing.
628
- - AI feature flags are part of the ten-result aggregation and must be passed into `parseAgentConfigs`; omitting them silently removes `Profile.aiFeature`.
624
+ - `getUserDesktopLoginConfig` must complete before site/team/dial-plan requests are constructed, while the five dependent promises remain all-or-nothing.
625
+ - The `aiFeature` section is part of the organization aggregate and must be passed into `parseAgentConfigs`; omitting it silently removes `Profile.aiFeature`.
626
+ - The team filter value must stay unquoted (`filter=userId=={dbId}`) — the quoted form returns HTTP 400 — and must not carry an `attributes=` projection, which would strip `multiMediaProfileId`, `teamType` and `siteName`.
629
627
  - Team responses do not own channel configuration, and auxiliary-code requests require `desktopProfileFilter=true` during profile construction.
630
628
 
631
629
  ## Module Do's / Don'ts
632
- - DO preserve the user-first dependency boundary and the exact ten-promise result order.
630
+ - DO preserve the user-first dependency boundary and the exact five-promise result order.
633
631
  - DO paginate team and auxiliary-code endpoints until their metadata indicates completion.
634
632
  - DON'T return a partially assembled Profile after any required dependency fails.
635
633
  - DON'T invent TeamList fields such as `channelMap` or omit `maskSensitiveData`/`aiFeature` mappings.
@@ -638,7 +636,7 @@ public async getUserUsingCI(orgId: string, agentId: string): Promise<AgentRespon
638
636
  - Profile creation is all-or-nothing across dependent API calls so consumers never receive internally inconsistent partial configuration.
639
637
 
640
638
  ## Test-Case Strategy (module)
641
- `test/unit/spec/services/config/index.ts` must cover staged user-first orchestration, ten-promise aggregation, AI-feature mapping, conditional dial plan, pagination, auxiliary-code URL filtering, real response field names, and whole-profile rejection on any required failure.
639
+ `test/unit/spec/services/config/index.ts` must cover staged user-first orchestration, five-promise aggregation, AI-feature mapping, conditional dial plan, the `userDbId` team filter, pagination, auxiliary-code URL filtering, real response field names, and whole-profile rejection on any required failure.
642
640
 
643
641
  | Behavior / Requirement | Existing test evidence | Gap |
644
642
  |---|---|---|
@@ -647,6 +645,8 @@ public async getUserUsingCI(orgId: string, agentId: string): Promise<AgentRespon
647
645
  | `CONFIG-R-003` | `test/unit/spec/services/config/index.ts` | None. |
648
646
  | `CONFIG-R-004` | `test/unit/spec/services/config/index.ts` | None. |
649
647
  | `CONFIG-R-005` | `test/unit/spec/services/config/index.ts` | Keep an explicit rejection assertion for each required dependency category. |
648
+ | `CONFIG-R-006` | `test/unit/spec/services/config/Util.ts` | None. |
649
+ | `CONFIG-R-007` | `test/unit/spec/services/config/index.ts` | None. |
650
650
 
651
651
  ## Traceability
652
652
  - Repo architecture: `../../../../ai-docs/ARCHITECTURE.md` · Registry: `../../../../ai-docs/SPEC_INDEX.md`