@webex/plugin-meetings 3.12.0-webex-services-ready.4 → 3.13.0

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 (165) 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 +130 -4
  22. package/ai-docs/ARCHITECTURE.md +208 -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/assets/README.md +28 -0
  40. package/assets/e2ee-0.0.1.js +2 -0
  41. package/assets/e2ee-0.0.1.wasm +0 -0
  42. package/dist/aiEnableRequest/index.js +1 -1
  43. package/dist/annotation/index.js +55 -19
  44. package/dist/annotation/index.js.map +1 -1
  45. package/dist/assets/e2ee-0.0.1.js +2 -0
  46. package/dist/assets/e2ee-0.0.1.wasm +0 -0
  47. package/dist/breakouts/breakout.js +1 -1
  48. package/dist/breakouts/index.js +39 -5
  49. package/dist/breakouts/index.js.map +1 -1
  50. package/dist/common/errors/webex-errors.js +7 -2
  51. package/dist/common/errors/webex-errors.js.map +1 -1
  52. package/dist/config.js +1 -0
  53. package/dist/config.js.map +1 -1
  54. package/dist/constants.js +6 -5
  55. package/dist/constants.js.map +1 -1
  56. package/dist/hashTree/hashTreeParser.js +101 -48
  57. package/dist/hashTree/hashTreeParser.js.map +1 -1
  58. package/dist/index.js +1 -0
  59. package/dist/index.js.map +1 -1
  60. package/dist/interceptors/dataChannelAuthToken.js +41 -59
  61. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  62. package/dist/interceptors/locusRetry.js +1 -1
  63. package/dist/interceptors/locusRetry.js.map +1 -1
  64. package/dist/interpretation/index.js +46 -12
  65. package/dist/interpretation/index.js.map +1 -1
  66. package/dist/interpretation/siLanguage.js +1 -1
  67. package/dist/locus-info/index.js +236 -80
  68. package/dist/locus-info/index.js.map +1 -1
  69. package/dist/locus-info/types.js +2 -1
  70. package/dist/locus-info/types.js.map +1 -1
  71. package/dist/media/MediaConnectionAwaiter.js +225 -175
  72. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  73. package/dist/meeting/index.js +355 -299
  74. package/dist/meeting/index.js.map +1 -1
  75. package/dist/meeting/util.js +8 -2
  76. package/dist/meeting/util.js.map +1 -1
  77. package/dist/meeting/voicea-meeting.js +2 -1
  78. package/dist/meeting/voicea-meeting.js.map +1 -1
  79. package/dist/meeting-info/meeting-info-v2.js +10 -3
  80. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  81. package/dist/meetings/index.js +72 -31
  82. package/dist/meetings/index.js.map +1 -1
  83. package/dist/multistream/remoteMediaManager.js +32 -4
  84. package/dist/multistream/remoteMediaManager.js.map +1 -1
  85. package/dist/multistream/sendSlotManager.js +11 -1
  86. package/dist/multistream/sendSlotManager.js.map +1 -1
  87. package/dist/types/annotation/index.d.ts +19 -0
  88. package/dist/types/common/errors/webex-errors.d.ts +6 -2
  89. package/dist/types/config.d.ts +1 -0
  90. package/dist/types/constants.d.ts +2 -1
  91. package/dist/types/hashTree/hashTreeParser.d.ts +12 -0
  92. package/dist/types/index.d.ts +1 -0
  93. package/dist/types/locus-info/index.d.ts +45 -1
  94. package/dist/types/locus-info/types.d.ts +1 -0
  95. package/dist/types/media/MediaConnectionAwaiter.d.ts +61 -53
  96. package/dist/types/meeting/index.d.ts +49 -12
  97. package/dist/types/meeting/util.d.ts +3 -1
  98. package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
  99. package/dist/types/meetings/index.d.ts +2 -1
  100. package/dist/types/multistream/remoteMediaManager.d.ts +18 -0
  101. package/dist/types/multistream/sendSlotManager.d.ts +5 -1
  102. package/dist/webinar/index.js +298 -255
  103. package/dist/webinar/index.js.map +1 -1
  104. package/package.json +25 -23
  105. package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
  106. package/src/annotation/ai-docs/annotation-spec.md +236 -0
  107. package/src/annotation/index.ts +61 -29
  108. package/src/breakouts/ai-docs/breakouts-spec.md +324 -0
  109. package/src/breakouts/index.ts +35 -2
  110. package/src/common/errors/webex-errors.ts +8 -2
  111. package/src/config.ts +5 -1
  112. package/src/constants.ts +2 -1
  113. package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +243 -0
  114. package/src/hashTree/ai-docs/hash-tree-spec.md +267 -0
  115. package/src/hashTree/hashTreeParser.ts +67 -3
  116. package/src/index.ts +1 -0
  117. package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
  118. package/src/interceptors/dataChannelAuthToken.ts +48 -77
  119. package/src/interceptors/locusRetry.ts +1 -1
  120. package/src/interpretation/ai-docs/interpretation-spec.md +256 -0
  121. package/src/interpretation/index.ts +38 -1
  122. package/src/locus-info/ai-docs/locus-info-spec.md +293 -0
  123. package/src/locus-info/index.ts +156 -35
  124. package/src/locus-info/types.ts +1 -0
  125. package/src/media/MediaConnectionAwaiter.ts +223 -207
  126. package/src/media/ai-docs/media-spec.md +267 -0
  127. package/src/meeting/ai-docs/meeting-spec.md +404 -0
  128. package/src/meeting/index.ts +332 -296
  129. package/src/meeting/util.ts +7 -4
  130. package/src/meeting/voicea-meeting.ts +1 -1
  131. package/src/meeting-info/ai-docs/meeting-info-spec.md +261 -0
  132. package/src/meeting-info/meeting-info-v2.ts +7 -2
  133. package/src/meetings/ai-docs/meetings-spec.md +296 -0
  134. package/src/meetings/index.ts +59 -23
  135. package/src/member/ai-docs/member-spec.md +196 -0
  136. package/src/members/ai-docs/members-spec.md +256 -0
  137. package/src/metrics/ai-docs/metrics-spec.md +185 -0
  138. package/src/multistream/ai-docs/multistream-spec.md +295 -0
  139. package/src/multistream/remoteMediaManager.ts +23 -1
  140. package/src/multistream/sendSlotManager.ts +15 -1
  141. package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +234 -0
  142. package/src/reachability/ai-docs/reachability-spec.md +261 -0
  143. package/src/reactions/ai-docs/reactions-spec.md +198 -0
  144. package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +272 -0
  145. package/src/recording-controller/ai-docs/recording-controller-spec.md +223 -0
  146. package/src/roap/ai-docs/roap-spec.md +241 -0
  147. package/src/webinar/ai-docs/webinar-spec.md +243 -0
  148. package/src/webinar/index.ts +168 -188
  149. package/test/unit/spec/annotation/index.ts +214 -182
  150. package/test/unit/spec/breakouts/index.ts +145 -13
  151. package/test/unit/spec/hashTree/hashTreeParser.ts +212 -1
  152. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +81 -99
  153. package/test/unit/spec/interceptors/locusRetry.ts +29 -1
  154. package/test/unit/spec/interpretation/index.ts +93 -0
  155. package/test/unit/spec/locus-info/index.js +397 -0
  156. package/test/unit/spec/media/MediaConnectionAwaiter.ts +426 -19
  157. package/test/unit/spec/media/properties.ts +3 -3
  158. package/test/unit/spec/meeting/index.js +1219 -723
  159. package/test/unit/spec/meeting/utils.js +52 -18
  160. package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
  161. package/test/unit/spec/meeting-info/meetinginfov2.js +69 -1
  162. package/test/unit/spec/meetings/index.js +145 -43
  163. package/test/unit/spec/multistream/remoteMediaManager.ts +46 -0
  164. package/test/unit/spec/multistream/sendSlotManager.ts +30 -2
  165. package/test/unit/spec/webinar/index.ts +886 -718
@@ -0,0 +1,295 @@
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
+ # MULTISTREAM — 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/multistream/`.
13
+
14
+ ## Metadata
15
+
16
+ | Field | Value |
17
+ |---|---|
18
+ | Module id | `multistream` |
19
+ | Source path(s) | `src/multistream/` |
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 slot/remote-media managers and tests |
36
+ | Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
37
+
38
+ ## Overview
39
+
40
+ `src/multistream/` contains 7 direct source/reference file(s) and has 7 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
+ Maps multistream media-core slots to stable remote-media objects/groups and arbitrates send/receive requests.
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/multistream/
54
+ ├── mediaRequestManager.ts — request coordination or payload types
55
+ ├── receiveSlot.ts — receiveSlot implementation responsibility
56
+ ├── receiveSlotManager.ts — receiveSlotManager implementation responsibility
57
+ ├── remoteMedia.ts — remoteMedia implementation responsibility
58
+ ├── remoteMediaGroup.ts — remoteMediaGroup implementation responsibility
59
+ ├── remoteMediaManager.ts — remoteMediaManager implementation responsibility
60
+ ├── sendSlotManager.ts — sendSlotManager implementation responsibility
61
+ └── ai-docs/multistream-spec.md — canonical module specification
62
+ ```
63
+
64
+ ## Key Files (source of truth)
65
+
66
+ | File | Holds |
67
+ |---|---|
68
+ | `src/multistream/mediaRequestManager.ts` | request coordination or payload types |
69
+ | `src/multistream/receiveSlot.ts` | receiveSlot implementation responsibility |
70
+ | `src/multistream/receiveSlotManager.ts` | receiveSlotManager implementation responsibility |
71
+ | `src/multistream/remoteMedia.ts` | remoteMedia implementation responsibility |
72
+ | `src/multistream/remoteMediaGroup.ts` | remoteMediaGroup implementation responsibility |
73
+ | `src/multistream/remoteMediaManager.ts` | remoteMediaManager implementation responsibility |
74
+ | `src/multistream/sendSlotManager.ts` | sendSlotManager implementation responsibility |
75
+ | `test/unit/spec/multistream/mediaRequestManager.ts` and 6 sibling test file(s) | mirrored characterization/unit coverage |
76
+
77
+ ## Public Surface
78
+
79
+ | Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
80
+ |---|---|---|---|---|---|---|
81
+ | `multistream.1` | SDK / in-process | `ReceiveSlot`: `memberId`, `csi`, `sourceState`, `stream`, `setMaxFs()`, `findMemberId()`, `logString()`, and `wcmeReceiveSlot` | Expose one stable wrapper around a media-core receive slot and its resolved participant/source state. | Preserve accessors and source-state event behavior across slot reassignment. | `src/multistream/receiveSlot.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
82
+ | `multistream.2` | SDK / lifecycle | `ReceiveSlotManager.allocateSlot()`, `releaseSlot()`, `reset()`, `getStats()`, `updateMemberIds()`, `findReceiveSlotBySsrc()` | Allocate, recycle, inspect, and reconcile the finite receive-slot pool. | `releaseSlot()` only moves the same slot object from the allocated pool to the free pool; it does not reset CSI/member/source state or detach listeners. | `src/multistream/receiveSlotManager.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
83
+ | `multistream.3` | SDK / in-process | `RemoteMedia.setSizeHint()`, `getEffectiveMaxFs()`, `stop()`, `sendMediaRequest()`, `cancelMediaRequest()`, `mediaType`, `memberId`, `csi`, `sourceState`, `stream`, and `getUnderlyingReceiveSlot()` | Give consumers a stable remote-media identity while its underlying slot and request change. | `stop()` cancels the request and removes owned slot listeners; it is not an async transport result. | `src/multistream/remoteMedia.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
84
+ | `multistream.4` | SDK / in-process | `RemoteMediaGroup.getRemoteMedia()`, `setActiveSpeakerCsis()`, `pin()`, `unpin()`, `isPinned()`, `setPreferLiveVideo()`, `setNamedMediaGroup()`, `stop()`, `includes()`, and `getEffectiveMaxFs()` | Coordinate a related set of stable remote-media objects and pin/preference policy. | Preserve group membership and pinning semantics when layouts change. | `src/multistream/remoteMediaGroup.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
85
+ | `multistream.5` | SDK / lifecycle | `RemoteMediaManager.start()`, `stop()`, `setLayout()`, `getLayoutId()`, `setPreferLiveVideo()`, `setActiveSpeakerCsis()`, `setReceiveNamedMediaGroup()`, `logAllReceiveSlots()`, `setRemoteVideoCsis()`, `setRemoteVideoCsi()`, `addMemberVideoPane()`, `removeMemberVideoPane()`, `pinActiveSpeakerVideoPane()`, `unpinActiveSpeakerVideoPane()`, and `isPinned()` | Translate meeting layout and CSI intent into remote-media groups and receive-slot assignments. | Preserve manager-scoped event/listener cleanup and current layout identifiers. | `src/multistream/remoteMediaManager.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
86
+ | `multistream.6` | SDK / in-process | `MediaRequestManager.addRequest()`, `cancelRequest()`, `commit()`, `reset()`, `setDegradationPreferences()`, and `setNumCurrentSources()` | Batch active-speaker/receiver-selected constraints and synchronously deliver `StreamRequest[]` to media core. | Mixed active-speaker `preferLiveVideo` values throw synchronously; the callback returns `void`. | `src/multistream/mediaRequestManager.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
87
+ | `multistream.7` | SDK / lifecycle | `SendSlotManager.createSlot()`, `getSlot()`, `setNamedMediaGroups()`, `setSourceStateOverride()`, `publishStream()`, `unpublishStream()`, `setActive()`, `setCodecParameters()`, `deleteCodecParameters()`, `setCustomCodecParameters()`, `markCustomCodecParametersForDeletion()`, and `reset()` | Own outgoing media-core send-slot publication and codec configuration. | Preserve explicit publication and codec-deletion operations. `reset()` calls `unpublishStream()` on every slot (best-effort, logging and swallowing rejection) before clearing them, so each slot detaches its publishedStream's track-change/constraints/mute/ended listeners instead of being discarded while still subscribed. | `src/multistream/sendSlotManager.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
88
+ | `multistream.8` | exported layout/configuration | `VideoLayout`, `ActiveSpeakerVideoPaneGroup`, `MemberVideoPane`, `Configuration`, `DefaultConfiguration`, `Event`, `Events`, `LayoutId`, `PaneSize`, `PaneId`, `PaneGroupId`, and `VideoLayoutChangedEventData` | Define the layout model and events consumed by `RemoteMediaManager`. | Add layout fields and events compatibly; existing ids and defaults are observable. | `src/multistream/remoteMediaManager.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
89
+ | `multistream.9` | exported media contracts | `AV1_CODEC_PARAMETERS`, `H264_CODEC_PARAMETERS`, `ActiveSpeakerPolicyInfo`, `ReceiverSelectedPolicyInfo`, `PolicyInfo`, `H264CodecInfo`, `CodecInfo`, `MediaRequest`, `MediaRequestId`, `ReceiveSlotEvents`, `StreamState`, `CSI`, `MemberId`, `ReceiveSlotId`, `FindMemberIdCallback`, `CreateSlotCallback`, `RemoteMediaEvents`, `RemoteVideoResolution`, `MAX_FS_VALUES`, `getMaxFs()`, and `RemoteMediaId` | Share the exact request, codec, resolution, event, and identity vocabulary across Meeting and media-core adapters. | `StreamState` is imported and re-exported from `@webex/internal-media-core` by `receiveSlot.ts`, not defined locally; preserve that upstream type identity plus raw codec values, max-fs mapping, event names, and other identifier types. | `src/multistream/receiveSlot.ts`, `src/multistream/` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
90
+
91
+ ### Emitted events
92
+
93
+ These are object-local `EventsScope` emissions on exported consumer-reachable classes, not package-wide `Trigger`/`TriggerProxy` events. Preserve each literal, emitting object, timing, and payload.
94
+
95
+ | Emitter | Event literal | Timing | Payload | Emission evidence |
96
+ |---|---|---|---|---|
97
+ | `ReceiveSlot` | `sourceUpdate` | After an internal-media-core source update refreshes state/CSI/member id, or when `findMemberId()` later resolves a previously unknown member. | `{state, csi, memberId}` | `src/multistream/receiveSlot.ts` |
98
+ | `ReceiveSlot` | `maxFsUpdate` | Synchronously when `setMaxFs(newFs)` is called. | `{maxFs: newFs}` | `src/multistream/receiveSlot.ts` |
99
+ | `RemoteMedia` | `sourceUpdate` | When the associated `ReceiveSlot` emits `sourceUpdate`; the same payload is forwarded. | `{state, csi, memberId}` | `src/multistream/remoteMedia.ts` |
100
+ | `RemoteMedia` | `stopped` | After `stop()` cancels its request, removes receive-slot listeners, and clears the slot association. | `{}` | `src/multistream/remoteMedia.ts` |
101
+ | `RemoteMediaManager` | `AudioCreated` | After the main-audio `RemoteMediaGroup` is created during startup. | main-audio `RemoteMediaGroup` | `src/multistream/remoteMediaManager.ts` |
102
+ | `RemoteMediaManager` | `InterpretationAudioCreated` | After a configured interpretation/named-audio `RemoteMediaGroup` is created. | interpretation-audio `RemoteMediaGroup` | `src/multistream/remoteMediaManager.ts` |
103
+ | `RemoteMediaManager` | `ScreenShareAudioCreated` | After screen-share audio slots exist and their `RemoteMediaGroup` is created. | screen-share-audio `RemoteMediaGroup` | `src/multistream/remoteMediaManager.ts` |
104
+ | `RemoteMediaManager` | `VideoLayoutChanged` | After `setLayout()` updates receive slots and remote-media objects for the selected layout. | `VideoLayoutChangedEventData` (`layoutId`, active-speaker groups, member panes, optional screen-share video) | `src/multistream/remoteMediaManager.ts` |
105
+
106
+ Compatibility notes:
107
+ - 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.
108
+
109
+ ## Requires (dependencies)
110
+
111
+ internal-media-core multistream connection, member CSI data, codecs, event callbacks, and Meeting media state.
112
+
113
+ ## Requirements
114
+
115
+ | ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
116
+ |---|---|---|---|---|---|---|
117
+ | `MULTISTREAM-R-001` | manage receive slots and remote-media groups. | Maps multistream media-core slots to stable remote-media objects/groups and arbitrates send/receive requests. | `src/multistream/remoteMediaManager.ts` | `test/unit/spec/multistream/remoteMediaManager.ts` | none | PRESENT |
118
+ | `MULTISTREAM-R-002` | Map member/CSI/layout requests to media-core. `ReceiveSlotManager.releaseSlot()` changes pool membership only; any association/listener cleanup must already be owned by `RemoteMedia.stop()`, request cancellation, or the surrounding manager flow. | Member, CSI, slot, and layout mappings must remain consistent while media-core reuses transport resources, without assigning cleanup behavior to a pool operation that does not perform it. | `src/multistream/remoteMediaManager.ts`, `src/multistream/receiveSlotManager.ts`, `src/multistream/remoteMedia.ts` | `test/unit/spec/multistream/remoteMediaManager.ts`, `test/unit/spec/multistream/receiveSlotManager.ts` | simultaneous slot reuse and layout change needs listener-identity coverage | PRESENT |
119
+ | `MULTISTREAM-R-003` | `MediaRequestManager` performs synchronous validation and calls its `sendMediaRequestsCallback(StreamRequest[])`, whose return type is `void`; it has no async rejection path. A mix of active-speaker requests with different `preferLiveVideo` values throws synchronously. `RemoteMedia.stop()` and request cancellation detach their owned associations/listeners; `releaseSlot()` does not. | Callers must handle the implemented synchronous validation boundary without inventing a rejected media-request promise, and cleanup must remain attributed to the object that performs it. | `src/multistream/mediaRequestManager.ts`, `src/multistream/remoteMedia.ts`, `src/multistream/receiveSlotManager.ts` | `test/unit/spec/multistream/mediaRequestManager.ts`, `test/unit/spec/multistream/remoteMedia.ts`, `test/unit/spec/multistream/receiveSlotManager.ts` | none | PRESENT |
120
+ | `MULTISTREAM-R-004` | RemoteMedia identity remains stable while tracks/receive slots and member CSI mappings change. Exported `ReceiveSlot`, `RemoteMedia`, and `RemoteMediaManager` objects emit the object-local event literals and payloads listed above at their concrete update/creation/stop boundaries. | Consumers keep references to remote media across layout and transport updates and rely on scoped events to know when those stable objects change. | `src/multistream/receiveSlot.ts`, `src/multistream/remoteMedia.ts`, `src/multistream/remoteMediaManager.ts` | `test/unit/spec/multistream/receiveSlot.ts`, `test/unit/spec/multistream/remoteMedia.ts`, `test/unit/spec/multistream/remoteMediaManager.ts` | none | PRESENT |
121
+ | `MULTISTREAM-R-005` | `RemoteMedia.stop()` cancels its request, removes listeners from its receive slot, and invalidates the association. `MediaRequestManager.cancelRequest()` removes its `SourceUpdate` and `MaxFsUpdate` handlers from every request slot before deletion. | Slot reuse must not deliver another participant's media or request callbacks through stale listeners. | `src/multistream/remoteMedia.ts`, `src/multistream/mediaRequestManager.ts` | `test/unit/spec/multistream/remoteMedia.ts`, `test/unit/spec/multistream/mediaRequestManager.ts` | none | PRESENT |
122
+ | `MULTISTREAM-R-006` | Media request arbitration and send-slot management preserve the latest supported layout/send intent. | Concurrent layout/member changes should not apply obsolete stream requests. | `src/multistream/mediaRequestManager.ts`, `src/multistream/sendSlotManager.ts` | `test/unit/spec/multistream/mediaRequestManager.ts`, `test/unit/spec/multistream/sendSlotManager.ts` | none | PRESENT |
123
+ | `MULTISTREAM-R-007` | `SendSlotManager.reset()` calls `unpublishStream()` on every slot (catching and logging any rejection) before clearing the slot map. `unpublishStream()` detaches the slot's `OutputTrackChange`/`ConstraintsChange`/mute-state/`Ended` listeners from its `publishedStream` synchronously, before any awaited sender-replace work. | Simply clearing the slot map (as before) abandons each `SendSlot` still subscribed to its last published stream. If that stream object is reused by a later, unrelated meeting instance (the stream is owned by the caller, not the slot), the abandoned slot's handler fires on the new meeting's stream activity and throws trying to replace a track on its own (already-closed) connection's sender. | `src/multistream/sendSlotManager.ts` | `test/unit/spec/multistream/sendSlotManager.ts` | none | PRESENT |
124
+
125
+ ## Design Overview
126
+
127
+ The module is a set of cooperating media managers rather than one entry controller: receive slots project remote sources, remote-media groups expose them, the media-request manager batches receive requests, and the send-slot manager applies source-state overrides.
128
+
129
+ ## Data Flow
130
+
131
+ ```mermaid
132
+ flowchart LR
133
+ MediaCore[internal-media-core slots/events] --> Slot[receiveSlot.ts]
134
+ Slot --> SlotManager[receiveSlotManager.ts]
135
+ SlotManager --> Remote[remoteMedia.ts]
136
+ Remote --> Group[remoteMediaGroup.ts]
137
+ Group --> RemoteManager[remoteMediaManager.ts]
138
+ SlotManager --> RequestManager[mediaRequestManager.ts]
139
+ SendCore[send slots] --> SendManager[sendSlotManager.ts]
140
+ RequestManager --> Meeting[Meeting media request owner]
141
+ ```
142
+
143
+ ## Sequence Diagram(s)
144
+
145
+ Sequence coverage:
146
+
147
+ | Operation group | Diagram | Failure coverage |
148
+ |---|---|---|
149
+ | UC-1…UC-6 — multistream slot and request operation groups | Multistream slot and request primary sequence | unknown/reused slot, pool-only release, removed source, mixed-preference validation, and owner-specific listener detachment |
150
+ | UC-1…UC-6 — multistream slot and request alternate/failure paths | Multistream slot and request alternate/failure sequence | unknown slot/CSI, removed remote source, conflicting slot assignment, or mixed `preferLiveVideo` validation |
151
+
152
+ ### Multistream slot and request primary sequence
153
+
154
+ ```mermaid
155
+ sequenceDiagram
156
+ participant C as Media core
157
+ participant S as ReceiveSlot
158
+ participant P as ReceiveSlotManager
159
+ participant M as RemoteMediaManager
160
+ participant R as RemoteMedia
161
+ participant Q as MediaRequestManager
162
+ participant A as Meeting / application consumer
163
+ C-->>S: source state / CSI / track event
164
+ S-->>R: ReceiveSlotEvents.SourceUpdate
165
+ R-->>A: RemoteMediaEvents.SourceUpdate
166
+ M->>P: allocateSlot(...)
167
+ P-->>M: allocated ReceiveSlot
168
+ M->>R: construct RemoteMedia with the allocated slot
169
+ M->>Q: commit() after request/allocation changes
170
+ Q-->>M: batched request completion
171
+ ```
172
+
173
+ ### Multistream slot and request alternate/failure sequence
174
+
175
+ ```mermaid
176
+ sequenceDiagram
177
+ participant C as Media-core slot event
178
+ participant S as ReceiveSlot
179
+ participant R as RemoteMedia
180
+ participant Q as MediaRequestManager
181
+ participant A as Meeting / application consumer
182
+ C-->>S: source state, CSI, or track update
183
+ S-->>R: ReceiveSlotEvents.SourceUpdate
184
+ R-->>A: forwarded RemoteMediaEvents.SourceUpdate
185
+ A->>R: sendMediaRequest(csi, commit)
186
+ alt RemoteMedia still owns a ReceiveSlot
187
+ R->>Q: addRequest(...) and optionally commit
188
+ Q-->>R: media request id
189
+ else RemoteMedia was stopped or request validation throws
190
+ R->>R: cancelMediaRequest(...) and detach ReceiveSlot listeners
191
+ R--xA: synchronous invalidated-media or mixed-preference error
192
+ end
193
+ ```
194
+
195
+ ## Class / Component Relationships
196
+
197
+ ```mermaid
198
+ classDiagram
199
+ class MediaCore
200
+ class Slot
201
+ class SlotManager
202
+ class Remote
203
+ class Group
204
+ class RemoteManager
205
+ class RequestManager
206
+ class SendCore
207
+ class SendManager
208
+ class Meeting
209
+ MediaCore --> Slot
210
+ Slot --> SlotManager
211
+ SlotManager --> Remote
212
+ Remote --> Group
213
+ Group --> RemoteManager
214
+ SlotManager --> RequestManager
215
+ SendCore --> SendManager
216
+ RequestManager --> Meeting
217
+ ```
218
+
219
+ The arrows identify ownership and delegation inside `src/multistream/`; files that only declare types or constants are not presented as transports.
220
+
221
+ ## Use Cases
222
+
223
+ - **UC-1:** Allocate receive slots and return them to the free pool. `releaseSlot()` preserves the slot object's current CSI/member/source/listener state; callers must perform any required association cleanup through its actual owner before pool reuse. Evidence: `src/multistream/receiveSlotManager.ts`, `src/multistream/receiveSlot.ts`, `src/multistream/remoteMedia.ts`.
224
+ - **UC-2:** Keep a `RemoteMedia` identity stable as its receive slot, track, source state, member id, or size hint changes. Evidence: `src/multistream/remoteMedia.ts`.
225
+ - **UC-3:** Build remote-media groups, switch layouts, update active-speaker/CSI intent, and pin or unpin the active-speaker pane. Evidence: `src/multistream/remoteMediaGroup.ts`, `src/multistream/remoteMediaManager.ts`.
226
+ - **UC-4:** Add, cancel, and commit media requests, applying degradation and current-source limits before synchronously delivering `StreamRequest[]`. Evidence: `src/multistream/mediaRequestManager.ts`.
227
+ - **UC-5:** Reject a commit synchronously when active-speaker request groups disagree on `preferLiveVideo`. Evidence: `src/multistream/mediaRequestManager.ts`.
228
+ - **UC-6:** Publish/unpublish outgoing send slots and update named media groups, source-state overrides, active state, and codec parameters. Evidence: `src/multistream/sendSlotManager.ts`.
229
+
230
+ ## State Model
231
+
232
+ Receive/send slots, remote-media objects/groups, requested layouts, CSI mappings, and pending media requests live for the connection lifetime.
233
+
234
+ ## Business Rules & Invariants
235
+
236
+ - A slot has one active owner/mapping while allocated. Returning it to the free pool does not itself detach tracks/listeners or reset CSI/member/source state; `RemoteMedia.stop()` and request cancellation own their respective cleanup. Object-local emissions retain the exact literals/payloads listed under Public Surface, and request arbitration preserves the latest supported layout intent. Enforced by current code under `src/multistream/`.
237
+
238
+ ## Concurrency & Reactive Flow
239
+
240
+ - Receive-slot and RemoteMedia identity is checked at each association change. `RemoteMedia.stop()` and `MediaRequestManager.cancelRequest()` detach the listeners they own; `ReceiveSlotManager.releaseSlot()` only changes pool membership. `MediaRequestManager` arbitrates changed constraints so a superseded slot/group does not consume a later request result.
241
+
242
+ ## State Machine
243
+
244
+ ```mermaid
245
+ stateDiagram-v2
246
+ state "no source" as NO_SOURCE
247
+ [*] --> NO_SOURCE
248
+ NO_SOURCE --> live: slot reports a live source
249
+ live --> NO_SOURCE: receive slot reports source removed
250
+ live --> live: CSI/track/source-state update
251
+ ```
252
+
253
+ The diagram records the initialized `no source` value and the `live` source path consumed by current multistream code and tests.
254
+
255
+ ## Protocol / Wire Format
256
+
257
+ - External payloads are parsed/serialized by files under `src/multistream/` 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.
258
+
259
+ ## Error Handling & Failure Modes
260
+
261
+ | Condition | Signal | Caller recovery |
262
+ |---|---|---|
263
+ | Slot/CSI is unknown or a remote source is removed | The owning association is absent or detached by its `RemoteMedia`/request lifecycle. Merely calling `releaseSlot()` changes pool membership and provides no cleanup signal. | Reconcile against the current slot/member mapping and invoke the actual association owner before returning a slot to the pool. |
264
+ | Active-speaker requests mix different `preferLiveVideo` values | `MediaRequestManager.commit()` throws synchronously before delivering stream requests. | Make the grouped active-speaker policy consistent, then commit again. |
265
+ | Current slot reports a live source | The stable `RemoteMedia` object receives the slot/track update and emits its scoped update. | Continue using the stable remote-media identity. |
266
+ | `SendSlotManager.reset()` is called and a slot's `unpublishStream()` rejects (e.g. the underlying connection is already closing) | The rejection is caught and logged as a warning; the slot is still removed from the map. `reset()` itself never throws. | No caller action needed; the slot map is cleared regardless of the unpublish outcome. |
267
+
268
+ ## Pitfalls
269
+
270
+ - Remote-media identity is not the same as a transient track or slot. Recreating objects on every update breaks consumer references.
271
+ - `Event.InterpretationAudioCreated` is emitted at runtime, but the current exported `Events` interface does not declare its callback alongside the other manager events. Treat the runtime event as observable and the type-interface omission as a separate possible product/type defect.
272
+ - Public behavior may be reachable through a parent `Meeting`/`Meetings` object even when the source helper is not exported directly.
273
+
274
+ ## Key Design Trade-off
275
+
276
+ - Stable remote-media objects are favored over exposing raw media-core slots, requiring explicit mapping and lifecycle management.
277
+
278
+ ## Test-Case Strategy (module)
279
+
280
+ Use the current mirrored suites: `test/unit/spec/multistream/mediaRequestManager.ts`, `test/unit/spec/multistream/receiveSlot.ts`, `test/unit/spec/multistream/receiveSlotManager.ts`, `test/unit/spec/multistream/remoteMedia.ts`, `test/unit/spec/multistream/remoteMediaGroup.ts`, `test/unit/spec/multistream/remoteMediaManager.ts`, `test/unit/spec/multistream/sendSlotManager.ts`. Characterize the multistream-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
281
+
282
+ | Behavior / Requirement | Existing test evidence | Gap |
283
+ |---|---|---|
284
+ | `MULTISTREAM-R-001` | `test/unit/spec/multistream/remoteMediaManager.ts` | cover each receive-slot, remote-media/group/manager, request-manager, layout, and send-slot family |
285
+ | `MULTISTREAM-R-002` | `test/unit/spec/multistream/remoteMediaManager.ts` | simultaneous slot reuse and layout change needs listener-identity coverage |
286
+ | `MULTISTREAM-R-003` | `test/unit/spec/multistream/mediaRequestManager.ts` | assert the synchronous mixed-`preferLiveVideo` throw and that the `void` callback is not treated as a promise |
287
+ | `MULTISTREAM-R-004` | `test/unit/spec/multistream/remoteMedia.ts`, `test/unit/spec/multistream/remoteMediaManager.ts` | none |
288
+ | `MULTISTREAM-R-005` | `test/unit/spec/multistream/receiveSlot.ts`, `test/unit/spec/multistream/receiveSlotManager.ts`, `test/unit/spec/multistream/remoteMedia.ts` | verify rapid slot reuse while distinguishing pool-only release from RemoteMedia/request listener cleanup |
289
+ | `MULTISTREAM-R-006` | `test/unit/spec/multistream/mediaRequestManager.ts`, `test/unit/spec/multistream/sendSlotManager.ts` | verify stale request suppression |
290
+ | `MULTISTREAM-R-007` | `test/unit/spec/multistream/sendSlotManager.ts` | covered for the unpublish-before-clear happy path and the rejected-unpublish warning/no-throw path |
291
+
292
+ ## Traceability
293
+
294
+ - Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
295
+ - Coverage state and contracts baseline: `../../../.sdd/manifest.json`
@@ -53,6 +53,28 @@ export interface Configuration {
53
53
  namedMediaGroup?: NamedMediaGroup;
54
54
  }
55
55
 
56
+ export const getRemoteMediaManagerConfigForLogging = (config?: Configuration) => {
57
+ if (!config) {
58
+ return config;
59
+ }
60
+
61
+ const {initialLayoutId, layouts} = config.video;
62
+
63
+ return {
64
+ ...config,
65
+ video: {
66
+ ...config.video,
67
+ layouts: {
68
+ count: Object.keys(layouts).length,
69
+ initial: {
70
+ id: initialLayoutId,
71
+ definition: layouts[initialLayoutId],
72
+ },
73
+ },
74
+ },
75
+ };
76
+ };
77
+
56
78
  /* Predefined layouts: */
57
79
 
58
80
  // An "all equal" grid, with size up to 3 x 3 = 9:
@@ -335,7 +357,7 @@ export class RemoteMediaManager extends EventsScope {
335
357
 
336
358
  LoggerProxy.logger.log(
337
359
  `RemoteMediaManager#constructor --> RemoteMediaManager created with config: ${JSON.stringify(
338
- this.config
360
+ getRemoteMediaManagerConfigForLogging(this.config)
339
361
  )}`
340
362
  );
341
363
  }
@@ -346,10 +346,24 @@ export default class SendSlotManager {
346
346
  }
347
347
 
348
348
  /**
349
- * This method is used to reset the SendSlotsManager by deleting all the sendSlots
349
+ * This method is used to reset the SendSlotsManager by unpublishing and deleting all the sendSlots.
350
+ * Each slot is explicitly unpublished first so it detaches its stream event listeners
351
+ * (OutputTrackChange, ConstraintsChange, mute-state, Ended); otherwise an abandoned slot stays
352
+ * subscribed to a stream that may be reused by a later meeting and throws when that stream's
353
+ * track changes, because the slot's sender belongs to this (now-closing) peer connection.
350
354
  * @returns {undefined}
351
355
  */
352
356
  public reset(): void {
357
+ this.slots.forEach((slot, mediaType) => {
358
+ slot.unpublishStream().catch((error) => {
359
+ this.LoggerProxy.logger.warn(
360
+ `SendSlotsManager->reset#Failed to unpublish stream for ${mediaType} while resetting: ${
361
+ error?.message || error
362
+ }`
363
+ );
364
+ });
365
+ });
366
+
353
367
  this.slots.clear();
354
368
  }
355
369
  }
@@ -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`