@webex/plugin-meetings 3.12.0-next.17 → 3.12.0-next.170
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.
- package/.sdd/manifest.json +1312 -0
- package/.sdd/templates/.source.json +30 -0
- package/.sdd/templates/component-repo/module-docs/module-spec-quality.md +111 -0
- package/.sdd/templates/component-repo/module-docs/module-spec.template.md +321 -0
- package/.sdd/templates/component-repo/reference-docs/adr/_adr-example.md +59 -0
- package/.sdd/templates/component-repo/reference-docs/patterns/_pattern-example.md +49 -0
- package/.sdd/templates/component-repo/reference-docs/rules/_rule-example.md +42 -0
- package/.sdd/templates/component-repo/standing-docs/AGENTS.template.md +120 -0
- package/.sdd/templates/component-repo/standing-docs/ARCHITECTURE.template.md +206 -0
- package/.sdd/templates/component-repo/standing-docs/CONTRACTS.template.md +90 -0
- package/.sdd/templates/component-repo/standing-docs/DATA_MODEL.template.md +68 -0
- package/.sdd/templates/component-repo/standing-docs/GETTING_STARTED.template.md +111 -0
- package/.sdd/templates/component-repo/standing-docs/GLOSSARY.template.md +57 -0
- package/.sdd/templates/component-repo/standing-docs/REVIEW_CHECKLIST.template.md +69 -0
- package/.sdd/templates/component-repo/standing-docs/RULES.template.md +96 -0
- package/.sdd/templates/component-repo/standing-docs/SECURITY.template.md +84 -0
- package/.sdd/templates/component-repo/standing-docs/SERVICE_STATE.template.md +82 -0
- package/.sdd/templates/component-repo/standing-docs/SPEC_INDEX.template.md +94 -0
- package/.sdd/templates/component-repo/standing-docs/TEST_INDEX.template.md +64 -0
- package/.sdd/templates/component-repo/template-map.json +112 -0
- package/AGENTS.md +135 -0
- package/ai-docs/ARCHITECTURE.md +207 -0
- package/ai-docs/CONTRACTS.md +267 -0
- package/ai-docs/DATA_MODEL.md +64 -0
- package/ai-docs/GETTING_STARTED.md +73 -0
- package/ai-docs/GLOSSARY.md +56 -0
- package/ai-docs/REVIEW_CHECKLIST.md +45 -0
- package/ai-docs/RULES.md +79 -0
- package/ai-docs/SECURITY.md +74 -0
- package/ai-docs/SERVICE_STATE.md +59 -0
- package/ai-docs/SPEC_INDEX.md +85 -0
- package/ai-docs/TEST_INDEX.md +45 -0
- package/ai-docs/adr/0001-migrate-existing-docs-into-sdd.md +61 -0
- package/ai-docs/patterns/defensive-error-propagation.md +55 -0
- package/ai-docs/patterns/event-scope-emission.md +46 -0
- package/ai-docs/patterns/source-to-test-path-mirroring.md +45 -0
- package/ai-docs/patterns/stateless-plugin-request-classes.md +53 -0
- package/ai-docs/patterns/typed-constants-and-enum-values.md +47 -0
- package/dist/aiEnableRequest/index.js +15 -2
- package/dist/aiEnableRequest/index.js.map +1 -1
- package/dist/annotation/index.js +2 -2
- package/dist/annotation/index.js.map +1 -1
- package/dist/breakouts/breakout.js +8 -3
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/events.js +29 -14
- package/dist/breakouts/events.js.map +1 -1
- package/dist/breakouts/index.js +99 -4
- package/dist/breakouts/index.js.map +1 -1
- package/dist/common/errors/webex-errors.js +49 -5
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/constants.js +37 -10
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/index.js +46 -10
- package/dist/controls-options-manager/index.js.map +1 -1
- package/dist/hashTree/constants.js +4 -1
- package/dist/hashTree/constants.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js +1096 -391
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/hashTree/utils.js +20 -0
- package/dist/hashTree/utils.js.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/interceptors/dataChannelAuthToken.js +75 -15
- package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
- package/dist/interceptors/locusRetry.js +24 -9
- package/dist/interceptors/locusRetry.js.map +1 -1
- package/dist/interpretation/index.js +55 -12
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/interpretation.types.js +7 -0
- package/dist/interpretation/interpretation.types.js.map +1 -0
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.js +4 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +615 -176
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +36 -5
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/types.js +20 -0
- package/dist/locus-info/types.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +15 -2
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/media/index.js +8 -2
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +4 -5
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +5 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +1684 -835
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +229 -82
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +10 -1
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +5 -2
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/util.js +37 -3
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting/voicea-meeting.js +2 -1
- package/dist/meeting/voicea-meeting.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +12 -5
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +300 -128
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +6 -1
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/request.js +39 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +116 -18
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +10 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +30 -0
- package/dist/member/util.js.map +1 -1
- package/dist/members/index.js +101 -43
- package/dist/members/index.js.map +1 -1
- package/dist/members/util.js +8 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +7 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/multistream/codec/constants.js +63 -0
- package/dist/multistream/codec/constants.js.map +1 -0
- package/dist/multistream/mediaRequestManager.js +62 -15
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +9 -0
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +32 -4
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +121 -83
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +2 -0
- package/dist/reachability/reachability.types.js.map +1 -1
- package/dist/reachability/util.js +45 -0
- package/dist/reachability/util.js.map +1 -1
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/recording-controller/index.js +1 -3
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/roap/turnDiscovery.js +8 -1
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/types/common/errors/webex-errors.d.ts +32 -2
- package/dist/types/config.d.ts +2 -2
- package/dist/types/constants.d.ts +13 -1
- package/dist/types/controls-options-manager/index.d.ts +16 -0
- package/dist/types/hashTree/constants.d.ts +1 -0
- package/dist/types/hashTree/hashTreeParser.d.ts +201 -22
- package/dist/types/hashTree/utils.d.ts +7 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/interceptors/locusRetry.d.ts +4 -4
- package/dist/types/interpretation/interpretation.types.d.ts +10 -0
- package/dist/types/locus-info/index.d.ts +106 -8
- package/dist/types/locus-info/infoUtils.d.ts +8 -0
- package/dist/types/locus-info/types.d.ts +22 -1
- package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
- package/dist/types/media/properties.d.ts +6 -2
- package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
- package/dist/types/meeting/index.d.ts +178 -11
- package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
- package/dist/types/meeting/request.d.ts +1 -0
- package/dist/types/meeting/util.d.ts +9 -0
- package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
- package/dist/types/meetings/index.d.ts +40 -19
- package/dist/types/meetings/meetings.types.d.ts +15 -0
- package/dist/types/meetings/request.d.ts +14 -0
- package/dist/types/member/index.d.ts +1 -0
- package/dist/types/member/types.d.ts +1 -0
- package/dist/types/member/util.d.ts +9 -0
- package/dist/types/members/index.d.ts +15 -2
- package/dist/types/members/util.d.ts +1 -5
- package/dist/types/metrics/constants.d.ts +6 -0
- package/dist/types/multistream/codec/constants.d.ts +7 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
- package/dist/types/multistream/remoteMediaManager.d.ts +18 -0
- package/dist/types/reachability/clusterReachability.d.ts +3 -3
- package/dist/types/reachability/index.d.ts +10 -3
- package/dist/types/reachability/reachability.types.d.ts +7 -0
- package/dist/types/reachability/util.d.ts +17 -0
- package/dist/types/reactions/reactions.type.d.ts +3 -0
- package/dist/webinar/index.js +307 -161
- package/dist/webinar/index.js.map +1 -1
- package/package.json +23 -23
- package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
- package/src/aiEnableRequest/index.ts +16 -0
- package/src/annotation/ai-docs/annotation-spec.md +236 -0
- package/src/annotation/index.ts +6 -4
- package/src/breakouts/ai-docs/breakouts-spec.md +324 -0
- package/src/breakouts/breakout.ts +3 -1
- package/src/breakouts/events.ts +33 -11
- package/src/breakouts/index.ts +122 -2
- package/src/common/errors/webex-errors.ts +50 -3
- package/src/config.ts +2 -2
- package/src/constants.ts +21 -3
- package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +243 -0
- package/src/controls-options-manager/index.ts +62 -10
- package/src/hashTree/ai-docs/hash-tree-spec.md +267 -0
- package/src/hashTree/constants.ts +7 -0
- package/src/hashTree/hashTreeParser.ts +861 -193
- package/src/hashTree/utils.ts +19 -0
- package/src/index.ts +6 -0
- package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
- package/src/interceptors/dataChannelAuthToken.ts +88 -12
- package/src/interceptors/locusRetry.ts +26 -5
- package/src/interpretation/ai-docs/interpretation-spec.md +256 -0
- package/src/interpretation/index.ts +65 -10
- package/src/interpretation/interpretation.types.ts +11 -0
- package/src/locus-info/ai-docs/locus-info-spec.md +293 -0
- package/src/locus-info/controlsUtils.ts +3 -1
- package/src/locus-info/index.ts +566 -164
- package/src/locus-info/infoUtils.ts +41 -6
- package/src/locus-info/types.ts +26 -1
- package/src/media/MediaConnectionAwaiter.ts +21 -4
- package/src/media/ai-docs/media-spec.md +267 -0
- package/src/media/index.ts +10 -1
- package/src/media/properties.ts +8 -3
- package/src/meeting/ai-docs/meeting-spec.md +401 -0
- package/src/meeting/in-meeting-actions.ts +8 -0
- package/src/meeting/index.ts +944 -120
- package/src/meeting/locusMediaRequest.ts +106 -6
- package/src/meeting/muteState.ts +10 -1
- package/src/meeting/request.ts +11 -0
- package/src/meeting/util.ts +51 -7
- package/src/meeting/voicea-meeting.ts +1 -1
- package/src/meeting-info/ai-docs/meeting-info-spec.md +261 -0
- package/src/meeting-info/meeting-info-v2.ts +11 -4
- package/src/meetings/ai-docs/meetings-spec.md +296 -0
- package/src/meetings/index.ts +200 -80
- package/src/meetings/meetings.types.ts +19 -0
- package/src/meetings/request.ts +43 -0
- package/src/meetings/util.ts +117 -4
- package/src/member/ai-docs/member-spec.md +196 -0
- package/src/member/index.ts +10 -0
- package/src/member/types.ts +1 -0
- package/src/member/util.ts +29 -0
- package/src/members/ai-docs/members-spec.md +256 -0
- package/src/members/index.ts +70 -7
- package/src/members/util.ts +12 -4
- package/src/metrics/ai-docs/metrics-spec.md +185 -0
- package/src/metrics/constants.ts +6 -0
- package/src/multistream/ai-docs/multistream-spec.md +292 -0
- package/src/multistream/codec/constants.ts +58 -0
- package/src/multistream/mediaRequestManager.ts +119 -28
- package/src/multistream/receiveSlot.ts +18 -0
- package/src/multistream/remoteMediaManager.ts +23 -1
- package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +234 -0
- package/src/reachability/ai-docs/reachability-spec.md +261 -0
- package/src/reachability/clusterReachability.ts +3 -2
- package/src/reachability/index.ts +47 -16
- package/src/reachability/reachability.types.ts +11 -0
- package/src/reachability/util.ts +36 -0
- package/src/reactions/ai-docs/reactions-spec.md +198 -0
- package/src/reactions/reactions.type.ts +3 -0
- package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +272 -0
- package/src/recording-controller/ai-docs/recording-controller-spec.md +223 -0
- package/src/recording-controller/index.ts +1 -2
- package/src/roap/ai-docs/roap-spec.md +241 -0
- package/src/roap/turnDiscovery.ts +9 -1
- package/src/webinar/ai-docs/webinar-spec.md +243 -0
- package/src/webinar/index.ts +216 -38
- package/test/unit/spec/aiEnableRequest/index.ts +86 -0
- package/test/unit/spec/annotation/index.ts +3 -3
- package/test/unit/spec/breakouts/breakout.ts +9 -3
- package/test/unit/spec/breakouts/events.ts +120 -2
- package/test/unit/spec/breakouts/index.ts +223 -3
- package/test/unit/spec/common/errors/webex-errors.ts +78 -0
- package/test/unit/spec/controls-options-manager/index.js +139 -32
- package/test/unit/spec/hashTree/hashTreeParser.ts +2451 -184
- package/test/unit/spec/hashTree/utils.ts +37 -0
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
- package/test/unit/spec/interceptors/locusRetry.ts +234 -5
- package/test/unit/spec/interpretation/index.ts +119 -4
- package/test/unit/spec/locus-info/controlsUtils.js +172 -57
- package/test/unit/spec/locus-info/index.js +1014 -58
- package/test/unit/spec/locus-info/infoUtils.js +184 -1
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
- package/test/unit/spec/media/index.ts +92 -0
- package/test/unit/spec/media/properties.ts +23 -23
- package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
- package/test/unit/spec/meeting/index.js +2834 -110
- package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
- package/test/unit/spec/meeting/muteState.js +81 -0
- package/test/unit/spec/meeting/request.js +12 -0
- package/test/unit/spec/meeting/utils.js +189 -17
- package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
- package/test/unit/spec/meeting-info/meetinginfov2.js +88 -11
- package/test/unit/spec/meetings/index.js +544 -49
- package/test/unit/spec/meetings/request.js +141 -0
- package/test/unit/spec/meetings/utils.js +402 -51
- package/test/unit/spec/member/index.js +7 -0
- package/test/unit/spec/member/util.js +89 -0
- package/test/unit/spec/members/index.js +216 -0
- package/test/unit/spec/members/request.js +37 -1
- package/test/unit/spec/members/utils.js +63 -0
- package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
- package/test/unit/spec/multistream/remoteMediaManager.ts +46 -0
- package/test/unit/spec/reachability/index.ts +128 -46
- package/test/unit/spec/reachability/util.ts +31 -0
- package/test/unit/spec/recording-controller/index.js +9 -8
- package/test/unit/spec/roap/turnDiscovery.ts +20 -0
- package/test/unit/spec/webinar/index.ts +332 -31
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
<!-- sdd-generated-metadata
|
|
2
|
+
doc_kind: module-spec
|
|
3
|
+
generated_from: module-spec@0.2.2
|
|
4
|
+
generator_plugin: repo-annotation@1.0.5+codex.20260818094939
|
|
5
|
+
generated_by: codex
|
|
6
|
+
approved_by: repository user
|
|
7
|
+
updated_at: 2026-08-22T15:21:29Z
|
|
8
|
+
validation_status: pass-with-warnings
|
|
9
|
+
-->
|
|
10
|
+
# WEBINAR — SPEC
|
|
11
|
+
|
|
12
|
+
> Start here → root [`AGENTS.md`](../../../AGENTS.md) · router [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md) · system [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md). This is the canonical source-local spec for `src/webinar/`.
|
|
13
|
+
|
|
14
|
+
## Metadata
|
|
15
|
+
|
|
16
|
+
| Field | Value |
|
|
17
|
+
|---|---|
|
|
18
|
+
| Module id | `webinar` |
|
|
19
|
+
| Source path(s) | `src/webinar/` |
|
|
20
|
+
| Parent spec | — |
|
|
21
|
+
| Doc kind | Module spec |
|
|
22
|
+
| Coverage score | 93% assessed 2026-08-22; 13/14 mandatory fields present; all critical and Important fields present; one noncritical polish gap remains; pending independent validation of the participant-role repair |
|
|
23
|
+
| Generated from | `module-spec` @ SDLC template library `0.2.2` |
|
|
24
|
+
| generated_by / approved_by / updated_at | codex / repository user / 2026-08-22T15:21:29Z |
|
|
25
|
+
| Validation status | pass-with-warnings |
|
|
26
|
+
|
|
27
|
+
## Evidence Rules
|
|
28
|
+
|
|
29
|
+
Requirements cite current source and mirrored tests. Current code wins over retained prose when they conflict; commit and PR history are excluded. Missing evidence stays a gap.
|
|
30
|
+
|
|
31
|
+
## Source Material Register
|
|
32
|
+
|
|
33
|
+
| Source material | Scope | Decision | Detail location or disposition |
|
|
34
|
+
|---|---|---|---|
|
|
35
|
+
| No routed legacy module spec | overview / API / behavior / tests | none; generated from current webinar controller, collection, utilities, and tests |
|
|
36
|
+
| Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
|
|
37
|
+
|
|
38
|
+
## Overview
|
|
39
|
+
|
|
40
|
+
`src/webinar/` contains 3 direct source/reference file(s) and has 3 mirrored unit-test file(s). This spec separates its public operations, runtime data movement, component ownership, state applicability, and verification boundary.
|
|
41
|
+
|
|
42
|
+
## Purpose / Responsibility
|
|
43
|
+
|
|
44
|
+
Owns webinar practice-session data-channel lifecycle, role/status projection, and host webcast controls including layout and attendee operations.
|
|
45
|
+
|
|
46
|
+
## Stack
|
|
47
|
+
|
|
48
|
+
TypeScript/JavaScript in the Node 22.14 Yarn workspace; Webex core/plugin abstractions and Mocha/Sinon/`@webex/test-helper-chai` tests.
|
|
49
|
+
|
|
50
|
+
## Folder / Package Structure
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
src/webinar/
|
|
54
|
+
├── collection.ts — module-owned collection
|
|
55
|
+
├── index.ts — module facade/controller or primary exports
|
|
56
|
+
├── utils.ts — normalization/helper functions
|
|
57
|
+
└── ai-docs/webinar-spec.md — canonical module specification
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Key Files (source of truth)
|
|
61
|
+
|
|
62
|
+
| File | Holds |
|
|
63
|
+
|---|---|
|
|
64
|
+
| `src/webinar/collection.ts` | module-owned collection |
|
|
65
|
+
| `src/webinar/index.ts` | module facade/controller or primary exports |
|
|
66
|
+
| `src/webinar/utils.ts` | normalization/helper functions |
|
|
67
|
+
| `test/unit/spec/webinar/collection.ts` and 2 sibling test file(s) | mirrored characterization/unit coverage |
|
|
68
|
+
|
|
69
|
+
## Public Surface
|
|
70
|
+
|
|
71
|
+
| Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
|
|
72
|
+
|---|---|---|---|---|---|---|
|
|
73
|
+
| `webinar.1` | SDK / state | `cleanUp()`, `locusUrlUpdate()`, `updateWebcastUrl()`, `updateCanManageWebcast()`, `updateRoleChanged()`, `getValidatedWebinarMeeting()`, and `updateStatusByRole()` | Derive webinar and practice-session state for the owning meeting from current Locus inputs. | Preserve owner validation and current role/status transitions. | `src/webinar/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
74
|
+
| `webinar.2` | SDK / lifecycle | `isJoinPracticeSessionDataChannel()`, `ensurePracticeSessionDatachannelToken()`, `updatePSDataChannel()`, `cleanupPSDataChannel()`, `setPracticeSessionState()`, and `updatePracticeSessionStatus()` | Own the meeting-specific practice-session LLM token, socket, and relay listener lifecycle. | Replacement/cleanup must affect only the owning meeting's channel resources. | `src/webinar/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
75
|
+
| `webinar.3` | SDK / remote | `startWebcast()` and `stopWebcast()` | Start or stop webcast through the current webcast URL. | Current code validates URL/input but does not consult `canManageWebcast` locally. | `src/webinar/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
76
|
+
| `webinar.4` | SDK / remote | `queryWebcastLayout()` and `updateWebcastLayout()` | Read or update the webcast layout using the current webcast instance URL and the supplied layout fields. | These methods do not call `sanitizeParams()` or enforce `canManageWebcast`; preserve their direct request outcome. | `src/webinar/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
77
|
+
| `webinar.5` | SDK / remote | `viewAllWebcastAttendees()`, `searchWebcastAttendees()`, `expelWebcastAttendee()`, and `searchLargeScaleWebinarAttendees()` | Query, search, or expel webcast attendees through the configured service endpoint. | Standard search uses `encodeURIComponent`; only large-scale search calls `sanitizeParams()` before `URLSearchParams`. None enforces `canManageWebcast`. | `src/webinar/index.ts`, `src/webinar/utils.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
78
|
+
| `webinar.6` | exported helpers/models | `sanitizeParams()` and `WebinarCollection.set()` / `get()` | Sanitize request parameters and provide the collection registered by the `Webinar` plugin definition. | `index.ts` declares `collections: {webinar: WebinarCollection}` for framework-managed instantiation; controller methods do not explicitly call the collection's read/write methods. | `src/webinar/index.ts`, `src/webinar/utils.ts`, `src/webinar/collection.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
79
|
+
|
|
80
|
+
Compatibility notes:
|
|
81
|
+
- 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.
|
|
82
|
+
|
|
83
|
+
## Requires (dependencies)
|
|
84
|
+
|
|
85
|
+
Parent Meeting/Locus state, webinar service URLs, data-channel tokens/media, role/capability state, collection/request access, and metrics/events.
|
|
86
|
+
|
|
87
|
+
## Requirements
|
|
88
|
+
|
|
89
|
+
| ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
|
|
90
|
+
|---|---|---|---|---|---|---|
|
|
91
|
+
| `WEBINAR-R-001` | derive webinar role, practice-session, and webcast state. | Owns webinar practice-session data-channel lifecycle, role/status projection, and host webcast controls including layout and attendee operations. | `src/webinar/index.ts` | `test/unit/spec/webinar/index.ts` | none | PRESENT |
|
|
92
|
+
| `WEBINAR-R-002` | start/stop practice-session data channel and webcast. | Practice-channel and webcast operations use different owners and request paths, so their lifecycle and authorization behavior must stay distinct. | `src/webinar/index.ts` | `test/unit/spec/webinar/index.ts` | stored `canManageWebcast` is not read by webcast methods; retain as an authorization-gap characterization | PRESENT |
|
|
93
|
+
| `WEBINAR-R-003` | Invalid inputs and HTTP/channel failures remain visible; practice-session cleanup removes the relay listener/token ownership only for the meeting that owns the channel. | Practice resources are meeting-owned, while webcast authorization currently depends on the service rather than the stored capability. | `src/webinar/` | `test/unit/spec/webinar/index.ts` | none | PRESENT |
|
|
94
|
+
| `WEBINAR-R-004` | Practice-session data-channel token/connection state is created, replaced, and cleaned independently from the public meeting channel. | Practice participants must not receive or retain events on the wrong session transport. | `src/webinar/index.ts` | `test/unit/spec/webinar/index.ts` | none | PRESENT |
|
|
95
|
+
| `WEBINAR-R-005` | Webcast operations send the user token against the current webcast URL without reading `canManageWebcast`. `startWebcast()` validates `meeting`; large-scale attendee search validates the resolvable webinar meeting and attendee-search URL and sanitizes its optional query fields. Layout, standard view/search/expel, and stop operations perform no equivalent local validation/sanitization. | This preserves the method-specific enforcement boundary instead of generalizing the large-scale-search checks across unrelated operations. | `src/webinar/index.ts`, `src/webinar/utils.ts` | `test/unit/spec/webinar/index.ts`, `test/unit/spec/webinar/utils.ts` | Possible product authorization defect: confirm whether these operations should reject locally when `canManageWebcast` is false. | PRESENT |
|
|
96
|
+
| `WEBINAR-R-006` | Role and practice/webcast status updates refresh the controller before exposing the new state. | Consumer controls must follow the latest Locus role/status projection rather than stale local intent. | `src/webinar/index.ts` | `test/unit/spec/webinar/index.ts` | none | PRESENT |
|
|
97
|
+
|
|
98
|
+
## Design Overview
|
|
99
|
+
|
|
100
|
+
`Webinar` projects Locus role/practice/webcast data, owns the practice-session LLM data-channel token/listener lifecycle, and calls webcast/layout/attendee URLs directly. `utils.ts` sanitizes only large-scale attendee-search parameters. `index.ts` registers `WebinarCollection` through its WebexPlugin `collections` declaration for framework-managed instantiation, although controller methods do not explicitly read or populate it.
|
|
101
|
+
|
|
102
|
+
## Data Flow
|
|
103
|
+
|
|
104
|
+
```mermaid
|
|
105
|
+
flowchart LR
|
|
106
|
+
Locus[Locus webinar role/status/URLs] --> Controller[index.ts]
|
|
107
|
+
Caller[Meeting / webinar consumer] --> Controller
|
|
108
|
+
Controller --> LLM[practice-session LLM data channel]
|
|
109
|
+
Controller --> Service[webcast/layout/attendee HTTP URLs]
|
|
110
|
+
Framework[WebexPlugin collection lifecycle] --> Collection[collection.ts WebinarCollection]
|
|
111
|
+
Controller -. declares collection .-> Framework
|
|
112
|
+
Utils[utils.ts query sanitization] --> Service
|
|
113
|
+
Controller --> Caller
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Sequence Diagram(s)
|
|
117
|
+
|
|
118
|
+
Sequence coverage:
|
|
119
|
+
|
|
120
|
+
| Operation group | Diagram | Failure coverage |
|
|
121
|
+
|---|---|---|
|
|
122
|
+
| UC-1…UC-4 — webinar practice and webcast operation groups | Webinar practice and webcast primary sequence | invalid URL/input, practice-channel failure/cleanup, webcast rejection, and absent local capability guard |
|
|
123
|
+
| UC-1…UC-4 — webinar practice and webcast alternate/failure paths | Webinar practice and webcast alternate/failure sequence | missing webinar/service URL, invalid layout/search input, practice-channel ownership conflict, token refresh failure, or HTTP rejection |
|
|
124
|
+
|
|
125
|
+
### Webinar practice and webcast primary sequence
|
|
126
|
+
|
|
127
|
+
```mermaid
|
|
128
|
+
sequenceDiagram
|
|
129
|
+
participant C as Webinar consumer
|
|
130
|
+
participant W as Webinar index.ts
|
|
131
|
+
participant U as utils.ts
|
|
132
|
+
participant S as Webcast service URL
|
|
133
|
+
C->>W: start/stop webcast, layout, or attendee operation
|
|
134
|
+
W->>W: validate required meeting/URL/input
|
|
135
|
+
Note over W: canManageWebcast is stored but not read as a client-side gate
|
|
136
|
+
W->>U: sanitize only large-scale attendee-search parameters
|
|
137
|
+
W->>S: HTTP operation with user token
|
|
138
|
+
S-->>W: response or rejection
|
|
139
|
+
W-->>C: result
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Webinar practice and webcast alternate/failure sequence
|
|
143
|
+
|
|
144
|
+
```mermaid
|
|
145
|
+
sequenceDiagram
|
|
146
|
+
participant L as Locus webinar update
|
|
147
|
+
participant W as Webinar
|
|
148
|
+
participant P as Practice-session LLM channel
|
|
149
|
+
participant C as Meeting consumer
|
|
150
|
+
L-->>W: role/status/practice channel URL and token
|
|
151
|
+
alt update belongs to this meeting's practice session
|
|
152
|
+
W->>P: create/replace owned channel and relay listener
|
|
153
|
+
P-->>C: scoped practice-session events
|
|
154
|
+
else owning meeting cleans up or channel is replaced
|
|
155
|
+
W->>P: remove this meeting's relay listener/token ownership
|
|
156
|
+
end
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Class / Component Relationships
|
|
160
|
+
|
|
161
|
+
```mermaid
|
|
162
|
+
classDiagram
|
|
163
|
+
class Locus
|
|
164
|
+
class Controller
|
|
165
|
+
class Caller
|
|
166
|
+
class LLM
|
|
167
|
+
class Service
|
|
168
|
+
class Collection
|
|
169
|
+
class Utils
|
|
170
|
+
Locus --> Controller
|
|
171
|
+
Caller --> Controller
|
|
172
|
+
Controller --> LLM
|
|
173
|
+
Controller --> Service
|
|
174
|
+
Framework --> Collection
|
|
175
|
+
Controller ..> Framework : declares collection registration
|
|
176
|
+
Utils --> Service
|
|
177
|
+
Controller --> Caller
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
The arrows identify ownership and delegation inside `src/webinar/`; files that only declare types or constants are not presented as transports.
|
|
181
|
+
|
|
182
|
+
## Use Cases
|
|
183
|
+
|
|
184
|
+
- **UC-1:** Project webinar role, webcast URL, practice status, and owner identity from Locus updates. Evidence: `src/webinar/index.ts`.
|
|
185
|
+
- **UC-2:** Acquire the practice-session token, connect/replace its LLM channel for the owning meeting, and remove its relay listener during cleanup. Evidence: `src/webinar/index.ts`.
|
|
186
|
+
- **UC-3:** Start/stop webcast or query/update layout after current URL/input checks; `canManageWebcast` is stored but not enforced by these methods. Evidence: `src/webinar/index.ts`.
|
|
187
|
+
- **UC-4:** View or expel attendees directly, standard-search with `encodeURIComponent`, or large-scale-search after `sanitizeParams()` and meeting/search-URL validation, while relying on service authorization. Evidence: `src/webinar/index.ts`, `src/webinar/utils.ts`.
|
|
188
|
+
|
|
189
|
+
## State Model
|
|
190
|
+
|
|
191
|
+
Webcast URL, management capability, role transition, practice-session status/channel/token, layout, attendee collection, and listeners are meeting scoped.
|
|
192
|
+
|
|
193
|
+
## Business Rules & Invariants
|
|
194
|
+
|
|
195
|
+
- Practice-channel replacement is meeting-owner scoped. Only `searchLargeScaleWebinarAttendees()` uses `sanitizeParams()`; standard attendee search URL-encodes its keyword, and layout/view/expel operations do neither. Webcast operations rely on server authorization and do not consult `canManageWebcast`. Evidence: `src/webinar/index.ts`, `src/webinar/utils.ts`.
|
|
196
|
+
|
|
197
|
+
## Concurrency & Reactive Flow
|
|
198
|
+
|
|
199
|
+
- Practice-session channel/listener/token ownership is keyed to the owning meeting and is detached when that meeting replaces or cleans up its practice channel. Webcast HTTP operations settle their returned promises; current code stores `canManageWebcast` but does not read it as a local authorization guard.
|
|
200
|
+
|
|
201
|
+
## State Machine
|
|
202
|
+
|
|
203
|
+
```mermaid
|
|
204
|
+
stateDiagram-v2
|
|
205
|
+
state "practiceSessionEnabled = false" as PracticeFalse
|
|
206
|
+
state "practiceSessionEnabled = true" as PracticeTrue
|
|
207
|
+
[*] --> PracticeFalse
|
|
208
|
+
PracticeFalse --> PracticeTrue: updatePracticeSessionStatus({enabled: true})
|
|
209
|
+
PracticeTrue --> PracticeFalse: updatePracticeSessionStatus({enabled: false})
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
The diagram is limited to the stored boolean projection in `src/webinar/index.ts`. Practice-channel creation/replacement is a side effect of `updatePracticeSessionStatus()`/`updatePSDataChannel()`, not a separately named controller state.
|
|
213
|
+
|
|
214
|
+
## Error Handling & Failure Modes
|
|
215
|
+
|
|
216
|
+
| Condition | Signal | Caller recovery |
|
|
217
|
+
|---|---|---|
|
|
218
|
+
| `startWebcast()` lacks a meeting, or large-scale search cannot resolve its webinar meeting/attendee-search URL | The async operation rejects before issuing its request. Layout, stop, standard view/search, and expel do not perform the same local validation. | Supply the method-specific required context; do not infer a shared validation gate. |
|
|
219
|
+
| Practice-session channel/token setup fails or its owning meeting cleans up | The failure remains visible; cleanup removes only that meeting's relay listener/token ownership. | Re-establish the practice channel for the owning meeting if still required. |
|
|
220
|
+
| Webcast HTTP request rejects | The returned promise rejects. `canManageWebcast` is not consulted as a client-side guard by these operations. | Handle the service rejection; treat local capability enforcement as the recorded product-decision gap. |
|
|
221
|
+
|
|
222
|
+
## Pitfalls
|
|
223
|
+
|
|
224
|
+
- Practice-session media/data-channel state differs from public webcast state. Reusing the ordinary meeting channel without cleanup can deliver events to the wrong session.
|
|
225
|
+
- Verify both typed constants/enums and raw wire values before changing a logical condition in this legacy package.
|
|
226
|
+
|
|
227
|
+
## Test-Case Strategy (module)
|
|
228
|
+
|
|
229
|
+
Use the current mirrored suites: `test/unit/spec/webinar/collection.ts`, `test/unit/spec/webinar/index.ts`, `test/unit/spec/webinar/utils.ts`. Characterize the webinar-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
|
|
230
|
+
|
|
231
|
+
| Behavior / Requirement | Existing test evidence | Gap |
|
|
232
|
+
|---|---|---|
|
|
233
|
+
| `WEBINAR-R-001` | `test/unit/spec/webinar/index.ts` | cover state, practice channel, webcast, layout, attendee, and standalone helper groups |
|
|
234
|
+
| `WEBINAR-R-002` | `test/unit/spec/webinar/index.ts` | cover start/stop, layout, search, pagination, and expel request inputs separately |
|
|
235
|
+
| `WEBINAR-R-003` | `test/unit/spec/webinar/index.ts` | prove practice cleanup is owner-scoped and webcast methods do not read `canManageWebcast` |
|
|
236
|
+
| `WEBINAR-R-004` | `test/unit/spec/webinar/index.ts` | verify token/channel replacement cleanup |
|
|
237
|
+
| `WEBINAR-R-005` | `test/unit/spec/webinar/index.ts`, `test/unit/spec/webinar/utils.ts` | characterize current no-client-gate behavior; capability enforcement remains a product-decision gap |
|
|
238
|
+
| `WEBINAR-R-006` | `test/unit/spec/webinar/index.ts` | none |
|
|
239
|
+
|
|
240
|
+
## Traceability
|
|
241
|
+
|
|
242
|
+
- Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
|
|
243
|
+
- Coverage state and contracts baseline: `../../../.sdd/manifest.json`
|
package/src/webinar/index.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import {WebexPlugin, config} from '@webex/webex-core';
|
|
5
5
|
import uuid from 'uuid';
|
|
6
6
|
import {get} from 'lodash';
|
|
7
|
-
import {DataChannelTokenType} from '@webex/internal-plugin-llm';
|
|
8
7
|
import {
|
|
9
8
|
_ID_,
|
|
10
9
|
HEADERS,
|
|
@@ -14,12 +13,27 @@ import {
|
|
|
14
13
|
SHARE_STATUS,
|
|
15
14
|
DEFAULT_LARGE_SCALE_WEBINAR_ATTENDEE_SEARCH_LIMIT,
|
|
16
15
|
LLM_PRACTICE_SESSION,
|
|
16
|
+
LOCUS_LLM_EVENT,
|
|
17
17
|
} from '../constants';
|
|
18
18
|
|
|
19
19
|
import WebinarCollection from './collection';
|
|
20
20
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
21
|
+
import MeetingUtil from '../meeting/util';
|
|
21
22
|
import {sanitizeParams} from './utils';
|
|
22
23
|
|
|
24
|
+
const PS_LLM_EVENTS = [
|
|
25
|
+
{
|
|
26
|
+
event: `event:relay.event:${LLM_PRACTICE_SESSION}`,
|
|
27
|
+
listenerKey: 'relay',
|
|
28
|
+
handlerKey: 'processRelayEvent',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
event: `${LOCUS_LLM_EVENT}:${LLM_PRACTICE_SESSION}`,
|
|
32
|
+
listenerKey: 'locusLLM',
|
|
33
|
+
handlerKey: 'processLocusLLMEvent',
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
|
|
23
37
|
/**
|
|
24
38
|
* @class Webinar
|
|
25
39
|
*/
|
|
@@ -98,13 +112,49 @@ const Webinar = WebexPlugin.extend({
|
|
|
98
112
|
return {isPromoted, isDemoted};
|
|
99
113
|
},
|
|
100
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Resolves the meeting associated with this webinar instance, guarded against the
|
|
117
|
+
* meetingId pointer drifting onto an unrelated transient meeting (e.g. an inbound
|
|
118
|
+
* 1:1 call) that may exist in the meeting collection. Returns the meeting only when
|
|
119
|
+
* its locusUrl matches this webinar's tracked locusUrl. Returns undefined (with a
|
|
120
|
+
* warning) when the meeting cannot be resolved or when the webinar's locusUrl has
|
|
121
|
+
* not been initialized yet — callers must treat this as "no owned meeting" rather
|
|
122
|
+
* than fall through to an unvalidated lookup.
|
|
123
|
+
* @returns {object|undefined}
|
|
124
|
+
*/
|
|
125
|
+
getValidatedWebinarMeeting() {
|
|
126
|
+
const meeting = this.webex.meetings.getMeetingByType(_ID_, this.meetingId);
|
|
127
|
+
|
|
128
|
+
if (!meeting) {
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (!this.locusUrl) {
|
|
133
|
+
LoggerProxy.logger.warn(
|
|
134
|
+
`Webinar:index#getValidatedWebinarMeeting --> skipping; webinar locusUrl is not yet initialized for meetingId ${this.meetingId}`
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (meeting.locusUrl !== this.locusUrl) {
|
|
141
|
+
LoggerProxy.logger.warn(
|
|
142
|
+
`Webinar:index#getValidatedWebinarMeeting --> skipping; meeting ${this.meetingId} locusUrl ${meeting.locusUrl} does not match webinar locusUrl ${this.locusUrl}`
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
return undefined;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return meeting;
|
|
149
|
+
},
|
|
150
|
+
|
|
101
151
|
/**
|
|
102
152
|
* should join practice session data channel or not
|
|
103
153
|
* @param {Object} {isPromoted: boolean, isDemoted: boolean}} Role transition states
|
|
104
154
|
* @returns {void}
|
|
105
155
|
*/
|
|
106
156
|
updateStatusByRole({isPromoted, isDemoted}) {
|
|
107
|
-
const meeting = this.
|
|
157
|
+
const meeting = this.getValidatedWebinarMeeting();
|
|
108
158
|
|
|
109
159
|
if (
|
|
110
160
|
(isDemoted && meeting?.shareStatus === SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE) ||
|
|
@@ -128,34 +178,73 @@ const Webinar = WebexPlugin.extend({
|
|
|
128
178
|
|
|
129
179
|
/**
|
|
130
180
|
* Disconnects the practice session data channel and removes its relay listener.
|
|
181
|
+
* The listener reference removed here is the exact callback captured at subscribe
|
|
182
|
+
* time (see updatePSDataChannel) so that cleanup is correct even if the underlying
|
|
183
|
+
* meeting can no longer be resolved (e.g. locusUrl mismatch).
|
|
131
184
|
* @returns {Promise<void>}
|
|
132
185
|
*/
|
|
133
186
|
async cleanupPSDataChannel() {
|
|
187
|
+
const {isOwner} = this.webex.internal.llm.resolveSessionOwnership(
|
|
188
|
+
this.meetingId,
|
|
189
|
+
LLM_PRACTICE_SESSION
|
|
190
|
+
);
|
|
191
|
+
this.llmListeners = this.llmListeners || {};
|
|
192
|
+
|
|
134
193
|
if (this._pendingOnlineListener) {
|
|
135
194
|
// @ts-ignore - Fix type
|
|
136
195
|
this.webex.internal.llm.off('online', this._pendingOnlineListener);
|
|
137
196
|
this._pendingOnlineListener = null;
|
|
138
197
|
}
|
|
139
198
|
|
|
140
|
-
|
|
199
|
+
try {
|
|
200
|
+
// @ts-ignore - Fix type
|
|
201
|
+
const disconnected = await this.webex.internal.llm.disconnectLLM(
|
|
202
|
+
{
|
|
203
|
+
code: 3050,
|
|
204
|
+
reason: 'done (permanent)',
|
|
205
|
+
},
|
|
206
|
+
LLM_PRACTICE_SESSION,
|
|
207
|
+
this.meetingId
|
|
208
|
+
);
|
|
141
209
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
210
|
+
if (!disconnected) {
|
|
211
|
+
LoggerProxy.logger.info(
|
|
212
|
+
`Webinar:index#cleanupPSDataChannel --> skipping disconnect; practice-session LLM is not owned by meeting ${this.meetingId}`
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
} catch (error) {
|
|
216
|
+
// disconnectLLM clears ownership only on success; release a stale owner
|
|
217
|
+
// tag here so other meeting instances can reclaim practice-session LLM.
|
|
218
|
+
if (isOwner) {
|
|
219
|
+
// @ts-ignore - Fix type
|
|
220
|
+
this.webex.internal.llm.setOwnerMeetingId?.(undefined, LLM_PRACTICE_SESSION);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
throw error;
|
|
224
|
+
} finally {
|
|
225
|
+
if (this._practiceSessionRelayListener) {
|
|
226
|
+
// @ts-ignore - Fix type
|
|
227
|
+
this.webex.internal.llm.off(
|
|
228
|
+
`event:relay.event:${LLM_PRACTICE_SESSION}`,
|
|
229
|
+
this._practiceSessionRelayListener
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
this._practiceSessionRelayListener = null;
|
|
233
|
+
|
|
234
|
+
for (const {event, listenerKey} of PS_LLM_EVENTS) {
|
|
235
|
+
if (this.llmListeners[listenerKey]) {
|
|
236
|
+
// @ts-ignore - Fix type
|
|
237
|
+
this.webex.internal.llm.off(event, this.llmListeners[listenerKey]);
|
|
238
|
+
this.llmListeners[listenerKey] = null;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
155
242
|
},
|
|
156
243
|
|
|
157
244
|
/**
|
|
158
245
|
* Ensures practice-session token exists before registering the practice LLM channel.
|
|
246
|
+
* Caller is responsible for passing a meeting that has already been resolved via
|
|
247
|
+
* getValidatedWebinarMeeting() — this method does not re-validate ownership.
|
|
159
248
|
* @param {object} meeting
|
|
160
249
|
* @returns {Promise<string|undefined>}
|
|
161
250
|
*/
|
|
@@ -169,7 +258,8 @@ const Webinar = WebexPlugin.extend({
|
|
|
169
258
|
|
|
170
259
|
// @ts-ignore
|
|
171
260
|
const cachedToken = this.webex.internal.llm.getDatachannelToken(
|
|
172
|
-
|
|
261
|
+
LLM_PRACTICE_SESSION,
|
|
262
|
+
this.meetingId
|
|
173
263
|
);
|
|
174
264
|
|
|
175
265
|
if (cachedToken) {
|
|
@@ -187,7 +277,8 @@ const Webinar = WebexPlugin.extend({
|
|
|
187
277
|
// @ts-ignore
|
|
188
278
|
this.webex.internal.llm.setDatachannelToken(
|
|
189
279
|
datachannelToken,
|
|
190
|
-
dataChannelTokenType ||
|
|
280
|
+
dataChannelTokenType || LLM_PRACTICE_SESSION,
|
|
281
|
+
this.meetingId
|
|
191
282
|
);
|
|
192
283
|
|
|
193
284
|
return datachannelToken;
|
|
@@ -208,11 +299,17 @@ const Webinar = WebexPlugin.extend({
|
|
|
208
299
|
* @returns {Promise}
|
|
209
300
|
*/
|
|
210
301
|
async updatePSDataChannel() {
|
|
302
|
+
this.llmListeners = this.llmListeners || {};
|
|
303
|
+
|
|
211
304
|
this._updatePSDataChannelSequence = (this._updatePSDataChannelSequence || 0) + 1;
|
|
212
305
|
const invocationSequence = this._updatePSDataChannelSequence;
|
|
213
306
|
|
|
214
|
-
const meeting = this.
|
|
307
|
+
const meeting = this.getValidatedWebinarMeeting();
|
|
215
308
|
const isPracticeSession = meeting?.isJoined() && this.isJoinPracticeSessionDataChannel();
|
|
309
|
+
const {currentOwner, isOwner} = this.webex.internal.llm.resolveSessionOwnership(
|
|
310
|
+
this.meetingId,
|
|
311
|
+
LLM_PRACTICE_SESSION
|
|
312
|
+
);
|
|
216
313
|
|
|
217
314
|
if (!isPracticeSession) {
|
|
218
315
|
await this.cleanupPSDataChannel();
|
|
@@ -220,16 +317,25 @@ const Webinar = WebexPlugin.extend({
|
|
|
220
317
|
return undefined;
|
|
221
318
|
}
|
|
222
319
|
|
|
320
|
+
if (!isOwner) {
|
|
321
|
+
LoggerProxy.logger.info(
|
|
322
|
+
`Webinar:index#updatePSDataChannel --> skipping; practice-session LLM owned by meeting ${currentOwner}, not ${this.meetingId}`
|
|
323
|
+
);
|
|
324
|
+
|
|
325
|
+
return undefined;
|
|
326
|
+
}
|
|
327
|
+
|
|
223
328
|
// @ts-ignore - Fix type
|
|
224
329
|
const {url = undefined, info: {practiceSessionDatachannelUrl = undefined} = {}} =
|
|
225
330
|
meeting?.locusInfo || {};
|
|
226
331
|
|
|
227
332
|
// @ts-ignore
|
|
228
333
|
let practiceSessionDatachannelToken = this.webex.internal.llm.getDatachannelToken(
|
|
229
|
-
|
|
334
|
+
LLM_PRACTICE_SESSION,
|
|
335
|
+
this.meetingId
|
|
230
336
|
);
|
|
231
337
|
|
|
232
|
-
const
|
|
338
|
+
const keepTranscriptionSubscribed = this.webex.internal.voicea.getKeepTranscriptionSubscribed();
|
|
233
339
|
|
|
234
340
|
if (!practiceSessionDatachannelUrl) {
|
|
235
341
|
return undefined;
|
|
@@ -303,6 +409,30 @@ const Webinar = WebexPlugin.extend({
|
|
|
303
409
|
practiceSessionDatachannelToken = refreshedPracticeSessionToken;
|
|
304
410
|
}
|
|
305
411
|
|
|
412
|
+
const {currentOwner: currentOwnerBeforeConnect, isOwner: isOwnerBeforeConnect} =
|
|
413
|
+
this.webex.internal.llm.resolveSessionOwnership(this.meetingId, LLM_PRACTICE_SESSION);
|
|
414
|
+
|
|
415
|
+
if (!isOwnerBeforeConnect) {
|
|
416
|
+
LoggerProxy.logger.info(
|
|
417
|
+
`Webinar:index#updatePSDataChannel --> skipping pre-connect owner write; practice-session LLM owned by meeting ${currentOwnerBeforeConnect}, not ${this.meetingId}`
|
|
418
|
+
);
|
|
419
|
+
|
|
420
|
+
return undefined;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// Ensure refresh for practice datachannel requests is routed to this
|
|
424
|
+
// meeting only when we are actually about to connect the practice session.
|
|
425
|
+
// This avoids claiming ownership in flows that return early (e.g. missing
|
|
426
|
+
// practiceSessionDatachannelUrl or waiting for default session online).
|
|
427
|
+
// @ts-ignore - Fix type
|
|
428
|
+
this.webex.internal.llm.setRefreshHandler(
|
|
429
|
+
() => meeting.refreshDataChannelToken(),
|
|
430
|
+
LLM_PRACTICE_SESSION,
|
|
431
|
+
this.meetingId
|
|
432
|
+
);
|
|
433
|
+
// @ts-ignore - Fix type
|
|
434
|
+
this.webex.internal.llm.setOwnerMeetingId?.(this.meetingId, LLM_PRACTICE_SESSION);
|
|
435
|
+
|
|
306
436
|
// @ts-ignore - Fix type
|
|
307
437
|
return this.webex.internal.llm
|
|
308
438
|
.registerAndConnect(
|
|
@@ -312,19 +442,33 @@ const Webinar = WebexPlugin.extend({
|
|
|
312
442
|
LLM_PRACTICE_SESSION
|
|
313
443
|
)
|
|
314
444
|
.then((registerAndConnectResult) => {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
445
|
+
const {currentOwner: currentOwnerAfterConnect, isOwner: isOwnerAfterConnect} =
|
|
446
|
+
this.webex.internal.llm.resolveSessionOwnership(this.meetingId, LLM_PRACTICE_SESSION);
|
|
447
|
+
|
|
448
|
+
if (this.meetingId && isOwnerAfterConnect) {
|
|
449
|
+
// @ts-ignore - Fix type
|
|
450
|
+
this.webex.internal.llm.setOwnerMeetingId?.(this.meetingId, LLM_PRACTICE_SESSION);
|
|
451
|
+
} else {
|
|
452
|
+
LoggerProxy.logger.info(
|
|
453
|
+
`Webinar:index#updatePSDataChannel --> skipping post-connect owner write; practice-session LLM owned by meeting ${currentOwnerAfterConnect}, not ${this.meetingId}`
|
|
454
|
+
);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// Track the exact listener references so cleanupPSDataChannel can
|
|
458
|
+
// unsubscribe deterministically, even if the meeting can no longer
|
|
459
|
+
// be resolved at cleanup time.
|
|
460
|
+
for (const {event, listenerKey, handlerKey} of PS_LLM_EVENTS) {
|
|
461
|
+
if (this.llmListeners[listenerKey]) {
|
|
462
|
+
// @ts-ignore - Fix type
|
|
463
|
+
this.webex.internal.llm.off(event, this.llmListeners[listenerKey]);
|
|
464
|
+
}
|
|
465
|
+
this.llmListeners[listenerKey] = meeting?.[handlerKey];
|
|
466
|
+
// @ts-ignore - Fix type
|
|
467
|
+
this.webex.internal.llm.on(event, this.llmListeners[listenerKey]);
|
|
468
|
+
}
|
|
325
469
|
// @ts-ignore - Fix type
|
|
326
470
|
this.webex.internal.voicea?.announce?.();
|
|
327
|
-
if (
|
|
471
|
+
if (keepTranscriptionSubscribed) {
|
|
328
472
|
this.webex.internal.voicea.updateSubchannelSubscriptions({subscribe: ['transcription']});
|
|
329
473
|
}
|
|
330
474
|
LoggerProxy.logger.info(
|
|
@@ -332,6 +476,23 @@ const Webinar = WebexPlugin.extend({
|
|
|
332
476
|
);
|
|
333
477
|
|
|
334
478
|
return Promise.resolve(registerAndConnectResult);
|
|
479
|
+
})
|
|
480
|
+
.catch((error) => {
|
|
481
|
+
const {
|
|
482
|
+
currentOwner: currentOwnerAfterRegisterFailure,
|
|
483
|
+
isOwner: isOwnerAfterRegisterFailure,
|
|
484
|
+
} = this.webex.internal.llm.resolveSessionOwnership(this.meetingId, LLM_PRACTICE_SESSION);
|
|
485
|
+
|
|
486
|
+
if (isOwnerAfterRegisterFailure) {
|
|
487
|
+
// @ts-ignore - Fix type
|
|
488
|
+
this.webex.internal.llm.setOwnerMeetingId?.(undefined, LLM_PRACTICE_SESSION);
|
|
489
|
+
} else {
|
|
490
|
+
LoggerProxy.logger.info(
|
|
491
|
+
`Webinar:index#updatePSDataChannel --> skipping failure owner release; practice-session LLM owned by meeting ${currentOwnerAfterRegisterFailure}, not ${this.meetingId}`
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
throw error;
|
|
335
496
|
});
|
|
336
497
|
},
|
|
337
498
|
|
|
@@ -341,6 +502,8 @@ const Webinar = WebexPlugin.extend({
|
|
|
341
502
|
* @returns {Promise}
|
|
342
503
|
*/
|
|
343
504
|
setPracticeSessionState(enabled) {
|
|
505
|
+
const meeting = this.getValidatedWebinarMeeting();
|
|
506
|
+
|
|
344
507
|
return this.request({
|
|
345
508
|
method: HTTP_VERBS.PATCH,
|
|
346
509
|
uri: `${this.locusUrl}/controls`,
|
|
@@ -349,10 +512,16 @@ const Webinar = WebexPlugin.extend({
|
|
|
349
512
|
enabled,
|
|
350
513
|
},
|
|
351
514
|
},
|
|
352
|
-
})
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
515
|
+
})
|
|
516
|
+
.then((response) => {
|
|
517
|
+
MeetingUtil.updateLocusFromApiResponse(meeting, response);
|
|
518
|
+
|
|
519
|
+
return response;
|
|
520
|
+
})
|
|
521
|
+
.catch((error) => {
|
|
522
|
+
LoggerProxy.logger.error('Meeting:webinar#setPracticeSessionState failed', error);
|
|
523
|
+
throw error;
|
|
524
|
+
});
|
|
356
525
|
},
|
|
357
526
|
|
|
358
527
|
/**
|
|
@@ -532,7 +701,14 @@ const Webinar = WebexPlugin.extend({
|
|
|
532
701
|
* @returns {Promise}
|
|
533
702
|
*/
|
|
534
703
|
async searchLargeScaleWebinarAttendees(payload) {
|
|
535
|
-
const meeting = this.
|
|
704
|
+
const meeting = this.getValidatedWebinarMeeting();
|
|
705
|
+
if (!meeting) {
|
|
706
|
+
LoggerProxy.logger.error(
|
|
707
|
+
'Meeting:webinar5k#searchLargeScaleWebinarAttendees failed --> webinar meeting could not be validated'
|
|
708
|
+
);
|
|
709
|
+
throw new Error('Meeting:webinar5k#Webinar meeting is not resolvable for the current locus');
|
|
710
|
+
}
|
|
711
|
+
|
|
536
712
|
const rawParams = {
|
|
537
713
|
search_text: payload?.queryString,
|
|
538
714
|
limit: payload?.limit ?? DEFAULT_LARGE_SCALE_WEBINAR_ATTENDEE_SEARCH_LIMIT,
|
|
@@ -540,7 +716,9 @@ const Webinar = WebexPlugin.extend({
|
|
|
540
716
|
};
|
|
541
717
|
const attendeeSearchUrl = meeting?.locusInfo?.links?.resources?.attendeeSearch?.url;
|
|
542
718
|
if (!attendeeSearchUrl) {
|
|
543
|
-
LoggerProxy.logger.error(
|
|
719
|
+
LoggerProxy.logger.error(
|
|
720
|
+
'Meeting:webinar5k#searchLargeScaleWebinarAttendees failed --> attendee search url unavailable'
|
|
721
|
+
);
|
|
544
722
|
throw new Error('Meeting:webinar5k#Attendee search url is not available');
|
|
545
723
|
}
|
|
546
724
|
|