@webex/plugin-meetings 3.13.0-next.13 → 3.13.0-next.15

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 (100) hide show
  1. package/.repo-context.json +577 -0
  2. package/.sdd/manifest.json +1320 -428
  3. package/AGENTS.md +528 -72
  4. package/dist/aiEnableRequest/index.js +1 -1
  5. package/dist/breakouts/breakout.js +1 -1
  6. package/dist/breakouts/index.js +1 -1
  7. package/dist/config.js +1 -1
  8. package/dist/interpretation/index.js +1 -1
  9. package/dist/interpretation/siLanguage.js +1 -1
  10. package/dist/webinar/index.js +1 -1
  11. package/docs/adr/0001-migrate-existing-docs-into-sdd.md +141 -0
  12. package/docs/adr/index.md +26 -0
  13. package/docs/architecture.md +816 -0
  14. package/docs/getting-started.md +177 -0
  15. package/docs/index.md +53 -0
  16. package/docs/specs/README.md +126 -0
  17. package/package.json +21 -21
  18. package/schemas/repo-context.schema.json +796 -0
  19. package/src/aiEnableRequest/docs/README.md +376 -0
  20. package/src/annotation/docs/README.md +402 -0
  21. package/src/breakouts/docs/README.md +643 -0
  22. package/src/controls-options-manager/docs/README.md +365 -0
  23. package/src/hashTree/docs/README.md +566 -0
  24. package/src/interceptors/docs/README.md +434 -0
  25. package/src/interpretation/docs/README.md +420 -0
  26. package/src/locus-info/docs/README.md +609 -0
  27. package/src/media/docs/README.md +488 -0
  28. package/src/meeting/docs/README.md +834 -0
  29. package/src/meeting-info/docs/README.md +352 -0
  30. package/src/meetings/docs/README.md +549 -0
  31. package/src/member/docs/README.md +347 -0
  32. package/src/members/docs/README.md +514 -0
  33. package/src/metrics/docs/README.md +287 -0
  34. package/src/multistream/docs/README.md +523 -0
  35. package/src/personal-meeting-room/docs/README.md +322 -0
  36. package/src/reachability/docs/README.md +548 -0
  37. package/src/reactions/docs/README.md +296 -0
  38. package/src/reconnection-manager/docs/README.md +485 -0
  39. package/src/recording-controller/docs/README.md +335 -0
  40. package/src/roap/docs/README.md +444 -0
  41. package/src/webinar/docs/README.md +425 -0
  42. package/.sdd/templates/.source.json +0 -30
  43. package/.sdd/templates/component-repo/module-docs/module-spec-quality.md +0 -111
  44. package/.sdd/templates/component-repo/module-docs/module-spec.template.md +0 -321
  45. package/.sdd/templates/component-repo/reference-docs/adr/_adr-example.md +0 -59
  46. package/.sdd/templates/component-repo/reference-docs/patterns/_pattern-example.md +0 -49
  47. package/.sdd/templates/component-repo/reference-docs/rules/_rule-example.md +0 -42
  48. package/.sdd/templates/component-repo/standing-docs/AGENTS.template.md +0 -120
  49. package/.sdd/templates/component-repo/standing-docs/ARCHITECTURE.template.md +0 -206
  50. package/.sdd/templates/component-repo/standing-docs/CONTRACTS.template.md +0 -90
  51. package/.sdd/templates/component-repo/standing-docs/DATA_MODEL.template.md +0 -68
  52. package/.sdd/templates/component-repo/standing-docs/GETTING_STARTED.template.md +0 -111
  53. package/.sdd/templates/component-repo/standing-docs/GLOSSARY.template.md +0 -57
  54. package/.sdd/templates/component-repo/standing-docs/REVIEW_CHECKLIST.template.md +0 -69
  55. package/.sdd/templates/component-repo/standing-docs/RULES.template.md +0 -96
  56. package/.sdd/templates/component-repo/standing-docs/SECURITY.template.md +0 -84
  57. package/.sdd/templates/component-repo/standing-docs/SERVICE_STATE.template.md +0 -82
  58. package/.sdd/templates/component-repo/standing-docs/SPEC_INDEX.template.md +0 -94
  59. package/.sdd/templates/component-repo/standing-docs/TEST_INDEX.template.md +0 -64
  60. package/.sdd/templates/component-repo/template-map.json +0 -112
  61. package/ai-docs/ARCHITECTURE.md +0 -208
  62. package/ai-docs/CONTRACTS.md +0 -267
  63. package/ai-docs/DATA_MODEL.md +0 -64
  64. package/ai-docs/GETTING_STARTED.md +0 -73
  65. package/ai-docs/GLOSSARY.md +0 -56
  66. package/ai-docs/REVIEW_CHECKLIST.md +0 -45
  67. package/ai-docs/RULES.md +0 -79
  68. package/ai-docs/SECURITY.md +0 -74
  69. package/ai-docs/SERVICE_STATE.md +0 -59
  70. package/ai-docs/SPEC_INDEX.md +0 -85
  71. package/ai-docs/TEST_INDEX.md +0 -45
  72. package/ai-docs/adr/0001-migrate-existing-docs-into-sdd.md +0 -61
  73. package/ai-docs/patterns/defensive-error-propagation.md +0 -55
  74. package/ai-docs/patterns/event-scope-emission.md +0 -46
  75. package/ai-docs/patterns/source-to-test-path-mirroring.md +0 -45
  76. package/ai-docs/patterns/stateless-plugin-request-classes.md +0 -53
  77. package/ai-docs/patterns/typed-constants-and-enum-values.md +0 -47
  78. package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +0 -223
  79. package/src/annotation/ai-docs/annotation-spec.md +0 -236
  80. package/src/breakouts/ai-docs/breakouts-spec.md +0 -324
  81. package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +0 -243
  82. package/src/hashTree/ai-docs/hash-tree-spec.md +0 -267
  83. package/src/interceptors/ai-docs/interceptors-spec.md +0 -247
  84. package/src/interpretation/ai-docs/interpretation-spec.md +0 -256
  85. package/src/locus-info/ai-docs/locus-info-spec.md +0 -293
  86. package/src/media/ai-docs/media-spec.md +0 -267
  87. package/src/meeting/ai-docs/meeting-spec.md +0 -404
  88. package/src/meeting-info/ai-docs/meeting-info-spec.md +0 -261
  89. package/src/meetings/ai-docs/meetings-spec.md +0 -298
  90. package/src/member/ai-docs/member-spec.md +0 -196
  91. package/src/members/ai-docs/members-spec.md +0 -256
  92. package/src/metrics/ai-docs/metrics-spec.md +0 -185
  93. package/src/multistream/ai-docs/multistream-spec.md +0 -295
  94. package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +0 -234
  95. package/src/reachability/ai-docs/reachability-spec.md +0 -261
  96. package/src/reactions/ai-docs/reactions-spec.md +0 -198
  97. package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +0 -272
  98. package/src/recording-controller/ai-docs/recording-controller-spec.md +0 -223
  99. package/src/roap/ai-docs/roap-spec.md +0 -241
  100. package/src/webinar/ai-docs/webinar-spec.md +0 -243
@@ -1,404 +0,0 @@
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-09-08T00:00:00Z
8
- validation_status: pass-with-warnings
9
- -->
10
- # MEETING — 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/meeting/`.
13
-
14
- ## Metadata
15
-
16
- | Field | Value |
17
- |---|---|
18
- | Module id | `meeting` |
19
- | Source path(s) | `src/meeting/` |
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-09-08T00:00:00Z |
25
- | Revalidated against | `b7b93b443e` (manual diff review of `f9a29f61..b7b93b443e`; not a generator/validator tool run) |
26
- | Validation status | pass-with-warnings |
27
-
28
- ## Evidence Rules
29
-
30
- 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.
31
-
32
- ## Source Material Register
33
-
34
- | Source material | Scope | Decision | Detail location or disposition |
35
- |---|---|---|---|
36
- | Retained package README and upgrade guide | overview / API / behavior / tests | used and verified; staged create/join/media/control/end flows and events were reorganized here, with current code correcting old usage details |
37
- | Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
38
-
39
- ## Overview
40
-
41
- `src/meeting/` contains 12 direct source/reference file(s) and has 9 mirrored unit-test file(s). This spec separates its public operations, runtime data movement, component ownership, state applicability, and verification boundary.
42
-
43
- ## Purpose / Responsibility
44
-
45
- Owns one meeting's join/leave lifecycle, Locus projection integration, media, controls, feature controllers, events, and teardown.
46
-
47
- ## Stack
48
-
49
- 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`.
50
-
51
- ## Folder / Package Structure
52
-
53
- ```text
54
- src/meeting/
55
- ├── brbState.ts — state projection or transition logic
56
- ├── connectionStateHandler.ts — state projection or transition logic
57
- ├── in-meeting-actions.ts — in-meeting-actions implementation responsibility
58
- ├── index.ts — module facade/controller or primary exports
59
- ├── locusMediaRequest.ts — request coordination or payload types
60
- ├── muteState.ts — state projection or transition logic
61
- ├── request.ts — HTTP request boundary
62
- ├── request.type.ts — request coordination or payload types
63
- ├── state.ts — state projection or transition logic
64
- ├── type.ts — type implementation responsibility
65
- ├── util.ts — normalization/helper functions
66
- ├── voicea-meeting.ts — voicea-meeting implementation responsibility
67
- └── ai-docs/meeting-spec.md — canonical module specification
68
- ```
69
-
70
- ## Key Files (source of truth)
71
-
72
- | File | Holds |
73
- |---|---|
74
- | `src/meeting/brbState.ts` | state projection or transition logic |
75
- | `src/meeting/connectionStateHandler.ts` | state projection or transition logic |
76
- | `src/meeting/in-meeting-actions.ts` | in-meeting-actions implementation responsibility |
77
- | `src/meeting/index.ts` | module facade/controller or primary exports |
78
- | `src/meeting/locusMediaRequest.ts` | request coordination or payload types |
79
- | `src/meeting/muteState.ts` | state projection or transition logic |
80
- | `src/meeting/request.ts` | HTTP request boundary |
81
- | `src/meeting/request.type.ts` | request coordination or payload types |
82
- | `src/meeting/state.ts` | state projection or transition logic |
83
- | `src/meeting/type.ts` | type implementation responsibility |
84
- | `src/meeting/util.ts` | normalization/helper functions |
85
- | `src/meeting/voicea-meeting.ts` | voicea-meeting implementation responsibility |
86
- | `test/unit/spec/meeting/brbState.ts` and 8 sibling test file(s) | mirrored characterization/unit coverage |
87
-
88
- ## Public Surface
89
-
90
- | Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
91
- |---|---|---|---|---|---|---|
92
- | `meeting.1` | SDK / identity/metrics | `getWebexObject()`, `isLocusCall()`, `correlationId`, `pstnCorrelationId`, `userNameInput`, `emailInput`, `sessionCorrelationId`, `isoLocalClientMeetingJoinTime`, `setCorrelationId()`, `updateCallStateForMetrics()`, `postMetrics()`, and `getCurUserType()` | Expose meeting identity and maintain correlation/call-state context used by requests and telemetry. | Preserve accessor semantics, correlation propagation, and metric field names. | `src/meeting/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
93
- | `meeting.2` | SDK / meeting-info/auth | `injectMeetingInfo()`, `refreshPermissionToken()`, `fetchMeetingInfo()`, `verifyPassword()`, `verifyRegistrationId()`, `refreshCaptcha()`, `parseMeetingInfo()`, `setSelfUserPolicies()`, `setPermissionTokenPayload()`, `setSipUri()`, `getPermissionTokenExpiryInfo()`, and `checkAndRefreshPermissionToken()` | Resolve destination/authentication context before joining and refresh expiring permission state. | Preserve typed meeting-info failures, token ownership, and direct request outcomes. | `src/meeting/index.ts`, `src/meeting-info/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
94
- | `meeting.3` | SDK / members, breakouts, and BRB | `setUpBreakoutsListener()`, `invite()`, `cancelPhoneInvite()`, `cancelInviteByMemberId()`, `admit()`, `beRightBack()`, `remove()`, `mute()`, `transfer()`, and `getMembers()` | Delegate roster/lobby/host operations to Members, bridge breakout events, and route BRB changes through the Meeting-owned `brbState`. | Preserve target member ids, returned promises, scoped event behavior, and BRB's multistream/media-connection guards. | `src/meeting/index.ts`, `src/meeting/brbState.ts`, `src/members/index.ts`, `src/breakouts/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
95
- | `meeting.4` | SDK / Locus/log/event plus module helper | Meeting methods `finalizeMeetingAfterInitialLocusSetup()`, `setLocus()`, `uploadLogs()`, `startPeriodicLogUpload()`, `stopPeriodicLogUpload()`, `setMercuryListener()`, `forwardEvent()`, and `handleDataChannelUrlChange()`; module-level export `storeEventForDebugging()` | Establish composed controller state, own Meeting listener forwarding, and capture/upload meeting diagnostics without presenting the module helper as a Meeting instance method. | Preserve listener/event names, periodic upload lifecycle, and the module-level helper boundary. | `src/meeting/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
96
- | `meeting.5` | SDK / teardown | `unsetRemoteStreams()`, `closeRemoteStream()`, `closeRemoteStreams()`, `cleanupLocalStreams()`, `closePeerConnections()`, `unsetPeerConnections()`, `clearDataChannelToken()`, and `saveDataChannelToken()` | Release or detach the stream, peer-connection, and token resources owned by the Meeting lifecycle. | Keep close versus unset semantics distinct and cleanup idempotent. `closePeerConnections()` resets `sendSlotManager` (unpublishing every send slot) before closing `webrtcMediaConnection`, so each slot detaches its stream event listeners while the connection is still open instead of being abandoned on an already-closed one. | `src/meeting/index.ts`, `src/media/properties.ts`, `src/multistream/sendSlotManager.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
97
- | `meeting.6` | SDK / local mute | `muteAudio()`, `unmuteAudio()`, `muteVideo()`, and `unmuteVideo()` | Apply local audio/video mute intent through the Meeting mute/media state. | Preserve remote-mute/unmute constraints and caller-visible outcomes. | `src/meeting/index.ts`, `src/meeting/muteState.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
98
- | `meeting.7` | SDK / lifecycle/media | `joinWithMedia()`, `reconnect()`, `join()`, `addMedia()`, `canUpdateMedia()`, `updateMedia()`, `acknowledge()`, `decline()`, `buildLeaveFetchRequestOptions()`, `leave()`, `endMeetingForAll()`, and `getMediaConnectionDebugId()` | Drive the join/leave FSM and establish or renegotiate media against current Locus state. | Preserve state guards, request ordering, media options, and rollback/cleanup behavior. | `src/meeting/index.ts`, `src/meeting/request.ts`, `src/meeting/locusMediaRequest.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
99
- | `meeting.8` | SDK / captions/reactions/consent | `isTranscriptionSupported()`, `isReactionsSupported()`, `setCaptionLanguage()`, `setSpokenLanguage()`, `startTranscription()`, `stopTranscription()`, `sendReaction()`, `toggleReactions()`, `extendMeeting()`, and `setPostMeetingDataConsent()` | Expose optional in-meeting collaboration features through their current request/data-channel paths. | Preserve implemented support checks and event values; `setPostMeetingDataConsent()` forwards its request without a local feature/capability check. | `src/meeting/index.ts`, `src/reactions/reactions.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
100
- | `meeting.9` | SDK / telephony/move | `usePhoneAudio()`, `disconnectPhoneAudio()`, `moveTo()`, `moveFrom()`, `sendDTMF()`, `sipCallOut()`, and `cancelSipCallOut()` | Switch audio devices/meetings and operate PSTN/SIP signaling within the current meeting. | Preserve correlation/participant context and direct request failures. | `src/meeting/index.ts`, `src/meeting/request.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
101
- | `meeting.10` | SDK / meeting controls | `startRecording()`, `stopRecording()`, `pauseRecording()`, `resumeRecording()`, `setMuteOnEntry()`, `setDisallowUnmute()`, `setMuteAll()`, `lockMeeting()`, `unlockMeeting()`, `changeVideoLayout()`, and `setRemoteQualityLevel()` | Delegate recording, meeting-control, layout, and remote-quality actions to their owning controller/request. | Preserve capability checks, action values, and service-vs-Locus routing. | `src/meeting/index.ts`, `src/recording-controller/index.ts`, `src/controls-options-manager/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
102
- | `meeting.11` | SDK / share/publication | `startWhiteboardShare()`, `stopWhiteboardShare()`, `enableMusicMode()`, `setSendNamedMediaGroup()`, `publishStreams()`, and `unpublishStreams()` | Start/stop whiteboard sharing and configure/publish/unpublish local media-core streams. | Preserve explicit stream lists, publication state, and share cleanup reasons. | `src/meeting/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
103
- | `meeting.12` | SDK / stage/LLM/data channel | `setStage()`, `unsetStage()`, `notifyHost()`, `updateLLMConnection()`, `refreshDataChannelToken()`, and `getDataChannelTokenType()` | Manage stage synchronization, host notification, and meeting data-channel authorization/connection state. | Preserve stage payload options and token-type selection; `refreshDataChannelToken()` logs request failure and resolves `null` rather than rejecting. `updateLLMConnection()` still disconnects/cleans up a mismatched or not-joined existing `llmChannel` first, but requires `locusInfo.url` and `locusInfo.info.datachannelUrl` to both be populated before creating or registering a *new* `llmChannel`; if either is missing after cleanup it resolves `undefined` without creating one, and `handleDataChannelUrlChange()` re-invokes it once `MEETING_INFO_UPDATED` supplies the real `datachannelUrl`. | `src/meeting/index.ts`, `src/meeting/request.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
104
- | `meeting.13` | exported helper classes | `BrbState.enable()` / `handleServerBrbUpdate()`; `LocusMediaRequest.send()` / `isConfluenceCreated()` / `downgradeFromMultistreamToTranscoded()`; `MuteState.init()`, `handleLocalStreamChange()`, `enable()`, `handleLocalStreamMuteStateChange()`, `applyClientStateLocally()`, `handleServerRemoteMuteUpdate()`, `handleServerLocalUnmuteRequired()`, `isMuted()`, `isRemotelyMuted()`, `isUnmuteAllowed()`, and `isLocallyMuted()` | Separate BRB, mute, and Locus-media mechanics from the main Meeting facade. | Preserve helper state transitions and media-request contract shapes. | `src/meeting/brbState.ts`, `src/meeting/locusMediaRequest.ts`, `src/meeting/muteState.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
105
- | `meeting.14` | exported request adapter | `MeetingRequest.joinMeeting()`, `getLocusDTO()`, `prepareLeaveMeetingRequestOptions()`, `leaveMeeting()`, `buildLeaveMeetingRequestOptions()`, `acknowledgeMeeting()`, `lockMeeting()`, `declineMeeting()`, `changeMeetingFloor()`, `sendDTMF()`, `changeVideoLayout()`, `endMeetingForAll()`, `keepAlive()`, `sendReaction()`, `extendMeeting()`, `toggleReactions()`, `getLocusStatusByUrl()`, `setBrb()`, `setPostMeetingDataConsent()`, `synchronizeStage()`, `notifyHost()`, `sipCallOut()`, `cancelSipCallOut()`, and `fetchDatachannelToken()` | Provide the direct Locus/request boundary used by Meeting operations. | Preserve per-method HTTP outcomes: missing data-channel token inputs reject, while a token transport failure is caught and resolves `null`; other adapters retain their implemented response/rejection behavior. | `src/meeting/request.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
106
- | `meeting.15` | exported contracts | `createBrbState`, `BrbState`, `ConnectionStateEvent`, `ConnectionStateChangedEvent`, `ConnectionStateHandler`, `InMeetingActions`, `CaptionData`, `Transcription`, `LocalStreams`, `AddMediaOptions`, `AdditionalMediaOptions`, `CallStateForMetrics`, `MEDIA_UPDATE_TYPE`, `ScreenShareFloorStatus`, `RequestResult`, `RoapRequest`, `LocalMuteRequest`, `Request`, `Config`, `MediaRequestType`, `LocusMediaRequest`, `createMuteState`, `MuteState`, `MeetingRequest`, `SendReactionOptions`, `ToggleReactionsOptions`, `BrbOptions`, `PostMeetingDataConsentOptions`, `StageCustomLogoPositions`, `StageNameLabelType`, `StageCustomBackground`, `StageCustomLogo`, `StageCustomNameLabel`, `SetStageOptions`, `SetStageVideoLayout`, `UnsetStageVideoLayout`, `fetchDataChannelTokenOptions`, `SynchronizeVideoLayout`, `Invitee`, `getSpeaker()`, `getSpeakerFromProxyOrStore()`, and `processNewCaptions()` | Share the exact state, option, request, stage, caption, speaker, and event vocabulary used by Meeting consumers and helpers. | Add fields/options compatibly; existing raw media-update, screen-share, layout, and request values are observable contracts. | `src/meeting/index.ts`, `src/meeting/brbState.ts`, `src/meeting/connectionStateHandler.ts`, `src/meeting/in-meeting-actions.ts`, `src/meeting/locusMediaRequest.ts`, `src/meeting/muteState.ts`, `src/meeting/request.ts`, `src/meeting/type.ts`, `src/meeting/request.type.ts`, `src/meeting/state.ts`, `src/meeting/util.ts`, `src/meeting/voicea-meeting.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
107
- | `meeting.16` | SDK / negotiation/keepalive | `handleRoapFailure()`, `roapMessageReceived()`, `setupSdpListeners()`, `setupMediaConnectionListeners()`, `setupStatsAnalyzerEventHandlers()`, `mediaNegotiatedEvent()`, `processNextQueuedMediaUpdate()`, `clearMeetingData()`, `startKeepAlive()`, and `stopKeepAlive()` | Coordinate ROAP/media event listeners, queued renegotiation, meeting-data reset, and Locus keepalive around the main lifecycle. | Preserve queue ordering, listener ownership, and keepalive timer cleanup. | `src/meeting/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
108
-
109
- ### Emitted events
110
-
111
- 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.
112
-
113
- | Event literal | Constant / expression | Emission evidence |
114
- |---|---|---|
115
- | `meeting:caption-received` | `EVENT_TRIGGERS.MEETING_CAPTION_RECEIVED` | `src/meeting/index.ts` |
116
- | `meeting:embeddedApps:update` | `EVENT_TRIGGERS.MEETING_EMBEDDED_APPS_UPDATE` | `src/meeting/index.ts` |
117
- | `meeting:entryExitTone:update` | `EVENT_TRIGGERS.MEETING_ENTRY_EXIT_TONE_UPDATE` | `src/meeting/index.ts` |
118
- | `meeting:locked` | `EVENT_TRIGGERS.MEETING_LOCKED` | `src/meeting/index.ts` |
119
- | `meeting:locus:locusUrl:update` | `EVENT_TRIGGERS.MEETING_LOCUS_URL_UPDATE` | `src/meeting/index.ts` |
120
- | `meeting:manualCaptionControl:updated` | `EVENT_TRIGGERS.MEETING_MANUAL_CAPTION_UPDATED` | `src/meeting/index.ts` |
121
- | `meeting:media:local:start` | `EVENT_TRIGGERS.MEETING_MEDIA_LOCAL_STARTED` | `src/meeting/index.ts` |
122
- | `meeting:media:remote:start` | `EVENT_TRIGGERS.MEETING_MEDIA_REMOTE_STARTED` | `src/meeting/index.ts` |
123
- | `meeting:meetingContainer:update` | `EVENT_TRIGGERS.MEETING_MEETING_CONTAINER_UPDATE` | `src/meeting/index.ts` |
124
- | `meeting:participant-reason-changed` | `EVENT_TRIGGERS.MEETING_PARTICIPANT_REASON_CHANGED` | `src/meeting/index.ts` |
125
- | `meeting:receiveTranscription:started` | `EVENT_TRIGGERS.MEETING_STARTED_RECEIVING_TRANSCRIPTION` | `src/meeting/index.ts` |
126
- | `meeting:receiveTranscription:stopped` | `EVENT_TRIGGERS.MEETING_STOPPED_RECEIVING_TRANSCRIPTION` | `src/meeting/index.ts` |
127
- | `meeting:recording:paused` | `EVENT_TRIGGERS.MEETING_PAUSED_RECORDING` | `src/meeting/index.ts` |
128
- | `meeting:recording:resumed` | `EVENT_TRIGGERS.MEETING_RESUMED_RECORDING` | `src/meeting/index.ts` |
129
- | `meeting:recording:started` | `EVENT_TRIGGERS.MEETING_STARTED_RECORDING` | `src/meeting/index.ts` |
130
- | `meeting:recording:stopped` | `EVENT_TRIGGERS.MEETING_STOPPED_RECORDING` | `src/meeting/index.ts` |
131
- | `meeting:resourceLinks:update` | `EVENT_TRIGGERS.MEETING_RESOURCE_LINKS_UPDATE` | `src/meeting/index.ts` |
132
- | `meeting:ringing` | `EVENT_TRIGGERS.MEETING_RINGING` | `src/meeting/state.ts` |
133
- | `meeting:ringingStop` | `EVENT_TRIGGERS.MEETING_RINGING_STOP` | `src/meeting/state.ts` |
134
- | `meeting:self:brbUpdate` | `EVENT_TRIGGERS.MEETING_SELF_BRB_UPDATE` | `src/meeting/index.ts` |
135
- | `meeting:self:cannotViewParticipantList` | `EVENT_TRIGGERS.MEETING_SELF_CANNOT_VIEW_PARTICIPANT_LIST` | `src/meeting/index.ts` |
136
- | `meeting:self:guestAdmitted` | `EVENT_TRIGGERS.MEETING_SELF_GUEST_ADMITTED` | `src/meeting/index.ts` |
137
- | `meeting:self:isSharingBlocked` | `EVENT_TRIGGERS.MEETING_SELF_IS_SHARING_BLOCKED` | `src/meeting/index.ts` |
138
- | `meeting:self:left` | `EVENT_TRIGGERS.MEETING_SELF_LEFT` | `src/meeting/index.ts` |
139
- | `meeting:self:lobbyWaiting` | `EVENT_TRIGGERS.MEETING_SELF_LOBBY_WAITING` | `src/meeting/index.ts` |
140
- | `meeting:self:mutedByOthers` | `EVENT_TRIGGERS.MEETING_SELF_MUTED_BY_OTHERS` | `src/meeting/index.ts` |
141
- | `meeting:self:phoneAudioUpdate` | `EVENT_TRIGGERS.MEETING_SELF_PHONE_AUDIO_UPDATE` | `src/meeting/index.ts` |
142
- | `meeting:self:requestedToUnmute` | `EVENT_TRIGGERS.MEETING_SELF_REQUESTED_TO_UNMUTE` | `src/meeting/index.ts` |
143
- | `meeting:self:rolesChanged` | `EVENT_TRIGGERS.MEETING_SELF_ROLES_CHANGED` | `src/meeting/index.ts` |
144
- | `meeting:self:unmutedByOthers` | `EVENT_TRIGGERS.MEETING_SELF_UNMUTED_BY_OTHERS` | `src/meeting/index.ts` |
145
- | `meeting:self:videoMutedByOthers` | `EVENT_TRIGGERS.MEETING_SELF_VIDEO_MUTED_BY_OTHERS` | `src/meeting/index.ts` |
146
- | `meeting:self:videoUnmutedByOthers` | `EVENT_TRIGGERS.MEETING_SELF_VIDEO_UNMUTED_BY_OTHERS` | `src/meeting/index.ts` |
147
- | `media:remoteAudio:created` | `EVENT_TRIGGERS.REMOTE_MEDIA_AUDIO_CREATED` | `src/meeting/index.ts` |
148
- | `media:remoteInterpretationAudio:created` | `EVENT_TRIGGERS.REMOTE_MEDIA_INTERPRETATION_AUDIO_CREATED` | `src/meeting/index.ts` |
149
- | `media:remoteScreenShareAudio:created` | `EVENT_TRIGGERS.REMOTE_MEDIA_SCREEN_SHARE_AUDIO_CREATED` | `src/meeting/index.ts` |
150
- | `media:remoteVideo:layoutChanged` | `EVENT_TRIGGERS.REMOTE_MEDIA_VIDEO_LAYOUT_CHANGED` | `src/meeting/index.ts` |
151
- | `meeting:srtpCipher:updated` | `EVENT_TRIGGERS.MEETING_SRTP_CIPHER_UPDATED` | `src/meeting/index.ts` |
152
- | `meeting:startedSharingLocal` | `EVENT_TRIGGERS.MEETING_STARTED_SHARING_LOCAL` | `src/meeting/index.ts` |
153
- | `meeting:startedSharingRemote` | `EVENT_TRIGGERS.MEETING_STARTED_SHARING_REMOTE` | `src/meeting/index.ts` |
154
- | `meeting:startedSharingWhiteboard` | `EVENT_TRIGGERS.MEETING_STARTED_SHARING_WHITEBOARD` | `src/meeting/index.ts` |
155
- | `meeting:stateChange` | `EVENT_TRIGGERS.MEETING_STATE_CHANGE` | `src/meeting/index.ts` |
156
- | `meeting:stoppedSharingRemote` | `EVENT_TRIGGERS.MEETING_STOPPED_SHARING_REMOTE` | `src/meeting/index.ts` |
157
- | `meeting:stoppedSharingWhiteboard` | `EVENT_TRIGGERS.MEETING_STOPPED_SHARING_WHITEBOARD` | `src/meeting/index.ts` |
158
- | `meeting:streamPublishStateChanged` | `EVENT_TRIGGERS.MEETING_STREAM_PUBLISH_STATE_CHANGED` | `src/meeting/index.ts` |
159
- | `meeting:transcription:connected` | `EVENT_TRIGGERS.MEETING_TRANSCRIPTION_CONNECTED` | `src/meeting/index.ts` |
160
- | `meeting:transcription:spokenLanguageUpdate` | `EVENT_TRIGGERS.MEETING_TRANSCRIPTION_SPOKEN_LANGUAGE_UPDATED` | `src/meeting/index.ts` |
161
- | `meeting:unlocked` | `EVENT_TRIGGERS.MEETING_UNLOCKED` | `src/meeting/index.ts` |
162
- | `network:connected` | `EVENT_TRIGGERS.MEETINGS_NETWORK_CONNECTED` | `src/meeting/index.ts` |
163
- | `network:disconnected` | `EVENT_TRIGGERS.MEETINGS_NETWORK_DISCONNECTED` | `src/meeting/index.ts`, `src/meetings/index.ts` |
164
- | `network:quality` | `EVENT_TRIGGERS.NETWORK_QUALITY` | `src/meeting/index.ts` |
165
-
166
- Compatibility notes:
167
- - 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.
168
-
169
- ## Requires (dependencies)
170
-
171
- Meetings host, LocusInfo, Members, meeting requests, media/ROAP/multistream, reconnection, reachability, feature controllers, Webex services, and metrics.
172
-
173
- ## Requirements
174
-
175
- | ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
176
- |---|---|---|---|---|---|---|
177
- | `MEETING-R-001` | join, acknowledge, leave, and end-for-all lifecycle. | Owns one meeting's join/leave lifecycle, Locus projection integration, media, controls, feature controllers, events, and teardown. | `src/meeting/index.ts` | `test/unit/spec/meeting/index.js` | none | PRESENT |
178
- | `MEETING-R-002` | add/update/stop media and local/remote stream state. | Media establishment/update and stream teardown must follow lifecycle state so a failed transition does not leak resources. | `src/meeting/index.ts`, `src/meeting/request.ts` | `test/unit/spec/meeting/index.js` | queued media update during leave/reconnect needs explicit ordering coverage | PRESENT |
179
- | `MEETING-R-003` | Typed join/media/control failures remain caller-visible. Successful leave and the Meetings-owned destroy path both invoke `MeetingUtil.cleanUp()`, which closes remote streams/peer connections and detaches local-stream state. Before leave/end requests, `stopListeningForMeetingEvents()` removes the LLM, bound Mercury `ONLINE`/`OFFLINE`, transcription, and annotation listeners it owns; it does not remove the LocusInfo listener set, which can still process Locus-driven triggers while the request is in flight. FSM `fail(error)` transitions to `ERROR` and supplies the error to `onEnterError`. | Callers must receive the actual failure outcome, and partial pre-request listener teardown must not be described as cleanup of every Meeting listener or attributed to a nonexistent `Meeting.destroy()`/`stopMedia()` method. | `src/meeting/index.ts`, `src/meeting/util.ts`, `src/meeting/state.ts`, `src/meetings/index.ts` | `test/unit/spec/meeting/index.js`, `test/unit/spec/meeting/connectionStateHandler.ts` | characterize LocusInfo callbacks that arrive between listener subset teardown and leave/end settlement | PRESENT |
180
- | `MEETING-R-004` | Join applies returned Locus state and can complete before media is added or ready. | The retained staged lifecycle and current code allow signaling participation without conflating it with WebRTC readiness. | `src/meeting/index.ts`, `src/meeting/request.ts` | `test/unit/spec/meeting/index.js`, `test/unit/spec/meeting/request.js` | none | PRESENT |
181
- | `MEETING-R-005` | Media setup uses provided/acquired local streams, negotiates signaling, and emits media readiness/stopped outcomes by media type. | Consumers attach media asynchronously and need local, remote audio/video, and remote-share distinctions. | `src/meeting/index.ts`, `src/media/index.ts` | `test/unit/spec/meeting/index.js`, `test/unit/spec/media/index.ts` | none | PRESENT |
182
- | `MEETING-R-006` | Locus updates refresh members, actions, lock/recording/share/self state, and composed feature controllers before scoped consumer events. | Consumers require one coherent per-meeting projection rather than unrelated raw event payloads. | `src/meeting/index.ts`, `src/locus-info/index.ts` | `test/unit/spec/meeting/index.js`, `test/unit/spec/locus-info/index.js` | none | PRESENT |
183
- | `MEETING-R-007` | Locking, host transfer, recording, mute, share, reactions, BRB, stage, DTMF, and end-for-all operations use current capability/role and request contracts. | These are privileged or state-sensitive mutations and invalid exposure leads to server rejection or incorrect UI actions. | `src/meeting/index.ts`, `src/meeting/request.ts`, `src/meeting/in-meeting-actions.ts` | `test/unit/spec/meeting/index.js`, `test/unit/spec/meeting/request.js`, `test/unit/spec/meeting/in-meeting-actions.ts` | none | PRESENT |
184
- | `MEETING-R-008` | `MeetingUtil.cleanUp()` closes remote streams and peer connections, detaches local streams, resets reconnection/media state, stops keepalive, and cleans breakout/webinar/interpretation/Locus/LLM resources. Before leave/end, `stopListeningForMeetingEvents()` removes only LLM, the meeting's bound Mercury `ONLINE`/`OFFLINE`, transcription, and annotation listeners; LocusInfo listeners remain until later cleanup. Meetings-owned destroy delegates to `MeetingUtil.cleanUp()`. `closePeerConnections()` resets (unpublishes) every `sendSlotManager` slot before closing `webrtcMediaConnection`; a slot reset after the connection is closed would abandon it still subscribed to its last published stream's track-change events, and that stream object can be reused by a later meeting instance. | Partially initialized or recovered calls otherwise leak resources, while accurately scoping the pre-request subset avoids a false guarantee that no Locus-driven callback can run during leave/end. Unpublishing send slots before the connection closes prevents an abandoned slot's sender (bound to the now-closing connection) from later throwing when a reused stream's track changes. | `src/meeting/index.ts`, `src/meeting/util.ts`, `src/meetings/index.ts`, `src/multistream/sendSlotManager.ts` | `test/unit/spec/meeting/index.js`, `test/unit/spec/meeting/connectionStateHandler.ts`, `test/unit/spec/multistream/sendSlotManager.ts` | verify integration cleanup for every optional controller and the in-flight LocusInfo-listener window | PRESENT |
185
- | `MEETING-R-009` | `joinWithMedia()` retries only when the call is not 1-1 and either `retryCount < 1` or the error is a `UserNotJoinedError`/Locus-dropped-us error under `JOIN_WITH_MEDIA_RETRY_MAX_COUNT`. Retry is then forced off for definitively non-transient failures: SDP-offer-creation errors, WebRTC-API-not-available errors, browser media errors, and `LOCUS_USER_FULL` (`error.error.body.errorCode === 2423001`, matched by the private `isLocusUserFullError()`). On the terminal path the thrown error is the current `error` when it is `LOCUS_USER_FULL`, otherwise the retained `firstError ?? error`. | Retrying a full Locus consumes attempts and delays the caller for a failure that cannot change, and a capacity error must reach the consumer verbatim, so it deliberately outranks any earlier retryable error that would otherwise be surfaced as `firstError`. | `src/meeting/index.ts`, `src/locus-info/types.ts` | `test/unit/spec/meeting/index.js` | none | PRESENT |
186
- | `MEETING-R-010` | `processNewCaptions()` treats a final caption whose `transcriptId` has no recorded interim list as valid: it reads `transcriptData.interimCaptions[transcriptId] ?? []`, so no interim captions are spliced, the key is deleted, `captionData.id` becomes the bare `transcriptId`, and the final caption is appended. | A final-only transcript is a normal upstream case, not corrupt input; indexing the missing interim list directly would throw inside the caption pipeline and drop the caption for the consumer. | `src/meeting/voicea-meeting.ts` | `test/unit/spec/meeting/voicea-meeting.ts` | none | PRESENT |
187
- | `MEETING-R-011` | `updateLLMConnection()` first runs its existing-channel reuse/cleanup logic unchanged: a mismatched-URL or not-joined `llmChannel` is still disconnected via `cleanupLLMConneciton()` regardless of whether the new `locusInfo.url`/`locusInfo.info.datachannelUrl` are populated. Only after that does it require both to be non-empty before creating or registering a *new* `llmChannel`; if either is missing — e.g. a lobby-transition event (`SELF_UNADMITTED_GUEST`/`SELF_ADMITTED_GUEST`) fires before Locus has synced them on rejoin — it resolves `undefined` without creating one. `handleDataChannelUrlChange()` re-invokes `updateLLMConnection()` once `MEETING_INFO_UPDATED` delivers the real `datachannelUrl`. | Registering a new channel with an empty data-channel URL throws inside the request/service-interceptor layer; the un-awaited lobby-event call sites do not catch that rejection, so it previously surfaced as an uncaught error during meeting rejoin. Skipping only the creation step — not the cleanup of a stale channel — avoids that failure while still preventing a left-behind session from continuing to receive events while the user waits in the lobby. | `src/meeting/index.ts` | `test/unit/spec/meeting/index.js` | none | PRESENT |
188
-
189
- ## Design Overview
190
-
191
- `Meeting` orchestrates join/leave, controls, media, Locus, members, feature controllers, and metrics. `state.ts` is the package lifecycle FSM; request and media helpers own remote calls, while specialized files own mute, BRB, connection, in-meeting actions, and Voicea behavior.
192
-
193
- ## Data Flow
194
-
195
- ```mermaid
196
- flowchart LR
197
- Consumer[SDK consumer] --> Meeting[index.ts]
198
- Meeting --> FSM[state.ts]
199
- Meeting --> Request[request.ts / locusMediaRequest.ts]
200
- Request --> Locus[Locus and media services]
201
- Locus --> LocusInfo[src/locus-info]
202
- LocusInfo --> Meeting
203
- Meeting --> Media[src/media / src/roap / src/multistream]
204
- Meeting --> Features[members / breakouts / webinar / interpretation / annotation]
205
- Meeting --> Events[meeting-scoped events]
206
- ```
207
-
208
- ## Sequence Diagram(s)
209
-
210
- Sequence coverage:
211
-
212
- | Operation group | Diagram | Failure coverage |
213
- |---|---|---|
214
- | UC-1…UC-8 — meeting lifecycle and feature operation groups | Meeting lifecycle and feature primary sequence | join/media/control rejection, lifecycle rollback, queued update ordering, and resource cleanup |
215
- | UC-1…UC-8 — meeting lifecycle and feature alternate/failure paths | Meeting lifecycle and feature alternate/failure sequence | invalid lifecycle transition, Locus request rejection, media negotiation failure, permission/capability denial, or teardown race |
216
-
217
- ### Meeting lifecycle and feature primary sequence
218
-
219
- ```mermaid
220
- sequenceDiagram
221
- participant C as Consumer
222
- participant M as Meeting
223
- participant S as state.ts
224
- participant U as MeetingUtil util.ts
225
- participant R as MeetingRequest request.ts
226
- participant L as Locus
227
- C->>M: join(options)
228
- M->>S: ring transition when not already ringing
229
- M->>U: joinMeetingOptions(this, options)
230
- U->>R: joinMeeting(request options)
231
- R->>L: HTTP Locus operation
232
- L-->>R: Locus DTO or rejection
233
- R-->>U: Locus response or rejection
234
- U-->>M: join result or mapped join error
235
- M->>S: join transition after successful Locus response
236
- M->>M: update LocusInfo, members, media, and features
237
- M-->>C: join result and scoped events
238
- ```
239
-
240
- ### Meeting lifecycle and feature alternate/failure sequence
241
-
242
- ```mermaid
243
- sequenceDiagram
244
- participant C as Consumer
245
- participant M as Meeting
246
- participant F as Meeting FSM
247
- participant L as Locus / media operation
248
- C->>M: join, media/control action, leave, or endMeetingForAll
249
- M->>F: validate lifecycle transition
250
- alt accepted lifecycle operation
251
- M->>L: perform Locus/media operation
252
- L-->>M: result or failure
253
- M-->>C: returned promise and scoped meeting events
254
- else invalid transition or capability/permission denial
255
- M--xC: typed rejection without a successful transition
256
- end
257
- ```
258
-
259
- ## Class / Component Relationships
260
-
261
- ```mermaid
262
- classDiagram
263
- class Consumer
264
- class Meeting
265
- class FSM
266
- class Request
267
- class Locus
268
- class LocusInfo
269
- class Media
270
- class Features
271
- class Events
272
- Consumer --> Meeting
273
- Meeting --> FSM
274
- Meeting --> Request
275
- Request --> Locus
276
- Locus --> LocusInfo
277
- LocusInfo --> Meeting
278
- Meeting --> Media
279
- Meeting --> Features
280
- Meeting --> Events
281
- ```
282
-
283
- The arrows identify ownership and delegation inside `src/meeting/`; files that only declare types or constants are not presented as transports.
284
-
285
- ## Use Cases
286
-
287
- - **UC-1:** Resolve meeting info, password/registration/captcha, and permission-token context before joining, preserving typed lookup/authentication failures. Evidence: `src/meeting/index.ts`, `src/meeting-info/index.ts`.
288
- - **UC-2:** Join, acknowledge, decline, leave, reconnect, or end-for-all through the lifecycle FSM while reconciling accepted Locus state into composed controllers. Evidence: `src/meeting/index.ts`, `src/meeting/request.ts`.
289
- - **UC-3:** Add or update media, publish/unpublish local streams, mute/unmute audio/video, and cleanly close/detach remote/local media resources. Evidence: `src/meeting/index.ts`, `src/media/properties.ts`, `src/meeting/muteState.ts`.
290
- - **UC-4:** Invite, admit, remove, mute, transfer, or retrieve members; bridge breakout events; and apply BRB through `brbState.enable()` after multistream/media-connection guards. Evidence: `src/meeting/index.ts`, `src/meeting/brbState.ts`, `src/members/index.ts`, `src/breakouts/index.ts`.
291
- - **UC-5:** Start/stop/pause/resume recording, update entry/mute controls, lock/unlock, change layout, and select remote quality through the owning controller. Evidence: `src/meeting/index.ts`, `src/recording-controller/index.ts`, `src/controls-options-manager/index.ts`.
292
- - **UC-6:** Send reactions, configure captions/languages, start/stop transcription, or extend the meeting under their implemented checks; forward post-meeting consent directly without inventing a local feature gate. Evidence: `src/meeting/index.ts`, `src/reactions/reactions.ts`.
293
- - **UC-7:** Switch to/from phone audio, move between meetings, send DTMF, or initiate/cancel SIP call-out while retaining correlation context. Evidence: `src/meeting/index.ts`, `src/meeting/request.ts`.
294
- - **UC-8:** Synchronize stage, notify host, refresh the data-channel token, and update the LLM connection while preserving Meeting-owned listener/token cleanup. Evidence: `src/meeting/index.ts`, `src/meeting/request.ts`.
295
-
296
- ## State Model
297
-
298
- Identity, meeting/locus state, members, local and remote streams, media connection, mute/share/BRB/control state, feature controllers, timers, and correlation identifiers are meeting-scoped.
299
-
300
- ## Business Rules & Invariants
301
-
302
- - Remote Locus state remains authoritative; `MeetingUtil.cleanUp()` owns media/resource closure for successful leave and Meetings-owned destroy. Before leave/end, `stopListeningForMeetingEvents()` removes the LLM/Mercury/transcription/annotation subset but not LocusInfo listeners; privileged operations require current capability/role data. Enforced by `src/meeting/index.ts`, `src/meeting/util.ts`, and `src/meetings/index.ts`.
303
-
304
- ## Concurrency & Reactive Flow
305
-
306
- - Meeting lifecycle work is serialized through the meeting FSM and current Locus/media state. Failure transitions receive their error payload; successful leave and Meetings-owned destroy use `MeetingUtil.cleanUp()`. Leave/end remove the LLM, bound Mercury, transcription, and annotation listener subset before the Locus operation, but LocusInfo listeners are not part of that method and can still process Locus-driven callbacks until later cleanup.
307
-
308
- ## State Machine
309
-
310
- ```mermaid
311
- stateDiagram-v2
312
- [*] --> IDLE
313
- IDLE --> RINGING: ring
314
- ERROR --> RINGING: ring
315
- JOINED --> RINGING: ring
316
- IDLE --> JOINED: join
317
- RINGING --> JOINED: join
318
- ERROR --> JOINED: join
319
- JOINED --> JOINED: join
320
- JOINED --> ANSWERED: remote answered
321
- JOINED --> DECLINED: remote declined
322
- JOINED --> ERROR: remote has neither result / fail
323
- ERROR --> ANSWERED: remote answered
324
- ERROR --> DECLINED: remote declined
325
- ERROR --> ERROR: remote has neither result / fail
326
- IDLE --> ENDED: leave / end
327
- RINGING --> ENDED: leave / decline / end
328
- JOINED --> ENDED: leave / end
329
- ANSWERED --> ENDED: leave / end
330
- DECLINED --> ENDED: leave / end
331
- ERROR --> ENDED: leave / decline / end
332
- IDLE --> ERROR: fail
333
- RINGING --> ERROR: fail
334
- ANSWERED --> ERROR: fail
335
- DECLINED --> ERROR: fail
336
- ENDED --> ERROR: fail
337
- IDLE --> IDLE: reset
338
- RINGING --> IDLE: reset
339
- JOINED --> IDLE: reset
340
- ANSWERED --> IDLE: reset
341
- DECLINED --> IDLE: reset
342
- ENDED --> IDLE: reset
343
- ERROR --> IDLE: reset
344
- ```
345
-
346
- The diagram follows the `MEETING_STATE_MACHINE` values and transition table implemented in `src/meeting/state.ts`.
347
-
348
- ## Protocol / Wire Format
349
-
350
- - External payloads are parsed/serialized by files under `src/meeting/` 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.
351
-
352
- ## Error Handling & Failure Modes
353
-
354
- | Condition | Signal | Caller recovery |
355
- |---|---|---|
356
- | Lifecycle transition is invalid or a required permission/capability is absent | The public operation rejects and does not report a successful transition. | Refresh current meeting state/capabilities before issuing another operation. |
357
- | Locus or media negotiation fails | The returned promise rejects with the typed/current failure and the FSM failure path preserves the error for meeting failure handling. | Handle the error; start a new operation only if current meeting state permits it. |
358
- | Data-channel token inputs are missing or retrieval fails | `MeetingRequest.fetchDatachannelToken()` rejects for missing Locus/participant ids but catches transport failure and returns `null`; `refreshDataChannelToken()` also logs and returns `null`. | Branch on `null` before using token fields; do not handle transport failure as a rejected refresh promise. |
359
- | Post-meeting consent is requested | `setPostMeetingDataConsent()` forwards the supplied boolean and current Locus/device/self context without a local feature or capability check. | Treat server/request outcome as authoritative; do not rely on a client-side eligibility rejection. |
360
- | Successful leave or Meetings-owned destroy runs while media/listeners/controllers are owned | `MeetingUtil.cleanUp()` closes remote streams/peer connections and cleans feature/reconnection/keepalive state. Before leave/end, only the LLM, bound Mercury, transcription, and annotation subset is stopped; LocusInfo listeners can remain active until later cleanup. `closePeerConnections()` resets `sendSlotManager` (unpublishing every slot) before closing the connection, so a slot cannot remain subscribed to a stream that a later meeting instance reuses. | Do not assume pre-request teardown suppresses every Locus-driven callback, and do not reuse a removed meeting instance. |
361
- | `joinWithMedia()` fails because the Locus is full | `isLocusUserFullError()` matches `errorCode` `2423001`, retry is suppressed, `leave()` runs if the join had succeeded, and that error is thrown in preference to any retained `firstError`. | Surface the capacity error to the user; do not re-issue `joinWithMedia()` expecting a different outcome. |
362
- | `updateLLMConnection()` runs before `locusInfo.url`/`locusInfo.info.datachannelUrl` have synced for this meeting (e.g., a lobby-transition event firing on rejoin before Locus resyncs) | Existing-channel cleanup still runs first — a mismatched-URL or not-joined `llmChannel` is disconnected via `cleanupLLMConneciton()` regardless. The method then resolves `undefined` immediately and does not create/register a new `llmChannel` with the empty urls. | No caller action needed; `handleDataChannelUrlChange()` re-invokes `updateLLMConnection()` once `MEETING_INFO_UPDATED` supplies the real `datachannelUrl`. |
363
- | A final caption arrives with no preceding interim captions for its `transcriptId` | `processNewCaptions()` substitutes an empty interim list, appends the final caption under the bare `transcriptId`, and does not throw. | Consume the appended final caption normally. |
364
-
365
- ## Pitfalls
366
-
367
- - Joining and adding media are distinct stages. A join can succeed before streams are ready, and teardown must handle partially initialized media.
368
- - Public behavior may be reachable through a parent `Meeting`/`Meetings` object even when the source helper is not exported directly.
369
-
370
- ## Module Do's / Don'ts
371
-
372
- - DO preserve this boundary: Join and leave through the lifecycle FSM while reconciling accepted Locus state into composed controllers.
373
- - DON'T move remote I/O or lifecycle ownership into a passive type, constant, catalog, or normalization file.
374
-
375
- ## Host Integration & Theming
376
-
377
- The Webex SDK host supplies initialized request/device/Mercury/media capabilities and exposes this behavior through `webex.meetings` or its Meeting objects. The module renders no UI and has no theme contract.
378
-
379
- ## Key Design Trade-off
380
-
381
- - The object composes many controllers to give consumers one stable meeting surface; the cost is careful delegation and lifecycle cleanup.
382
-
383
- ## Test-Case Strategy (module)
384
-
385
- Use the current mirrored suites: `test/unit/spec/meeting/brbState.ts`, `test/unit/spec/meeting/connectionStateHandler.ts`, `test/unit/spec/meeting/in-meeting-actions.ts`, `test/unit/spec/meeting/index.js`, `test/unit/spec/meeting/locusMediaRequest.ts`, `test/unit/spec/meeting/muteState.js`, `test/unit/spec/meeting/request.js`, `test/unit/spec/meeting/utils.js`, `test/unit/spec/meeting/voicea-meeting.ts`. Characterize the meeting-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
386
-
387
- | Behavior / Requirement | Existing test evidence | Gap |
388
- |---|---|---|
389
- | `MEETING-R-001` | `test/unit/spec/meeting/index.js` | cover each lifecycle/media/member/control/feature/telephony/stage operation group represented above |
390
- | `MEETING-R-002` | `test/unit/spec/meeting/index.js` | queued media update during leave/reconnect needs explicit ordering coverage |
391
- | `MEETING-R-003` | `test/unit/spec/meeting/index.js` | split lifecycle rejection, rollback, stream/peer cleanup, listener removal, and token cleanup into independently asserted outcomes |
392
- | `MEETING-R-004` | `test/unit/spec/meeting/index.js`, `test/unit/spec/meeting/request.js` | none |
393
- | `MEETING-R-005` | `test/unit/spec/meeting/index.js`, `test/unit/spec/media/index.ts` | verify every media type and partial initialization |
394
- | `MEETING-R-006` | `test/unit/spec/meeting/index.js`, `test/unit/spec/locus-info/index.js` | verify event ordering for each projection family |
395
- | `MEETING-R-007` | `test/unit/spec/meeting/request.js`, `test/unit/spec/meeting/in-meeting-actions.ts` | verify capability-denied cases for each control |
396
- | `MEETING-R-008` | `test/unit/spec/meeting/index.js`, `test/unit/spec/multistream/sendSlotManager.ts` | covered for the send-slot unpublish-before-close ordering; verify every other optional controller cleanup path |
397
- | `MEETING-R-009` | `test/unit/spec/meeting/index.js` | covered for `LOCUS_USER_FULL` suppressing retry and taking precedence over `firstError`; add a case per non-retryable classifier |
398
- | `MEETING-R-010` | `test/unit/spec/meeting/voicea-meeting.ts` | covered for the final-only caption path |
399
- | `MEETING-R-011` | `test/unit/spec/meeting/index.js` | none |
400
-
401
- ## Traceability
402
-
403
- - Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
404
- - Coverage state and contracts baseline: `../../../.sdd/manifest.json`