@webex/plugin-meetings 3.12.0-next.15 → 3.12.0-next.151

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 (296) hide show
  1. package/.sdd/manifest.json +1312 -0
  2. package/.sdd/templates/.source.json +30 -0
  3. package/.sdd/templates/component-repo/module-docs/module-spec-quality.md +111 -0
  4. package/.sdd/templates/component-repo/module-docs/module-spec.template.md +321 -0
  5. package/.sdd/templates/component-repo/reference-docs/adr/_adr-example.md +59 -0
  6. package/.sdd/templates/component-repo/reference-docs/patterns/_pattern-example.md +49 -0
  7. package/.sdd/templates/component-repo/reference-docs/rules/_rule-example.md +42 -0
  8. package/.sdd/templates/component-repo/standing-docs/AGENTS.template.md +120 -0
  9. package/.sdd/templates/component-repo/standing-docs/ARCHITECTURE.template.md +206 -0
  10. package/.sdd/templates/component-repo/standing-docs/CONTRACTS.template.md +90 -0
  11. package/.sdd/templates/component-repo/standing-docs/DATA_MODEL.template.md +68 -0
  12. package/.sdd/templates/component-repo/standing-docs/GETTING_STARTED.template.md +111 -0
  13. package/.sdd/templates/component-repo/standing-docs/GLOSSARY.template.md +57 -0
  14. package/.sdd/templates/component-repo/standing-docs/REVIEW_CHECKLIST.template.md +69 -0
  15. package/.sdd/templates/component-repo/standing-docs/RULES.template.md +96 -0
  16. package/.sdd/templates/component-repo/standing-docs/SECURITY.template.md +84 -0
  17. package/.sdd/templates/component-repo/standing-docs/SERVICE_STATE.template.md +82 -0
  18. package/.sdd/templates/component-repo/standing-docs/SPEC_INDEX.template.md +94 -0
  19. package/.sdd/templates/component-repo/standing-docs/TEST_INDEX.template.md +64 -0
  20. package/.sdd/templates/component-repo/template-map.json +112 -0
  21. package/AGENTS.md +135 -0
  22. package/ai-docs/ARCHITECTURE.md +207 -0
  23. package/ai-docs/CONTRACTS.md +267 -0
  24. package/ai-docs/DATA_MODEL.md +64 -0
  25. package/ai-docs/GETTING_STARTED.md +73 -0
  26. package/ai-docs/GLOSSARY.md +56 -0
  27. package/ai-docs/REVIEW_CHECKLIST.md +45 -0
  28. package/ai-docs/RULES.md +79 -0
  29. package/ai-docs/SECURITY.md +74 -0
  30. package/ai-docs/SERVICE_STATE.md +59 -0
  31. package/ai-docs/SPEC_INDEX.md +85 -0
  32. package/ai-docs/TEST_INDEX.md +45 -0
  33. package/ai-docs/adr/0001-migrate-existing-docs-into-sdd.md +61 -0
  34. package/ai-docs/patterns/defensive-error-propagation.md +55 -0
  35. package/ai-docs/patterns/event-scope-emission.md +46 -0
  36. package/ai-docs/patterns/source-to-test-path-mirroring.md +45 -0
  37. package/ai-docs/patterns/stateless-plugin-request-classes.md +53 -0
  38. package/ai-docs/patterns/typed-constants-and-enum-values.md +47 -0
  39. package/dist/aiEnableRequest/index.js +15 -2
  40. package/dist/aiEnableRequest/index.js.map +1 -1
  41. package/dist/annotation/index.js +2 -2
  42. package/dist/annotation/index.js.map +1 -1
  43. package/dist/breakouts/breakout.js +8 -3
  44. package/dist/breakouts/breakout.js.map +1 -1
  45. package/dist/breakouts/events.js +29 -14
  46. package/dist/breakouts/events.js.map +1 -1
  47. package/dist/breakouts/index.js +99 -4
  48. package/dist/breakouts/index.js.map +1 -1
  49. package/dist/common/errors/webex-errors.js +49 -5
  50. package/dist/common/errors/webex-errors.js.map +1 -1
  51. package/dist/config.js +2 -2
  52. package/dist/config.js.map +1 -1
  53. package/dist/constants.js +37 -10
  54. package/dist/constants.js.map +1 -1
  55. package/dist/controls-options-manager/index.js +46 -10
  56. package/dist/controls-options-manager/index.js.map +1 -1
  57. package/dist/hashTree/constants.js +4 -1
  58. package/dist/hashTree/constants.js.map +1 -1
  59. package/dist/hashTree/hashTreeParser.js +1096 -391
  60. package/dist/hashTree/hashTreeParser.js.map +1 -1
  61. package/dist/hashTree/utils.js +20 -0
  62. package/dist/hashTree/utils.js.map +1 -1
  63. package/dist/index.js +7 -0
  64. package/dist/index.js.map +1 -1
  65. package/dist/interceptors/dataChannelAuthToken.js +75 -15
  66. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  67. package/dist/interceptors/locusRetry.js +23 -8
  68. package/dist/interceptors/locusRetry.js.map +1 -1
  69. package/dist/interpretation/index.js +55 -12
  70. package/dist/interpretation/index.js.map +1 -1
  71. package/dist/interpretation/interpretation.types.js +7 -0
  72. package/dist/interpretation/interpretation.types.js.map +1 -0
  73. package/dist/interpretation/siLanguage.js +1 -1
  74. package/dist/locus-info/controlsUtils.js +4 -1
  75. package/dist/locus-info/controlsUtils.js.map +1 -1
  76. package/dist/locus-info/index.js +615 -176
  77. package/dist/locus-info/index.js.map +1 -1
  78. package/dist/locus-info/infoUtils.js +36 -5
  79. package/dist/locus-info/infoUtils.js.map +1 -1
  80. package/dist/locus-info/types.js +20 -0
  81. package/dist/locus-info/types.js.map +1 -1
  82. package/dist/media/MediaConnectionAwaiter.js +15 -2
  83. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  84. package/dist/media/index.js +8 -2
  85. package/dist/media/index.js.map +1 -1
  86. package/dist/media/properties.js +4 -5
  87. package/dist/media/properties.js.map +1 -1
  88. package/dist/meeting/in-meeting-actions.js +7 -1
  89. package/dist/meeting/in-meeting-actions.js.map +1 -1
  90. package/dist/meeting/index.js +1684 -835
  91. package/dist/meeting/index.js.map +1 -1
  92. package/dist/meeting/locusMediaRequest.js +229 -82
  93. package/dist/meeting/locusMediaRequest.js.map +1 -1
  94. package/dist/meeting/muteState.js +10 -1
  95. package/dist/meeting/muteState.js.map +1 -1
  96. package/dist/meeting/request.js +5 -2
  97. package/dist/meeting/request.js.map +1 -1
  98. package/dist/meeting/util.js +37 -3
  99. package/dist/meeting/util.js.map +1 -1
  100. package/dist/meeting/voicea-meeting.js +2 -1
  101. package/dist/meeting/voicea-meeting.js.map +1 -1
  102. package/dist/meeting-info/meeting-info-v2.js +9 -3
  103. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  104. package/dist/meetings/index.js +300 -128
  105. package/dist/meetings/index.js.map +1 -1
  106. package/dist/meetings/meetings.types.js +6 -1
  107. package/dist/meetings/meetings.types.js.map +1 -1
  108. package/dist/meetings/request.js +39 -0
  109. package/dist/meetings/request.js.map +1 -1
  110. package/dist/meetings/util.js +116 -18
  111. package/dist/meetings/util.js.map +1 -1
  112. package/dist/member/index.js +10 -0
  113. package/dist/member/index.js.map +1 -1
  114. package/dist/member/types.js.map +1 -1
  115. package/dist/member/util.js +30 -0
  116. package/dist/member/util.js.map +1 -1
  117. package/dist/members/index.js +101 -43
  118. package/dist/members/index.js.map +1 -1
  119. package/dist/members/util.js +8 -1
  120. package/dist/members/util.js.map +1 -1
  121. package/dist/metrics/constants.js +7 -1
  122. package/dist/metrics/constants.js.map +1 -1
  123. package/dist/multistream/codec/constants.js +63 -0
  124. package/dist/multistream/codec/constants.js.map +1 -0
  125. package/dist/multistream/mediaRequestManager.js +62 -15
  126. package/dist/multistream/mediaRequestManager.js.map +1 -1
  127. package/dist/multistream/receiveSlot.js +9 -0
  128. package/dist/multistream/receiveSlot.js.map +1 -1
  129. package/dist/reachability/clusterReachability.js.map +1 -1
  130. package/dist/reachability/index.js +121 -83
  131. package/dist/reachability/index.js.map +1 -1
  132. package/dist/reachability/reachability.types.js +2 -0
  133. package/dist/reachability/reachability.types.js.map +1 -1
  134. package/dist/reachability/util.js +45 -0
  135. package/dist/reachability/util.js.map +1 -1
  136. package/dist/reactions/reactions.type.js.map +1 -1
  137. package/dist/recording-controller/index.js +1 -3
  138. package/dist/recording-controller/index.js.map +1 -1
  139. package/dist/roap/turnDiscovery.js +8 -1
  140. package/dist/roap/turnDiscovery.js.map +1 -1
  141. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  142. package/dist/types/config.d.ts +2 -2
  143. package/dist/types/constants.d.ts +13 -1
  144. package/dist/types/controls-options-manager/index.d.ts +16 -0
  145. package/dist/types/hashTree/constants.d.ts +1 -0
  146. package/dist/types/hashTree/hashTreeParser.d.ts +201 -22
  147. package/dist/types/hashTree/utils.d.ts +7 -0
  148. package/dist/types/index.d.ts +3 -0
  149. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  150. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  151. package/dist/types/locus-info/index.d.ts +106 -8
  152. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  153. package/dist/types/locus-info/types.d.ts +22 -1
  154. package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
  155. package/dist/types/media/properties.d.ts +6 -2
  156. package/dist/types/meeting/in-meeting-actions.d.ts +6 -0
  157. package/dist/types/meeting/index.d.ts +176 -11
  158. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  159. package/dist/types/meeting/request.d.ts +1 -0
  160. package/dist/types/meeting/util.d.ts +9 -0
  161. package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
  162. package/dist/types/meetings/index.d.ts +40 -19
  163. package/dist/types/meetings/meetings.types.d.ts +15 -0
  164. package/dist/types/meetings/request.d.ts +14 -0
  165. package/dist/types/member/index.d.ts +1 -0
  166. package/dist/types/member/types.d.ts +1 -0
  167. package/dist/types/member/util.d.ts +9 -0
  168. package/dist/types/members/index.d.ts +15 -2
  169. package/dist/types/members/util.d.ts +1 -5
  170. package/dist/types/metrics/constants.d.ts +6 -0
  171. package/dist/types/multistream/codec/constants.d.ts +7 -0
  172. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  173. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  174. package/dist/types/reachability/index.d.ts +10 -3
  175. package/dist/types/reachability/reachability.types.d.ts +7 -0
  176. package/dist/types/reachability/util.d.ts +17 -0
  177. package/dist/types/reactions/reactions.type.d.ts +3 -0
  178. package/dist/webinar/index.js +307 -161
  179. package/dist/webinar/index.js.map +1 -1
  180. package/package.json +23 -23
  181. package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
  182. package/src/aiEnableRequest/index.ts +16 -0
  183. package/src/annotation/ai-docs/annotation-spec.md +236 -0
  184. package/src/annotation/index.ts +6 -4
  185. package/src/breakouts/ai-docs/breakouts-spec.md +324 -0
  186. package/src/breakouts/breakout.ts +3 -1
  187. package/src/breakouts/events.ts +33 -11
  188. package/src/breakouts/index.ts +122 -2
  189. package/src/common/errors/webex-errors.ts +50 -3
  190. package/src/config.ts +2 -2
  191. package/src/constants.ts +21 -3
  192. package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +243 -0
  193. package/src/controls-options-manager/index.ts +62 -10
  194. package/src/hashTree/ai-docs/hash-tree-spec.md +267 -0
  195. package/src/hashTree/constants.ts +7 -0
  196. package/src/hashTree/hashTreeParser.ts +861 -193
  197. package/src/hashTree/utils.ts +19 -0
  198. package/src/index.ts +6 -0
  199. package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
  200. package/src/interceptors/dataChannelAuthToken.ts +88 -12
  201. package/src/interceptors/locusRetry.ts +25 -4
  202. package/src/interpretation/ai-docs/interpretation-spec.md +256 -0
  203. package/src/interpretation/index.ts +65 -10
  204. package/src/interpretation/interpretation.types.ts +11 -0
  205. package/src/locus-info/ai-docs/locus-info-spec.md +293 -0
  206. package/src/locus-info/controlsUtils.ts +3 -1
  207. package/src/locus-info/index.ts +566 -164
  208. package/src/locus-info/infoUtils.ts +41 -6
  209. package/src/locus-info/types.ts +26 -1
  210. package/src/media/MediaConnectionAwaiter.ts +21 -4
  211. package/src/media/ai-docs/media-spec.md +267 -0
  212. package/src/media/index.ts +10 -1
  213. package/src/media/properties.ts +8 -3
  214. package/src/meeting/ai-docs/meeting-spec.md +401 -0
  215. package/src/meeting/in-meeting-actions.ts +12 -0
  216. package/src/meeting/index.ts +937 -119
  217. package/src/meeting/locusMediaRequest.ts +106 -6
  218. package/src/meeting/muteState.ts +10 -1
  219. package/src/meeting/request.ts +11 -0
  220. package/src/meeting/util.ts +51 -7
  221. package/src/meeting/voicea-meeting.ts +1 -1
  222. package/src/meeting-info/ai-docs/meeting-info-spec.md +261 -0
  223. package/src/meeting-info/meeting-info-v2.ts +10 -4
  224. package/src/meetings/ai-docs/meetings-spec.md +296 -0
  225. package/src/meetings/index.ts +200 -80
  226. package/src/meetings/meetings.types.ts +19 -0
  227. package/src/meetings/request.ts +43 -0
  228. package/src/meetings/util.ts +117 -4
  229. package/src/member/ai-docs/member-spec.md +196 -0
  230. package/src/member/index.ts +10 -0
  231. package/src/member/types.ts +1 -0
  232. package/src/member/util.ts +29 -0
  233. package/src/members/ai-docs/members-spec.md +256 -0
  234. package/src/members/index.ts +70 -7
  235. package/src/members/util.ts +12 -4
  236. package/src/metrics/ai-docs/metrics-spec.md +185 -0
  237. package/src/metrics/constants.ts +6 -0
  238. package/src/multistream/ai-docs/multistream-spec.md +292 -0
  239. package/src/multistream/codec/constants.ts +58 -0
  240. package/src/multistream/mediaRequestManager.ts +119 -28
  241. package/src/multistream/receiveSlot.ts +18 -0
  242. package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +234 -0
  243. package/src/reachability/ai-docs/reachability-spec.md +261 -0
  244. package/src/reachability/clusterReachability.ts +3 -2
  245. package/src/reachability/index.ts +47 -16
  246. package/src/reachability/reachability.types.ts +11 -0
  247. package/src/reachability/util.ts +36 -0
  248. package/src/reactions/ai-docs/reactions-spec.md +198 -0
  249. package/src/reactions/reactions.type.ts +3 -0
  250. package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +272 -0
  251. package/src/recording-controller/ai-docs/recording-controller-spec.md +223 -0
  252. package/src/recording-controller/index.ts +1 -2
  253. package/src/roap/ai-docs/roap-spec.md +241 -0
  254. package/src/roap/turnDiscovery.ts +9 -1
  255. package/src/webinar/ai-docs/webinar-spec.md +243 -0
  256. package/src/webinar/index.ts +216 -38
  257. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  258. package/test/unit/spec/annotation/index.ts +3 -3
  259. package/test/unit/spec/breakouts/breakout.ts +9 -3
  260. package/test/unit/spec/breakouts/events.ts +120 -2
  261. package/test/unit/spec/breakouts/index.ts +223 -3
  262. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  263. package/test/unit/spec/controls-options-manager/index.js +139 -32
  264. package/test/unit/spec/hashTree/hashTreeParser.ts +2451 -184
  265. package/test/unit/spec/hashTree/utils.ts +37 -0
  266. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
  267. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  268. package/test/unit/spec/interpretation/index.ts +119 -4
  269. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  270. package/test/unit/spec/locus-info/index.js +1014 -58
  271. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  272. package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
  273. package/test/unit/spec/media/index.ts +92 -0
  274. package/test/unit/spec/media/properties.ts +23 -23
  275. package/test/unit/spec/meeting/in-meeting-actions.ts +6 -0
  276. package/test/unit/spec/meeting/index.js +2811 -117
  277. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  278. package/test/unit/spec/meeting/muteState.js +81 -0
  279. package/test/unit/spec/meeting/request.js +12 -0
  280. package/test/unit/spec/meeting/utils.js +179 -16
  281. package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
  282. package/test/unit/spec/meeting-info/meetinginfov2.js +76 -10
  283. package/test/unit/spec/meetings/index.js +544 -49
  284. package/test/unit/spec/meetings/request.js +141 -0
  285. package/test/unit/spec/meetings/utils.js +402 -51
  286. package/test/unit/spec/member/index.js +7 -0
  287. package/test/unit/spec/member/util.js +89 -0
  288. package/test/unit/spec/members/index.js +216 -0
  289. package/test/unit/spec/members/request.js +37 -1
  290. package/test/unit/spec/members/utils.js +63 -0
  291. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  292. package/test/unit/spec/reachability/index.ts +128 -46
  293. package/test/unit/spec/reachability/util.ts +31 -0
  294. package/test/unit/spec/recording-controller/index.js +9 -8
  295. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  296. package/test/unit/spec/webinar/index.ts +332 -31
@@ -0,0 +1,234 @@
1
+ <!-- sdd-generated-metadata
2
+ doc_kind: module-spec
3
+ generated_from: module-spec@0.2.2
4
+ generator_plugin: repo-annotation@1.0.5+codex.20260818094939
5
+ generated_by: codex
6
+ approved_by: repository user
7
+ updated_at: 2026-08-22T15:21:29Z
8
+ validation_status: pass-with-warnings
9
+ -->
10
+ # PERSONAL MEETING ROOM — SPEC
11
+
12
+ > Start here → root [`AGENTS.md`](../../../AGENTS.md) · router [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md) · system [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md). This is the canonical source-local spec for `src/personal-meeting-room/`.
13
+
14
+ ## Metadata
15
+
16
+ | Field | Value |
17
+ |---|---|
18
+ | Module id | `personal-meeting-room` |
19
+ | Source path(s) | `src/personal-meeting-room/` |
20
+ | Parent spec | — |
21
+ | Doc kind | Module spec |
22
+ | Coverage score | 93% assessed 2026-08-22; 13/14 mandatory fields present; all critical and Important fields present; one noncritical polish gap remains; pending independent validation of the participant-role repair |
23
+ | Generated from | `module-spec` @ SDLC template library `0.2.2` |
24
+ | generated_by / approved_by / updated_at | codex / repository user / 2026-08-22T15:21:29Z |
25
+ | Validation status | pass-with-warnings |
26
+
27
+ ## Evidence Rules
28
+
29
+ Requirements cite current source and mirrored tests. Current code wins over retained prose when they conflict; commit and PR history are excluded. Missing evidence stays a gap.
30
+
31
+ ## Source Material Register
32
+
33
+ | Source material | Scope | Decision | Detail location or disposition |
34
+ |---|---|---|---|
35
+ | Retained package consumer documentation | overview / API / behavior / tests | used and verified; PMR retrieval/claim usage was placed in the public surface and use cases |
36
+ | Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
37
+
38
+ ## Overview
39
+
40
+ `src/personal-meeting-room/` contains 3 direct source/reference file(s) and has 1 mirrored unit-test file(s). This spec separates its public operations, runtime data movement, component ownership, state applicability, and verification boundary.
41
+
42
+ ## Purpose / Responsibility
43
+
44
+ Retrieves a user's Personal Meeting Room information and performs the claim operation through the Webex service boundary.
45
+
46
+ ## Stack
47
+
48
+ TypeScript/JavaScript in the Node 22.14 Yarn workspace; Webex core/plugin abstractions and Mocha/Sinon/`@webex/test-helper-chai` tests.
49
+
50
+ ## Folder / Package Structure
51
+
52
+ ```text
53
+ src/personal-meeting-room/
54
+ ├── index.ts — module facade/controller or primary exports
55
+ ├── request.ts — PMR-claim validation and HTTP request boundary
56
+ ├── util.ts — normalization/helper functions
57
+ └── ai-docs/personal-meeting-room-spec.md — canonical module specification
58
+ ```
59
+
60
+ ## Key Files (source of truth)
61
+
62
+ | File | Holds |
63
+ |---|---|
64
+ | `src/personal-meeting-room/index.ts` | module facade/controller or primary exports |
65
+ | `src/personal-meeting-room/request.ts` | PMR-claim validation and HTTP request boundary |
66
+ | `src/personal-meeting-room/util.ts` | normalization/helper functions |
67
+ | `test/unit/spec/personal-meeting-room/personal-meeting-room.js` | mirrored characterization/unit coverage |
68
+
69
+ ## Public Surface
70
+
71
+ | Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
72
+ |---|---|---|---|---|---|---|
73
+ | `personal-meeting-room.1` | SDK / remote | `PersonalMeetingRoom.get()` | Fetch the current user's room through the injected meeting-info service and store a valid PMR projection. | Reject absent/non-PMR results; preserve the returned model state. | `src/personal-meeting-room/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
74
+ | `personal-meeting-room.2` | SDK / remote | `PersonalMeetingRoom.claim()` | Claim the current PMR through the request dependency, cache accepted response fields, and return the response body. | Preserve request rejection and response-body return semantics. | `src/personal-meeting-room/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
75
+ | `personal-meeting-room.3` | request adapter | `PersonalMeetingRoomRequest.claimPmr()` | Issue the PMR claim request with current Webex identity/request context. | This adapter performs claim I/O only; room lookup belongs to the injected meeting-info service. | `src/personal-meeting-room/request.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
76
+
77
+ Compatibility notes:
78
+ - Prefer additive fields/options and preserve current return and rejection semantics. Internal helpers are not public merely because they are exported within the source directory.
79
+
80
+ ## Requires (dependencies)
81
+
82
+ Webex host/request access, user/device identity, PMR service discovery, meeting-info normalization, and request errors.
83
+
84
+ ## Requirements
85
+
86
+ | ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
87
+ |---|---|---|---|---|---|---|
88
+ | `PERSONAL-MEETING-ROOM-R-001` | fetch the current user's Personal Meeting Room. | Retrieves a user's Personal Meeting Room information and performs the claim operation through the Webex service boundary. | `src/personal-meeting-room/index.ts` | `test/unit/spec/personal-meeting-room/personal-meeting-room.js` | none | PRESENT |
89
+ | `PERSONAL-MEETING-ROOM-R-002` | Copy a validated PMR response into the instance's PMR, SIP URI, meeting link, owner, name, and number fields. | Both lookup and claim must expose the same current room projection without attributing lookup to the claim-only request helper. | `src/personal-meeting-room/index.ts` | `test/unit/spec/personal-meeting-room/personal-meeting-room.js` | none | PRESENT |
90
+ | `PERSONAL-MEETING-ROOM-R-003` | `PersonalMeetingRoomRequest.claimPmr()` throws `ParameterError` synchronously when required claim options are absent, returns a rejected `ParameterError` promise for an invalid pin or link, and otherwise returns the request promise. Lookup/service failures and an accepted claim response without a body reject their returned chains; the instance owns no listener, timer, lock, or event cleanup. | Callers must distinguish the request builder's synchronous option validation from returned validation/service rejections while not confusing cached room metadata with an async lifecycle resource. | `src/personal-meeting-room/index.ts`, `src/personal-meeting-room/request.ts` | `test/unit/spec/personal-meeting-room/personal-meeting-room.js` | none | PRESENT |
91
+
92
+ ## Design Overview
93
+
94
+ `PersonalMeetingRoom.get()` delegates lookup to the injected `meetingInfo.fetchMeetingInfo`; `claim()` delegates only the claim operation to `PersonalMeetingRoomRequest.claimPmr`. `request.ts` and `util.ts` validate/build the claim request, while `index.ts` copies accepted response fields into the instance. The module has no listeners, timers, or event-emission lifecycle.
95
+
96
+ ## Data Flow
97
+
98
+ ```mermaid
99
+ flowchart LR
100
+ Caller[Meetings / consumer] --> PMR[index.ts]
101
+ PMR --> Lookup[meetingInfo.fetchMeetingInfo]
102
+ PMR --> Request[request.ts claimPmr]
103
+ Request --> Util[util.ts validate/build claim request]
104
+ Lookup --> Service[Meeting-info service]
105
+ Request --> Service2[PMR claim service]
106
+ Service --> PMR
107
+ Service2 --> Request
108
+ Request --> PMR
109
+ PMR --> Caller
110
+ ```
111
+
112
+ ## Sequence Diagram(s)
113
+
114
+ Sequence coverage:
115
+
116
+ | Operation group | Diagram | Failure coverage |
117
+ |---|---|---|
118
+ | UC-1…UC-3 — personal-room lookup and claim operation groups | Personal-room lookup and claim primary sequence | absent/non-PMR lookup, claim rejection, and cache preservation |
119
+ | UC-1…UC-3 — personal-room lookup and claim alternate/failure paths | Personal-room lookup and claim alternate/failure sequence | missing identity/site input, unavailable PMR, claim rejection, or request failure |
120
+
121
+ ### Personal-room lookup and claim primary sequence
122
+
123
+ ```mermaid
124
+ sequenceDiagram
125
+ participant C as Meetings / consumer
126
+ participant P as PersonalMeetingRoom
127
+ participant I as meetingInfo
128
+ participant R as request.ts claimPmr
129
+ C->>P: get() or claim(link, pin, preferred)
130
+ alt get
131
+ P->>I: fetchMeetingInfo({type: PERSONAL_ROOM})
132
+ I-->>P: PMR body or rejection
133
+ else claim
134
+ P->>R: claimPmr(identity, pin, link, preferred)
135
+ R-->>P: PMR body or rejection
136
+ end
137
+ P->>P: copy accepted PMR fields
138
+ P-->>C: PMR body
139
+ ```
140
+
141
+ ### Personal-room lookup and claim alternate/failure sequence
142
+
143
+ ```mermaid
144
+ sequenceDiagram
145
+ participant C as Consumer
146
+ participant P as PersonalMeetingRoom index.ts
147
+ participant R as claimPmr request helper
148
+ participant S as PMR service
149
+ C->>P: claim(link, pin, preferred)
150
+ P->>P: build identity context
151
+ P->>R: claimPmr(options)
152
+ R->>R: validate required options, pin, and link
153
+ R->>S: claim operation
154
+ alt accepted PMR response
155
+ S-->>P: PMR body
156
+ P->>P: copy PMR/SIP/link/owner/name/number fields
157
+ P-->>C: PMR body
158
+ else required option is absent
159
+ R--xC: synchronous ParameterError
160
+ else pin/link is invalid or service rejects
161
+ R--xC: rejected promise
162
+ end
163
+ ```
164
+
165
+ ## Class / Component Relationships
166
+
167
+ ```mermaid
168
+ classDiagram
169
+ class Caller
170
+ class PMR
171
+ class MeetingInfo
172
+ class Util
173
+ class Request
174
+ class LookupService
175
+ class ClaimService
176
+ Caller --> PMR
177
+ PMR --> MeetingInfo
178
+ MeetingInfo --> LookupService
179
+ PMR --> Request
180
+ Request --> Util
181
+ Request --> ClaimService
182
+ ClaimService --> Request
183
+ Request --> PMR
184
+ PMR --> Caller
185
+ ```
186
+
187
+ The arrows identify ownership and delegation inside `src/personal-meeting-room/`; files that only declare types or constants are not presented as transports.
188
+
189
+ ## Use Cases
190
+
191
+ - **UC-1:** Fetch personal-room information through the injected meeting-info service and reject a response that is absent or not a PMR. Evidence: `src/personal-meeting-room/index.ts`.
192
+ - **UC-2:** Claim a PMR through `PersonalMeetingRoomRequest.claimPmr()`, cache accepted response fields, and return the response body. Evidence: `src/personal-meeting-room/index.ts`, `src/personal-meeting-room/request.ts`.
193
+ - **UC-3:** Propagate lookup or claim failures without fabricating a cached room or fallback transport. Evidence: `src/personal-meeting-room/index.ts`, `src/personal-meeting-room/request.ts`.
194
+
195
+ ## State Model
196
+
197
+ The plugin retains current PMR information and request helper state for the owning SDK instance.
198
+
199
+ ## Business Rules & Invariants
200
+
201
+ - PMR data comes from the service response; claim uses current authenticated identity and never fabricates room ownership. Enforced under `src/personal-meeting-room/`.
202
+
203
+ ## Concurrency & Reactive Flow
204
+
205
+ - Lookup and claim calls are independent promises with no cancellation or response-order guard. Each accepted completion calls `set`, so the last completion to resolve overwrites the cached PMR fields.
206
+
207
+ ## Error Handling & Failure Modes
208
+
209
+ | Condition | Signal | Caller recovery |
210
+ |---|---|---|
211
+ | A required request-builder option is absent | `PersonalMeetingRoomRequest.claimPmr()` throws `ParameterError` synchronously before it returns a promise. | Supply user id, passcode, meeting address, and a truthy preferred flag before calling. |
212
+ | Pin or meeting link has an invalid format | `PersonalMeetingRoomRequest.claimPmr()` returns a rejected `ParameterError` promise. | Correct the formatted pin/link and handle the returned rejection. |
213
+ | Lookup returns no PMR or lookup/claim service rejects | The returned promise rejects; no listener/timer cleanup is involved. | Handle service availability or retry as a new lookup/claim. |
214
+ | Lookup or claim returns an accepted PMR body | `index.ts` copies the PMR, SIP URI, link, owner, name, and number fields and returns the body. | Read the instance's current cached room projection. |
215
+
216
+ ## Pitfalls
217
+
218
+ - A PMR is meeting metadata, not an already joined Meeting. Consumers must still create/join through Meetings.
219
+ - Verify both typed constants/enums and raw wire values before changing a logical condition in this legacy package.
220
+
221
+ ## Test-Case Strategy (module)
222
+
223
+ Use the current mirrored suites: `test/unit/spec/personal-meeting-room/personal-meeting-room.js`. Characterize the personal-meeting-room-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
224
+
225
+ | Behavior / Requirement | Existing test evidence | Gap |
226
+ |---|---|---|
227
+ | `PERSONAL-MEETING-ROOM-R-001` | `test/unit/spec/personal-meeting-room/personal-meeting-room.js` | cover valid/invalid lookup and successful/failed claim as separate paths |
228
+ | `PERSONAL-MEETING-ROOM-R-002` | `test/unit/spec/personal-meeting-room/personal-meeting-room.js` | cover accepted claim response fields and request-body forwarding together |
229
+ | `PERSONAL-MEETING-ROOM-R-003` | `test/unit/spec/personal-meeting-room/personal-meeting-room.js` | distinguish synchronous missing-option throws from invalid pin/link and service promise rejections, and assert failures leave no fabricated cached state |
230
+
231
+ ## Traceability
232
+
233
+ - Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
234
+ - Coverage state and contracts baseline: `../../../.sdd/manifest.json`
@@ -0,0 +1,261 @@
1
+ <!-- sdd-generated-metadata
2
+ doc_kind: module-spec
3
+ generated_from: module-spec@0.2.2
4
+ generator_plugin: repo-annotation@1.0.5+codex.20260818094939
5
+ generated_by: codex
6
+ approved_by: repository user
7
+ updated_at: 2026-08-22T15:21:29Z
8
+ validation_status: pass-with-warnings
9
+ -->
10
+ # REACHABILITY — SPEC
11
+
12
+ > Start here → root [`AGENTS.md`](../../../AGENTS.md) · router [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md) · system [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md). This is the canonical source-local spec for `src/reachability/`.
13
+
14
+ ## Metadata
15
+
16
+ | Field | Value |
17
+ |---|---|
18
+ | Module id | `reachability` |
19
+ | Source path(s) | `src/reachability/` |
20
+ | Parent spec | — |
21
+ | Doc kind | Module spec |
22
+ | Coverage score | 93% assessed 2026-08-22; 13/14 mandatory fields present; all critical and Important fields present; one noncritical polish gap remains; pending independent validation of the participant-role repair |
23
+ | Generated from | `module-spec` @ SDLC template library `0.2.2` |
24
+ | generated_by / approved_by / updated_at | codex / repository user / 2026-08-22T15:21:29Z |
25
+ | Validation status | pass-with-warnings |
26
+
27
+ ## Evidence Rules
28
+
29
+ Requirements cite current implementation and mirrored unit-test paths. Current code wins over retained prose when they conflict; commit and PR history are excluded by repository-owner decision. Missing test evidence is stated as a gap rather than inferred.
30
+
31
+ ## Source Material Register
32
+
33
+ | Source material | Scope | Decision | Detail location or disposition |
34
+ |---|---|---|---|
35
+ | No routed legacy module spec | overview / API / behavior / tests | none; generated from current cluster/probe/request code and tests |
36
+ | Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
37
+
38
+ ## Overview
39
+
40
+ `src/reachability/` contains 6 direct source/reference file(s) and has 4 mirrored unit-test file(s). This spec separates its public operations, runtime data movement, component ownership, state applicability, and verification boundary.
41
+
42
+ ## Purpose / Responsibility
43
+
44
+ Discovers media clusters, probes protocol reachability with peer connections, determines NAT characteristics, and reports results.
45
+
46
+ ## Stack
47
+
48
+ TypeScript/JavaScript in the Node 22.14 Yarn workspace; Webex core/plugin abstractions and Mocha/Sinon/`@webex/test-helper-chai` tests. Build target: `yarn workspace @webex/plugin-meetings build:src`.
49
+
50
+ ## Folder / Package Structure
51
+
52
+ ```text
53
+ src/reachability/
54
+ ├── clusterReachability.ts — clusterReachability implementation responsibility
55
+ ├── index.ts — module facade/controller or primary exports
56
+ ├── reachability.types.ts — module type declarations
57
+ ├── reachabilityPeerConnection.ts — reachabilityPeerConnection implementation responsibility
58
+ ├── request.ts — HTTP request boundary
59
+ ├── util.ts — normalization/helper functions
60
+ └── ai-docs/reachability-spec.md — canonical module specification
61
+ ```
62
+
63
+ ## Key Files (source of truth)
64
+
65
+ | File | Holds |
66
+ |---|---|
67
+ | `src/reachability/clusterReachability.ts` | clusterReachability implementation responsibility |
68
+ | `src/reachability/index.ts` | module facade/controller or primary exports |
69
+ | `src/reachability/reachability.types.ts` | module type declarations |
70
+ | `src/reachability/reachabilityPeerConnection.ts` | reachabilityPeerConnection implementation responsibility |
71
+ | `src/reachability/request.ts` | HTTP request boundary |
72
+ | `src/reachability/util.ts` | normalization/helper functions |
73
+ | `test/unit/spec/reachability/clusterReachability.ts` and 3 sibling test file(s) | mirrored characterization/unit coverage |
74
+
75
+ ## Public Surface
76
+
77
+ | Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
78
+ |---|---|---|---|---|---|---|
79
+ | `reachability.1` | SDK / remote | `Reachability.getClusters()` and `gatherReachability()` | Fetch cluster discovery data, cache the join cookie, and start a configured reachability run. | Disabled reachability rejects before the catch boundary; missing WebRTC capability or caught discovery/probe failure returns `{}`; a started successful run resolves its defer promise with `undefined` after storing results. | `src/reachability/index.ts`, `src/reachability/request.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
80
+ | `reachability.2` | SDK / async | `ClusterReachability.getResult()`, `start()`, `abort()` and `ReachabilityPeerConnection.getResult()`, `start()`, `abort()` | Run and settle per-cluster/per-protocol WebRTC probes with owned timers and peer connections. | Preserve the `udp`, `tcp`, and `xtls` protocol names and one-settlement cleanup. | `src/reachability/clusterReachability.ts`, `src/reachability/reachabilityPeerConnection.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
81
+ | `reachability.3` | SDK / lifecycle | `gatherReachabilityFallback()` and `stopReachability()` | Restart with fallback discovery when the minimum cluster target is missed, or abort an active run. | Both paths absorb their documented internal failures; stop emits `reachability:stopped` only for an active timer. | `src/reachability/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
82
+ | `reachability.4` | SDK / query | `isSubnetReachable()`, `isAnyPublicClusterReachable()`, `isWebexMediaBackendUnreachable()`, and `isAnyClusterReachableViaProtocol()` | Answer media-selection questions from the latest in-memory cluster results. | Preserve boolean/null semantics and current public/video-mesh distinctions. | `src/reachability/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
83
+ | `reachability.5` | SDK / report | `getJoinCookie()`, `getReachabilityReport()`, `getReachabilityMetrics()`, `getReachabilityResults()`, `getClientMediaPreferences()`, and `getReachabilityReportToAttachToRoap()` | Read cached/in-memory results and format local metrics, media preferences, or ROAP attachment data. | These methods construct/return data; they do not submit a reachability report to the service. | `src/reachability/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
84
+ | `reachability.6` | exported utilities | `resolveReachabilityProtocols()`, `isReachabilityEnabled()`, `convertStunUrlToTurn()`, and `convertStunUrlToTurnTls()` | Resolve configured protocol sets and transform validated STUN URLs for probe setup. | Invalid STUN input throws; preserve `xtls` and URL conversion behavior. | `src/reachability/util.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
85
+ | `reachability.7` | exported events/types | `Events`, `ResultEventData`, `ClientMediaIpsUpdatedEventData`, `NatTypeUpdatedEventData`, `Protocol`, `ResolvedReachabilityProtocols`, `ReachabilityProtocolConfig`, `EnableReachabilityChecksConfig`, `ReachabilityPeerConnectionEvents`, `TransportResult`, `NatType`, `ClusterReachabilityResult`, `ReachabilityMetrics`, `TransportResultForBackend`, `ReachabilityResultForBackend`, `ReachabilityResultsForBackend`, `ReachabilityResults`, `ReachabilityReportV0`, `ReachabilityReportV1`, `ClientMediaPreferences`, `GetClustersTrigger`, `ClusterNode`, and `ClusterList` | Share the exact probe/result vocabulary with Meetings, metrics, and ROAP code. | Add fields compatibly and preserve raw result/protocol/NAT values. | `src/reachability/clusterReachability.ts`, `src/reachability/reachability.types.ts`, `src/reachability/request.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
86
+ | `reachability.8` | dormant request helper | `ReachabilityRequest.remoteSDPForClusters()` | POST local SDP offers to the reachability resource and return remote SDP bodies when called directly. | No current package code invokes this exported helper; do not present it as part of `gatherReachability()`. | `src/reachability/request.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
87
+
88
+ ### Emitted events
89
+
90
+ Current source emits these observable literals from the `Reachability` controller. Preserve literal values and the current terminal/progress timing.
91
+
92
+ | Event literal | Constant / expression | Emission evidence |
93
+ |---|---|---|
94
+ | `reachability:done` | inline literal | `src/reachability/index.ts` |
95
+ | `reachability:firstResultAvailable` | inline literal | `src/reachability/index.ts` |
96
+ | `reachability:stopped` | inline literal | `src/reachability/index.ts` |
97
+
98
+ Compatibility notes:
99
+ - Prefer additive options and payload fields. Preserve method/event names, rejection semantics, and cleanup timing; route public changes through `src/index.ts` or the documented owning object.
100
+
101
+ ## Requires (dependencies)
102
+
103
+ Webex reachability services, browser RTCPeerConnection, STUN/TURN candidates, timers, and metrics/request access.
104
+
105
+ ## Requirements
106
+
107
+ | ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
108
+ |---|---|---|---|---|---|---|
109
+ | `REACHABILITY-R-001` | fetch and normalize candidate clusters. | Discovers media clusters, probes protocol reachability with peer connections, determines NAT characteristics, and reports results. | `src/reachability/index.ts` | `test/unit/spec/reachability/index.ts` | none | PRESENT |
110
+ | `REACHABILITY-R-002` | Run the `udp`, `tcp`, and `xtls` reachability probes used by code and metric keys. | Callers and telemetry consumers need the exact wire/field name rather than an ambiguous prose-only TLS label. | `src/reachability/index.ts`, `src/reachability/clusterReachability.ts`, `src/reachability/reachability.types.ts` | `test/unit/spec/reachability/index.ts` | none | PRESENT |
111
+ | `REACHABILITY-R-003` | `gatherReachability()` throws from its `async` body when reachability is disabled before entering its `try`, so the returned promise rejects; it returns `{}` when WebRTC is unavailable or when discovery/probe setup fails inside the `try`. A started successful run returns the defer promise, which resolves with `undefined` after results are stored. `getClusters()` retries once and can reject its direct caller on the second failure; fallback catches and logs its own failures. | Callers must distinguish the disabled-config rejection, empty-object skip/failure sentinel, and successful void settlement instead of treating every gather outcome as `{}` or a rejection. | `src/reachability/index.ts`, `src/reachability/clusterReachability.ts`, `src/reachability/reachabilityPeerConnection.ts` | `test/unit/spec/reachability/index.ts`, `test/unit/spec/reachability/clusterReachability.ts` | none | PRESENT |
112
+ | `REACHABILITY-R-004` | Each cluster/protocol probe settles once, closes its peer connection/timer, and contributes an explicit reachable/unreachable result. | ICE events and timeouts race; deterministic cleanup and aggregation prevent false success and leaks. | `src/reachability/clusterReachability.ts`, `src/reachability/reachabilityPeerConnection.ts` | `test/unit/spec/reachability/clusterReachability.ts` | none | PRESENT |
113
+ | `REACHABILITY-R-005` | The aggregate report preserves IP version, NAT/protocol/cluster outcomes, previous-report context, and trigger. | The backend and media selection need comparable current results rather than a single boolean. | `src/reachability/index.ts`, `src/reachability/reachability.types.ts`, `src/reachability/request.ts` | `test/unit/spec/reachability/index.ts`, `test/unit/spec/reachability/request.js` | none | PRESENT |
114
+
115
+ ## Design Overview
116
+
117
+ `Reachability` fetches media clusters with `request.ts`, builds a `ClusterReachability` aggregate per cluster, and runs UDP/TCP/`xtls` probes through `ReachabilityPeerConnection`; each probe owns and closes its peer connection and timeout.
118
+
119
+ ## Data Flow
120
+
121
+ ```mermaid
122
+ flowchart LR
123
+ Caller[Meetings registration / diagnostics] --> Reach[index.ts]
124
+ Reach --> Request[request.ts cluster discovery]
125
+ Request --> Service[reachability service]
126
+ Reach --> Cluster[clusterReachability.ts]
127
+ Cluster --> Probe[reachabilityPeerConnection.ts]
128
+ Probe --> ICE[WebRTC ICE candidate gathering]
129
+ Probe --> Cluster
130
+ Cluster --> Reach
131
+ Reach --> Local[local report / metrics / ROAP attachment]
132
+ ```
133
+
134
+ ## Sequence Diagram(s)
135
+
136
+ Sequence coverage:
137
+
138
+ | Operation group | Diagram | Failure coverage |
139
+ |---|---|---|
140
+ | UC-1…UC-5 — reachability discovery and probe operation groups | Reachability discovery and probe primary sequence | second discovery failure, absorbed gather failure, probe timeout/abort, and peer cleanup |
141
+ | UC-1…UC-5 — reachability discovery and probe alternate/failure paths | Reachability discovery and probe alternate/failure sequence | cluster discovery failure, ICE timeout, peer-connection failure, unsupported protocol, or explicit stop |
142
+
143
+ ### Reachability discovery and probe primary sequence
144
+
145
+ ```mermaid
146
+ sequenceDiagram
147
+ participant C as Caller
148
+ participant R as Reachability index.ts
149
+ participant Q as request.ts
150
+ participant P as ReachabilityPeerConnection
151
+ C->>R: gatherReachability()
152
+ R->>Q: fetch clusters
153
+ Q-->>R: candidate cluster list
154
+ loop UDP, TCP, xtls per cluster
155
+ R->>P: start probe
156
+ P-->>R: reachable/unreachable after ICE or timeout
157
+ end
158
+ R->>R: build in-memory results/report data
159
+ R-->>C: defer settles undefined; disabled rejects; skipped/caught failure returns empty object
160
+ ```
161
+
162
+ ### Reachability discovery and probe alternate/failure sequence
163
+
164
+ ```mermaid
165
+ sequenceDiagram
166
+ participant R as Reachability
167
+ participant P as Protocol probe
168
+ participant W as RTCPeerConnection
169
+ R->>P: probe cluster with udp, tcp, or xtls
170
+ P->>W: gather ICE candidates
171
+ alt candidate proves reachable
172
+ W-->>P: matching candidate
173
+ P-->>R: reachable result; close connection/timer
174
+ else timeout or terminal probe error
175
+ W--xP: timeout/error
176
+ P-->>R: unreachable result or rejection; close connection/timer
177
+ end
178
+ ```
179
+
180
+ ## Class / Component Relationships
181
+
182
+ ```mermaid
183
+ classDiagram
184
+ class Caller
185
+ class Reach
186
+ class Request
187
+ class Service
188
+ class Cluster
189
+ class Probe
190
+ class ICE
191
+ Caller --> Reach
192
+ Reach --> Request
193
+ Request --> Service
194
+ Reach --> Cluster
195
+ Cluster --> Probe
196
+ Probe --> ICE
197
+ Probe --> Cluster
198
+ Cluster --> Reach
199
+ Reach --> Request
200
+ ```
201
+
202
+ The arrows identify ownership and delegation inside `src/reachability/`; files that only declare types or constants are not presented as transports.
203
+
204
+ ## Use Cases
205
+
206
+ - **UC-1:** Fetch clusters with one retry, store the returned join cookie, and start enabled `udp`, `tcp`, and `xtls` probes. Evidence: `src/reachability/index.ts`, `src/reachability/request.ts`.
207
+ - **UC-2:** Settle each cluster/protocol probe once and close its timer and peer connection on success, failure, timeout, or abort. Evidence: `src/reachability/clusterReachability.ts`, `src/reachability/reachabilityPeerConnection.ts`.
208
+ - **UC-3:** Reject before probing when reachability is disabled, return `{}` when WebRTC is unavailable or a discovery/probe setup failure is caught, and otherwise resolve the run's defer with `undefined` after storing results. Evidence: `src/reachability/index.ts`.
209
+ - **UC-4:** Trigger fallback discovery when the minimum reachable-cluster threshold is missed, aborting the previous run before probing the replacement list. Evidence: `src/reachability/index.ts`.
210
+ - **UC-5:** Read results as metrics, client media preferences, or a ROAP attachment without calling the dormant `ReachabilityRequest.remoteSDPForClusters()` helper. Evidence: `src/reachability/index.ts`, `src/reachability/request.ts`.
211
+
212
+ ## State Model
213
+
214
+ Cluster/protocol probe state, peer connections, timers, partial results, and cached report data exist for one reachability run.
215
+
216
+ ## Business Rules & Invariants
217
+
218
+ - Each probe settles once and closes its peer connection/timer; unsupported or failed protocols are reported rather than inferred reachable. Enforced by `src/reachability/index.ts` and supporting code under `src/reachability/`.
219
+
220
+ ## Concurrency & Reactive Flow
221
+
222
+ - Each cluster/protocol probe owns one peer connection and timeout, settles once from its ICE/error/timeout path, and closes both resources before contributing to the aggregate. Cluster discovery is requested remotely; report/metric/ROAP shapes are constructed locally. Only failures inside `gatherReachability()`'s `try` are absorbed as `{}`; disabled configuration rejects before that boundary.
223
+
224
+ ## Protocol / Wire Format
225
+
226
+ - External payloads are parsed/serialized by files under `src/reachability/` and existing Webex/media dependencies. Preserve current field names, enum/raw values, sequence identifiers, and compatibility behavior; do not treat the normalized client model as the wire schema.
227
+
228
+ ## Error Handling & Failure Modes
229
+
230
+ | Condition | Signal | Caller recovery |
231
+ |---|---|---|
232
+ | Reachability is disabled in configuration | `gatherReachability()` throws `enableReachabilityChecks is disabled in config` from its `async` body before entering the catch block, which rejects the returned promise. | Enable the configured checks or handle the rejection; do not expect `{}` for this path. |
233
+ | Cluster discovery still fails after `getClusters()` retries once | A direct `getClusters()` caller receives the rejection; `gatherReachability()` and fallback callers catch it and resolve with their documented empty/void outcome. | Distinguish direct discovery from the failure-absorbing gather APIs. |
234
+ | ICE timeout or supported probe cannot establish reachability | The probe settles on its current unreachable/rejection path and closes its peer connection and timeout. | Record the explicit unreachable result; do not retain the probe connection. |
235
+ | All `udp`, `tcp`, and `xtls` probes settle | The module stores aggregate protocol/cluster/NAT/IP-version results, emits completion, and resolves the gather defer with `undefined`; no report-submission call is made. | Read the stored/local report through the query/report helpers rather than expecting the gather promise to carry the result object. |
236
+
237
+ ## Pitfalls
238
+
239
+ - Browser ICE callbacks and timeout can race. Cleanup must be idempotent and partial results must not be presented as a complete success.
240
+ - Public behavior may be reachable through a parent `Meeting`/`Meetings` object even when the source helper is not exported directly.
241
+
242
+ ## Key Design Trade-off
243
+
244
+ - Parallel probes reduce startup time but require per-probe isolation and deterministic aggregation.
245
+
246
+ ## Test-Case Strategy (module)
247
+
248
+ Use the current mirrored suites: `test/unit/spec/reachability/clusterReachability.ts`, `test/unit/spec/reachability/index.ts`, `test/unit/spec/reachability/request.js`, `test/unit/spec/reachability/util.ts`. Characterize the reachability-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
249
+
250
+ | Behavior / Requirement | Existing test evidence | Gap |
251
+ |---|---|---|
252
+ | `REACHABILITY-R-001` | `test/unit/spec/reachability/index.ts` | cover discovery, probe, fallback, stop, query, and report-format groups |
253
+ | `REACHABILITY-R-002` | `test/unit/spec/reachability/index.ts` | second discovery failure versus absorbed gather failure needs paired assertions |
254
+ | `REACHABILITY-R-003` | `test/unit/spec/reachability/index.ts` | keep paired assertions for disabled-config rejection, WebRTC/caught-failure `{}`, successful `undefined` defer settlement, and no `remoteSDPForClusters()` invocation |
255
+ | `REACHABILITY-R-004` | `test/unit/spec/reachability/clusterReachability.ts` | verify callback/timeout races |
256
+ | `REACHABILITY-R-005` | `test/unit/spec/reachability/index.ts`, `test/unit/spec/reachability/request.js` | verify partial/mixed protocol reports |
257
+
258
+ ## Traceability
259
+
260
+ - Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
261
+ - Coverage state and contracts baseline: `../../../.sdd/manifest.json`
@@ -6,13 +6,14 @@ import {Enum} from '../constants';
6
6
  import {
7
7
  ClusterReachabilityResult,
8
8
  NatType,
9
+ Protocol,
9
10
  ReachabilityPeerConnectionEvents,
10
11
  } from './reachability.types';
11
12
  import {ReachabilityPeerConnection} from './reachabilityPeerConnection';
12
13
 
13
14
  // data for the Events.resultReady event
14
15
  export type ResultEventData = {
15
- protocol: 'udp' | 'tcp' | 'xtls';
16
+ protocol: Protocol;
16
17
  result: 'reachable' | 'unreachable' | 'untested';
17
18
  latencyInMilliseconds: number; // amount of time it took to get the ICE candidate
18
19
  clientMediaIPs?: string[];
@@ -20,7 +21,7 @@ export type ResultEventData = {
20
21
 
21
22
  // data for the Events.clientMediaIpsUpdated event
22
23
  export type ClientMediaIpsUpdatedEventData = {
23
- protocol: 'udp' | 'tcp' | 'xtls';
24
+ protocol: Protocol;
24
25
  clientMediaIPs: string[];
25
26
  };
26
27
 
@@ -25,6 +25,7 @@ import {
25
25
  TransportResultForBackend,
26
26
  GetClustersTrigger,
27
27
  NatType,
28
+ Protocol,
28
29
  } from './reachability.types';
29
30
  import {
30
31
  ClientMediaIpsUpdatedEventData,
@@ -33,6 +34,7 @@ import {
33
34
  NatTypeUpdatedEventData,
34
35
  ResultEventData,
35
36
  } from './clusterReachability';
37
+ import {isReachabilityEnabled, resolveReachabilityProtocols} from './util';
36
38
  import EventsScope from '../common/events/events-scope';
37
39
  import BEHAVIORAL_METRICS from '../metrics/constants';
38
40
  import Metrics from '../metrics';
@@ -194,7 +196,7 @@ export default class Reachability extends EventsScope {
194
196
  */
195
197
  public async gatherReachability(trigger: string): Promise<ReachabilityResults> {
196
198
  // @ts-ignore
197
- if (!this.webex.config.meetings.enableReachabilityChecks) {
199
+ if (!isReachabilityEnabled(this.webex.config.meetings.enableReachabilityChecks)) {
198
200
  throw new Error('enableReachabilityChecks is disabled in config');
199
201
  }
200
202
 
@@ -515,7 +517,7 @@ export default class Reachability extends EventsScope {
515
517
  * Returns true only if ALL protocols (UDP, TCP and TLS) have been tested and none
516
518
  * of the media clusters where reachable with any of the protocols. This is done
517
519
  * irrespective of the config, so for example:
518
- * if config.meetings.experimental.enableTlsReachability === false,
520
+ * if config.meetings.enableReachabilityChecks disables TLS,
519
521
  * it will return false, because TLS reachability won't be tested,
520
522
  * so we can't say for sure that media backend is unreachable over TLS.
521
523
  *
@@ -568,6 +570,32 @@ export default class Reachability extends EventsScope {
568
570
  return unreachable;
569
571
  }
570
572
 
573
+ /**
574
+ * Checks if any cluster is reachable via the given protocol based on stored reachability results.
575
+ *
576
+ * @param {string} protocol - the protocol to check ('udp', 'tcp', or 'xtls')
577
+ * @returns {Promise<boolean>} true if at least one cluster has a 'reachable' result for the given protocol
578
+ */
579
+ async isAnyClusterReachableViaProtocol(protocol: Protocol): Promise<boolean> {
580
+ try {
581
+ // @ts-ignore
582
+ const resultsJson = await this.webex.boundedStorage.get(
583
+ this.namespace,
584
+ REACHABILITY.localStorageResult
585
+ );
586
+
587
+ const results: ReachabilityResults = JSON.parse(resultsJson);
588
+
589
+ return Object.values(results).some((result) => result[protocol]?.result === 'reachable');
590
+ } catch (e) {
591
+ LoggerProxy.logger.warn(
592
+ `Reachability:index#isAnyClusterReachableViaProtocol --> Error reading reachability data: ${e}`
593
+ );
594
+
595
+ return false;
596
+ }
597
+ }
598
+
571
599
  /**
572
600
  * Get list of all unreachable clusters
573
601
  * @returns {array} Unreachable clusters
@@ -700,7 +728,7 @@ export default class Reachability extends EventsScope {
700
728
  */
701
729
  protected getStatistics(
702
730
  results: Array<ClusterReachabilityResult & {isVideoMesh: boolean}>,
703
- protocol: 'udp' | 'tcp' | 'xtls',
731
+ protocol: Protocol,
704
732
  isVideoMesh: boolean
705
733
  ) {
706
734
  const values = results
@@ -888,14 +916,21 @@ export default class Reachability extends EventsScope {
888
916
 
889
917
  this.startTime = performance.now();
890
918
 
919
+ const protocols = resolveReachabilityProtocols(
920
+ // @ts-ignore
921
+ this.webex.config.meetings.enableReachabilityChecks
922
+ );
923
+
924
+ const enabledProtocols = [
925
+ protocols.udp && 'UDP',
926
+ protocols.tcp && 'TCP',
927
+ protocols.tls && 'TLS',
928
+ ].filter(Boolean);
929
+
891
930
  LoggerProxy.logger.log(
892
- `Reachability:index#performReachabilityChecks --> doing UDP${
893
- // @ts-ignore
894
- this.webex.config.meetings.experimental.enableTcpReachability ? ',TCP' : ''
895
- }${
896
- // @ts-ignore
897
- this.webex.config.meetings.experimental.enableTlsReachability ? ',TLS' : ''
898
- } reachability checks`
931
+ `Reachability:index#performReachabilityChecks --> doing ${enabledProtocols.join(
932
+ ','
933
+ )} reachability checks`
899
934
  );
900
935
 
901
936
  this.resetResultCounters();
@@ -905,18 +940,14 @@ export default class Reachability extends EventsScope {
905
940
  const cluster = clusterList[key];
906
941
 
907
942
  // Linus doesn't support TCP reachability checks on video mesh nodes
908
- const includeTcpReachability =
909
- // @ts-ignore
910
- this.webex.config.meetings.experimental.enableTcpReachability && !cluster.isVideoMesh;
943
+ const includeTcpReachability = protocols.tcp && !cluster.isVideoMesh;
911
944
 
912
945
  if (!includeTcpReachability) {
913
946
  cluster.tcp = [];
914
947
  }
915
948
 
916
949
  // Linus doesn't support xTLS reachability checks on video mesh nodes
917
- const includeTlsReachability =
918
- // @ts-ignore
919
- this.webex.config.meetings.experimental.enableTlsReachability && !cluster.isVideoMesh;
950
+ const includeTlsReachability = protocols.tls && !cluster.isVideoMesh;
920
951
 
921
952
  if (!includeTlsReachability) {
922
953
  cluster.xtls = [];