@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
@@ -2,6 +2,17 @@ import {IP_VERSION, Enum} from '../constants';
2
2
 
3
3
  export type Protocol = 'udp' | 'tcp' | 'xtls';
4
4
 
5
+ // Per-protocol reachability flags, fully resolved.
6
+ export type ResolvedReachabilityProtocols = {
7
+ udp: boolean;
8
+ tcp: boolean;
9
+ tls: boolean;
10
+ };
11
+
12
+ export type ReachabilityProtocolConfig = Partial<Omit<ResolvedReachabilityProtocols, 'udp'>>;
13
+
14
+ export type EnableReachabilityChecksConfig = boolean | ReachabilityProtocolConfig;
15
+
5
16
  /**
6
17
  * Events emitted by ReachabilityPeerConnection
7
18
  */
@@ -1,4 +1,40 @@
1
1
  /* eslint-disable import/prefer-default-export */
2
+ import {EnableReachabilityChecksConfig, ResolvedReachabilityProtocols} from './reachability.types';
3
+
4
+ /**
5
+ * Resolves `enableReachabilityChecks` into explicit per-protocol flags.
6
+ * Defaults to all protocols enabled when not configured.
7
+ * UDP is always tested unless reachability is disabled entirely (`false`).
8
+ *
9
+ * @param {EnableReachabilityChecksConfig} enabled value of config.meetings.enableReachabilityChecks
10
+ * @returns {ResolvedReachabilityProtocols} resolved per-protocol flags
11
+ */
12
+ export function resolveReachabilityProtocols(
13
+ enabled: EnableReachabilityChecksConfig = true
14
+ ): ResolvedReachabilityProtocols {
15
+ if (typeof enabled === 'object') {
16
+ return {
17
+ udp: true,
18
+ tcp: enabled.tcp ?? true,
19
+ tls: enabled.tls ?? true,
20
+ };
21
+ }
22
+
23
+ return {udp: enabled, tcp: enabled, tls: enabled};
24
+ }
25
+
26
+ /**
27
+ * Whether any reachability protocol is enabled.
28
+ *
29
+ * @param {EnableReachabilityChecksConfig} config value of config.meetings.enableReachabilityChecks
30
+ * @returns {boolean} true if any protocol is enabled
31
+ */
32
+ export function isReachabilityEnabled(config: EnableReachabilityChecksConfig = true): boolean {
33
+ const {udp, tcp, tls} = resolveReachabilityProtocols(config);
34
+
35
+ return udp || tcp || tls;
36
+ }
37
+
2
38
  /**
3
39
  * Converts a stun url to a turn url
4
40
  *
@@ -0,0 +1,198 @@
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
+ # REACTIONS — 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/reactions/`.
13
+
14
+ ## Metadata
15
+
16
+ | Field | Value |
17
+ |---|---|
18
+ | Module id | `reactions` |
19
+ | Source path(s) | `src/reactions/` |
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; reaction availability and event/request meaning were placed into the public surface and invariants |
36
+ | Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
37
+
38
+ ## Overview
39
+
40
+ `src/reactions/` contains 3 direct source/reference file(s) and has 0 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
+ Defines static reaction and skin-tone catalogs plus TypeScript shapes for reaction, sender, and relay payloads; owning Meeting code performs runtime lookup and fallback.
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/reactions/
54
+ ├── constants.ts — module constants and wire values
55
+ ├── reactions.ts — reactions implementation responsibility
56
+ ├── reactions.type.ts — reactions.type implementation responsibility
57
+ └── ai-docs/reactions-spec.md — canonical module specification
58
+ ```
59
+
60
+ ## Key Files (source of truth)
61
+
62
+ | File | Holds |
63
+ |---|---|
64
+ | `src/reactions/constants.ts` | module constants and wire values |
65
+ | `src/reactions/reactions.ts` | reactions implementation responsibility |
66
+ | `src/reactions/reactions.type.ts` | reactions.type implementation responsibility |
67
+ | no source-local mirrored test directory | explicit characterization gap |
68
+
69
+ ## Public Surface
70
+
71
+ | Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
72
+ |---|---|---|---|---|---|---|
73
+ | `reactions.1` | exported catalogs | `REACTION_RELAY_TYPES`, `Reactions`, and `SkinTones` | Define the supported relay, reaction, and skin-tone values consumed by Meeting request/event code. | Preserve existing raw values; add new catalog members compatibly. | `src/reactions/constants.ts`, `src/reactions/reactions.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
74
+ | `reactions.2` | exported types | `EmoticonData`, `SkinTone`, `Reaction`, `ReactionServerType`, `SkinToneType`, `Sender`, `ProcessedReaction`, and `RelayEvent` | Type the sender, relay, server, and normalized reaction payloads crossing the Meeting boundary. | Type changes must remain compatible with existing relay and sender shapes. | `src/reactions/reactions.type.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
75
+
76
+ ### Emitted events
77
+
78
+ Current source emits or forwards these observable literals for this operation boundary. Preserve literal values, scope, payload shape, and emission timing; a constant name alone is not a substitute for the consumer-visible value.
79
+
80
+ | Event literal | Constant / expression | Emission evidence |
81
+ |---|---|---|
82
+ | `meeting:receiveReactions` | `EVENT_TRIGGERS.MEETING_RECEIVE_REACTIONS` | `src/meeting/index.ts` |
83
+
84
+ Compatibility notes:
85
+ - 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.
86
+
87
+ ## Requires (dependencies)
88
+
89
+ Reaction constants/types and Meeting reaction request/event paths.
90
+
91
+ ## Requirements
92
+
93
+ | ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
94
+ |---|---|---|---|---|---|---|
95
+ | `REACTIONS-R-001` | Export the supported `Reactions` and `SkinTones` record values without executable normalization or transport behavior. | Owning Meeting code needs one stable catalog of server type/codepoint/shortcode values while retaining responsibility for selection and fallback. | `src/reactions/reactions.ts` | `test/unit/spec/meeting/index.js`, `test/unit/spec/meeting/request.js` | no source-local mirrored test exists | PRESENT |
96
+ | `REACTIONS-R-002` | type reaction, sender, and relay payloads. | Meeting serialization depends on the exact reaction, skin-tone, sender, and relay type vocabulary. | `src/reactions/reactions.ts`, `src/reactions/reactions.type.ts` | `test/unit/spec/meeting/request.js` | catalog values need an exhaustive serializer compatibility matrix in the owning Meeting tests | PRESENT |
97
+ | `REACTIONS-R-003` | The catalogs are plain records and perform no validation, parsing, serialization, or fallible I/O; `Meeting.sendReaction` passes an unknown reaction type through and falls back to the normal skin tone for an unknown tone. | The spec must not turn static data declarations into a runtime normalization API or rejection contract. | `src/reactions/`, `src/meeting/index.ts` | `test/unit/spec/meeting/index.js`, `test/unit/spec/meeting/request.js` | none | PRESENT |
98
+
99
+ ## Design Overview
100
+
101
+ `reactions.ts` and `constants.ts` export static reaction/skin-tone values, while `reactions.type.ts` supplies compile-time payload shapes. The module has no runtime transport or lifecycle state.
102
+
103
+ ## Data Flow
104
+
105
+ ```mermaid
106
+ flowchart LR
107
+ Consumer[Meeting/request/event code] --> Catalog[reactions.ts]
108
+ Constants[constants.ts wire values] --> Catalog
109
+ Types[reactions.type.ts payload types] --> Consumer
110
+ Catalog --> Payload[reaction + skin-tone value]
111
+ ```
112
+
113
+ ## Sequence Diagram(s)
114
+
115
+ Sequence coverage:
116
+
117
+ | Operation group | Diagram | Failure coverage |
118
+ |---|---|---|
119
+ | UC-1…UC-2 — reaction catalog and payload operation groups | Reaction catalog and payload primary sequence | catalog/type-only behavior and owning Meeting serialization/request failure |
120
+ | UC-1…UC-2 — reaction catalog and payload alternate/failure paths | Reaction catalog and payload alternate/failure sequence | consumer supplies a value outside the exported catalog or an owning request rejects it |
121
+
122
+ ### Reaction catalog and payload primary sequence
123
+
124
+ ```mermaid
125
+ sequenceDiagram
126
+ participant C as Meeting feature code
127
+ participant R as Reactions catalog
128
+ C->>R: select reaction and skin tone
129
+ R-->>C: declared wire values
130
+ C->>C: place values in request/event payload
131
+ ```
132
+
133
+ ### Reaction catalog and payload alternate/failure sequence
134
+
135
+ ```mermaid
136
+ sequenceDiagram
137
+ participant C as Caller / current input owner
138
+ participant M as Meeting.sendReaction
139
+ participant R as Reactions/SkinTones records
140
+ C->>M: sendReaction(reactionType, skinToneType)
141
+ M->>R: look up catalog entries
142
+ alt known reaction/tone
143
+ R-->>M: declared catalog values
144
+ else unknown value
145
+ M->>M: pass through custom reaction type; use normal tone fallback
146
+ end
147
+ M-->>C: request promise, or plain Error rejection when reactionChannelUrl is absent
148
+ ```
149
+
150
+ ## Class / Component Relationships
151
+
152
+ ```mermaid
153
+ classDiagram
154
+ class Consumer
155
+ class Catalog
156
+ class Constants
157
+ class Types
158
+ class Payload
159
+ Consumer --> Catalog
160
+ Constants --> Catalog
161
+ Types --> Consumer
162
+ Catalog --> Payload
163
+ ```
164
+
165
+ The arrows identify ownership and delegation inside `src/reactions/`; files that only declare types or constants are not presented as transports.
166
+
167
+ ## Use Cases
168
+
169
+ - **UC-1:** Resolve consumer reaction and skin-tone choices from the exported `Reactions` and `SkinTones` catalogs before `Meeting.sendReaction()` serializes them. Evidence: `src/reactions/reactions.ts`, `src/meeting/index.ts`.
170
+ - **UC-2:** Carry sender identity and relay payloads through the exported reaction types while leaving parsing, validation, and transport to Meeting. Evidence: `src/reactions/reactions.type.ts`, `src/meeting/index.ts`.
171
+
172
+ ## Business Rules & Invariants
173
+
174
+ - Consumer/server reaction and skin-tone values use declared enums/catalogs; participant sender data follows package privacy rules. Enforced under `src/reactions/`.
175
+
176
+ ## Protocol / Wire Format
177
+
178
+ - `src/reactions/` declares catalog values and TypeScript payload shapes used by owning request/event code. Preserve type names, enum/raw values, sender identity fields, and relay structure; parsing and serialization occur outside this module.
179
+
180
+ ## Pitfalls
181
+
182
+ - Display glyph/name and server relay type are different representations. Send the declared server value, not an arbitrary UI label.
183
+ - Verify both typed constants/enums and raw wire values before changing a logical condition in this legacy package.
184
+
185
+ ## Test-Case Strategy (module)
186
+
187
+ No mirrored module test directory exists. Characterize the reactions-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
188
+
189
+ | Behavior / Requirement | Existing test evidence | Gap |
190
+ |---|---|---|
191
+ | `REACTIONS-R-001` | `test/unit/spec/meeting/request.js` | cover every exported catalog value and payload shape through owning Meeting serialization tests |
192
+ | `REACTIONS-R-002` | `test/unit/spec/meeting/request.js` | keep serializer coverage tied to every exported reaction and skin-tone raw value |
193
+ | `REACTIONS-R-003` | `test/unit/spec/meeting/request.js` | add a boundary case showing transport failure belongs to Meeting rather than this catalog/type module |
194
+
195
+ ## Traceability
196
+
197
+ - Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
198
+ - Coverage state and contracts baseline: `../../../.sdd/manifest.json`
@@ -60,4 +60,7 @@ type RelayEventData = {
60
60
 
61
61
  export type RelayEvent = {
62
62
  data: RelayEventData;
63
+ headers?: {
64
+ route?: string;
65
+ };
63
66
  };
@@ -0,0 +1,272 @@
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
+ # RECONNECTION MANAGER — 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/reconnection-manager/`.
13
+
14
+ ## Metadata
15
+
16
+ | Field | Value |
17
+ |---|---|
18
+ | Module id | `reconnection-manager` |
19
+ | Source path(s) | `src/reconnection-manager/` |
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 recovery state machine and tests |
36
+ | Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
37
+
38
+ ## Overview
39
+
40
+ `src/reconnection-manager/` contains 1 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
+ Coordinates bounded network/media recovery, escalating from reconnecting media to rejoining the meeting when required.
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/reconnection-manager/
54
+ ├── index.ts — module facade/controller or primary exports
55
+ └── ai-docs/reconnection-manager-spec.md — canonical module specification
56
+ ```
57
+
58
+ ## Key Files (source of truth)
59
+
60
+ | File | Holds |
61
+ |---|---|
62
+ | `src/reconnection-manager/index.ts` | module facade/controller or primary exports |
63
+ | `test/unit/spec/reconnection-manager/index.js` | mirrored characterization/unit coverage |
64
+
65
+ ## Public Surface
66
+
67
+ | Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
68
+ |---|---|---|---|---|---|---|
69
+ | `reconnection-manager.1` | SDK / state | `ReconnectionManager.isReconnectInProgress()`, `reset()`, and `cleanUp()` | Expose the duplicate-run guard and reset only reconnection status plus rejoin attempts. | `cleanUp()` calls `reset()`; neither clears `iceState.timer` nor settles/clears the ICE defer. Use `resetReconnectionTimer()` for that separate state. | `src/reconnection-manager/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
70
+ | `reconnection-manager.2` | SDK / ICE wait | `waitForIceReconnect()`, `iceReconnected()`, and `resetReconnectionTimer()` | Wait for a bounded ICE recovery signal and settle/clear the owned timer/defer. | Preserve timeout duration, settlement, and reset ordering. | `src/reconnection-manager/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
71
+ | `reconnection-manager.3` | SDK / recovery | `reconnect()` | Run one guarded recovery sequence, emitting success after the ordinary recovery/completion-callback path and failure on terminal errors. | A successful auto-rejoin returns before `MEETING_RECONNECTION_SUCCESS`; disabled/duplicate starts throw, and terminal failure resets status/attempts in `finally`. | `src/reconnection-manager/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
72
+ | `reconnection-manager.4` | SDK / recovery | `reconnectMedia()` | Retry the current media reconnection path within configured attempt limits. | Preserve attempt bounds and escalation to meeting rejoin. | `src/reconnection-manager/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
73
+ | `reconnection-manager.5` | SDK / recovery | `rejoinMeeting()` | Rejoin the meeting and stop a share that was active at recovery start with the recovery reason. | Current code does not restore or republish sharing after recovery. | `src/reconnection-manager/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
74
+
75
+ ### Emitted events
76
+
77
+ Current source emits or forwards these observable literals for this operation boundary. Preserve literal values, scope, payload shape, and emission timing; a constant name alone is not a substitute for the consumer-visible value.
78
+
79
+ | Event literal | Constant / expression | Emission evidence |
80
+ |---|---|---|
81
+ | `meeting:reconnectionFailure` | `EVENT_TRIGGERS.MEETING_RECONNECTION_FAILURE` | `src/reconnection-manager/index.ts` |
82
+ | `meeting:reconnectionStarting` | `EVENT_TRIGGERS.MEETING_RECONNECTION_STARTING` | `src/reconnection-manager/index.ts` |
83
+ | `meeting:reconnectionSuccess` | `EVENT_TRIGGERS.MEETING_RECONNECTION_SUCCESS` | `src/reconnection-manager/index.ts` |
84
+ | `meeting:stoppedSharingLocal` | `EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL` | `src/meeting/index.ts`, `src/reconnection-manager/index.ts` |
85
+
86
+ `MEETING_RECONNECTION_SUCCESS` is emitted only after `executeReconnection()` and any completion callback finish on the ordinary path. When a `NeedsRejoinError` is handled by successful automatic rejoin, `reconnect()` returns immediately after `rejoinMeeting()` and skips that success event. Terminal errors still emit `MEETING_RECONNECTION_FAILURE`.
87
+
88
+ Compatibility notes:
89
+ - 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.
90
+
91
+ ## Requires (dependencies)
92
+
93
+ Meeting lifecycle/media methods, network state callbacks, timers, retry configuration, logging, events, and metrics.
94
+
95
+ ## Requirements
96
+
97
+ | ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
98
+ |---|---|---|---|---|---|---|
99
+ | `RECONNECTION-MANAGER-R-001` | start/reset/inspect reconnection state. | Coordinates bounded network/media recovery, escalating from reconnecting media to rejoining the meeting when required. | `src/reconnection-manager/index.ts` | `test/unit/spec/reconnection-manager/index.js` | none | PRESENT |
100
+ | `RECONNECTION-MANAGER-R-002` | retry media reconnection with timers. | Attempt limits and timers determine when recovery stays in media reconnect versus escalating to a full rejoin. | `src/reconnection-manager/index.ts` | `test/unit/spec/reconnection-manager/index.js` | ICE event/timeout races at the final attempt boundary need explicit coverage | PRESENT |
101
+ | `RECONNECTION-MANAGER-R-003` | Duplicate starts throw `ReconnectionNotStartedError`. Ordinary successful recovery emits `MEETING_RECONNECTION_SUCCESS` after its completion callback, but successful automatic rejoin returns before that emission. Terminal recovery failures emit `MEETING_RECONNECTION_FAILURE` and reject with `ReconnectionError`; some inner paths assign `FAILURE`, but the outer `finally` calls `reset()` and returns status to the default value. | Callers must not treat success-event presence as proof of every successful recovery mode, and must rely on the returned rejection/failure event rather than assume that `FAILURE` persists after settlement. | `src/reconnection-manager/index.ts` | `test/unit/spec/reconnection-manager/index.js` | characterize the absent success event after successful auto-rejoin | PRESENT |
102
+ | `RECONNECTION-MANAGER-R-004` | `status === IN_PROGRESS` prevents a second recovery run; `rejoinAttempts` is bounded by `maxRejoinAttempts` and both fields are reset by `reconnect()` cleanup. The separate ICE-wait path owns `iceState.timer` and clears it through `resetReconnectionTimer()`; `cleanUp()` does not invoke that method. | Concurrent network/media callbacks must not launch duplicate media negotiations or meeting joins, and lifecycle cleanup must not be documented as settling an independent ICE wait that current code leaves intact. | `src/reconnection-manager/index.ts` | `test/unit/spec/reconnection-manager/index.js` | characterize `cleanUp()` while an ICE wait is pending | PRESENT |
103
+ | `RECONNECTION-MANAGER-R-005` | Recovery first reconnects media where allowed, then escalates to meeting rejoin. If recovery started while sharing, current code calls `stopLocalShareStream` with `MEDIA_RECONNECTION` or `MEETING_REJOIN`; it does not republish or restore sharing. | This records the observable behavior and prevents a future test or caller from assuming restoration that does not exist. | `src/reconnection-manager/index.ts` | `test/unit/spec/reconnection-manager/index.js` | Possible product defect: user intent may be to restore prior sharing after recovery, but no restoration path exists. | PRESENT |
104
+
105
+ ## Design Overview
106
+
107
+ The manager serializes one recovery run, first attempting its own `reconnectMedia()` operation and then calling `Meeting.join()` when rejoin is required. It owns retry counters/timers and `stopLocalShareStream()`; its media operation reaches into the Meeting's ROAP and media-connection dependencies rather than calling a `Meeting.reconnectMedia()` method.
108
+
109
+ ## Data Flow
110
+
111
+ ```mermaid
112
+ flowchart LR
113
+ Network[network / media failure] --> Manager[index.ts]
114
+ Manager --> Media[manager-owned reconnectMedia using Meeting ROAP/media properties]
115
+ Manager --> Meeting[Meeting join and stream-unpublish dependencies]
116
+ Manager --> Rejoin[Meeting.join rejoin path]
117
+ Manager --> Timer[bounded retry timer]
118
+ Manager --> Events[start; ordinary-path success; terminal failure]
119
+ Manager --> ShareStop[stopLocalShareStream with recovery reason]
120
+ ```
121
+
122
+ ## Sequence Diagram(s)
123
+
124
+ Sequence coverage:
125
+
126
+ | Operation group | Diagram | Failure coverage |
127
+ |---|---|---|
128
+ | UC-1…UC-4 — reconnection and rejoin operation groups | Reconnection and rejoin primary sequence | disabled/duplicate start, ICE timeout, bounded retry escalation, and terminal reset |
129
+ | UC-1…UC-4 — reconnection and rejoin alternate/failure paths | Reconnection and rejoin alternate/failure sequence | duplicate start, exhausted retry count, media reconnection rejection, meeting rejoin rejection, or network state change during recovery |
130
+
131
+ ### Reconnection and rejoin primary sequence
132
+
133
+ ```mermaid
134
+ sequenceDiagram
135
+ participant N as Network/media callback
136
+ participant R as ReconnectionManager
137
+ participant M as Meeting
138
+ N-->>R: reconnect trigger
139
+ alt reconnection is disabled or another reconnect is already IN_PROGRESS
140
+ R--xN: ReconnectionNotStartedError without resetting status
141
+ else new recovery run
142
+ R->>R: set IN_PROGRESS
143
+ end
144
+ alt ordinary media reconnection succeeds after a new start
145
+ R->>R: stopLocalShareStream(MEDIA_RECONNECTION) when wasSharing
146
+ R->>R: reconnectMedia() using Meeting ROAP/media dependencies
147
+ R->>R: run completion callback when supplied
148
+ R-->>N: MEETING_RECONNECTION_SUCCESS and resolved promise
149
+ else NeedsRejoinError and auto-rejoin is enabled
150
+ R->>M: join({rejoin:true})
151
+ R->>R: stopLocalShareStream(MEETING_REJOIN) when wasSharing
152
+ R-->>N: resolved promise without MEETING_RECONNECTION_SUCCESS
153
+ else terminal recovery error
154
+ R--xN: MEETING_RECONNECTION_FAILURE and ReconnectionError
155
+ end
156
+ R->>R: finally resets status and rejoin attempts
157
+ ```
158
+
159
+ ### Reconnection and rejoin alternate/failure sequence
160
+
161
+ ```mermaid
162
+ sequenceDiagram
163
+ participant N as Network / media trigger
164
+ participant R as ReconnectionManager
165
+ participant M as Meeting
166
+ N->>R: reconnect while local share may be active
167
+ alt status is default and recovery is enabled
168
+ alt ordinary media reconnection
169
+ R->>R: stopLocalShareStream(MEDIA_RECONNECTION) when sharing
170
+ R->>R: reconnectMedia()
171
+ else automatic meeting rejoin
172
+ R->>M: join({rejoin:true})
173
+ R->>R: stopLocalShareStream(MEETING_REJOIN) when sharing
174
+ end
175
+ R-->>N: ordinary success event, successful auto-rejoin without that event, or failure event and ReconnectionError
176
+ else reconnection is disabled or another reconnect is already IN_PROGRESS
177
+ R--xN: ReconnectionNotStartedError
178
+ end
179
+ ```
180
+
181
+ ## Class / Component Relationships
182
+
183
+ ```mermaid
184
+ classDiagram
185
+ class Network
186
+ class Manager
187
+ class Meeting
188
+ class Media
189
+ class Rejoin
190
+ class Timer
191
+ class Events
192
+ class ShareStop
193
+ Network --> Manager
194
+ Manager --> Meeting
195
+ Manager --> Media
196
+ Manager --> Rejoin
197
+ Manager --> Timer
198
+ Manager --> Events
199
+ Manager --> ShareStop
200
+ ```
201
+
202
+ The arrows identify ownership and delegation inside `src/reconnection-manager/`; files that only declare types or constants are not presented as transports.
203
+
204
+ ## Use Cases
205
+
206
+ - **UC-1:** Reject recovery when reconnection is disabled or another `reconnect()` already owns the `IN_PROGRESS` state. Evidence: `src/reconnection-manager/index.ts`.
207
+ - **UC-2:** Wait for bounded ICE reconnection, clearing the timer/defer when ICE returns or the wait resets. Evidence: `src/reconnection-manager/index.ts`.
208
+ - **UC-3:** Retry media reconnection within configured limits, then escalate to meeting rejoin. Emit success only after the ordinary recovery/completion-callback path; a successful automatic rejoin resolves without that event, while terminal errors emit failure. Evidence: `src/reconnection-manager/index.ts`.
209
+ - **UC-4:** When recovery began while sharing, stop the local share stream with the matching recovery reason; current code does not restore or republish it. Evidence: `src/reconnection-manager/index.ts`.
210
+
211
+ ## State Model
212
+
213
+ The manager stores reconnection `status`, `rejoinAttempts`, configured attempt limits, and `iceState` (`disconnected`, resolver, timer, timeout). Sharing is read from the owning Meeting when recovery starts; there is no stored reconnect promise or last-recovery-mode field.
214
+
215
+ ## Business Rules & Invariants
216
+
217
+ - Only one recovery run is active and retries are bounded. `reconnect()` success/failure resets reconnection status and attempts; the independent ICE timer/defer is cleared only through `iceReconnected()`/`resetReconnectionTimer()`, not by `cleanUp()`. A previously active share is stopped with a recovery-specific reason and is not restored by this module. Evidence: `src/reconnection-manager/index.ts`.
218
+
219
+ ## Concurrency & Reactive Flow
220
+
221
+ - `status === IN_PROGRESS` is the duplicate-run guard for the duration of `reconnect()`. The outer `finally` resets status and `rejoinAttempts`; the independent ICE-wait timer is cleared by `iceReconnected()`/`resetReconnectionTimer()`. A share active at recovery start is stopped with the concrete recovery reason and is not republished by a later completion.
222
+
223
+ ## State Machine
224
+
225
+ ```mermaid
226
+ stateDiagram-v2
227
+ state "'' (default)" as DEFAULT
228
+ [*] --> DEFAULT
229
+ DEFAULT --> IN_PROGRESS: reconnect()
230
+ IN_PROGRESS --> DEFAULT: recovery succeeds / reset()
231
+ IN_PROGRESS --> FAILURE: terminal recovery error
232
+ FAILURE --> DEFAULT: reset()
233
+ ```
234
+
235
+ The diagram uses the concrete `''`, `IN_PROGRESS`, and `FAILURE` values declared for reconnection status.
236
+
237
+ ## Error Handling & Failure Modes
238
+
239
+ | Condition | Signal | Caller recovery |
240
+ |---|---|---|
241
+ | Reconnection is disabled or status is already `IN_PROGRESS` | `reconnect()` throws `ReconnectionNotStartedError`. | Wait for the active run to settle or enable recovery before a new attempt. |
242
+ | Media/WebSocket/rejoin recovery reaches a terminal failure | The manager emits `MEETING_RECONNECTION_FAILURE`, rejects with `ReconnectionError`, and `finally` resets status/attempts; inner `FAILURE` assignments are not persistent terminal state. | Handle the failure event/rejection and inspect current meeting state before another run. |
243
+ | `NeedsRejoinError` is handled by a successful automatic rejoin | `reconnect()` resolves after `rejoinMeeting()` and returns before `MEETING_RECONNECTION_SUCCESS` or the recovered metric is emitted. | Treat the resolved operation/current meeting state as the outcome; do not wait for a success event on this path. |
244
+ | Recovery began while local sharing was active | Current code unpublishes/stops the local share with `MEDIA_RECONNECTION` or `MEETING_REJOIN`; it does not restore or republish it. | Treat restoration as a separate product decision/operation. |
245
+ | `cleanUp()` runs while `waitForIceReconnect()` is pending | Status and rejoin attempts reset, but the ICE timer/defer remain active because `cleanUp()` does not call `resetReconnectionTimer()`. | Explicitly invoke the ICE reset path when the owner intends to settle that pending wait. |
246
+
247
+ ## Pitfalls
248
+
249
+ - Network and media events can request recovery concurrently. Starting a second timer/promise produces duplicate joins and stale completion callbacks.
250
+ - `cleanUp()` is not a full ICE-wait teardown: it resets status/attempts only. An owner that needs to settle and clear `iceState` must call `resetReconnectionTimer()` explicitly.
251
+ - Public behavior may be reachable through a parent `Meeting`/`Meetings` object even when the source helper is not exported directly.
252
+
253
+ ## Key Design Trade-off
254
+
255
+ - Escalating recovery favors continuity over immediate failure, with bounded delay and more lifecycle complexity.
256
+
257
+ ## Test-Case Strategy (module)
258
+
259
+ Use the current mirrored suites: `test/unit/spec/reconnection-manager/index.js`. Characterize the reconnection-manager-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
260
+
261
+ | Behavior / Requirement | Existing test evidence | Gap |
262
+ |---|---|---|
263
+ | `RECONNECTION-MANAGER-R-001` | `test/unit/spec/reconnection-manager/index.js` | cover state reset, ICE wait, media retry, rejoin, and sharing-stop groups |
264
+ | `RECONNECTION-MANAGER-R-002` | `test/unit/spec/reconnection-manager/index.js` | ICE event/timeout races at the final attempt boundary need explicit coverage |
265
+ | `RECONNECTION-MANAGER-R-003` | `test/unit/spec/reconnection-manager/index.js` | assert successful auto-rejoin resolves without `MEETING_RECONNECTION_SUCCESS`, both recovery reasons stop an active share, and no completion path republishes it |
266
+ | `RECONNECTION-MANAGER-R-004` | `test/unit/spec/reconnection-manager/index.js` | verify concurrent triggers and exhausted retries |
267
+ | `RECONNECTION-MANAGER-R-005` | `test/unit/spec/reconnection-manager/index.js` | characterize both `stopLocalShareStream` recovery reasons; restoration remains a product-decision gap |
268
+
269
+ ## Traceability
270
+
271
+ - Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
272
+ - Coverage state and contracts baseline: `../../../.sdd/manifest.json`