@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,643 @@
1
+ ---
2
+ type: Module Spec
3
+ title: 'Breakouts specification'
4
+ description: Responsibilities, boundaries, design, state, invariants, and verification for the meeting breakouts 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
+ # Breakouts
17
+
18
+ This canonical source-local document at `src/breakouts/docs/README.md` owns the stable
19
+ specification for **breakouts**: the `meeting.breakouts` controller (`Breakouts`, a `WebexPlugin`)
20
+ and its per-session `Breakout` objects. The module projects Locus breakout state into a session
21
+ collection, runs attendee moves and help requests, host and cohost management, edit locking, and
22
+ broadcast against the breakout service, and emits roster, help, message, return, and closing events
23
+ that `Meeting` re-emits to applications. Ground every claim in package evidence and link to the
24
+ [package architecture](../../../docs/architecture.md) instead of repeating broader facts. No service
25
+ specification exists because this package is a library.
26
+
27
+ Related context: [documentation index](../../../docs/index.md) ·
28
+ [package agent instructions](../../../AGENTS.md)
29
+
30
+ ## Metadata
31
+
32
+ | Field | Value |
33
+ | ----- | ----- |
34
+ | Owner | @webex/web-client, @webex/web-sdk |
35
+ | Source path | `src/breakouts` |
36
+ | Resource kind | module |
37
+ | Status | Draft |
38
+ | Last verified | 2026-11-16 at `0b8c34db7f` |
39
+ | Module id | `plugin-meetings/breakouts` |
40
+ | Parent spec | — |
41
+ | Doc kind | Module spec |
42
+ | Coverage score | Pending coverage assessment |
43
+ | Validation status | not-run |
44
+
45
+ ## Applicability
46
+
47
+ | Condition ID | Status | Evidence or reason | Owned section |
48
+ | ------------------------------------ | ---------- | ------------------ | ------------- |
49
+ | `module.has_tiers` | N/A | No tier policy exists in `package.json` or `src/breakouts/index.ts` | Tier |
50
+ | `module.has_ui` | N/A | `src/breakouts/index.ts` and `src/breakouts/breakout.ts` expose state, promises, and events; no UI | UI use-case flow |
51
+ | `module.crosses_service_boundaries` | Applicable | `src/breakouts/index.ts`, `src/breakouts/breakout.ts`, and `src/breakouts/request.ts` call the breakout service; `src/breakouts/index.ts` listens to Mercury and the LLM data channel | Cross-boundary use-case flow |
52
+ | `module.holds_client_state` | Applicable | Breakout projection props, the session collection, the edit lock, and subscription flags in `src/breakouts/index.ts` | Client state model |
53
+ | `module.enforces_domain_rules` | Applicable | Closing freeze, roster sequence check, main-session guards, and edit-lock rules in `src/breakouts/index.ts` and `src/breakouts/breakout.ts` | Business rules and invariants |
54
+ | `module.is_concurrent_async` | Applicable | Promise requests, a debounced roster query, a keepalive interval, and independent LLM and Locus inputs in `src/breakouts/index.ts` | Concurrency and reactive flow |
55
+ | `module.owns_persistence` | N/A | Nothing is stored; the breakout service and Locus hold the record (`src/breakouts/index.ts`) | Data, schema, and migration discipline |
56
+ | `module.stateful_transitions` | Applicable | Breakout status values in `src/constants.ts` and the edit-lock lifecycle in `src/breakouts/index.ts` | State machine |
57
+ | `module.exposes_wire_protocol` | N/A | Recorded false in `.sdd/manifest.json`; request bodies are described under Requirements | Protocol and wire format |
58
+ | `module.ui_multi_screen` | N/A | No UI | UI flow |
59
+ | `module.large_data_model` | N/A | The props in `src/breakouts/index.ts` and `src/breakouts/breakout.ts` are listed under Client state model | Data model |
60
+ | `module.returns_caller_errors` | Applicable | Synchronous throws, rejected promises, and BreakoutEditLockedError from `src/breakouts/utils.ts` | Caller-visible failure modes |
61
+ | `module.module_specific_conventions` | Applicable | Edit-lock body and error-mapping conventions in `src/breakouts/index.ts` | Module-specific rules |
62
+ | `module.published_package` | N/A | `src/index.ts` exports no breakouts symbol; the surface is reached through meeting.breakouts | Export stability |
63
+ | `module.embedded_in_host` | N/A | No host theme or embed API | Host integration and theming |
64
+ | `module.has_design_tradeoff` | Applicable | Edit locking and server-side authorization in `src/breakouts/index.ts` | Key design trade-off |
65
+ | `module.has_submodules` | N/A | The breakouts directory has no child module (`src/breakouts/index.ts`) | Sub-modules |
66
+
67
+ ## Evidence register
68
+
69
+ Requirements cite current source and mirrored tests under `test/unit/spec/breakouts/`. Where
70
+ prose and code disagree, current code wins; commit and PR history are not used as evidence. Missing
71
+ evidence stays a recorded gap.
72
+
73
+ | Evidence | What it establishes |
74
+ | -------- | ------------------- |
75
+ | `src/breakouts/index.ts` | `Breakouts` extends `WebexPlugin` (namespace `Meetings`): props, derived state, the `breakouts` collection and `currentBreakoutSession` child, every listener, request, edit-lock method, and the join-response metric logic |
76
+ | `src/breakouts/breakout.ts` | `Breakout` (`idAttribute: 'sessionId'`): join, leave, help, session broadcast, `Members` creation, and roster sequence checks |
77
+ | `src/breakouts/collection.ts` | `BreakoutCollection`, an ampersand collection of `Breakout` with `mainIndex: 'sessionId'` |
78
+ | `src/breakouts/request.ts` | `BreakoutRequest` extends `StatelessWebexPlugin`; `broadcast` builds the message body and swallows the no-joined-participants 409 |
79
+ | `src/breakouts/utils.ts` | `getBroadcastRoles`, `boServiceErrorHandler` (error codes to `BreakoutEditLockedError`), `isSessionTypeChangedFromSessionToMain` |
80
+ | `src/breakouts/edit-lock-error.ts` | `BreakoutEditLockedError` name, message, `sdkMessage`, and code from `ERROR_DICTIONARY.BREAKOUT_EDIT` |
81
+ | `src/breakouts/events.ts` | `breakoutEvent` move request, move response, and join response Call Analyzer metrics and their send conditions |
82
+ | `src/constants.ts` | `BREAKOUTS` (status, events, session types and states, actions, error codes, edit-lock states, `DEFAULT_TTL` 30), `EVENT_TRIGGERS` `meeting:breakouts:*`, `ERROR_DICTIONARY.BREAKOUT_EDIT` (code 9) |
83
+ | `src/meeting/index.ts` | `Meeting` creates `new Breakouts({meetingId}, {parent: webex})`, feeds Locus URL, service URL, roles, breakout controls, and session lists, registers and unregisters the LLM channel, triggers `LLM_CONNECT_RESPONSE`, and re-emits the module events |
84
+ | `src/meeting/util.ts` | `MeetingUtil.cleanUp` calls `breakouts.cleanUp()` |
85
+ | `src/meeting/request.ts` | A join with `breakoutsSupported` adds the `BREAKOUTS_SUPPORTED` device capability |
86
+ | `src/breakouts/README.md` | States that the host operations are not implemented, which `src/breakouts/index.ts` contradicts |
87
+ | `test/unit/spec/breakouts/index.ts` | Controller cases: listeners, derived state, updates, LLM channel, every host and assignment request, edit lock, and metrics |
88
+ | `test/unit/spec/breakouts/breakout.ts` | Session cases: join with metrics, leave guards, help, session broadcast, roster sequence |
89
+ | `test/unit/spec/breakouts/request.ts`, `test/unit/spec/breakouts/utils.js` | Broadcast body and 409 handling; roles, error mapping, session-type predicate |
90
+ | `test/unit/spec/breakouts/events.ts`, `test/unit/spec/breakouts/edit-lock-error.ts`, `test/unit/spec/breakouts/collection.ts` | Metric payloads and duplicate suppression; error construction; collection model |
91
+ | Observation, no stated WHY | The edit-lock body differs per method: `{token}` for `doToggleBreakout`, `create`, `clearSessions`; `{token, refresh: true}` for `start`, `end`, `assign`; `refresh: !unlockEdit` for `update`; the whole `editLock` object or `null` for `dynamicAssign`; none for `moveToLobby` and `removeFromBreakout` (`src/breakouts/index.ts`) |
92
+ | Observation, no stated WHY | `start()` defaults `allowBackToMain` and `allowToJoinLater` to `false`, and `end()` sends the current `delayCloseTime` (`src/breakouts/index.ts`) |
93
+ | Observation, no stated WHY | `ASK_RETURN_TO_MAIN` is re-emitted as `meeting:breakouts:askReturnToMain` only while the meeting `isJoined()` (`src/meeting/index.ts`) |
94
+
95
+ ## Purpose and boundary
96
+
97
+ - Responsibility: Owns breakout-session projections, participant and host workflows, roster/broadcast/help events, edit-lock lifecycle, and server mutations.
98
+ - In scope: the `Breakouts` controller and its props and derived state; the `breakouts` collection
99
+ and `currentBreakoutSession`; attendee `join`, `leave`, `askForHelp`; host and cohost enable,
100
+ toggle, create, clear, start, end, update, assign, dynamic assign, move to lobby, remove, ask all
101
+ to return, and broadcast; the edit lock and its keepalive; Mercury roster and help listeners; the
102
+ LLM broadcast-message subscription; per-session `Members` rosters; breakout Call Analyzer metrics.
103
+ - Out of scope: parsing Locus into breakout controls and session lists (`src/locus-info`); member
104
+ modelling (`src/members`); the LLM connection and its registration (`Meeting`,
105
+ `@webex/internal-plugin-llm`); the Mercury socket; metric transport (`webex.internal.newMetrics`);
106
+ what the breakout service authorizes and stores.
107
+ - Consumers: `Meeting` (`src/meeting/index.ts`) constructs it, feeds it, and re-emits its events;
108
+ applications call `meeting.breakouts` and its `Breakout` models directly.
109
+
110
+ ## Structure and key files
111
+
112
+ `src/breakouts/` contains 8 direct source and reference files (seven TypeScript files and the
113
+ retained `README.md`) and has 7 mirrored unit-test files under `test/unit/spec/breakouts/`. This
114
+ specification separates its public operations, runtime data movement, component ownership, state,
115
+ and verification boundary. Sources are TypeScript in the Node 22.14 Yarn workspace on Webex core
116
+ plugin abstractions (`WebexPlugin`, `StatelessWebexPlugin`) and ampersand collections; tests run
117
+ under Mocha with Sinon and `@webex/test-helper-chai` (`test:unit` in `package.json`), and one test
118
+ file is JavaScript.
119
+
120
+ | File | Holds |
121
+ | ---- | ----- |
122
+ | `src/breakouts/index.ts` | `Breakouts` controller mounted as `meeting.breakouts`: module facade/controller and primary (default) export holding props, derived state, listeners, host requests, edit lock, and metrics |
123
+ | `src/breakouts/breakout.ts` | `Breakout` session model: attendee join, leave, help request, session broadcast, and roster parsing for one breakout |
124
+ | `src/breakouts/collection.ts` | `BreakoutCollection`, the module-owned collection of `Breakout` models indexed by `sessionId` |
125
+ | `src/breakouts/edit-lock-error.ts` | `BreakoutEditLockedError`, the module-specific error type for edit-lock conflicts |
126
+ | `src/breakouts/events.ts` | `breakoutEvent` Call Analyzer metric construction/submission helper for move request, move response, and join response; feature events are emitted by `index.ts` |
127
+ | `src/breakouts/request.ts` | `BreakoutRequest`, the broadcast-specific request helper |
128
+ | `src/breakouts/utils.ts` | Normalization/helper functions: broadcast roles, breakout service error mapping, and the session-type predicate |
129
+ | `src/breakouts/README.md` | Retained human feature guide, context only; its host section predates the implemented host operations |
130
+ | `src/breakouts/docs/README.md` | This module specification |
131
+ | `test/unit/spec/breakouts/index.ts`, `test/unit/spec/breakouts/breakout.ts`, `test/unit/spec/breakouts/collection.ts`, `test/unit/spec/breakouts/edit-lock-error.ts`, `test/unit/spec/breakouts/events.ts`, `test/unit/spec/breakouts/request.ts`, `test/unit/spec/breakouts/utils.js` | Mirrored characterization/unit coverage, one test file per source file |
132
+
133
+ ## Public surface
134
+
135
+ `meeting.breakouts` is the `Breakouts` instance `Meeting` creates with `{meetingId}`; `src/index.ts`
136
+ exports no breakouts symbol, so applications reach the module only through a meeting. Every row
137
+ belongs to contract `breakouts-api`, indexed in the
138
+ [package architecture](../../../docs/architecture.md#public-and-consumer-surfaces); contract IDs and
139
+ coverage state are recorded in `.sdd/manifest.json`.
140
+
141
+ | Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
142
+ |---|---|---|---|---|---|---|
143
+ | `breakouts-api` | SDK / lifecycle | `initialize()`, `cleanUp()`, `locusUrlUpdate()`, `updateCanManageBreakouts()`, `breakoutServiceUrlUpdate()`, `updateBreakout()`, `handleRosterUpdate()`, `listenToCurrentSessionTypeChange()`, `registerLLMChannel()`, `unregisterLLMChannel()`, `listenToBroadcastMessages()`, `listenToBreakoutRosters()`, `listenToBreakoutHelp()`, `handleLLMBreakoutJoinResponseMetric()`, `submitLLMBreakoutJoinResponseMetric()`, `updateBreakoutSessions()`, and `clearBreakouts()` | Reconcile meeting-scoped breakout state and owned event subscriptions/metrics from Locus, Mercury, LLM, and service updates; `Meeting` calls these | Preserve session/member ids, listener topics, metric fields, and scoped emitted events. | `src/breakouts/index.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
144
+ | `breakouts-api` | SDK / query | `queryRosters()`, `isBreakoutInProgress()`, `isBreakoutIClosing()`, `getMainSession()`, `getBreakout()`, the derived `isInMainSession`, `isActiveBreakout`, `breakoutGroupId`, `breakoutStatus`, and `shouldQueryPreAssignments`, and the `breakouts` collection and `currentBreakoutSession` | Query and project current breakout sessions, main-session identity, roster, and close state; `getBreakout(true)` also takes the edit lock | Preserve collection identity and current enum/value semantics, including the `isBreakoutIClosing` spelling. | `src/breakouts/index.ts`, `src/breakouts/collection.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
145
+ | `breakouts-api` | attendee session object | `Breakout.initialize()`, `join()`, `leave()`, `askForHelp()`, `initMembers()`, `isNeedHandleRoster()`, `parseRoster()`, and `broadcast()` | Let an attendee act on one breakout and maintain its session-local roster; `broadcast()` here targets this one session. | These methods are owned by `breakout.ts`, not delegated through the controller index. | `src/breakouts/breakout.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
146
+ | `breakouts-api` | SDK / remote | controller `askAllToReturn()`, `broadcast()`, and `triggerReturnToMainEvent()` | Send host return/broadcast actions and expose the corresponding scoped meeting event. | Preserve broadcast roles/content and the return-to-main event, which carries no payload. | `src/breakouts/index.ts`, `src/breakouts/request.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
147
+ | `breakouts-api` | SDK / host remote | `enableBreakouts()`, `toggleBreakout()`, `doToggleBreakout()`, `create()`, `clearSessions()`, `start()`, `end()`, and `update()` | Create and transition the remote breakout configuration and sessions. | Preserve request sequencing, state values, and service rejection mapping. | `src/breakouts/index.ts`, `src/breakouts/utils.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
148
+ | `breakouts-api` | SDK / assignment remote | `assign()`, `queryPreAssignments()`, `dynamicAssign()`, `moveToLobby()`, and `removeFromBreakout()` | Manage pre/dynamic participant assignment and movement between lobby/session contexts. | Preserve participant/session ids and per-operation request bodies. | `src/breakouts/index.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
149
+ | `breakouts-api` | SDK / edit lock | `enableAndLockBreakout()`, `hasBreakoutLocked()`, `lockBreakout()`, `keepEditLockAlive()`, and `unLockEditBreakout()` | Acquire, refresh, inspect, and release the edit token used by protected host mutations. | Service lock conflicts map to `BreakoutEditLockedError`, while a locally held lock rejects with a plain `Error`; keepalive ownership is explicit. | `src/breakouts/index.ts`, `src/breakouts/edit-lock-error.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
150
+ | `breakouts-api` | module helpers and caller-visible error | `BreakoutRequest.broadcast()`, `BreakoutEditLockedError`, `getBroadcastRoles()`, `boServiceErrorHandler()`, and `isSessionTypeChangedFromSessionToMain()` | Provide the direct broadcast adapter, lock error, role selection, service-error mapping, and session-transition predicate; none is exported from `src/index.ts`, and callers meet `BreakoutEditLockedError` only as a rejection value. | Preserve error identity (`name`, `sdkMessage`, code 9), role ordering (`COHOST` before `PRESENTER`), and transition logic. | `src/breakouts/request.ts`, `src/breakouts/edit-lock-error.ts`, `src/breakouts/utils.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
151
+
152
+ Current source emits or forwards these observable literals for this operation boundary. Preserve literal values, scope, payload shape, and emission timing; a constant name alone is not a substitute for the consumer-visible value.
153
+
154
+ | Event literal | Constant / expression | Emission evidence |
155
+ |---|---|---|
156
+ | `ASK_FOR_HELP` | `BREAKOUTS.EVENTS.ASK_FOR_HELP` | `src/breakouts/index.ts` |
157
+ | `ASK_RETURN_TO_MAIN` | `BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN` | `src/breakouts/index.ts` |
158
+ | `BREAKOUTS_CLOSING` | `BREAKOUTS.EVENTS.BREAKOUTS_CLOSING` | `src/breakouts/index.ts` |
159
+ | `LEAVE_BREAKOUT` | `BREAKOUTS.EVENTS.LEAVE_BREAKOUT` | `src/breakouts/index.ts` |
160
+ | `LLM_CONNECT_RESPONSE` (inbound: `Meeting` triggers it on the controller) | `BREAKOUTS.EVENTS.LLM_CONNECT_RESPONSE` | `src/meeting/index.ts` |
161
+ | `meeting:breakouts:askForHelp` | `EVENT_TRIGGERS.MEETING_BREAKOUTS_ASK_FOR_HELP` | `src/meeting/index.ts` |
162
+ | `meeting:breakouts:askReturnToMain` | `EVENT_TRIGGERS.MEETING_BREAKOUTS_ASK_RETURN_TO_MAIN` | `src/meeting/index.ts` |
163
+ | `meeting:breakouts:closing` | `EVENT_TRIGGERS.MEETING_BREAKOUTS_CLOSING` | `src/meeting/index.ts` |
164
+ | `meeting:breakouts:leave` | `EVENT_TRIGGERS.MEETING_BREAKOUTS_LEAVE` | `src/meeting/index.ts` |
165
+ | `meeting:breakouts:message` | `EVENT_TRIGGERS.MEETING_BREAKOUTS_MESSAGE` | `src/meeting/index.ts` |
166
+ | `meeting:breakouts:preAssignmentsUpdate` | `EVENT_TRIGGERS.MEETING_BREAKOUTS_PRE_ASSIGNMENTS_UPDATE` | `src/meeting/index.ts` |
167
+ | `meeting:breakouts:update` | `EVENT_TRIGGERS.MEETING_BREAKOUTS_UPDATE` | `src/meeting/index.ts` |
168
+ | `MEMBERS_UPDATE` | `BREAKOUTS.EVENTS.MEMBERS_UPDATE` | `src/breakouts/index.ts` |
169
+ | `MESSAGE` | `BREAKOUTS.EVENTS.MESSAGE` | `src/breakouts/index.ts` |
170
+ | `PRE_ASSIGNMENTS_UPDATE` | `BREAKOUTS.EVENTS.PRE_ASSIGNMENTS_UPDATE` | `src/breakouts/index.ts` |
171
+
172
+ `MESSAGE` carries `{senderUserId, sentTime, message, sessionId}` and `ASK_FOR_HELP` carries
173
+ `{participant, sessionId}`; `Meeting` passes both payloads through to the `meeting:breakouts:*`
174
+ event, and the other events carry none. `meeting:breakouts:update` is also emitted by `Meeting`
175
+ after it applies Locus breakout controls or session lists. The literals are defined in
176
+ `src/constants.ts`.
177
+
178
+ Compatibility notes:
179
+
180
+ - Prefer additive fields/options and preserve current rejection/event/cleanup semantics. Internal helpers are not public merely because they are exported within the source directory.
181
+
182
+ ## Dependencies
183
+
184
+ Requires: Parent Meeting/Locus state, breakout service URL, request helper, breakout/member
185
+ collections, event utilities, timers, role/capability fields, and metrics. Contracts: provides
186
+ `breakouts-api`; requires `locus-http`, `webex-core-plugin-host`, `internal-plugin-llm-channel`, and
187
+ `internal-plugin-mercury-events` (`.sdd/manifest.json`).
188
+
189
+ | Dependency | Why it is required | Failure behavior |
190
+ | ---------- | ------------------ | ---------------- |
191
+ | `@webex/webex-core` (`webex-core-plugin-host`) | `WebexPlugin` and `StatelessWebexPlugin` base classes; `this.request` and `this.webex.request` carry every breakout-service call | Rejections propagate unless the method catches them (see Caller-visible failure modes) |
192
+ | Breakout service (`locus-http`) | Resource URL from Locus `services.breakout.url` plus `/breakout/` (`breakoutServiceUrlUpdate`) and the per-meeting breakout `url` from Locus breakout controls (`updateBreakout`) | Lock error codes `201409024` and `201403007` map to `BreakoutEditLockedError`; other errors pass through |
193
+ | `Meeting` and `LocusInfo` (`src/meeting/index.ts`) | Locus URL, service URLs, self roles (moderator or cohost sets `canManageBreakouts`), breakout controls, session lists, and the registered LLM channel | Without them the controller holds no URL and requests target `undefined` paths |
194
+ | `webex.internal.mercury` (`internal-plugin-mercury-events`) | `event:breakout.roster` and `event:breakout.help` | No retry; a missed roster event waits for the next one |
195
+ | LLM data channel (`internal-plugin-llm-channel`: `LLMChannel` from `Meeting`, and `webex.internal.llm`) | `event:breakout.message` broadcasts; `online` re-checks the subscription; `getWebSocketUrl` feeds metrics | No subscription while the channel is missing or disconnected |
196
+ | `webex.internal.newMetrics.submitClientEvent` | Breakout move and join Call Analyzer metrics through `breakoutEvent` | Skipped without a move id, a meeting, or `enableConvergedArchitecture` |
197
+ | `webex.meetings.getMeetingByType`, `webex.internal.device.url` | Meeting lookup for metrics and `Members`; the device URL in the move body | — |
198
+ | `src/members` (`Members`) | Per-breakout member rosters | — |
199
+ | `lodash` (`debounce`, `forEach`), `uuid` (`v4`), `ampersand-collection`, `window.setInterval` | Debounced roster query, state-list iteration, move ids, the collection, and the keepalive timer | — |
200
+
201
+ ## Requirements
202
+
203
+ | ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
204
+ |---|---|---|---|---|---|---|
205
+ | `BREAKOUTS-R-001` | initialize/query breakout session and roster state: `initialize()` wires the closing, pre-assignment, roster-query, return-to-main, LLM-connect, session-type, roster, help, and LLM `online` listeners; adding sessions runs `queryRosters()` (debounced, leading edge, 10 ms), which GETs `<url>/roster` with `locusUrl` base64-encoded, passes each roster `locus` to `handleRosterUpdate()`, and emits `MEMBERS_UPDATE`. | A client that joins gets no `breakout.roster` event for rosters that already exist, so the initial roster lists must be queried (code comment on `queryRosters`). | `src/breakouts/index.ts` | `test/unit/spec/breakouts/index.ts` | A failed roster query is only logged | Present |
206
+ | `BREAKOUTS-R-002` | Attendee `join()`, `leave()`, and `askForHelp()` execute on the per-session object in `breakout.ts`: `join()` POSTs `<url>/move` with `{breakoutMoveId, deviceUrl, groupId, sessionId}` between the move-request and move-response metrics, `leave()` joins the main session, and `askForHelp()` POSTs `<url>/help`. Controller and session broadcasts delegate to `BreakoutRequest.broadcast()`. | The session object and controller have distinct request ownership, so attributing every attendee operation to `index.ts` hides the actual call boundary. | `src/breakouts/breakout.ts`, `src/breakouts/index.ts`, `src/breakouts/request.ts` | `test/unit/spec/breakouts/breakout.ts`, `test/unit/spec/breakouts/index.ts`, `test/unit/spec/breakouts/request.ts` | none | Present |
207
+ | `BREAKOUTS-R-003` | Host and attendee request failures remain caller-visible as rejections and edit-lock conflicts are mapped explicitly; `queryRosters()` and `queryPreAssignments()` only log, and `keepEditLockAlive()` and `unLockEditBreakout()` return nothing, so their mapped rejections reach no caller. `unLockEditBreakout()` clears the keepalive after a successful DELETE, but `cleanUp()` only stops listeners/resets message subscription and does not clear the edit-lock timer. | The timer ownership gap must remain visible so cleanup is not relied on to release an editor that current code leaves active. | `src/breakouts/index.ts`, `src/breakouts/edit-lock-error.ts` | `test/unit/spec/breakouts/index.ts`, `test/unit/spec/breakouts/edit-lock-error.ts` | cleanup does not clear the edit-lock keepalive timer | Present |
208
+ | `BREAKOUTS-R-004` | Roster, session type, broadcasts, help requests, and return-to-main updates reconcile into meeting-scoped breakout/session/member projections and events: `updateBreakoutSessions()` rebuilds the collection from the Locus state lists, and `parseRoster()` replaces one session's members only for a newer Locus sequence. | Attendees need current session membership and host messages without consuming raw Locus/service payloads. | `src/breakouts/index.ts`, `src/breakouts/breakout.ts`, `src/breakouts/collection.ts` | `test/unit/spec/breakouts/index.ts`, `test/unit/spec/breakouts/breakout.ts`, `test/unit/spec/breakouts/collection.ts` | duplicate or out-of-order Mercury roster events are not characterized | Present |
209
+ | `BREAKOUTS-R-005` | Host create/start/end/update/assign/move/remove operations use current session ids/URLs and direct request calls owned by `index.ts`; `canManageBreakouts` is stored but does not gate these methods (it only feeds `shouldQueryPreAssignments`). | These operations mutate shared server state, and the current absence of a local capability guard must not be replaced with an invented authorization guarantee. | `src/breakouts/index.ts` | `test/unit/spec/breakouts/index.ts` | stored management capability is not enforced by host mutation methods | Present |
210
+ | `BREAKOUTS-R-006` | Edit-lock acquire/keepalive/unlock is coordinated around host configuration; `create`, `clearSessions`, `start`, `end`, `update`, the keepalive, and unlock map lock conflicts to `BreakoutEditLockedError` through `boServiceErrorHandler()`, while `assign`, `dynamicAssign`, `moveToLobby`, `removeFromBreakout`, and `doToggleBreakout` pass errors through unmapped; explicit unlock clears the timer. | Multiple hosts can edit breakout configuration, so conflict identity and explicit unlock behavior must remain stable even though general cleanup has a timer gap. | `src/breakouts/index.ts`, `src/breakouts/edit-lock-error.ts`, `src/breakouts/utils.ts` | `test/unit/spec/breakouts/edit-lock-error.ts`, `test/unit/spec/breakouts/utils.js`, `test/unit/spec/breakouts/index.ts` | general cleanup does not clear the timer | Present |
211
+ | `BREAKOUTS-R-007` | `listenToBroadcastMessages()` subscribes once to `event:breakout.message` on the registered LLM channel, and only while that channel `isConnected()`; it runs from `locusUrlUpdate()`, `registerLLMChannel()`, and the `webex.internal.llm` `online` event. `registerLLMChannel()` stops listening to a previously subscribed channel first; `unregisterLLMChannel()` stops listening and clears the flag. Each message emits `MESSAGE` with the current session's `sessionId`. | LLM may connect after `locusUrlUpdate` has already run, so the subscription is re-checked on connect (code comment in `initialize`), and a previous channel is cleaned up so one channel delivers messages (code comment in `registerLLMChannel`). | `src/breakouts/index.ts`, `src/meeting/index.ts` | `test/unit/spec/breakouts/index.ts` | The `sessionId` is not checked against the data channel (FIXME in code) | Present |
212
+ | `BREAKOUTS-R-008` | `updateBreakout(params)` sets the Locus breakout controls on the controller, unsets `groups`, `startTime`, and `status` when absent, keeps the last non-empty `breakoutMoveId`, replaces `currentBreakoutSession` (`current: true`, every state flag false), clears the collection when no breakout is in progress, and sends a join-response metric when the session or group id changed. | The three values are set manually so they are unset when not included in params, and a changed joined session should report a join response (code comments in `updateBreakout`). | `src/breakouts/index.ts` | `test/unit/spec/breakouts/index.ts` | none | Present |
213
+ | `BREAKOUTS-R-009` | `submitLLMBreakoutJoinResponseMetric()` sends `client.breakout-session.join.response` with LLM latency only when the stored LLM connect info carries the current `breakoutMoveId`, the current session has `sessionId` and `groupId`, and the client is in an active breakout or the main session, then clears the stored info. `breakoutEvent` submits only with a move id, a meeting, and `meetingInfo.enableConvergedArchitecture`, and lets the meeting's `shouldEmitBreakoutJoinResponseMetric` suppress duplicates. | The breakout update and the LLM response arrive independently, and the main session is accepted to mirror the desktop client, which reports both directions (JSDoc of `submitLLMBreakoutJoinResponseMetric`). | `src/breakouts/index.ts`, `src/breakouts/events.ts` | `test/unit/spec/breakouts/index.ts`, `test/unit/spec/breakouts/events.ts` | none | Present |
214
+ | `BREAKOUTS-R-010` | `enableBreakouts()` POSTs `{locusUrl}` to `breakoutServiceUrl` and rejects without it; `toggleBreakout(enable)` first enables when `enableBreakoutSession` is undefined, applies the response with `updateBreakout()`, and then disables only when `enable` is false; otherwise it PUTs `{enableBreakoutSession}` to `url`. | The first enable provisions the breakout resource and sets the initial data (code comment "first time enable, set the initial data"). | `src/breakouts/index.ts` | `test/unit/spec/breakouts/index.ts` | none | Present |
215
+ | `BREAKOUTS-R-011` | `getBreakout(true)` GETs `<url>?editlock=true`, stores the returned `editlock`, and starts `keepEditLockAlive()`, which PUTs `<url>/editlock/<token>` every ttl/2 seconds (a ttl below 30 uses `DEFAULT_TTL` 30) and replaces a running interval; a failed refresh clears the lock. `lockBreakout()` rejects with `Breakout already locked` when the held lock is `LOCKED`. | The service grants the lock for `ttl` seconds, so the holder refreshes it before it lapses (method name `keepEditLockAlive`; inferred from the ttl/2 period). | `src/breakouts/index.ts` | `test/unit/spec/breakouts/index.ts` | WHY inferred | Weak |
216
+ | `BREAKOUTS-R-012` | `assign(sessions)` PUTs `groups: [{id: breakoutGroupId, sessions}]` with `assigned` (member ids), `assignedEmails`, and `anyoneCanJoin`; `dynamicAssign()` PUTs `<url>/dynamicAssign` with `{id, participants, targetState}`; `moveToLobby()` PUTs `<url>/dynamicAssign` to the main group and session with `targetState: 'LOBBY'`; `removeFromBreakout()` POSTs `<url>/move` to the main group and session. | `dynamicAssign` is used for admitting participants from the lobby into a breakout directly (its JSDoc), and moving to the lobby or out of a breakout needs the main session as target (the methods' error messages). | `src/breakouts/index.ts` | `test/unit/spec/breakouts/index.ts` | none | Present |
217
+ | `BREAKOUTS-R-013` | `queryPreAssignments()` runs when `shouldQueryPreAssignments` (manager, breakouts enabled, pre-assignments exist) becomes true and none are loaded; it GETs `<url>/preassignments` with base64 `locusUrl`, stores `body.groups`, and emits `PRE_ASSIGNMENTS_UPDATE`. | Only a host or cohost of a meeting with pre-assignments needs them (derived `shouldQueryPreAssignments`). | `src/breakouts/index.ts` | `test/unit/spec/breakouts/index.ts` | none | Present |
218
+ | `BREAKOUTS-R-014` | `BREAKOUTS_CLOSING` fires when `breakoutStatus` becomes `CLOSING`; `LEAVE_BREAKOUT` fires when `currentBreakoutSession.sessionType` changes from `BREAKOUT` to `MAIN`; `ASK_RETURN_TO_MAIN` fires when a requested main session is added or its `requestedLastModifiedTime` changes. | `Meeting` re-emits them as `meeting:breakouts:closing`, `meeting:breakouts:leave`, and `meeting:breakouts:askReturnToMain` for applications (`src/meeting/index.ts`). | `src/breakouts/index.ts`, `src/breakouts/utils.ts` | `test/unit/spec/breakouts/index.ts`, `test/unit/spec/breakouts/utils.js` | none | Present |
219
+ | `BREAKOUTS-R-015` | Controller `broadcast(message, options)` throws without an active `breakoutGroupId`; `BreakoutRequest.broadcast()` POSTs `<url>/message` with `{message, groups: [{id, recipientRoles, sessions}]}`, roles `COHOST` and `PRESENTER` from `options.cohosts` and `options.presenters`, and `sessions` only for a session broadcast; a 409 with errorCode `201409036` is logged and resolves `undefined`. | That 409 means no participants have joined, which is not a failure for the sender (log text "no joined participants"). | `src/breakouts/index.ts`, `src/breakouts/request.ts`, `src/breakouts/utils.ts` | `test/unit/spec/breakouts/index.ts`, `test/unit/spec/breakouts/request.ts`, `test/unit/spec/breakouts/utils.js` | none | Present |
220
+
221
+ ## Design overview
222
+
223
+ Breakouts projects Locus breakout state into `Breakout` objects and a collection, performs most
224
+ server mutations directly from `index.ts`, delegates broadcast delivery to `BreakoutRequest`, lets
225
+ each `Breakout` send its own join, leave, and help requests, emits feature events from `index.ts`,
226
+ uses `events.ts` for breakout Call Analyzer metrics, subscribes to broadcast messages on the LLM
227
+ channel that `Meeting` registers, and owns the edit-lock keepalive timer.
228
+
229
+ `Meeting` is the only writer of the projection: Locus breakout controls go to `updateBreakout()`
230
+ (the current session and the controller props), the Locus session lists go to
231
+ `updateBreakoutSessions()` (the collection), and self roles go to `updateCanManageBreakouts()`.
232
+ `currentBreakoutSession` is a child model and is not a member of the `breakouts` collection. Each
233
+ `Breakout` creates its own `Members` instance the first time a roster arrives and replaces its
234
+ members only when the roster's Locus sequence is newer.
235
+
236
+ Host and cohost operations act on the breakout `url` and the managed group (`breakoutGroupId`, the
237
+ first `manageGroups` entry unless it is `CLOSED`); responses refresh `manageGroups`, `mainGroupId`,
238
+ and `mainSessionId`. Authorization stays with the breakout service: the client sends the held
239
+ edit-lock token, and `boServiceErrorHandler()` turns the service's lock error codes into
240
+ `BreakoutEditLockedError`.
241
+
242
+ ## Data flow and sequence coverage
243
+
244
+ Call style: in-process method calls on `meeting.breakouts` and its `Breakout` models; outbound
245
+ HTTPS to the breakout service through `this.request` and `this.webex.request`; inbound Locus
246
+ updates through `Meeting`, Mercury `breakout.roster` and `breakout.help` events, and LLM
247
+ `breakout.message` events; outbound metrics through `webex.internal.newMetrics`.
248
+
249
+ Sequence coverage:
250
+
251
+ | Operation group | Diagram | Failure coverage |
252
+ |---|---|---|
253
+ | UC-2…UC-5 — attendee session, broadcast, host, and edit-lock request groups | Breakout session and edit-lock primary sequence (diagram 1) | invalid session context, edit-lock conflict, request rejection, and listener/session cleanup |
254
+ | UC-2…UC-5 — breakout session and edit-lock alternate/failure paths | Breakout session and edit-lock alternate/failure sequence (diagram 2) | invalid session/lock context, edit-lock conflict, breakout service rejection, no joined participants for a broadcast, or absent local capability enforcement |
255
+ | UC-1 — inbound reconciliation from Locus, Mercury, and the LLM channel | Diagram 3 | closing freeze, stale roster sequence, missing session, and a missing or disconnected LLM channel |
256
+ | UC-5 — edit-lock keepalive and release | Diagram 4 and the edit-lock state machine | keepalive failure, unlock failure, and cleanup leaving the timer running |
257
+ | UC-6 — move and join-response metrics | Diagram 5 | missing move id, meeting, or converged architecture; LLM info for another move; duplicate suppression |
258
+
259
+ ```mermaid
260
+ flowchart LR
261
+ Locus[Locus breakout projection via Meeting] --> Controller[index.ts]
262
+ Controller --> Collection[collection.ts]
263
+ Collection --> Session[breakout.ts]
264
+ Caller[Meeting / host / attendee] --> Controller
265
+ Caller --> Session
266
+ Controller --> Direct[index.ts request / webex.request]
267
+ Session --> Direct
268
+ Direct --> Service[Breakout service URLs]
269
+ Controller --> Request[request.ts broadcast helper]
270
+ Session --> Request
271
+ Request --> Service
272
+ Mercury[Mercury roster / help] --> Controller
273
+ LLM[LLM channel breakout.message] --> Controller
274
+ Controller --> FeatureEvents[index.ts scoped feature events]
275
+ Controller --> Metrics[events.ts Call Analyzer metrics]
276
+ Session --> Metrics
277
+ Controller --> Lock[edit lock token + keepalive]
278
+ ```
279
+
280
+ Diagram 1 — breakout session and edit-lock primary sequence:
281
+
282
+ ```mermaid
283
+ sequenceDiagram
284
+ participant C as Host or attendee
285
+ participant B as Breakouts index.ts
286
+ participant O as Breakout breakout.ts
287
+ participant R as index.ts request boundary
288
+ participant BR as BreakoutRequest
289
+ participant S as Breakout service
290
+ C->>B: host mutation or controller broadcast
291
+ C->>O: attendee join / leave / help
292
+ B->>B: resolve session/URL and edit lock where required, no canManageBreakouts guard
293
+ alt attendee session operation
294
+ O->>S: direct session request
295
+ S-->>O: response or error
296
+ O-->>C: response, rejection, or synchronous leave guard throw
297
+ else broadcast
298
+ B->>BR: broadcast(current URL, group, roles)
299
+ BR->>S: POST message
300
+ S-->>BR: accepted response or error
301
+ BR-->>B: response
302
+ else host operation
303
+ B->>R: direct request with current URL and ids
304
+ R->>S: HTTP request
305
+ S-->>R: accepted state or error
306
+ R-->>B: response
307
+ end
308
+ B->>B: reconcile collection and lock timer when applicable
309
+ B-->>C: result and scoped breakout event
310
+ ```
311
+
312
+ Diagram 2 — breakout session and edit-lock alternate/failure sequence:
313
+
314
+ ```mermaid
315
+ sequenceDiagram
316
+ participant H as Host / attendee
317
+ participant B as Breakouts
318
+ participant O as Breakout breakout.ts
319
+ participant BR as BreakoutRequest
320
+ participant S as Breakout service
321
+ alt attendee join, leave, or help operation
322
+ H->>O: perform attendee session operation
323
+ opt leave operation
324
+ O->>O: reject main-session leave or a missing main session
325
+ end
326
+ O->>S: direct session request
327
+ S-->>O: response or rejection
328
+ O-->>H: response or returned rejection, leave guard may throw synchronously
329
+ else valid host operation
330
+ H->>B: acquire lock or perform host operation
331
+ B->>B: validate session URL, ids, and edit-lock state where required, do not check canManageBreakouts
332
+ B->>S: direct request or broadcast helper request
333
+ S-->>B: response
334
+ B-->>H: request result and reconciled breakout projection
335
+ else broadcast with no joined participants
336
+ BR->>S: POST message
337
+ S--xBR: 409, errorCode 201409036
338
+ BR-->>H: logged, resolves undefined
339
+ else local edit lock is already held
340
+ B--xH: lockBreakout() returned rejection carrying a plain Error, not BreakoutEditLockedError
341
+ else breakout service conflict or request rejection
342
+ S--xB: service rejection, lock error codes become BreakoutEditLockedError where mapped
343
+ B--xH: returned rejection
344
+ end
345
+ ```
346
+
347
+ Diagram 3 — inbound reconciliation:
348
+
349
+ ```mermaid
350
+ sequenceDiagram
351
+ participant M as Meeting / LocusInfo
352
+ participant B as Breakouts
353
+ participant K as BreakoutCollection
354
+ participant O as Breakout
355
+ participant Me as Mercury
356
+ participant L as LLM channel
357
+ M->>B: updateBreakout(breakout controls)
358
+ B->>B: set props, replace currentBreakoutSession
359
+ opt no breakout in progress
360
+ B->>K: reset()
361
+ end
362
+ M->>B: updateBreakoutSessions(payload)
363
+ alt breakouts closing
364
+ B->>B: ignore, keep rosters for the countdown
365
+ else
366
+ B->>K: set(one entry per sessionId with state flags)
367
+ K-->>B: add, so queryRosters (debounced) and return-to-main check
368
+ end
369
+ Me->>B: event:breakout.roster {locus}
370
+ B->>O: parseRoster(locus) when the session is known
371
+ O->>O: replace members only for a newer sequence
372
+ B-->>M: MEMBERS_UPDATE
373
+ Me->>B: event:breakout.help {participant, sessionId}
374
+ B-->>M: ASK_FOR_HELP
375
+ M->>B: registerLLMChannel(channel)
376
+ opt channel connected and not yet subscribed
377
+ B->>L: listen event:breakout.message
378
+ end
379
+ L->>B: event:breakout.message {senderUserId, sentTime, message}
380
+ B-->>M: MESSAGE with current sessionId
381
+ ```
382
+
383
+ Diagram 4 — edit-lock keepalive and release:
384
+
385
+ ```mermaid
386
+ sequenceDiagram
387
+ participant H as Host
388
+ participant B as Breakouts
389
+ participant S as Breakout service
390
+ H->>B: lockBreakout() or getBreakout(true)
391
+ B->>S: GET url?editlock=true
392
+ S-->>B: body.editlock {token, ttl, state}
393
+ B->>B: store editLock, start interval every ttl/2 s (ttl < 30 uses 30)
394
+ loop each interval
395
+ B->>S: PUT url/editlock/token
396
+ alt refresh fails
397
+ S--xB: error
398
+ B->>B: clear interval and editLock, mapped error is not returned
399
+ end
400
+ end
401
+ H->>B: unLockEditBreakout()
402
+ B->>S: DELETE url/editlock/token
403
+ alt success
404
+ B->>B: clear interval and editLock
405
+ else failure
406
+ B->>B: mapped rejection reaches no caller, lock kept
407
+ end
408
+ ```
409
+
410
+ Diagram 5 — move and join-response metrics:
411
+
412
+ ```mermaid
413
+ sequenceDiagram
414
+ participant A as Attendee
415
+ participant O as Breakout
416
+ participant M as Meeting
417
+ participant B as Breakouts
418
+ participant E as breakoutEvent
419
+ participant N as newMetrics
420
+ A->>O: join()
421
+ O->>E: move.request (new breakoutMoveId)
422
+ O->>O: POST url/move
423
+ O->>E: move.response
424
+ M->>B: updateBreakout(controls with breakoutMoveId)
425
+ opt session or group id changed
426
+ B->>E: join.response without LLM latency
427
+ end
428
+ M->>B: LLM_CONNECT_RESPONSE {meeting, llmLatency, error}
429
+ B->>B: store with current breakoutMoveId
430
+ opt move id matches, session ids set, in an active breakout or the main session
431
+ B->>E: join.response with llmLatency and llmWebsocketUrl
432
+ end
433
+ E->>E: skip without move id, meeting, or enableConvergedArchitecture, let the meeting suppress duplicates
434
+ E->>N: submitClientEvent
435
+ ```
436
+
437
+ ## Class and component relationships
438
+
439
+ ```mermaid
440
+ classDiagram
441
+ class WebexPlugin
442
+ class StatelessWebexPlugin
443
+ class Breakouts {
444
+ breakouts BreakoutCollection
445
+ currentBreakoutSession Breakout
446
+ editLock
447
+ intervalID
448
+ _llmChannel
449
+ }
450
+ class Breakout {
451
+ sessionId
452
+ groupId
453
+ sessionType
454
+ members Members
455
+ }
456
+ class BreakoutCollection
457
+ class BreakoutRequest {
458
+ broadcast()
459
+ }
460
+ class BreakoutEditLockedError
461
+ class breakoutEvent
462
+ class Members
463
+ WebexPlugin <|-- Breakouts
464
+ WebexPlugin <|-- Breakout
465
+ StatelessWebexPlugin <|-- BreakoutRequest
466
+ Breakouts *-- BreakoutCollection : breakouts collection
467
+ BreakoutCollection o-- Breakout : session models
468
+ Breakouts *-- Breakout : currentBreakoutSession child
469
+ Breakouts --> BreakoutRequest : broadcast request
470
+ Breakout --> BreakoutRequest : session broadcast request
471
+ Breakout *-- Members : roster
472
+ Breakouts ..> BreakoutEditLockedError : edit lock conflicts via utils
473
+ Breakouts ..> breakoutEvent : metrics events
474
+ Breakout ..> breakoutEvent : move metrics events
475
+ ```
476
+
477
+ The arrows identify ownership and delegation inside `src/breakouts/`; files that only declare types or constants are not presented as transports.
478
+
479
+ ## Use cases and flows
480
+
481
+ | Use case | Actor or caller | Primary steps and outcome | Failure or boundary behavior | Evidence |
482
+ | -------- | --------------- | ------------------------- | ---------------------------- | -------- |
483
+ | `UC-1` | `Meeting` | Reconcile session, roster, help, broadcast, and return-to-main changes into the meeting-scoped controller collection and its events | Closing freezes the collection; unknown sessions and stale rosters are ignored | `src/breakouts/index.ts`, `src/breakouts/collection.ts`, `src/meeting/index.ts` |
484
+ | `UC-2` | Attendee | Join, leave, request help, or broadcast on an individual `Breakout` object and maintain that session's member roster | `leave()` throws in the main session or without one; request errors reject | `src/breakouts/breakout.ts` |
485
+ | `UC-3` | Host or cohost | Enable, toggle, create, clear, start, end, or update breakout sessions through the host controller request path; ask everyone to return; broadcast | Missing service URL or group id rejects; lock conflicts reject as `BreakoutEditLockedError` | `src/breakouts/index.ts`, `src/breakouts/request.ts` |
486
+ | `UC-4` | Host or cohost | Query preassignments, assign, dynamically assign participants, move them to lobby, or remove them from a breakout | Moving or removing without main ids throws; request errors reject unmapped | `src/breakouts/index.ts` |
487
+ | `UC-5` | Host or cohost | Acquire and refresh an edit lock before protected host mutations, mapping service conflicts to `BreakoutEditLockedError`, then release it | A held lock rejects `lockBreakout()`; keepalive and unlock failures are silent | `src/breakouts/index.ts`, `src/breakouts/edit-lock-error.ts` |
488
+ | `UC-6` | `Meeting` and attendee | A move posts move request and response metrics; the Locus update and the LLM connect response each try the join-response metric | Skipped without converged architecture or a matching move id | `src/breakouts/breakout.ts`, `src/breakouts/index.ts`, `src/breakouts/events.ts` |
489
+
490
+ ### Cross-boundary use-case flow
491
+
492
+ | Boundary | Transport and ordering | Compatibility | Timeout, retry, and recovery |
493
+ | -------- | ---------------------- | ------------- | ---------------------------- |
494
+ | Breakout service (`UC-2` to `UC-5`) | HTTPS through `webex.request`; one request per call; `toggleBreakout` enables before it disables | Paths `move`, `help`, `message`, `requestMove`, `roster`, `preassignments`, `dynamicAssign`, and `editlock/<token>` under the breakout `url` | No retry; the keepalive interval is the only repeated request |
495
+ | Locus, through `Meeting` (`UC-1`) | In-process calls as Locus deltas are parsed | Breakout controls and session lists | A closing update is ignored; the next update corrects state |
496
+ | Mercury (`UC-1`) | `breakout.roster` and `breakout.help` events in arrival order | `data.locus` and `data.{participant, sessionId}` | No retry; a stale roster sequence is dropped |
497
+ | LLM data channel (`UC-1`) | `breakout.message` events on the registered channel | `data.{senderUserId, sentTime, message}` | Re-subscribed on `online`, channel registration, and Locus URL updates |
498
+ | Metrics (`UC-6`) | `submitClientEvent` | Event names `client.breakout-session.move.request`, `move.response`, `join.response` | Dropped when conditions fail |
499
+
500
+ ## Client state model
501
+
502
+ Breakout collection, current/main session ids, management capability, edit-lock token/timer, roster state, subscriptions, and pending metric context are meeting scoped.
503
+
504
+ | State or slice | Owner | Initial state | Transition triggers | Reset or persistence boundary |
505
+ | -------------- | ---------- | ------------- | ------------------- | ----------------------------- |
506
+ | Breakout projection (`sessionId`, `groupId`, `sessionType`, `status`, `groups`, `startTime`, `url`, `name`, `delayCloseTime`, `allowBackToMain`, `enableBreakoutSession`, `hasBreakoutPreAssignments`, `breakoutMoveId`) | `Breakouts` | unset | `updateBreakout` from Locus controls; the first `toggleBreakout` enable | Per meeting; `groups`, `startTime`, and `status` unset when absent; never persisted |
507
+ | `breakouts` collection | `Breakouts` | empty | `updateBreakoutSessions`; `clearBreakouts` when no breakout is in progress | Frozen while closing |
508
+ | `currentBreakoutSession` | `Breakouts` (child) | empty `Breakout` | `updateBreakout` | Replaced on every update |
509
+ | Per-session `members` and `breakoutRosterLocus` | `Breakout` | unset and `null` | `parseRoster` | Kept per session model |
510
+ | `locusUrl`, `mainLocusUrl`, `breakoutServiceUrl` | `Breakouts` | unset | `locusUrlUpdate`, `breakoutServiceUrlUpdate` | `mainLocusUrl` changes only in the main session or when unset |
511
+ | `canManageBreakouts` | `Breakouts` | unset | `updateCanManageBreakouts` on self role changes | Feeds only `shouldQueryPreAssignments` |
512
+ | `manageGroups`, `mainGroupId`, `mainSessionId`, `preAssignments` | `Breakouts` | unset | Host responses and `getBreakout`; `queryPreAssignments` | Overwritten only when the response carries them |
513
+ | `editLock`, `intervalID` | `Breakouts` | unset | `getBreakout(true)`, `lockBreakout`, keepalive; cleared by unlock, `update(…, true)`, `create`, and keepalive failure | Not cleared by `cleanUp` |
514
+ | `_llmChannel`, `hasSubscribedToMessage` | `Breakouts` | unset | `registerLLMChannel`, `listenToBroadcastMessages`, `unregisterLLMChannel` | `cleanUp` resets the flag |
515
+ | `llmBreakoutJoinResponseInfo` | `Breakouts` | unset | `handleLLMBreakoutJoinResponseMetric` | Cleared after the metric is sent |
516
+
517
+ ## Business rules and invariants
518
+
519
+ | ID | Invariant | WHY | Enforcement source | Test evidence |
520
+ | -- | --------- | --- | ------------------ | ------------- |
521
+ | `INV-001` | The collection holds one `Breakout` per `sessionId`; `updateBreakoutSessions` resets the five state flags (`active`, `assigned`, `allowed`, `assignedCurrent`, `requested`) and sets each flag the session's Locus lists name, plus the controller `url`. | A session can appear in several state lists, and the flags tell an attendee whether it is forced, assigned, allowed, or requested (prop comments in `breakout.ts`). | `src/breakouts/index.ts`, `src/breakouts/breakout.ts`, `src/breakouts/collection.ts` | `test/unit/spec/breakouts/index.ts` |
522
+ | `INV-002` | While `isBreakoutIClosing()` is true, `updateBreakoutSessions` leaves the collection unchanged. | Locus sends undefined or only the main session while closing, which would drop the breakout rosters during the countdown (code comment). | `src/breakouts/index.ts` | `test/unit/spec/breakouts/index.ts` |
523
+ | `INV-003` | `parseRoster` replaces a session's members only when the Locus sequence is newer than the last one, or when either lacks a sequence. | The breakout roster event carries the full roster, so members are replaced, and an older roster must not overwrite a newer one (code comment and `isNeedHandleRoster`). | `src/breakouts/breakout.ts` | `test/unit/spec/breakouts/breakout.ts` |
524
+ | `INV-004` | `mainLocusUrl` follows `locusUrl` only in the main session or while unset. | It must keep the main session's Locus URL while the user is in a breakout (prop comment). | `src/breakouts/index.ts` | None found |
525
+ | `INV-005` | Host mutations use the current session/service context and the held edit-lock token where applicable; current code stores `canManageBreakouts` but does not enforce it. | Authorization belongs to the breakout service (`BREAKOUTS-R-005`). | `src/breakouts/index.ts` | `test/unit/spec/breakouts/index.ts` |
526
+ | `INV-006` | Collection/session ids remain consistent; `cleanUp()` releases subscriptions but not the edit-lock keepalive. | See `BREAKOUTS-R-003`. | `src/breakouts/index.ts` | `test/unit/spec/breakouts/index.ts` |
527
+
528
+ ## Concurrency and reactive flow
529
+
530
+ - Execution model: one JavaScript event loop; requests return promises; ampersand change events,
531
+ Mercury events, and LLM events run listeners synchronously; the keepalive uses
532
+ `window.setInterval`.
533
+ - Edit-lock ownership: The active edit-lock token and its keepalive timer belong to one host edit session. `unLockEditBreakout()` clears that timer, while `cleanUp()` does not; roster and session updates reconcile by their current session/member ids before scoped breakout events are emitted.
534
+ - Ordering guarantees: the roster query is debounced on the leading edge (10 ms), so a burst of
535
+ added sessions sends one query; the Locus update and the LLM connect response may arrive in either
536
+ order, and the join-response metric waits for both (`BREAKOUTS-R-009`).
537
+ - Idempotency and retry: `listenToBroadcastMessages` subscribes at most once per channel
538
+ (`hasSubscribedToMessage`); a new keepalive interval replaces the running one; nothing else is
539
+ retried.
540
+ - Shared-state protection: none beyond the flags above; concurrent host mutations are arbitrated by
541
+ the service's edit lock.
542
+
543
+ ## State machine
544
+
545
+ Breakout status values come from Locus and the breakout service; the client does not move between
546
+ them itself. `start()` and `end()` request the change, and the next Locus update reports it.
547
+
548
+ ```mermaid
549
+ stateDiagram-v2
550
+ [*] --> CLOSED
551
+ CLOSED --> PENDING: host prepares sessions (status reported by Locus)
552
+ PENDING --> OPEN: start
553
+ OPEN --> CLOSING: end (close requested, delayCloseTime countdown)
554
+ CLOSING --> CLOSED: sessions close
555
+ OPEN --> OPEN: roster / help / broadcast update
556
+ ```
557
+
558
+ The diagram uses the breakout `CLOSED`, `PENDING`, `OPEN`, and `CLOSING` values declared in
559
+ `src/constants.ts`. Code reads only `OPEN` and `CLOSING` (in progress), `CLOSING` (emit
560
+ `BREAKOUTS_CLOSING`, freeze the collection), and `CLOSED` (no managed group); no code reads
561
+ `PENDING`. When no breakout is in progress, `updateBreakout` clears the collection.
562
+
563
+ The edit lock has its own lifecycle on the controller:
564
+
565
+ ```mermaid
566
+ stateDiagram-v2
567
+ [*] --> Unlocked
568
+ Unlocked --> Held: getBreakout(true) returns an editlock token
569
+ Held --> Held: keepalive refresh succeeds, or lockBreakout restarts it when not LOCKED
570
+ Held --> Held: lockBreakout when LOCKED (rejects)
571
+ Held --> Unlocked: unLockEditBreakout succeeds
572
+ Held --> Unlocked: update with unlockEdit, or create
573
+ Held --> Unlocked: keepalive refresh fails
574
+ ```
575
+
576
+ - `cleanUp()` changes neither state: a held lock keeps its interval running.
577
+ - The attendee's session type is a second transition: `currentBreakoutSession.sessionType` moving
578
+ from `BREAKOUT` to `MAIN` emits `LEAVE_BREAKOUT`; other changes emit nothing.
579
+
580
+ ## Caller-visible failure modes
581
+
582
+ | Condition | Signal | Caller recovery |
583
+ |---|---|---|
584
+ | Required session/main-session context is absent | `Breakout.leave()`, controller `getMainSession()` (and so `askAllToReturn()`), controller `broadcast()`, `moveToLobby()`, and `removeFromBreakout()` throw synchronously; `update()` without `params.id` and `enableBreakouts()` without `breakoutServiceUrl` return rejected promises. Stored management capability is not a local guard. | Distinguish a direct throw from an async rejection and refresh current breakout state before retrying. |
585
+ | Another editor owns the breakout lock | A service lock conflict is mapped to `BreakoutEditLockedError` by `boServiceErrorHandler()`; a lock already held locally instead rejects with a plain `Error('Breakout already locked')` from the `async` `lockBreakout()`. | Wait for the lock owner to release it before retrying, and do not assume every lock failure is a `BreakoutEditLockedError`. |
586
+ | A breakout request rejects or the controller is cleaned up | The returned request promise remains rejected; cleanup removes owned listeners but does not cancel the edit-lock keepalive timer. | Handle the asynchronous rejection and explicitly unlock before discarding an edit session. |
587
+ | A broadcast reaches no joined participants | `BreakoutRequest.broadcast()` logs `no joined participants` for a 409 with errorCode `201409036` and resolves `undefined`. | Treat `undefined` as delivered to nobody. |
588
+ | The roster or pre-assignment query fails | Logged as `Meeting:breakouts#queryRosters failed` or `Meeting:breakouts#queryPreAssignments failed`; no rejection and no event. | Wait for the next roster event or state change. |
589
+ | An edit-lock refresh or unlock fails | The refresh clears the lock and its interval; neither method returns its promise, so the mapped error is an unhandled rejection. | Check `hasBreakoutLocked()` before protected edits. |
590
+ | `enableBreakouts()` fails | Logs `Meeting:request#touchBreakout --> Error provisioning error` and rethrows. | Handle the rejection; `toggleBreakout()` rejects with it. |
591
+
592
+ ## Pitfalls and constraints
593
+
594
+ - The retained README says host operations were not implemented, but current code implements create/start/end/update/assignment and edit locking. Do not preserve that stale limitation.
595
+ - Verify both typed constants/enums and raw wire values before changing a logical condition in this legacy package.
596
+ - `isBreakoutIClosing` is misspelled and public; renaming it breaks callers.
597
+ - `unLockEditBreakout()` returns `undefined`, so a caller cannot wait for the release or see its
598
+ failure.
599
+ - `MESSAGE` stamps the current session's id; the code does not check that the message came through
600
+ the data channel of that session (FIXME in `listenToBroadcastMessages`).
601
+ - A `test/unit/spec/breakouts/index.ts` case stubs `webex.internal.llm.getLocusUrl`, which the code
602
+ no longer reads; it passes because no channel is registered.
603
+ - `breakoutServiceUrlUpdate` appends `/breakout/` to the Locus service URL; pass the bare URL.
604
+
605
+ ## Module-specific rules
606
+
607
+ - Do: preserve this boundary: reconcile session, roster, help, broadcast, and return-to-main changes into the meeting-scoped collection; `Meeting` feeds the Locus updates in.
608
+ - Do not: move remote I/O or lifecycle ownership into a passive type, constant, catalog, or normalization file such as `collection.ts`, `utils.ts`, or `edit-lock-error.ts`.
609
+ - Do: route a new host mutation's errors through `boServiceErrorHandler()` and send the held
610
+ edit-lock token, so lock conflicts surface as `BreakoutEditLockedError` (`BREAKOUTS-R-006`).
611
+ - Do: subscribe to LLM broadcast messages only through `listenToBroadcastMessages()`, which guards
612
+ connection and duplicate subscription (`BREAKOUTS-R-007`).
613
+ - Do not: add a local `canManageBreakouts` guard to host mutations without a change request; the
614
+ service authorizes them (`BREAKOUTS-R-005`).
615
+
616
+ ## Key design trade-off
617
+
618
+ | Chosen trade-off | Preserved invariant or benefit | Cost or limitation | Decision evidence |
619
+ | ---------------- | ------------------------------ | ------------------ | ----------------- |
620
+ | Edit locking prevents concurrent host configuration conflicts, but requires keepalive, unlock, and failure cleanup around mutations | One host edits the configuration at a time, and a conflicting edit fails with `BreakoutEditLockedError` | The keepalive timer outlives `cleanUp()`, and refresh and unlock failures are silent | `src/breakouts/index.ts`, `src/breakouts/utils.ts` |
621
+ | Host permissions are left to the breakout service | The client never refuses an operation the service would allow | A non-host's request is sent and rejected by the service | `src/breakouts/index.ts` |
622
+
623
+ ## Verification
624
+
625
+ Use the current mirrored suites: `test/unit/spec/breakouts/breakout.ts`, `test/unit/spec/breakouts/collection.ts`, `test/unit/spec/breakouts/edit-lock-error.ts`, `test/unit/spec/breakouts/events.ts`, `test/unit/spec/breakouts/index.ts`, `test/unit/spec/breakouts/request.ts`, `test/unit/spec/breakouts/utils.js`. Characterize the breakouts-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
626
+
627
+ | Behavior / Requirement | Existing test evidence | Gap |
628
+ |---|---|---|
629
+ | `BREAKOUTS-R-001` | `test/unit/spec/breakouts/index.ts` | cover controller reconciliation separately from per-session `Breakout` operations; the listener set of `initialize()` is asserted only in part |
630
+ | `BREAKOUTS-R-002` | `test/unit/spec/breakouts/breakout.ts`, `test/unit/spec/breakouts/request.ts` | cover each create/start/end/update/assignment body and its required URL/session context under `BREAKOUTS-R-010` to `BREAKOUTS-R-015`; the attendee bodies and move metrics are covered |
631
+ | `BREAKOUTS-R-003` | `test/unit/spec/breakouts/index.ts`, `test/unit/spec/breakouts/breakout.ts` | characterize lock conflict, session-object join/leave/help failures, and listener cleanup as separate outcomes; no case asserts that `cleanUp()` leaves the keepalive running |
632
+ | `BREAKOUTS-R-004` | `test/unit/spec/breakouts/index.ts`, `test/unit/spec/breakouts/breakout.ts` | verify duplicate/out-of-order Mercury roster updates |
633
+ | `BREAKOUTS-R-005` | `test/unit/spec/breakouts/index.ts` | characterize that host mutations proceed without a local `canManageBreakouts` rejection and leave authorization to the service |
634
+ | `BREAKOUTS-R-006` | `test/unit/spec/breakouts/edit-lock-error.ts`, `test/unit/spec/breakouts/utils.js`, `test/unit/spec/breakouts/index.ts` | verify keepalive/unlock cleanup on failure; no case for unmapped errors from `assign` or `dynamicAssign` |
635
+ | `BREAKOUTS-R-007` | `test/unit/spec/breakouts/index.ts` | none |
636
+ | `BREAKOUTS-R-008`, `BREAKOUTS-R-009` | `test/unit/spec/breakouts/index.ts`, `test/unit/spec/breakouts/events.ts` | none |
637
+ | `BREAKOUTS-R-010` to `BREAKOUTS-R-015` | `test/unit/spec/breakouts/index.ts`, `test/unit/spec/breakouts/request.ts`, `test/unit/spec/breakouts/utils.js` | the keepalive period is covered; the `lockBreakout` rejection is covered |
638
+ | `INV-001` to `INV-003`, `INV-005`, `INV-006` | `test/unit/spec/breakouts/index.ts`, `test/unit/spec/breakouts/breakout.ts` | none |
639
+ | `INV-004` | None found | no case asserts `mainLocusUrl` |
640
+
641
+ Every cited case invokes the named behavior. A module specification is complete only when its
642
+ public surface, invariants, failure modes, and test evidence agree with the implementation. The
643
+ module stays Partial until coverage review and independent validation run on this specification.