@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
@@ -0,0 +1,834 @@
1
+ ---
2
+ type: Module Spec
3
+ title: 'Meeting specification'
4
+ description: Responsibilities, boundaries, design, state, invariants, and verification for the plugin-meetings Meeting module.
5
+ tags: [module, specification]
6
+ ---
7
+ <!-- sdd-generated-metadata
8
+ doc_kind: module-spec
9
+ generated_from: module-spec@0.3.0
10
+ generated_by: claude-code
11
+ approved_by: rarajes2@cisco.com
12
+ updated_at: 2026-11-17T03:14:21Z
13
+ validation_status: pass-with-warnings
14
+ -->
15
+
16
+ # Meeting
17
+
18
+ This source-local document at `src/meeting/docs/README.md` owns the stable specification for
19
+ **the Meeting module**: the `Meeting` class that represents one meeting or call, together with its
20
+ lifecycle state machine, Locus request adapters, mute and BRB helpers, in-meeting action flags, and
21
+ caption processing. Ground every claim in package evidence and link to the
22
+ [package architecture](../../../docs/architecture.md) instead of repeating broader facts. No service
23
+ specification exists because this package is a library.
24
+
25
+ Related context: [documentation index](../../../docs/index.md) ·
26
+ [package agent instructions](../../../AGENTS.md) ·
27
+ [module registry](../../../docs/specs/README.md).
28
+ Repo architecture: [package architecture](../../../docs/architecture.md) · Registry:
29
+ [module registry](../../../docs/specs/README.md). Coverage state and contracts baseline:
30
+ `.sdd/manifest.json` routes this module and registers its contract IDs.
31
+ Neighbouring specifications: [Meetings collection](../../meetings/docs/README.md) ·
32
+ [LocusInfo](../../locus-info/docs/README.md) · [Members](../../members/docs/README.md) ·
33
+ [media](../../media/docs/README.md) · [ROAP](../../roap/docs/README.md) ·
34
+ [multistream](../../multistream/docs/README.md) ·
35
+ [reconnection manager](../../reconnection-manager/docs/README.md).
36
+
37
+ ## Metadata
38
+
39
+ | Field | Value |
40
+ | ----------------- | ----- |
41
+ | Owner | @webex/web-client, @webex/web-sdk |
42
+ | Source path | `src/meeting` |
43
+ | Resource kind | module |
44
+ | Status | Draft |
45
+ | Last verified | 2026-11-16 at `0b8c34db7f` |
46
+ | Module id | `plugin-meetings/meeting` |
47
+ | Parent spec | — |
48
+ | Doc kind | Module spec |
49
+ | Coverage score | Pending coverage assessment |
50
+ | Validation status | not-run |
51
+
52
+ ## Applicability
53
+
54
+ | Condition ID | Status | Evidence or reason | Owned section |
55
+ | ------------------------------------ | ---------- | ------------------ | ------------- |
56
+ | `module.has_tiers` | N/A | No tier policy exists in `package.json` or under src/meeting | Tier |
57
+ | `module.has_ui` | N/A | `src/meeting/index.ts` returns promises and emits events; it renders nothing | UI use-case flow |
58
+ | `module.crosses_service_boundaries` | Applicable | `src/meeting/request.ts` and `src/meeting/locusMediaRequest.ts` call Locus, the meeting policy, site, and hydra services; `src/meeting/index.ts` uses Mercury and the LLM data channel | Cross-boundary use-case flow |
59
+ | `module.holds_client_state` | Applicable | `src/meeting/index.ts` keeps identity, Locus projections, media, mute, share, LLM, and timer state for one meeting | Client state model |
60
+ | `module.enforces_domain_rules` | Applicable | Lifecycle, media, retry, and cleanup rules in `src/meeting/index.ts`, `src/meeting/state.ts`, and `src/meeting/util.ts` | Business rules and invariants |
61
+ | `module.is_concurrent_async` | Applicable | Queued media updates, the queued Locus media requests, timers, and un-awaited LLM work in `src/meeting/index.ts` and `src/meeting/locusMediaRequest.ts` | Concurrency and reactive flow |
62
+ | `module.owns_persistence` | N/A | Nothing is persisted by the src/meeting files; the join cookie read in `src/meeting/request.ts` is owned by reachability | Data, schema, and migration discipline |
63
+ | `module.stateful_transitions` | Applicable | `src/meeting/state.ts` defines the meeting state machine | State machine |
64
+ | `module.exposes_wire_protocol` | Applicable | The Locus participant, media, and control requests built in `src/meeting/request.ts` and `src/meeting/locusMediaRequest.ts` | Protocol and wire format |
65
+ | `module.ui_multi_screen` | N/A | No UI | UI flow |
66
+ | `module.large_data_model` | N/A | The Locus data model is owned by `src/locus-info/index.ts`; this module's exported types are listed under Public surface | Data model |
67
+ | `module.returns_caller_errors` | Applicable | Typed rejections from `src/common/errors/webex-errors.ts` and request failures surfaced by `src/meeting/index.ts` | Caller-visible failure modes |
68
+ | `module.module_specific_conventions` | Applicable | Lifecycle through the state machine and remote I/O kept in the request classes (`src/meeting/index.ts`, `src/meeting/request.ts`) | Module-specific rules |
69
+ | `module.published_package` | Applicable | `src/index.ts` exports Meeting from the published package defined in `package.json` (main, types, deploy:npm) | Export stability |
70
+ | `module.embedded_in_host` | Applicable | Meeting extends StatelessWebexPlugin and relies on the host's webex.request, device, Mercury, and metrics (`src/meeting/index.ts`) | Host integration and theming |
71
+ | `module.has_design_tradeoff` | Applicable | One Meeting object composes many controllers (`src/meeting/index.ts`) | Key design trade-off |
72
+ | `module.has_submodules` | N/A | The src/meeting directory has no child module directory | Sub-modules |
73
+
74
+ ## Evidence register
75
+
76
+ Requirements cite current implementation and mirrored unit-test paths. Code wins over prose when
77
+ they conflict, and commit and PR history are excluded as evidence by repository-owner decision.
78
+ Missing test evidence is stated as a gap rather than inferred.
79
+
80
+ | Evidence | What it establishes |
81
+ | -------- | ------------------- |
82
+ | `src/meeting/index.ts` | The `Meeting` class (default export, a StatelessWebexPlugin), its exported types and `MEDIA_UPDATE_TYPE`, `ScreenShareFloorStatus`, and the module-level `storeEventForDebugging`; every public method, the Locus listeners, the LLM connection, and media setup. JSDoc and code comments are the recorded rationale |
83
+ | `src/meeting/state.ts` | `MeetingStateMachine.create`: the javascript-state-machine transition table, `onRing`, `onRemote`, `onEnterError`, and a 25-state history |
84
+ | `src/meeting/util.ts` | `MeetingUtil`: join, leave, end, and decline options; `cleanUp`; display-hint capability checks; the Locus delta request with sequence; `updateLocusFromApiResponse` |
85
+ | `src/meeting/request.ts`, `src/meeting/request.type.ts` | `MeetingRequest` and its option types: every Locus, policy, site, and hydra request the Meeting sends |
86
+ | `src/meeting/locusMediaRequest.ts` | `LocusMediaRequest`: the queued Locus `/media` PUT for ROAP and local mute, confluence state, and selfUrl retry |
87
+ | `src/meeting/muteState.ts`, `src/meeting/brbState.ts` | `MuteState` and `BrbState`: client versus server mute and BRB state |
88
+ | `src/meeting/connectionStateHandler.ts` | `ConnectionStateHandler`: emits `connectionState:changed` when the media connection's combined state changes |
89
+ | `src/meeting/in-meeting-actions.ts` | `InMeetingActions`: the action flags, whose `set` reports whether anything changed |
90
+ | `src/meeting/voicea-meeting.ts` | `getSpeaker`, `getSpeakerFromProxyOrStore`, `processNewCaptions` |
91
+ | `src/meeting/type.ts` | `Invitee` |
92
+ | `src/constants.ts` | `EVENT_TRIGGERS` literals, `MEETING_STATE_MACHINE`, `ICE_CONNECTION_TIMEOUT` (20000) and `DTLS_CONNECTION_TIMEOUT` (15000), `SHARE_STATUS` |
93
+ | `src/media/MediaConnectionAwaiter.ts` | The separate ICE and DTLS waits that `mediaProperties.waitForMediaConnectionConnected` runs; the Meeting wraps their failure |
94
+ | `src/common/errors/webex-errors.ts` | `MediaConnectionTimedOutError` (with `iceConnected`), `AddMediaFailed`, `UserNotJoinedError`, `MeetingNotActiveError`, `UserInLobbyError`, `NoMediaEstablishedYetError` |
95
+ | `src/locus-info/types.ts` | `LocusErrorCodes.LOCUS_USER_FULL` = 2423001 |
96
+ | `src/meetings/index.ts` | `Meetings.destroy` calls `MeetingUtil.cleanUp` with `preserveVoiceaChannel: false`, then `locusInfo.cleanUp()`; the E2EE manager and WASM loader live on Meetings, not on Meeting |
97
+ | `src/index.ts` | Exports `Meeting` from the package |
98
+ | `package.json` | `test:unit` runs `webex-legacy-tools test --unit --runner mocha`; `build:src` builds `dist` |
99
+ | `test/unit/spec/meeting/index.js` and 8 sibling suites in the same test directory | Mocha, Sinon, and `@webex/test-helper-chai` unit coverage, listed under Verification |
100
+ | Observation: the Meeting mute methods call a removed MuteState method | `muteAudio`, `unmuteAudio`, `muteVideo`, and `unmuteVideo` call `this.audio.handleClientRequest` or `this.video.handleClientRequest`, which `src/meeting/muteState.ts` no longer defines; past the joined, media, and control guards they throw a TypeError. The unit tests stub the method (`test/unit/spec/meeting/index.js`) |
101
+ | Observation: unsetPeerConnections removes every Mercury ONLINE and OFFLINE listener | With `reconnection.detection` on, it calls `mercury.off(ONLINE)` and `mercury.off(OFFLINE)` without a handler, unlike `stopListeningForMercuryEvents`, whose comment says Mercury is shared and only the bound handlers may be removed (`src/meeting/index.ts`) |
102
+ | Observation: keepalive interval | `startKeepAlive` sends a keepalive every `(keepAliveSecs - 1) * 750` ms, a value the code comment says was taken from UCF, and stops after the first failed request (`src/meeting/index.ts`) |
103
+ | Observation: a successful leave with moveMeeting skips cleanup | `MeetingUtil.leaveMeeting` resolves without `cleanUp` when `options.moveMeeting` is set (`src/meeting/util.ts`) |
104
+
105
+ ## Purpose and boundary
106
+
107
+ - Responsibility: owns one meeting's join/leave lifecycle, Locus projection integration, media,
108
+ controls, feature controllers, events, and teardown.
109
+ - In scope: meeting info and permission-token handling before join; `join`, `joinWithMedia`,
110
+ `acknowledge`, `decline`, `leave`, `endMeetingForAll`, and `reconnect`; media setup, update, and
111
+ publishing; local and remote streams; mute and BRB; share and whiteboard floor; recording, lock,
112
+ and control delegation; captions, transcription, reactions, and stage; phone audio, move, DTMF, and
113
+ SIP call-out; the LLM data channel and its token; keepalive; log upload; Meeting-scoped events.
114
+ - Out of scope: the meetings collection, device registration, E2EE and WASM module loading
115
+ (`src/meetings`, `src/e2ee`); Locus state parsing and hash-tree sync (`src/locus-info`,
116
+ `src/hashTree`); the roster (`src/members`); WebRTC connection creation and the ICE/DTLS waits
117
+ (`src/media`); ROAP and TURN discovery (`src/roap`); multistream slots and layouts
118
+ (`src/multistream`); reconnection (`src/reconnection-manager`); breakouts, interpretation,
119
+ annotation, webinar, AI enable requests, recording and control-option controllers in their own
120
+ modules.
121
+ - Consumers: applications through `webex.meetings` and the exported `Meeting` class; the Meetings
122
+ collection (`src/meetings/index.ts`); the reconnection manager and the feature controllers that
123
+ hold a meeting reference.
124
+
125
+ ## Structure and key files
126
+
127
+ `src/meeting/` contains 12 direct source files and has 9 mirrored unit-test files; this specification
128
+ separates their public operations, runtime data movement, component ownership, state, and
129
+ verification boundary.
130
+ TypeScript source with Mocha, Sinon, and `@webex/test-helper-chai` unit tests: `test:unit` runs
131
+ `webex-legacy-tools test --unit --runner mocha`, and the build target is
132
+ `yarn workspace @webex/plugin-meetings build:src` (`package.json`).
133
+
134
+ | File | Holds |
135
+ | ---- | ----- |
136
+ | `src/meeting/brbState.ts` | BRB state projection and transition logic: `BrbState` keeps client and server BRB, applies it through `setBrb`, and sets the main video source override to away |
137
+ | `src/meeting/connectionStateHandler.ts` | Connection state projection: `ConnectionStateHandler` turns peer and ICE connection state changes into one `connectionState:changed` event |
138
+ | `src/meeting/in-meeting-actions.ts` | `InMeetingActions` implementation: the action flags (can lock, can admit, and so on) whose `set` reports a change |
139
+ | `src/meeting/index.ts` | module facade/controller and primary exports: the `Meeting` class, its exported types, and `storeEventForDebugging` |
140
+ | `src/meeting/locusMediaRequest.ts` | Locus media request coordination and payload types: the queued `/media` request for ROAP and local mute |
141
+ | `src/meeting/muteState.ts` | Mute state projection and transition logic: `MuteState` reconciles local, server, and remote mute |
142
+ | `src/meeting/request.ts` | HTTP request boundary: `MeetingRequest` for Locus, policy, site, and hydra calls |
143
+ | `src/meeting/request.type.ts` | Request option and payload types for reactions, BRB, consent, stage, and the data-channel token |
144
+ | `src/meeting/state.ts` | Lifecycle state machine and transition logic |
145
+ | `src/meeting/type.ts` | The `Invitee` type implementation responsibility |
146
+ | `src/meeting/util.ts` | `MeetingUtil` normalization/helper functions: request options, cleanup, capability checks, and Locus delta requests |
147
+ | `src/meeting/voicea-meeting.ts` | Voicea caption processing for the meeting: speaker lookup and interim/final caption merging |
148
+ | `test/unit/spec/meeting/brbState.ts` and 8 sibling test files | mirrored characterization/unit coverage: `connectionStateHandler.ts`, `in-meeting-actions.ts`, `index.js`, `locusMediaRequest.ts`, `muteState.js`, `request.js`, `utils.js`, `voicea-meeting.ts` |
149
+ | `src/meeting/docs/README.md` | This module specification, the canonical module specification for this folder |
150
+
151
+ ## Public surface
152
+
153
+ | Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
154
+ |---|---|---|---|---|---|---|
155
+ | `meeting-api` | 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` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
156
+ | `meeting-api` | 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` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
157
+ | `meeting-api` | 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` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
158
+ | `meeting-api` | 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` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
159
+ | `meeting-api` | SDK / teardown | `unsetRemoteStreams()`, `closeRemoteStream()`, `closeRemoteStreams()`, `cleanupLocalStreams()`, `closePeerConnections()`, `unsetPeerConnections()`, 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. There is no `clearDataChannelToken()`; the channel's token goes away with the LLM channel in `cleanupLLMConneciton`, but a pending `_pendingDatachannelToken` is not cleared there and stays until `updateLLMConnection()` hands it to a new channel. | `src/meeting/index.ts`, `src/media/properties.ts`, `src/multistream/sendSlotManager.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
160
+ | `meeting-api` | SDK / local mute | `muteAudio()`, `unmuteAudio()`, `muteVideo()`, and `unmuteVideo()` | Reject when the user is not joined, media is not established, or no mute control exists; otherwise call the mute control. | These methods call `handleClientRequest`, which `MuteState` no longer defines (Evidence register); local mute flows through the local stream mute events into `MuteState.handleLocalStreamMuteStateChange`, and remote-mute/unmute constraints are applied there. | `src/meeting/index.ts`, `src/meeting/muteState.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
161
+ | `meeting-api` | 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` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
162
+ | `meeting-api` | SDK / captions/reactions/consent | `isTranscriptionSupported()`, `isReactionsSupported()`, `setCaptionLanguage()`, `setSpokenLanguage()`, `startTranscription()`, `startTranscriptionIfNeeded()`, `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` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
163
+ | `meeting-api` | 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` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
164
+ | `meeting-api` | 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` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
165
+ | `meeting-api` | 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` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
166
+ | `meeting-api` | SDK / stage/LLM/data channel | `setStage()`, `unsetStage()`, `notifyHost()`, `updateLLMConnection()`, `isLLMConnected()`, `getLLMLocusUrl()`, `setLLMChannelDataToken()`, `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 the meeting to be joined and `locusInfo.url` and `locusInfo.info.datachannelUrl` to both be populated before creating or registering a *new* `llmChannel`; otherwise 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` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
167
+ | `meeting-api` | 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` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
168
+ | `locus-http` | 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` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
169
+ | `meeting-api` | 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()`, `processNewCaptions()`, and the default exports `MeetingStateMachine` and `MeetingUtil` | 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` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
170
+ | `meeting-api` | 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` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
171
+
172
+ Provided contract IDs: `meeting-api`, `meetings-events`, and `locus-http`. They are provided here, indexed in the
173
+ [package architecture](../../../docs/architecture.md#public-and-consumer-surfaces), and registered in
174
+ `.sdd/manifest.json`. `Meeting` is exported from `src/index.ts`; `MeetingRequest`,
175
+ `LocusMediaRequest`, and the helper classes are reached through a Meeting instance.
176
+
177
+ Emitted events (`meetings-events`). Current source emits or forwards these observable literals for
178
+ this operation boundary. Preserve literal values, scope, payload shape, and emission timing; a
179
+ constant name alone is not a substitute for the consumer-visible value.
180
+
181
+ | Event literal | Constant / expression | Emission evidence |
182
+ |---|---|---|
183
+ | `meeting:caption-received` | `EVENT_TRIGGERS.MEETING_CAPTION_RECEIVED` | `src/meeting/index.ts` |
184
+ | `meeting:embeddedApps:update` | `EVENT_TRIGGERS.MEETING_EMBEDDED_APPS_UPDATE` | `src/meeting/index.ts` |
185
+ | `meeting:entryExitTone:update` | `EVENT_TRIGGERS.MEETING_ENTRY_EXIT_TONE_UPDATE` | `src/meeting/index.ts` |
186
+ | `meeting:locked` | `EVENT_TRIGGERS.MEETING_LOCKED` | `src/meeting/index.ts` |
187
+ | `meeting:locus:locusUrl:update` | `EVENT_TRIGGERS.MEETING_LOCUS_URL_UPDATE` | `src/meeting/index.ts` |
188
+ | `meeting:manualCaptionControl:updated` | `EVENT_TRIGGERS.MEETING_MANUAL_CAPTION_UPDATED` | `src/meeting/index.ts` |
189
+ | `meeting:media:local:start` | `EVENT_TRIGGERS.MEETING_MEDIA_LOCAL_STARTED` | `src/meeting/index.ts` |
190
+ | `meeting:media:remote:start` | `EVENT_TRIGGERS.MEETING_MEDIA_REMOTE_STARTED` | `src/meeting/index.ts` |
191
+ | `meeting:meetingContainer:update` | `EVENT_TRIGGERS.MEETING_MEETING_CONTAINER_UPDATE` | `src/meeting/index.ts` |
192
+ | `meeting:participant-reason-changed` | `EVENT_TRIGGERS.MEETING_PARTICIPANT_REASON_CHANGED` | `src/meeting/index.ts` |
193
+ | `meeting:receiveTranscription:started` | `EVENT_TRIGGERS.MEETING_STARTED_RECEIVING_TRANSCRIPTION` | `src/meeting/index.ts` |
194
+ | `meeting:receiveTranscription:stopped` | `EVENT_TRIGGERS.MEETING_STOPPED_RECEIVING_TRANSCRIPTION` | `src/meeting/index.ts` |
195
+ | `meeting:recording:paused` | `EVENT_TRIGGERS.MEETING_PAUSED_RECORDING` | `src/meeting/index.ts` |
196
+ | `meeting:recording:resumed` | `EVENT_TRIGGERS.MEETING_RESUMED_RECORDING` | `src/meeting/index.ts` |
197
+ | `meeting:recording:started` | `EVENT_TRIGGERS.MEETING_STARTED_RECORDING` | `src/meeting/index.ts` |
198
+ | `meeting:recording:stopped` | `EVENT_TRIGGERS.MEETING_STOPPED_RECORDING` | `src/meeting/index.ts` |
199
+ | `meeting:resourceLinks:update` | `EVENT_TRIGGERS.MEETING_RESOURCE_LINKS_UPDATE` | `src/meeting/index.ts` |
200
+ | `meeting:ringing` | `EVENT_TRIGGERS.MEETING_RINGING` | `src/meeting/state.ts` |
201
+ | `meeting:ringingStop` | `EVENT_TRIGGERS.MEETING_RINGING_STOP` | `src/meeting/state.ts` |
202
+ | `meeting:self:brbUpdate` | `EVENT_TRIGGERS.MEETING_SELF_BRB_UPDATE` | `src/meeting/index.ts` |
203
+ | `meeting:self:cannotViewParticipantList` | `EVENT_TRIGGERS.MEETING_SELF_CANNOT_VIEW_PARTICIPANT_LIST` | `src/meeting/index.ts` |
204
+ | `meeting:self:guestAdmitted` | `EVENT_TRIGGERS.MEETING_SELF_GUEST_ADMITTED` | `src/meeting/index.ts` |
205
+ | `meeting:self:isSharingBlocked` | `EVENT_TRIGGERS.MEETING_SELF_IS_SHARING_BLOCKED` | `src/meeting/index.ts` |
206
+ | `meeting:self:left` | `EVENT_TRIGGERS.MEETING_SELF_LEFT` | `src/meeting/index.ts` |
207
+ | `meeting:self:lobbyWaiting` | `EVENT_TRIGGERS.MEETING_SELF_LOBBY_WAITING` | `src/meeting/index.ts` |
208
+ | `meeting:self:mutedByOthers` | `EVENT_TRIGGERS.MEETING_SELF_MUTED_BY_OTHERS` | `src/meeting/index.ts` |
209
+ | `meeting:self:phoneAudioUpdate` | `EVENT_TRIGGERS.MEETING_SELF_PHONE_AUDIO_UPDATE` | `src/meeting/index.ts` |
210
+ | `meeting:self:requestedToUnmute` | `EVENT_TRIGGERS.MEETING_SELF_REQUESTED_TO_UNMUTE` | `src/meeting/index.ts` |
211
+ | `meeting:self:rolesChanged` | `EVENT_TRIGGERS.MEETING_SELF_ROLES_CHANGED` | `src/meeting/index.ts` |
212
+ | `meeting:self:unmutedByOthers` | `EVENT_TRIGGERS.MEETING_SELF_UNMUTED_BY_OTHERS` | `src/meeting/index.ts` |
213
+ | `meeting:self:videoMutedByOthers` | `EVENT_TRIGGERS.MEETING_SELF_VIDEO_MUTED_BY_OTHERS` | `src/meeting/index.ts` |
214
+ | `meeting:self:videoUnmutedByOthers` | `EVENT_TRIGGERS.MEETING_SELF_VIDEO_UNMUTED_BY_OTHERS` | `src/meeting/index.ts` |
215
+ | `media:remoteAudio:created` | `EVENT_TRIGGERS.REMOTE_MEDIA_AUDIO_CREATED` | `src/meeting/index.ts` |
216
+ | `media:remoteInterpretationAudio:created` | `EVENT_TRIGGERS.REMOTE_MEDIA_INTERPRETATION_AUDIO_CREATED` | `src/meeting/index.ts` |
217
+ | `media:remoteScreenShareAudio:created` | `EVENT_TRIGGERS.REMOTE_MEDIA_SCREEN_SHARE_AUDIO_CREATED` | `src/meeting/index.ts` |
218
+ | `media:remoteVideo:layoutChanged` | `EVENT_TRIGGERS.REMOTE_MEDIA_VIDEO_LAYOUT_CHANGED` | `src/meeting/index.ts` |
219
+ | `meeting:srtpCipher:updated` | `EVENT_TRIGGERS.MEETING_SRTP_CIPHER_UPDATED` | `src/meeting/index.ts` |
220
+ | `meeting:startedSharingLocal` | `EVENT_TRIGGERS.MEETING_STARTED_SHARING_LOCAL` | `src/meeting/index.ts` |
221
+ | `meeting:startedSharingRemote` | `EVENT_TRIGGERS.MEETING_STARTED_SHARING_REMOTE` | `src/meeting/index.ts` |
222
+ | `meeting:startedSharingWhiteboard` | `EVENT_TRIGGERS.MEETING_STARTED_SHARING_WHITEBOARD` | `src/meeting/index.ts` |
223
+ | `meeting:stateChange` | `EVENT_TRIGGERS.MEETING_STATE_CHANGE` | `src/meeting/index.ts` |
224
+ | `meeting:stoppedSharingRemote` | `EVENT_TRIGGERS.MEETING_STOPPED_SHARING_REMOTE` | `src/meeting/index.ts` |
225
+ | `meeting:stoppedSharingWhiteboard` | `EVENT_TRIGGERS.MEETING_STOPPED_SHARING_WHITEBOARD` | `src/meeting/index.ts` |
226
+ | `meeting:streamPublishStateChanged` | `EVENT_TRIGGERS.MEETING_STREAM_PUBLISH_STATE_CHANGED` | `src/meeting/index.ts` |
227
+ | `meeting:transcription:connected` | `EVENT_TRIGGERS.MEETING_TRANSCRIPTION_CONNECTED` | `src/meeting/index.ts` |
228
+ | `meeting:transcription:spokenLanguageUpdate` | `EVENT_TRIGGERS.MEETING_TRANSCRIPTION_SPOKEN_LANGUAGE_UPDATED` | `src/meeting/index.ts` |
229
+ | `meeting:unlocked` | `EVENT_TRIGGERS.MEETING_UNLOCKED` | `src/meeting/index.ts` |
230
+ | `network:connected` | `EVENT_TRIGGERS.MEETINGS_NETWORK_CONNECTED` | `src/meeting/index.ts` |
231
+ | `network:disconnected` | `EVENT_TRIGGERS.MEETINGS_NETWORK_DISCONNECTED` | `src/meeting/index.ts`, `src/meetings/index.ts` |
232
+ | `network:quality` | `EVENT_TRIGGERS.NETWORK_QUALITY` | `src/meeting/index.ts` |
233
+ | `media:activeSpeakerChanged` | `EVENT_TRIGGERS.ACTIVE_SPEAKER_CHANGED` | `src/meeting/index.ts` |
234
+ | `media:inboundAudio:issueDetected` | `EVENT_TRIGGERS.MEDIA_INBOUND_AUDIO_ISSUE_DETECTED` | `src/meeting/index.ts` |
235
+ | `media:negotiated` | `EVENT_TRIGGERS.MEDIA_NEGOTIATED` | `src/meeting/index.ts` |
236
+ | `media:ready` | `EVENT_TRIGGERS.MEDIA_READY` | `src/meeting/index.ts` |
237
+ | `media:remoteAudioSourceCountChanged` | `EVENT_TRIGGERS.REMOTE_AUDIO_SOURCE_COUNT_CHANGED` | `src/meeting/index.ts` |
238
+ | `media:remoteVideoSourceCountChanged` | `EVENT_TRIGGERS.REMOTE_VIDEO_SOURCE_COUNT_CHANGED` | `src/meeting/index.ts` |
239
+ | `media:stopped` | `EVENT_TRIGGERS.MEDIA_STOPPED` | `src/meeting/index.ts` |
240
+ | `meeting:actionsUpdate` | `EVENT_TRIGGERS.MEETING_ACTIONS_UPDATE` | `src/meeting/index.ts` |
241
+ | `meeting:breakouts:askForHelp` | `EVENT_TRIGGERS.MEETING_BREAKOUTS_ASK_FOR_HELP` | `src/meeting/index.ts` |
242
+ | `meeting:breakouts:askReturnToMain` | `EVENT_TRIGGERS.MEETING_BREAKOUTS_ASK_RETURN_TO_MAIN` | `src/meeting/index.ts` |
243
+ | `meeting:breakouts:closing` | `EVENT_TRIGGERS.MEETING_BREAKOUTS_CLOSING` | `src/meeting/index.ts` |
244
+ | `meeting:breakouts:leave` | `EVENT_TRIGGERS.MEETING_BREAKOUTS_LEAVE` | `src/meeting/index.ts` |
245
+ | `meeting:breakouts:message` | `EVENT_TRIGGERS.MEETING_BREAKOUTS_MESSAGE` | `src/meeting/index.ts` |
246
+ | `meeting:breakouts:preAssignmentsUpdate` | `EVENT_TRIGGERS.MEETING_BREAKOUTS_PRE_ASSIGNMENTS_UPDATE` | `src/meeting/index.ts` |
247
+ | `meeting:breakouts:update` | `EVENT_TRIGGERS.MEETING_BREAKOUTS_UPDATE` | `src/meeting/index.ts` |
248
+ | `meeting:controls:ai-summary-notification:updated` | `EVENT_TRIGGERS.MEETING_CONTROLS_AI_SUMMARY_NOTIFICATION_UPDATED` | `src/meeting/index.ts` |
249
+ | `meeting:controls:annotation:updated` | `EVENT_TRIGGERS.MEETING_CONTROLS_ANNOTATION_UPDATED` | `src/meeting/index.ts` |
250
+ | `meeting:controls:auto-end-meeting-warning:updated` | `EVENT_TRIGGERS.MEETING_CONTROLS_AUTO_END_MEETING_WARNING_UPDATED` | `src/meeting/index.ts` |
251
+ | `meeting:controls:disallow-unmute:updated` | `EVENT_TRIGGERS.MEETING_CONTROLS_DISALLOW_UNMUTE_UPDATED` | `src/meeting/index.ts` |
252
+ | `meeting:controls:meeting-full:updated` | `EVENT_TRIGGERS.MEETING_CONTROLS_MEETING_FULL_UPDATED` | `src/meeting/index.ts` |
253
+ | `meeting:controls:mute-on-entry:updated` | `EVENT_TRIGGERS.MEETING_CONTROLS_MUTE_ON_ENTRY_UPDATED` | `src/meeting/index.ts` |
254
+ | `meeting:controls:polling-qa:updated` | `EVENT_TRIGGERS.MEETING_CONTROLS_POLLING_QA_UPDATED` | `src/meeting/index.ts` |
255
+ | `meeting:controls:practice-session-status:updated` | `EVENT_TRIGGERS.MEETING_CONTROLS_PRACTICE_SESSION_STATUS_UPDATED` | `src/meeting/index.ts` |
256
+ | `meeting:controls:raise-hand:updated` | `EVENT_TRIGGERS.MEETING_CONTROLS_RAISE_HAND_UPDATED` | `src/meeting/index.ts` |
257
+ | `meeting:controls:reactions:updated` | `EVENT_TRIGGERS.MEETING_CONTROLS_REACTIONS_UPDATED` | `src/meeting/index.ts` |
258
+ | `meeting:controls:remote-desktop-control:updated` | `EVENT_TRIGGERS.MEETING_CONTROLS_REMOTE_DESKTOP_CONTROL_UPDATED` | `src/meeting/index.ts` |
259
+ | `meeting:controls:share-control:updated` | `EVENT_TRIGGERS.MEETING_CONTROLS_SHARE_CONTROL_UPDATED` | `src/meeting/index.ts` |
260
+ | `meeting:controls:stage-view:updated` | `EVENT_TRIGGERS.MEETING_CONTROLS_STAGE_VIEW_UPDATED` | `src/meeting/index.ts` |
261
+ | `meeting:controls:video:updated` | `EVENT_TRIGGERS.MEETING_CONTROLS_VIDEO_UPDATED` | `src/meeting/index.ts` |
262
+ | `meeting:controls:view-the-participants-list:updated` | `EVENT_TRIGGERS.MEETING_CONTROLS_VIEW_THE_PARTICIPANTS_LIST_UPDATED` | `src/meeting/index.ts` |
263
+ | `meeting:controls:webcast:updated` | `EVENT_TRIGGERS.MEETING_CONTROLS_WEBCAST_UPDATED` | `src/meeting/index.ts` |
264
+ | `meeting:interpretation:handoffRequestsArrived` | `EVENT_TRIGGERS.MEETING_INTERPRETATION_HANDOFF_REQUESTS_ARRIVED` | `src/meeting/index.ts` |
265
+ | `meeting:interpretation:supportLanguagesUpdate` | `EVENT_TRIGGERS.MEETING_INTERPRETATION_SUPPORT_LANGUAGES_UPDATE` | `src/meeting/index.ts` |
266
+ | `meeting:interpretation:update` | `EVENT_TRIGGERS.MEETING_INTERPRETATION_UPDATE` | `src/meeting/index.ts`, `src/meeting/util.ts` |
267
+ | `meeting:layout:update` | `EVENT_TRIGGERS.MEETING_CONTROLS_LAYOUT_UPDATE` | `src/meeting/index.ts` |
268
+ | `meeting:meetingInfoAvailable` | `EVENT_TRIGGERS.MEETING_INFO_AVAILABLE` | `src/meeting/index.ts` |
269
+ | `meeting:meetingInfoUpdated` | `EVENT_TRIGGERS.MEETING_INFO_UPDATED` | `src/meeting/index.ts` |
270
+ | `meeting:receiveReactions` | `EVENT_TRIGGERS.MEETING_RECEIVE_REACTIONS` | `src/meeting/index.ts` |
271
+ | `meeting:stoppedSharingLocal` | `EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL` | `src/meeting/index.ts` |
272
+ | `meeting:updateAnnotationInfo` | `EVENT_TRIGGERS.MEETING_UPDATE_ANNOTATION_INFO` | `src/meeting/index.ts` |
273
+
274
+ Compatibility notes:
275
+
276
+ - Prefer additive options and payload fields. Preserve method/event names, rejection semantics, and
277
+ cleanup timing; route public changes through `src/index.ts` or the documented owning object.
278
+
279
+ ## Dependencies
280
+
281
+ Requires the Meetings host, LocusInfo, Members, meeting requests, media/ROAP/multistream,
282
+ reconnection, reachability, feature controllers, Webex services, and metrics.
283
+
284
+ Required contract IDs, as registered in `.sdd/manifest.json`: `locus-info-projection`,
285
+ `members-api`, `media-connection`, `roap-signaling`, `remote-media-api`, `reachability-service`,
286
+ `reconnection-manager`, `internal-media-core`, `media-helpers-streams`,
287
+ `internal-plugin-llm-channel`, `internal-plugin-voicea-transcription`, `meetings-metrics`, and
288
+ `webex-core-plugin-host`. The Meetings collection row names the host that constructs the Meeting;
289
+ it is a consumer relationship, not a required contract.
290
+
291
+ | Dependency | Why it is required | Failure behavior |
292
+ | ---------- | ------------------ | ---------------- |
293
+ | Meetings collection (`src/meetings`) | Creates the Meeting, owns registration, reachability, sync, and `destroy` | `join` rejects when the device is not registered |
294
+ | LocusInfo (`src/locus-info`, contract `locus-info-projection`) | Applies Locus full state, deltas, and API responses; emits the events the Meeting listens to | Meeting state lags until the next Locus update |
295
+ | Members (`src/members`, `members-api`) | Roster operations behind `invite`, `admit`, `remove`, `mute`, `transfer` | Rejections propagate |
296
+ | Media (`src/media`, `media-connection`) | Creates the WebRTC connection; waits for ICE then DTLS | Timeout becomes `MediaConnectionTimedOutError`, then a TURN-TLS retry or `AddMediaFailed` |
297
+ | ROAP (`src/roap`, `roap-signaling`) | Offer/answer and TURN discovery | `handleRoapFailure` and the add-media failure path |
298
+ | Multistream (`src/multistream`, `remote-media-api`) | Send and receive slots, media requests, remote media manager | — |
299
+ | Reachability (`src/reachability`, `reachability-service`) | TLS reachability for the TURN-TLS-only retry and metric fields | A failed probe counts as unreachable |
300
+ | Reconnection manager (`src/reconnection-manager`, `reconnection-manager`) | Media recovery behind `reconnect` and the connection-state listener | ReconnectionNotStartedError resolves; others reject |
301
+ | `@webex/internal-media-core` (`internal-media-core`) | Connection state, media types, ROAP and multistream connections | — |
302
+ | `@webex/media-helpers` (`media-helpers-streams`) | Local stream classes and their mute and track events | — |
303
+ | `@webex/internal-plugin-llm` (`internal-plugin-llm-channel`) | `createChannel`, `registerAndConnect`, data-channel token | Connection failure is logged after join and rejected from `updateLLMConnection` |
304
+ | `@webex/internal-plugin-voicea` (`internal-plugin-voicea-transcription`) | `createChannel`, `switchLLMChannel`, captions and transcription | A failed switch is logged |
305
+ | Metrics (`src/metrics`, `meetings-metrics`) and `webex.internal.newMetrics` | Behavioral metrics and call-analyzer client events | Not awaited |
306
+ | `@webex/webex-core` (`webex-core-plugin-host`) | `StatelessWebexPlugin`, `webex.request`, device, Mercury, service catalog | Request rejections propagate |
307
+
308
+ ## Requirements
309
+
310
+ | ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
311
+ |---|---|---|---|---|---|---|
312
+ | `MEETING-R-001` | join, acknowledge, leave, and end-for-all lifecycle: `join()` rejects when the device is not registered, returns the pending promise to a concurrent caller, generates a new correlation id on every later join unless one is passed, resets the FSM on `rejoin` or from ENDED, rings unless RINGING, then calls `MeetingUtil.joinMeetingOptions` and moves to JOINED; `acknowledge(INCOMING)` sends the alert and rings; `decline` moves to ENDED; `leave` and `endMeetingForAll` move to ENDED after the Locus request. | The `state.ts` transition comments: a meeting rings before it joins, 1:1 calls stay in RINGING, and leave, end, and decline move to ENDED; one join promise at a time keeps one Locus join per attempt. | `src/meeting/index.ts`, `src/meeting/state.ts`, `src/meeting/util.ts` | `test/unit/spec/meeting/index.js` | none | PRESENT |
313
+ | `MEETING-R-002` | add/update/stop media and local/remote stream state: `updateMedia`, the transcoded media update, and the share-floor request are queued in `queuedMediaUpdates` and run one at a time while no ROAP exchange is in progress (`canUpdateMedia`). | Media establishment/update and stream teardown must follow lifecycle state so a failed transition does not leak resources; the `canUpdateMedia` comment keeps queuing at the SDK level because of server issues with concurrent updates. | `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 |
314
+ | `MEETING-R-003` | Typed join/media/control failures remain caller-visible. Successful leave (unless `moveMeeting`), successful end-for-all, and the Meetings-owned destroy path 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; the method comment records the Locus team recommendation to stop listening before `/leave` and `/end`. | `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 |
315
+ | `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 |
316
+ | `MEETING-R-005` | Media setup uses provided local streams, negotiates signaling, and emits media readiness/stopped outcomes by media type. `addMediaInternal` rejects with `MeetingNotActiveError` unless the meeting is active or `allowMediaInLobby` is set, with `UserNotJoinedError` when Locus shows the user LEFT, and with `UserInLobbyError` for an unadmitted user unless wireless share or `allowMediaInLobby`; it publishes local streams in the lobby only with `allowPublishMediaInLobby`, and on `MultistreamNotSupportedError` downgrades to transcoded and retries with forced TURN discovery. | Consumers attach media asynchronously and need local, remote audio/video, and remote-share distinctions; the code comments: publishing in the lobby could expose the user if the admit event is missed, and a downgrade lands on a new confluence that may be on another node. | `src/meeting/index.ts`, `src/media/index.ts` | `test/unit/spec/meeting/index.js`, `test/unit/spec/media/index.ts` | none | PRESENT |
317
+ | `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 |
318
+ | `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 |
319
+ | `MEETING-R-008` | `MeetingUtil.cleanUp()` tells the device the meeting ended, stops periodic log upload, cleans breakouts, webinar, and interpretation, drops `locusMediaRequest`, stops the stats analyzer, closes remote streams and peer connections, detaches local streams, unsets peer connections, resets reconnection state, stops keepalive, and cleans the LLM connection when `enableAutomaticLLM` is on. 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()` and then calls `locusInfo.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; hash-tree parsers survive leave so they can consume Locus's final END message. | `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 |
320
+ | `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 (status 409 or 403) under `JOIN_WITH_MEDIA_RETRY_MAX_COUNT` (2). 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 |
321
+ | `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 |
322
+ | `MEETING-R-011` | `updateLLMConnection()` first runs its existing-channel reuse/cleanup logic: it returns early when the existing `llmChannel` is connected or connecting to the same URLs while joined, and otherwise disconnects it via `cleanupLLMConneciton({preserveVoiceaChannel: true})` regardless of whether the new `locusInfo.url`/`locusInfo.info.datachannelUrl` are populated. Only after that does it require the meeting to be joined and both URLs to be non-empty before creating or registering a *new* `llmChannel`; if not — 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` and `enableAutomaticLLM` is on. | 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 |
323
+ | `MEETING-R-012` | When waiting for the media connection fails (ICE then DTLS, each with its own timeout in the media module), the Meeting submits `client.ice.end` before media has ever connected and throws `MediaConnectionTimedOutError` with `iceConnected`. If TURN was not used, `addMedia` retries once with forced TURN discovery, rejoining first when the state is LEFT; otherwise it throws `AddMediaFailed` with the connection type, `iceConnected`, and `iceConnectedAtLeastOnce`. A `joinWithMedia` retry after an `AddMediaFailed` DTLS handshake failure over UDP on a multistream meeting uses `iceTransportPolicy: 'relay'` when any cluster is reachable over TLS. | The `shouldRetryMediaWithOnlyTurnTLS` comment: a single TURN-TLS transport minimizes the chance of the media server sending DTLS on the wrong transport and gets past firewalls that let STUN through but block other UDP. | `src/meeting/index.ts`, `src/media/MediaConnectionAwaiter.ts`, `src/common/errors/webex-errors.ts`, `src/constants.ts` | `test/unit/spec/meeting/index.js` | The VMN case, where TURN discovery returns no URLs and relay is dropped, is covered; ICE-versus-DTLS timeouts are tested in the media module | PRESENT |
324
+ | `MEETING-R-013` | `joinWithMedia()` rejects with `ParameterError` unless `mediaOptions.allowMediaInLobby` is true, throws `WebrtcApiNotAvailableError` before any request when `RTCPeerConnection` is not available, suspends Locus-driven meeting destruction for the whole attempt, and on a retry after a successful join calls only `addMedia` with forced TURN discovery. | The code comments: fail fast when WebRTC is missing, and ignore the Locus drop notification caused by the first failed attempt, which would otherwise clean the meeting up and break the retry. | `src/meeting/index.ts` | `test/unit/spec/meeting/index.js` | none | PRESENT |
325
+ | `MEETING-R-014` | `LocusMediaRequest` sends one Locus `/media` PUT at a time. A local-mute request before the confluence exists only records the latest mute values and resolves; a queued local mute merges into the queued request; a ROAP message removes queued local mutes and carries the latest mute state. The selfUrl is resolved when the request leaves the queue, and a 409 or 403 is retried with the new selfUrl while it keeps rotating, up to a retry limit. | The code comments: a mute before the confluence would fail, ROAP requests already carry the mute state, and Locus rotates selfUrl on breakout end, move-to, and lobby admit, so a captured value can be stale. | `src/meeting/locusMediaRequest.ts` | `test/unit/spec/meeting/locusMediaRequest.ts` | none | PRESENT |
326
+ | `MEETING-R-015` | `reconnect(options)` rejects with `ParameterError` when there is no reconnection manager or media was never established, runs `cleanUpBeforeReconnection`, and passes a completion callback that waits for the remote SDP answer and the connected media connection; it resolves on `ReconnectionNotStartedError` and uploads logs and rejects on any other failure. | The rejection messages: reconnection needs a manager and established media; a not-started reconnection is not a failure of the meeting. | `src/meeting/index.ts` | `test/unit/spec/meeting/index.js` | none | PRESENT |
327
+
328
+ ## Design overview
329
+
330
+ `Meeting` orchestrates join/leave, controls, media, Locus, members, feature controllers, and metrics.
331
+ `state.ts` is the package lifecycle FSM; request and media helpers own remote calls, while
332
+ specialized files own mute, BRB, connection, in-meeting actions, and Voicea behavior.
333
+
334
+ The constructor builds the collaborators: `MeetingRequest` (with a Locus delta request bound by a
335
+ `WeakRef`), `LocusInfo`, `Members`, the feature controllers (breakouts, interpretation, annotation,
336
+ webinar, AI enable request, recording, control options), `MediaProperties`, the ROAP and
337
+ reconnection managers, and the FSM. It then registers LocusInfo listeners that translate Locus
338
+ changes into Meeting fields and events. Media state is created per `addMedia`: mute and BRB state
339
+ objects, the WebRTC connection, its `ConnectionStateHandler`, the stats analyzer, and, for
340
+ multistream, the slot and request managers. The LLM data channel is created on join when
341
+ `enableAutomaticLLM` is on and recreated when the Locus or data-channel URL changes.
342
+
343
+ ## Data flow and sequence coverage
344
+
345
+ Sequence coverage: the call style is in-process async method calls from the application; outbound
346
+ HTTPS to Locus and other services through `webex.request` in the request classes; inbound Locus
347
+ events from Mercury and the LLM channel through LocusInfo; WebRTC through the media module.
348
+
349
+ | Operation group | Entry and outcome | Diagram or evidence | Failure and recovery coverage |
350
+ | --------------- | ----------------- | ------------------- | ----------------------------- |
351
+ | Meeting info and auth | `fetchMeetingInfo`, `verifyPassword`, `verifyRegistrationId`, `refreshCaptcha`, permission-token refresh | `src/meeting/index.ts` (one meeting-info call each) | Typed password, captcha, and permission errors fail join |
352
+ | Join | `join` | Diagram 1 | Not registered, bad quality option, token errors, Locus rejection |
353
+ | Join with media | `joinWithMedia` | Diagram 2 | Retry rules, LOCUS_USER_FULL, leave on terminal failure |
354
+ | Add media | `addMedia`, `addMediaInternal` | Diagram 3 | Lobby and state guards, downgrade, TURN-TLS retry, AddMediaFailed |
355
+ | Media updates | `updateMedia`, share floor, transcoded update | Diagram 4 | Queue while ROAP is in progress; each promise settles in order |
356
+ | Locus-driven updates | LocusInfo events | Diagram 5 | Events emitted only for real changes |
357
+ | Leave and end | `leave`, `endMeetingForAll`, `decline` | Diagram 6 | FSM fail, metrics, log upload |
358
+ | LLM data channel | `updateLLMConnection` | Diagram 7 | Reuse, cleanup, empty URL skip, registration failure |
359
+ | Controls and features | recording, lock, mute-all, layout, reactions, stage, DTMF, SIP | `src/meeting/request.ts` and the controllers | Request rejections propagate |
360
+ | Reconnection | `reconnect`, connection-state changes | `src/reconnection-manager/index.ts` (see the reconnection manager specification) | Not-started resolves; failure uploads logs and rejects |
361
+
362
+ ```mermaid
363
+ flowchart LR
364
+ Consumer[SDK consumer] --> Meeting[index.ts]
365
+ Meeting --> FSM[state.ts]
366
+ Meeting --> Request[request.ts / locusMediaRequest.ts]
367
+ Request --> Locus[Locus and media services]
368
+ Locus --> LocusInfo[src/locus-info]
369
+ LocusInfo --> Meeting
370
+ Meeting --> Media[src/media / src/roap / src/multistream]
371
+ Meeting --> Features[members / breakouts / webinar / interpretation / annotation]
372
+ Meeting --> LLM[LLM data channel and voicea]
373
+ Meeting --> Events[meeting-scoped events]
374
+ ```
375
+
376
+ Diagram 1 — join, the meeting lifecycle primary sequence:
377
+
378
+ ```mermaid
379
+ sequenceDiagram
380
+ participant C as Consumer
381
+ participant M as Meeting
382
+ participant S as state.ts
383
+ participant U as MeetingUtil util.ts
384
+ participant R as MeetingRequest request.ts
385
+ participant L as Locus
386
+ C->>M: join(options)
387
+ alt device not registered
388
+ M--xC: Error
389
+ else a join is already pending
390
+ M-->>C: the pending join promise
391
+ end
392
+ M->>S: reset on rejoin or from ENDED, ring transition when not already ringing
393
+ M->>M: checkAndRefreshPermissionToken
394
+ M->>U: joinMeetingOptions(this, options)
395
+ U->>R: joinMeeting(request options)
396
+ R->>L: HTTP Locus operation
397
+ L-->>R: Locus DTO or rejection
398
+ R-->>U: Locus response or rejection
399
+ U-->>M: join result or mapped join error
400
+ alt success
401
+ M->>S: join transition after successful Locus response
402
+ M->>M: setupLocusMediaRequest, saveDataChannelToken, updateLLMConnection (not awaited)
403
+ M-->>C: join result and scoped events
404
+ else failure
405
+ M->>S: fail(error)
406
+ M--xC: rejection
407
+ end
408
+ ```
409
+
410
+ Diagram 2 — join with media and its retry:
411
+
412
+ ```mermaid
413
+ sequenceDiagram
414
+ participant C as Consumer
415
+ participant M as Meeting
416
+ participant RO as roap
417
+ participant LI as LocusInfo
418
+ C->>M: joinWithMedia({joinOptions, mediaOptions})
419
+ M->>LI: suspendDestroyMeeting(true)
420
+ opt first try, or the previous error was UserNotJoined or Locus dropped us
421
+ M->>RO: generateTurnDiscoveryRequestMessage
422
+ M->>M: join(joinOptions with roapMessage)
423
+ M->>RO: handleTurnDiscoveryHttpResponse
424
+ end
425
+ M->>M: addMediaInternal(..., relay when DTLS failed over UDP and TLS is reachable)
426
+ alt success
427
+ M->>LI: suspendDestroyMeeting(false)
428
+ M-->>C: {join, media, multistreamEnabled}
429
+ else failure and shouldRetry
430
+ M->>M: record retryCount, prevError, firstError, then joinWithMedia(options)
431
+ else terminal failure
432
+ M->>M: leave() when join had succeeded
433
+ M->>LI: suspendDestroyMeeting(false)
434
+ M--xC: LOCUS_USER_FULL error, else firstError ?? error
435
+ end
436
+ ```
437
+
438
+ Diagram 3 — add media:
439
+
440
+ ```mermaid
441
+ sequenceDiagram
442
+ participant C as Consumer
443
+ participant M as Meeting
444
+ participant MP as mediaProperties and media module
445
+ participant RO as roap
446
+ C->>M: addMedia(options)
447
+ M->>M: guards: active or allowMediaInLobby, not LEFT, admitted or allowed
448
+ M->>M: create MuteState, BrbState, local stream references unless unpublished lobby
449
+ M->>RO: TURN discovery
450
+ M->>MP: createMediaConnection, initiate offer, wait for remote SDP answer
451
+ M->>MP: waitForMediaConnectionConnected (ICE, then DTLS)
452
+ alt MultistreamNotSupportedError
453
+ M->>M: downgradeFromMultistreamToTranscoded, establish again with forced TURN
454
+ else timed out and TURN not used yet
455
+ M->>M: retryWithForcedTurnDiscovery (rejoin first when LEFT)
456
+ else timed out with TURN
457
+ M--xC: AddMediaFailed {connectionType, iceConnected, iceConnectedAtLeastOnce}
458
+ end
459
+ M->>M: request share floor when a share stream exists
460
+ M-->>C: resolved, ADD_MEDIA_SUCCESS and client.media-engine.ready
461
+ ```
462
+
463
+ Diagram 4 — queued media updates:
464
+
465
+ ```mermaid
466
+ sequenceDiagram
467
+ participant C as Consumer
468
+ participant M as Meeting
469
+ participant Q as queuedMediaUpdates
470
+ C->>M: updateMedia / share floor / transcoded update
471
+ M->>Q: push {type, options, resolve, reject}
472
+ alt canUpdateMedia (no ROAP in progress)
473
+ M->>Q: shift next item
474
+ M->>M: run the update
475
+ M-->>C: settle that item's promise
476
+ M->>M: processNextQueuedMediaUpdate()
477
+ else ROAP in progress
478
+ M->>M: wait, the next negotiation completion calls processNextQueuedMediaUpdate()
479
+ end
480
+ ```
481
+
482
+ Diagram 5 — Locus-driven updates:
483
+
484
+ ```mermaid
485
+ sequenceDiagram
486
+ participant L as Locus via Mercury or LLM
487
+ participant LI as LocusInfo
488
+ participant M as Meeting
489
+ participant F as Members and feature controllers
490
+ participant C as Consumer
491
+ L->>LI: full state, delta, or API response
492
+ LI->>M: LOCUSINFO event (self, controls, media shares, meeting info, url)
493
+ M->>M: update fields, InMeetingActions, mute and BRB state
494
+ M->>F: locusUrlUpdate, display hints, policies
495
+ M-->>C: meeting:* event when the value changed
496
+ ```
497
+
498
+ Diagram 6 — leave and end:
499
+
500
+ ```mermaid
501
+ sequenceDiagram
502
+ participant C as Consumer
503
+ participant M as Meeting
504
+ participant U as MeetingUtil
505
+ participant L as Locus
506
+ C->>M: leave(options) or endMeetingForAll()
507
+ M->>M: stopListeningForMeetingEvents()
508
+ M->>U: leaveMeeting or endMeetingForAll
509
+ U->>L: PUT participant leave or POST end
510
+ alt success
511
+ U->>U: cleanUp(meeting) (not for moveMeeting)
512
+ M->>M: FSM leave or end, clearMeetingData, request log upload
513
+ M-->>C: resolved
514
+ else failure
515
+ M->>M: FSM fail(error), failure metric, request log upload
516
+ M--xC: rejection
517
+ end
518
+ ```
519
+
520
+ Diagram 7 — the LLM data channel:
521
+
522
+ ```mermaid
523
+ sequenceDiagram
524
+ participant M as Meeting
525
+ participant LLM as webex.internal.llm channel
526
+ participant V as voicea channel
527
+ M->>M: updateLLMConnection()
528
+ alt existing channel on the same URLs and joined
529
+ M-->>M: undefined
530
+ else existing channel otherwise
531
+ M->>LLM: cleanupLLMConneciton({preserveVoiceaChannel: true})
532
+ end
533
+ alt not joined, or url or datachannelUrl empty
534
+ M-->>M: undefined, wait for MEETING_INFO_UPDATED
535
+ else
536
+ M->>LLM: createChannel, setRefreshHandler, registerAndConnect(url, datachannelUrl, token)
537
+ M->>M: sync LLM hash-tree datasets, add relay and Locus listeners, register annotation and breakouts
538
+ M->>V: switchLLMChannel, then startTranscriptionIfNeeded (not awaited)
539
+ end
540
+ ```
541
+
542
+ ## Class and component relationships
543
+
544
+ ```mermaid
545
+ classDiagram
546
+ class Consumer
547
+ class Meeting
548
+ class FSM["MeetingStateMachine"]
549
+ class Request["MeetingRequest and LocusMediaRequest"]
550
+ class Locus
551
+ class LocusInfo
552
+ class Media["MediaProperties and the media connection"]
553
+ class Features["Members and feature controllers"]
554
+ class Events
555
+ class MuteState
556
+ class BrbState
557
+ class ReconnectionManager
558
+ Consumer --> Meeting
559
+ Meeting --> FSM
560
+ Meeting --> Request
561
+ Request --> Locus
562
+ Locus --> LocusInfo
563
+ LocusInfo --> Meeting
564
+ Meeting --> Media
565
+ Meeting --> Features
566
+ Meeting --> Events
567
+ Meeting *-- MuteState : audio, video
568
+ Meeting *-- BrbState
569
+ Meeting *-- ReconnectionManager
570
+ ```
571
+
572
+ The arrows identify ownership and delegation inside `src/meeting/`; files that only declare types or
573
+ constants are not presented as transports.
574
+
575
+ ## Use cases and flows
576
+
577
+ | Use case | Actor or caller | Primary steps and outcome | Failure or boundary behavior | Evidence |
578
+ | -------- | --------------- | ------------------------- | ---------------------------- | -------- |
579
+ | `UC-1` | Application | Resolve meeting info, password/registration/captcha, and permission-token context before joining, preserving typed lookup/authentication failures. | Captcha, password, and permission errors fail the join and the FSM | `src/meeting/index.ts`, `src/meeting-info/index.ts` |
580
+ | `UC-2` | Application | Join, acknowledge, decline, leave, reconnect, or end-for-all through the lifecycle FSM while reconciling accepted Locus state into composed controllers. | Rejections move the FSM to ERROR | `src/meeting/index.ts`, `src/meeting/request.ts`, `test/unit/spec/meeting/index.js` |
581
+ | `UC-3` | Application | Add or update media, publish/unpublish local streams, and cleanly close/detach remote/local media resources; mute flows through the local stream and `MuteState`. | TURN-TLS retry, downgrade, AddMediaFailed | `src/meeting/index.ts`, `src/media/properties.ts`, `src/meeting/muteState.ts` |
582
+ | `UC-4` | Host or application | Invite, admit, remove, mute, transfer, or retrieve members; bridge breakout events; and apply BRB through `brbState.enable()` after multistream/media-connection guards. | BRB rejects for transcoded meetings or without a media connection | `src/meeting/index.ts`, `src/meeting/brbState.ts`, `src/members/index.ts`, `src/breakouts/index.ts` |
583
+ | `UC-5` | Host | Start/stop/pause/resume recording, update entry/mute controls, lock/unlock, change layout, and select remote quality through the owning controller. | Controller and request rejections propagate | `src/meeting/index.ts`, `src/recording-controller/index.ts`, `src/controls-options-manager/index.ts` |
584
+ | `UC-6` | Participant | 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. | Unsupported features reject or log | `src/meeting/index.ts`, `src/reactions/reactions.ts` |
585
+ | `UC-7` | Participant | Switch to/from phone audio, move between meetings, send DTMF, or initiate/cancel SIP call-out while retaining correlation context. | Request failures propagate | `src/meeting/index.ts`, `src/meeting/request.ts` |
586
+ | `UC-8` | Meeting itself and host | Synchronize stage, notify host, refresh the data-channel token, and update the LLM connection while preserving Meeting-owned listener/token cleanup. | Token refresh resolves `null`; LLM registration failure rejects | `src/meeting/index.ts`, `src/meeting/request.ts` |
587
+
588
+ ### Cross-boundary use-case flow
589
+
590
+ - Locus REST (`locus-http`): HTTPS through `webex.request`. Participant and control requests go
591
+ through the Locus delta request, which adds the current Locus `sequence` to the body and applies a
592
+ Locus DTO from the response when the request URI starts with the meeting's `locusUrl`. Media
593
+ requests are serialized by `LocusMediaRequest`.
594
+ - Mercury: the Meeting listens to `ONLINE` and `OFFLINE` only for metrics; Locus events reach it
595
+ through LocusInfo.
596
+ - LLM data channel: a websocket registered per meeting; relay events carry reactions and captions,
597
+ and Locus LLM events carry hash-tree updates.
598
+ - Other services: the meeting policy service (`continueMeeting`), the site `notifyhost` API, hydra
599
+ `meetingParticipants/callout`, the reaction channel, and the keepalive URL.
600
+ - Timeouts and retries: media waits use the media module's ICE and DTLS timeouts; keepalive stops
601
+ after one failure; the media request retries on selfUrl rotation; joinWithMedia retries as in
602
+ MEETING-R-009.
603
+
604
+ ## Client state model
605
+
606
+ Identity, meeting/locus state, members, local and remote streams, media connection,
607
+ mute/share/BRB/control state, feature controllers, timers, and correlation identifiers are
608
+ meeting-scoped.
609
+
610
+ | State or slice | Owner | Initial state | Transition triggers | Reset or persistence boundary |
611
+ | -------------- | ----- | ------------- | ------------------- | ----------------------------- |
612
+ | `meetingFiniteStateMachine` | Meeting | IDLE | join, ring, leave, end, decline, fail, reset | Lives with the instance |
613
+ | `correlationId` and `callStateForMetrics` | Meeting | From the constructor | A new UUID on each later join unless one is passed | Lives with the instance |
614
+ | `audio`, `video` (MuteState), `brbState` | Meeting | null until `addMedia` | Local stream mute events and Locus self updates | `closePeerConnections(true)` and `clearMeetingData` set audio and video to null |
615
+ | `mediaProperties`, `remoteMediaManager`, slot and request managers | Meeting | Empty | `addMedia`, `moveTo`, reconnect | `closePeerConnections`, `unsetPeerConnections` |
616
+ | `shareStatus`, `screenShareFloorState` | Meeting | No share, released | Local share and Locus media-share updates | `clearMeetingData` |
617
+ | `queuedMediaUpdates` | Meeting | Empty | `enqueueMediaUpdate` | Emptied by `clearMeetingData` |
618
+ | `llmChannel`, `voiceaChannel` | Meeting | None | Join, URL changes, admit | `cleanupLLMConneciton` (`voiceaChannel` is kept when `preserveVoiceaChannel` is set) |
619
+ | `_pendingDatachannelToken` | Meeting | None | `saveDataChannelToken` on join, and `ensureDefaultDatachannelTokenAfterAdmit` when no channel exists | Cleared only when `updateLLMConnection` hands it to a new `llmChannel`; `cleanupLLMConneciton` does not clear it, so it can outlive leave |
620
+ | `joinWithMediaRetryInfo` | Meeting | Zero retries | Each `joinWithMedia` failure | Reset on success and on the terminal failure |
621
+ | `keepAliveTimerId`, log-upload timer, LLM health-check timer | Meeting | None | `startKeepAlive`, `startPeriodicLogUpload`, LLM connect | `stopKeepAlive`, `stopPeriodicLogUpload`, LLM cleanup |
622
+ | `inMeetingActions` | Meeting | All null | `updateMeetingActions` on Locus and policy changes | Lives with the instance |
623
+
624
+ ## Business rules and invariants
625
+
626
+ Remote Locus state remains authoritative; `MeetingUtil.cleanUp()` owns media/resource closure for
627
+ successful leave and Meetings-owned destroy. Before leave/end, `stopListeningForMeetingEvents()`
628
+ removes the LLM/Mercury/transcription/annotation subset but not LocusInfo listeners; privileged
629
+ operations require current capability/role data.
630
+
631
+ | ID | Invariant | WHY | Enforcement source | Test evidence |
632
+ | -- | --------- | --- | ------------------ | ------------- |
633
+ | `INV-001` | Lifecycle state changes only through the transitions in `state.ts`. | The `state.ts` comments define which operations are valid from which state, so an operation the table does not allow is rejected rather than reported (MEETING-R-001). | `src/meeting/state.ts` | `test/unit/spec/meeting/index.js` (join, leave, decline, and fail transitions through `meetingFiniteStateMachine`) |
634
+ | `INV-002` | At most one join request is in flight per meeting. | `join` returns the pending `deferJoin` promise to concurrent callers (MEETING-R-001). | `src/meeting/index.ts` | `test/unit/spec/meeting/index.js` |
635
+ | `INV-003` | At most one queued media update runs at a time, and only while no ROAP exchange is in progress. | The `canUpdateMedia` comment (MEETING-R-002). | `src/meeting/index.ts` | `test/unit/spec/meeting/index.js` |
636
+ | `INV-004` | At most one Locus `/media` request is in flight, and it always carries the latest mute state. | The `LocusMediaRequest` comments (MEETING-R-014). | `src/meeting/locusMediaRequest.ts` | `test/unit/spec/meeting/locusMediaRequest.ts` |
637
+ | `INV-005` | A new LLM channel is never registered with an empty URL or for a meeting that is not joined. | Registering with an empty data-channel URL throws in the request/interceptor layer, and the lobby-event call sites do not catch it, so it surfaced as an uncaught error on rejoin (MEETING-R-011). | `src/meeting/index.ts` | `test/unit/spec/meeting/index.js` |
638
+ | `INV-006` | Send slots are reset before the media connection closes. | The `closePeerConnections` comment: resetting while the connection is open lets each slot finish its stop-sending negotiation and detach its stream listeners, instead of racing the close and staying subscribed to a stream a later meeting may reuse (MEETING-R-008). | `src/meeting/index.ts` | `test/unit/spec/meeting/index.js` |
639
+
640
+ ## Concurrency and reactive flow
641
+
642
+ - Execution model: the JavaScript event loop; Locus, Mercury, LLM, and media events arrive as
643
+ emitter callbacks; timers run keepalive, periodic log upload, and the LLM health check.
644
+ - Ordering guarantees: Meeting lifecycle work is serialized through the meeting FSM and current
645
+ Locus/media state. Failure transitions receive their error payload; successful leave and
646
+ Meetings-owned destroy use `MeetingUtil.cleanUp()`. Leave/end remove the LLM, bound Mercury,
647
+ transcription, and annotation listener subset before the Locus operation, but LocusInfo listeners
648
+ are not part of that method and can still process Locus-driven callbacks until later cleanup.
649
+ Media updates run in queue order; Locus media requests run one at a time.
650
+ - Idempotency and retry: `stopListeningForMeetingEvents` and `stopListeningForMercuryEvents` are
651
+ idempotent; `cleanupLLMConneciton` always clears the health-check timer; joinWithMedia retries as
652
+ in MEETING-R-009.
653
+ - Shared-state protection: Mercury is shared with other plugins, so only bound handlers are removed
654
+ in `stopListeningForMercuryEvents`.
655
+ - Blocking restrictions: the LLM connection after join and the voicea channel switch are not awaited,
656
+ so a data-channel failure never fails the join.
657
+
658
+ ## State machine
659
+
660
+ ```mermaid
661
+ stateDiagram-v2
662
+ [*] --> IDLE
663
+ IDLE --> RINGING: ring
664
+ ERROR --> RINGING: ring
665
+ JOINED --> RINGING: ring
666
+ IDLE --> JOINED: join
667
+ RINGING --> JOINED: join
668
+ ERROR --> JOINED: join
669
+ JOINED --> JOINED: join
670
+ JOINED --> ANSWERED: remote answered
671
+ JOINED --> DECLINED: remote declined
672
+ JOINED --> ERROR: remote has neither result / fail
673
+ ERROR --> ANSWERED: remote answered
674
+ ERROR --> DECLINED: remote declined
675
+ ERROR --> ERROR: remote has neither result / fail
676
+ IDLE --> ENDED: leave / end
677
+ RINGING --> ENDED: leave / decline / end
678
+ JOINED --> ENDED: leave / end
679
+ ANSWERED --> ENDED: leave / end
680
+ DECLINED --> ENDED: leave / end
681
+ ERROR --> ENDED: leave / decline / end
682
+ IDLE --> ERROR: fail
683
+ RINGING --> ERROR: fail
684
+ ANSWERED --> ERROR: fail
685
+ DECLINED --> ERROR: fail
686
+ ENDED --> ERROR: fail
687
+ IDLE --> IDLE: reset
688
+ RINGING --> IDLE: reset
689
+ JOINED --> IDLE: reset
690
+ ANSWERED --> IDLE: reset
691
+ DECLINED --> IDLE: reset
692
+ ENDED --> IDLE: reset
693
+ ERROR --> IDLE: reset
694
+ ```
695
+
696
+ The diagram follows the `MEETING_STATE_MACHINE` values and transition table implemented in
697
+ `src/meeting/state.ts`. `onRing` emits `meeting:ringing`, `onRemote` emits `meeting:ringingStop`,
698
+ `onEnterError` logs the error with the last states, and the history keeps 25 states.
699
+
700
+ Rejected transitions: when a consumer calls join, a media/control action, leave, or
701
+ endMeetingForAll and the Meeting FSM cannot validate the lifecycle transition (javascript-state-machine
702
+ throws for a transition its table does not allow), or a required capability/permission is absent, the
703
+ returned promise is a typed rejection without a successful transition, and no scoped meeting event
704
+ reports one. An accepted operation performs the Locus/media operation and settles with its result or
705
+ failure.
706
+
707
+ ## Protocol and wire format
708
+
709
+ External payloads are parsed/serialized by files under `src/meeting/` and existing Webex/media
710
+ dependencies. Preserve current field names, enum/raw values, sequence identifiers, and compatibility
711
+ behavior; do not treat the normalized client model as the wire schema.
712
+
713
+ | Message or frame | Version | Producer or serializer | Consumer or parser | Compatibility and ordering rule |
714
+ | ---------------- | ------- | ---------------------- | ------------------ | ------------------------------- |
715
+ | Join: POST `<locusUrl>/participant` or `<clusterUrl>/loci/call`, with `alternateRedirect=true` | Locus REST, unversioned | `src/meeting/request.ts` | `src/meeting/util.ts` (parse join) | The response Locus is applied through LocusInfo |
716
+ | Leave: PUT `<locusUrl>/participant/<selfId>/leave` | Locus REST | `src/meeting/request.ts` | Locus | Sent after listener teardown |
717
+ | Alert, decline: PUT `<locusUrl>/participant/alert` and `/participant/decline` | Locus REST | `src/meeting/request.ts` | Locus | — |
718
+ | Controls: PATCH or PUT `<locusUrl>/controls` (lock, layout, reactions, stage) | Locus REST | `src/meeting/request.ts` | Locus | Through the delta request with `sequence`; `changeVideoLayout` is debounced 2000 ms |
719
+ | Self controls: PATCH `<locusUrl>/participant/<selfId>/controls` (BRB, consent) | Locus REST | `src/meeting/request.ts` | Locus | Through the delta request with `sequence` |
720
+ | Media: PUT `<selfUrl>/media` with `localMedias[0].localSdp` as a JSON string of mute state and ROAP message | Locus REST | `src/meeting/locusMediaRequest.ts` | Locus | One at a time; `localSdp` must be JSON-stringified for Locus |
721
+ | End: POST `<locusUrl>/end`; DTMF: POST `<locusUrl>/sendDtmf`; floor: PUT floor grant URI | Locus REST | `src/meeting/request.ts` | Locus | — |
722
+ | Data-channel token: GET `<locusUrl>/participant/<id>[/practiceSession]/datachannel/token` | Locus REST | `src/meeting/request.ts` | `src/meeting/index.ts` | Missing ids reject; transport errors resolve `null` |
723
+ | Keepalive: GET `keepAliveUrl` | Locus REST | `src/meeting/request.ts` | Locus | Every `(keepAliveSecs - 1) * 750` ms |
724
+ | Extend: POST `<meetingPolicyUrl>/continueMeeting`; notify host: POST `https://<site>/wbxappapi/v1/meetings/<uuid>/notifyhost`; SIP: POST hydra `meetingParticipants/callout` and `cancelCallout`; reaction: POST reaction channel URL | Service REST | `src/meeting/request.ts` | Those services | — |
725
+
726
+ ## Caller-visible failure modes
727
+
728
+ | Condition | Signal | Caller recovery |
729
+ |---|---|---|
730
+ | 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. |
731
+ | 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. |
732
+ | 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. |
733
+ | 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. |
734
+ | 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. |
735
+ | `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. |
736
+ | `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`. |
737
+ | 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. |
738
+ | Media never connects, even over TURN-TLS | `addMedia` rejects with `AddMediaFailed` carrying `connectionType`, `iceConnected`, and `iceConnectedAtLeastOnce`; `isDtlsHandshakeFailure` tells an ICE-connected DTLS failure apart. | Retry through `joinWithMedia`, which can switch to TURN-TLS only. |
739
+ | `addMedia` before the meeting is active, after LEFT, or in the lobby | `MeetingNotActiveError`, `UserNotJoinedError`, or `UserInLobbyError` | Join, wait for admission, or pass `allowMediaInLobby`. |
740
+ | `joinWithMedia` without `allowMediaInLobby`, or without WebRTC | `ParameterError`, or `WebrtcApiNotAvailableError` before any request | Fix the options or the environment. |
741
+ | `muteAudio`, `unmuteAudio`, `muteVideo`, or `unmuteVideo` | `UserNotJoinedError`, `NoMediaEstablishedYetError`, or `ParameterError` from the guards; past them, a TypeError (Evidence register) | Mute through the local stream instead. |
742
+
743
+ Evidence: `src/meeting/index.ts`, `src/meeting/request.ts`, `src/meeting/util.ts`,
744
+ `src/meeting/voicea-meeting.ts`, `src/common/errors/webex-errors.ts`, and
745
+ `test/unit/spec/meeting/index.js`.
746
+
747
+ ## Pitfalls and constraints
748
+
749
+ - Joining and adding media are distinct stages. A join can succeed before streams are ready, and
750
+ teardown must handle partially initialized media.
751
+ - Public behavior may be reachable through a parent `Meeting`/`Meetings` object even when the source
752
+ helper is not exported directly.
753
+ - The Meeting mute methods fail past their guards because `MuteState.handleClientRequest` no longer
754
+ exists; the unit tests stub it, so they do not catch this (Evidence register).
755
+ - `unsetPeerConnections` removes every Mercury `ONLINE` and `OFFLINE` listener when
756
+ `reconnection.detection` is on, including other plugins' listeners (Evidence register).
757
+ - The method name `cleanupLLMConneciton` is misspelled in code; search for that spelling.
758
+ - `src/meeting/index.ts` is over 11,000 lines; keep new logic in the helper files or the feature
759
+ modules where it belongs.
760
+
761
+ ## Module-specific rules
762
+
763
+ - Do: preserve this boundary: Join and leave through the lifecycle FSM while reconciling accepted
764
+ Locus state into composed controllers (`src/meeting/state.ts`, `src/meeting/index.ts`).
765
+ - Do: send Locus participant and control mutations through the Locus delta request so the sequence
766
+ is added and the response is applied (`src/meeting/util.ts`).
767
+ - Do not: move remote I/O or lifecycle ownership into a passive type, constant, catalog, or
768
+ normalization file.
769
+ - Do not: call `mercury.off` without a handler for a Meeting-owned listener; Mercury is shared.
770
+
771
+ ## Export stability
772
+
773
+ | Export or entry point | Consumer | Stability | Versioning and deprecation rule | Declaration or API report |
774
+ | --------------------- | -------- | --------- | ------------------------------- | ------------------------- |
775
+ | `Meeting` (named export of the package entry) | Applications that type or construct meetings | Published, contract `meeting-api` | Public method names, parameters, return promises, and rejection types change only in a semver-major release; new options and payload fields are added compatibly | `src/index.ts`, `src/meeting/index.ts`, `package.json` |
776
+ | Meeting-scoped event literals | Applications listening on a Meeting | Published, contract `meetings-events` | Literal values, scope, payload shape, and emission timing are preserved; new events and payload fields are additive | `src/constants.ts`, `src/meeting/index.ts` |
777
+ | Exported Meeting types (`AddMediaOptions`, `LocalStreams`, `CaptionData`, `Transcription`, `MEDIA_UPDATE_TYPE`, `ScreenShareFloorStatus`) | TypeScript consumers through the generated declarations | Published with the package types | Fields and union members are added, not removed or renamed, outside a major release | `src/meeting/index.ts`, `package.json` |
778
+ | `MeetingRequest`, `LocusMediaRequest`, helper classes | The Meeting and its controllers | Internal, contract `locus-http` for the request adapter | Not exported from `src/index.ts`; may change with the Meeting | `src/meeting/request.ts`, `src/meeting/locusMediaRequest.ts` |
779
+
780
+ The package publishes `dist/index.js` with declarations at `dist/types/index.d.ts` through
781
+ `deploy:npm`. Compatibility follows the notes under Public surface: prefer additive options and
782
+ payload fields, and preserve method/event names, rejection semantics, and cleanup timing.
783
+
784
+ ## Host integration and theming
785
+
786
+ The Webex SDK host supplies initialized request/device/Mercury/media capabilities and exposes this
787
+ behavior through `webex.meetings` or its Meeting objects. The module renders no UI and has no theme
788
+ contract.
789
+
790
+ - Mount or entry contract: `Meeting` extends `StatelessWebexPlugin`; the Meetings collection
791
+ constructs it with the parent webex.
792
+ - Required providers, peers, or host versions: `webex.request`, `webex.internal.device`,
793
+ `webex.internal.mercury`, `webex.internal.llm`, `webex.internal.voicea`,
794
+ `webex.internal.newMetrics`, and `webex.meetings` (registration and reachability).
795
+ - Theme and design-token contract: none.
796
+ - Accessibility and lifecycle obligations: call `leave` or `endMeetingForAll` so cleanup runs; the
797
+ Meetings collection destroys the meeting after Locus removes it.
798
+
799
+ ## Key design trade-off
800
+
801
+ The object composes many controllers to give consumers one stable meeting surface; the cost is
802
+ careful delegation and lifecycle cleanup.
803
+
804
+ | Chosen trade-off | Preserved invariant or benefit | Cost or limitation | Decision evidence |
805
+ | ---------------- | ------------------------------ | ------------------ | ----------------- |
806
+ | One Meeting facade owning every per-meeting controller | One object, one event scope, and one cleanup path per meeting | A very large class, and cleanup that must name every controller | `src/meeting/index.ts`, `src/meeting/util.ts` |
807
+
808
+ ## Verification
809
+
810
+ Use the current mirrored suites: `test/unit/spec/meeting/brbState.ts`,
811
+ `test/unit/spec/meeting/connectionStateHandler.ts`, `test/unit/spec/meeting/in-meeting-actions.ts`,
812
+ `test/unit/spec/meeting/index.js`, `test/unit/spec/meeting/locusMediaRequest.ts`,
813
+ `test/unit/spec/meeting/muteState.js`, `test/unit/spec/meeting/request.js`,
814
+ `test/unit/spec/meeting/utils.js`, `test/unit/spec/meeting/voicea-meeting.ts`. Characterize the
815
+ meeting-specific use cases above and each listed failure condition; add cleanup or transition cases
816
+ only for resources and state this module actually owns.
817
+
818
+ | Behavior / Requirement | Existing test evidence | Gap |
819
+ |---|---|---|
820
+ | `MEETING-R-001` | `test/unit/spec/meeting/index.js` | cover each lifecycle/media/member/control/feature/telephony/stage operation group represented above |
821
+ | `MEETING-R-002` | `test/unit/spec/meeting/index.js` | queued media update during leave/reconnect needs explicit ordering coverage |
822
+ | `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 |
823
+ | `MEETING-R-004` | `test/unit/spec/meeting/index.js`, `test/unit/spec/meeting/request.js` | none |
824
+ | `MEETING-R-005` | `test/unit/spec/meeting/index.js`, `test/unit/spec/media/index.ts` | verify every media type and partial initialization |
825
+ | `MEETING-R-006` | `test/unit/spec/meeting/index.js`, `test/unit/spec/locus-info/index.js` | verify event ordering for each projection family |
826
+ | `MEETING-R-007` | `test/unit/spec/meeting/request.js`, `test/unit/spec/meeting/in-meeting-actions.ts` | verify capability-denied cases for each control |
827
+ | `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 |
828
+ | `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 |
829
+ | `MEETING-R-010` | `test/unit/spec/meeting/voicea-meeting.ts` | covered for the final-only caption path |
830
+ | `MEETING-R-011` | `test/unit/spec/meeting/index.js` | none |
831
+ | `MEETING-R-012` | `test/unit/spec/meeting/index.js` | covered for the relay decision and AddMediaFailed fields |
832
+ | `MEETING-R-013` | `test/unit/spec/meeting/index.js` | none |
833
+ | `MEETING-R-014` | `test/unit/spec/meeting/locusMediaRequest.ts` | none |
834
+ | `MEETING-R-015` | `test/unit/spec/meeting/index.js` | none |