@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,420 @@
1
+ ---
2
+ type: Module Spec
3
+ title: 'Simultaneous interpretation specification'
4
+ description: Responsibilities, boundaries, design, state, invariants, and verification for the meeting simultaneous-interpretation 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
+ # Simultaneous interpretation
17
+
18
+ This canonical source-local document at `src/interpretation/docs/README.md` owns the stable
19
+ specification for **simultaneous interpretation**: the `meeting.simultaneousInterpretation`
20
+ controller (`SimultaneousInterpretation`, a `WebexPlugin`) with its `siLanguages` collection of
21
+ `SILanguage` models. The module holds the meeting's interpretation languages and the self
22
+ interpreter's direction, queries the languages a host can assign, reads and updates interpreters,
23
+ ends interpretation, changes an interpreter's direction, and offers, requests, accepts, and declines
24
+ interpreter handoffs through the approval service. Ground every claim in package evidence and link to
25
+ the [package architecture](../../../docs/architecture.md) instead of repeating broader facts. No
26
+ service specification exists because this package is a library.
27
+
28
+ Related context: [documentation index](../../../docs/index.md) ·
29
+ [package agent instructions](../../../AGENTS.md)
30
+
31
+ ## Metadata
32
+
33
+ | Field | Value |
34
+ | ----- | ----- |
35
+ | Owner | @webex/web-client, @webex/web-sdk |
36
+ | Source path | `src/interpretation` |
37
+ | Resource kind | module |
38
+ | Status | Draft |
39
+ | Last verified | 2026-11-16 at `0b8c34db7f` |
40
+ | Module id | `plugin-meetings/interpretation` |
41
+ | Parent spec | — |
42
+ | Doc kind | Module spec |
43
+ | Coverage score | Pending coverage assessment |
44
+ | Validation status | not-run |
45
+
46
+ ## Applicability
47
+
48
+ | Condition ID | Status | Evidence or reason | Owned section |
49
+ | ------------------------------------ | ---------- | ------------------ | ------------- |
50
+ | `module.has_tiers` | N/A | No tier policy exists in `package.json` or `src/interpretation/index.ts` | Tier |
51
+ | `module.has_ui` | N/A | `src/interpretation/index.ts` exposes state, promises, and events; no UI | UI use-case flow |
52
+ | `module.crosses_service_boundaries` | Applicable | Locus and approval-service requests and the Mercury approval listener in `src/interpretation/index.ts` | Cross-boundary use-case flow |
53
+ | `module.holds_client_state` | Applicable | Language, self-interpreter, enablement, and URL props in `src/interpretation/index.ts` | Client state model |
54
+ | `module.enforces_domain_rules` | Applicable | Input guards, the handoff filter, and the target-language rule in `src/interpretation/index.ts` | Business rules and invariants |
55
+ | `module.is_concurrent_async` | Applicable | Promise requests, an automatic language query, and a Mercury listener in `src/interpretation/index.ts` | Concurrency and reactive flow |
56
+ | `module.owns_persistence` | N/A | Nothing is stored; Locus holds the record (`src/interpretation/index.ts`) | Data, schema, and migration discipline |
57
+ | `module.stateful_transitions` | Applicable | The self interpreter's active state and the meeting's SI enablement in `src/interpretation/index.ts` | State machine |
58
+ | `module.exposes_wire_protocol` | N/A | Recorded false in `.sdd/manifest.json`; request bodies are described under Requirements | Protocol and wire format |
59
+ | `module.ui_multi_screen` | N/A | No UI | UI flow |
60
+ | `module.large_data_model` | N/A | Two small types in `src/interpretation/interpretation.types.ts` and one model in `src/interpretation/siLanguage.ts` | Data model |
61
+ | `module.returns_caller_errors` | Applicable | Local rejections and rethrown request errors in `src/interpretation/index.ts` | Caller-visible failure modes |
62
+ | `module.module_specific_conventions` | Applicable | The log-and-rethrow request convention and the Locus-response update in `src/interpretation/index.ts` | Module-specific rules |
63
+ | `module.published_package` | N/A | `src/index.ts` exports only the two interpreter types; the controller is reached through a meeting | Export stability |
64
+ | `module.embedded_in_host` | N/A | No host theme or embed API | Host integration and theming |
65
+ | `module.has_design_tradeoff` | N/A | Recorded false in `.sdd/manifest.json`; no trade-off is stated in `src/interpretation/index.ts` | Key design trade-off |
66
+ | `module.has_submodules` | N/A | The interpretation directory has no child module (`src/interpretation/index.ts`) | Sub-modules |
67
+
68
+ ## Evidence register
69
+
70
+ Requirements cite current source and mirrored tests under `test/unit/spec/interpretation/`. Where
71
+ prose and code disagree, current code wins; commit and PR history are not used as evidence. Missing
72
+ evidence stays a recorded gap.
73
+
74
+ | Evidence | What it establishes |
75
+ | -------- | ------------------- |
76
+ | `src/interpretation/index.ts` | `SimultaneousInterpretation` extends `WebexPlugin` (namespace `Meetings`): props, the derived `shouldQuerySupportLanguages`, the `siLanguages` collection, every request, and the Mercury handoff listener |
77
+ | `src/interpretation/collection.ts` | `SILanguageCollection`, an ampersand collection of `SILanguage` with `mainIndex: 'languageName'` |
78
+ | `src/interpretation/siLanguage.ts` | `SILanguage` (`idAttribute: 'languageName'`) with `languageCode` and `languageName` |
79
+ | `src/interpretation/interpretation.types.ts` | `Interpreter` (`order`, `sourceLanguage`, `targetLanguage`, `usingResource`) and `InterpreterUsingResource` (`id`, optional `email`) |
80
+ | `src/constants.ts` | `INTERPRETATION` (events, action types, resource type `SiHandover`, capabilities), `LOCUSEVENT.APPROVAL_REQUEST`, and `EVENT_TRIGGERS` `meeting:interpretation:*` |
81
+ | `src/meeting/index.ts` | `Meeting` creates `new SimultaneousInterpretation({}, {parent: webex})`, feeds Locus URL, approval URL, interpretation controls, self interpretation, and roles, re-emits the module events, and uses `getTargetLanguageCode()` in `setSendNamedMediaGroup` |
82
+ | `src/meeting/util.ts` | `parseInterpretationInfo` sets SI enablement from meeting info and seeds `siLanguages`; `cleanUp` calls `simultaneousInterpretation.cleanUp()`; `updateLocusFromApiResponse` applies a Locus response to a meeting |
83
+ | `src/index.ts` | Exports the `Interpreter` and `InterpreterUsingResource` types |
84
+ | `src/interpretation/README.md` | Names `getSupportLanguages()`, `siLanguage.subscribe()`, and `siLanguage.unsubscribe()`, which `src/interpretation/index.ts` and `src/interpretation/siLanguage.ts` do not define |
85
+ | `test/unit/spec/interpretation/index.ts` | Controller cases: automatic language query, setters, updates, target language code, every request and its guards, and the handoff listener |
86
+ | `test/unit/spec/interpretation/collection.ts`, `test/unit/spec/interpretation/siLanguage.ts` | Collection model and `SILanguage` props |
87
+ | Observation, no stated WHY | `changeDirection()` sends the current `isActive` and `order` with the swapped languages (`src/interpretation/index.ts`) |
88
+ | Observation, no stated WHY | `listenToHandoffRequests` compares only the first receiver with self (`src/interpretation/index.ts`) |
89
+
90
+ ## Purpose and boundary
91
+
92
+ - Responsibility: Owns simultaneous-interpretation language state, interpreter collections, direction changes, and interpreter handoff request/approval workflows.
93
+ - In scope: the `SimultaneousInterpretation` controller and its props; the `siLanguages`
94
+ collection; the host language query, interpreter read and update, and ending interpretation; the
95
+ self interpreter's direction change; handoff offer, request, accept, and decline; the Mercury
96
+ `locus.approval_request` listener for `SiHandover`.
97
+ - Out of scope: parsing Locus and meeting info into interpretation data (`src/locus-info`,
98
+ `MeetingUtil.parseInterpretationInfo`); sending audio to a language's named media group
99
+ (`Meeting.setSendNamedMediaGroup`); applying Locus responses (`MeetingUtil.updateLocusFromApiResponse`);
100
+ what Locus and the approval service decide.
101
+ - Consumers: `Meeting` (`src/meeting/index.ts`, `src/meeting/util.ts`) constructs, feeds, and
102
+ cleans it up and re-emits its events; applications call `meeting.simultaneousInterpretation`.
103
+
104
+ ## Structure and key files
105
+
106
+ `src/interpretation/` contains 5 direct source and reference files (four TypeScript files and the
107
+ retained `README.md`) and has 3 mirrored unit-test files under `test/unit/spec/interpretation/`.
108
+ This specification separates its public operations, runtime data movement, component ownership,
109
+ state, and verification boundary. Sources are TypeScript in the Node 22.14 Yarn workspace on Webex
110
+ core plugin abstractions (`WebexPlugin`) and ampersand collections; tests run under Mocha with Sinon
111
+ and `@webex/test-helper-chai` (`test:unit` in `package.json`).
112
+
113
+ | File | Holds |
114
+ | ---- | ----- |
115
+ | `src/interpretation/index.ts` | `SimultaneousInterpretation` controller mounted as `meeting.simultaneousInterpretation`: module facade/controller and primary (default) export holding props, requests, and the handoff listener |
116
+ | `src/interpretation/collection.ts` | `SILanguageCollection`, the module-owned collection of `SILanguage` models indexed by `languageName` |
117
+ | `src/interpretation/interpretation.types.ts` | Module type declarations: `Interpreter` and `InterpreterUsingResource` |
118
+ | `src/interpretation/siLanguage.ts` | `SILanguage` model: one interpretation language with its `languageName` id and numeric `languageCode` |
119
+ | `src/interpretation/README.md` | Retained human feature guide, context only; some method names in it do not exist |
120
+ | `src/interpretation/docs/README.md` | This module specification |
121
+ | `test/unit/spec/interpretation/index.ts`, `test/unit/spec/interpretation/collection.ts`, `test/unit/spec/interpretation/siLanguage.ts` | Mirrored characterization/unit coverage, one test file per source file except the types |
122
+
123
+ ## Public surface
124
+
125
+ `meeting.simultaneousInterpretation` is the `SimultaneousInterpretation` instance `Meeting` creates;
126
+ `src/index.ts` exports only the `Interpreter` and `InterpreterUsingResource` types, so applications
127
+ reach the controller through a meeting. Every row belongs to contract `interpretation-api`, indexed in
128
+ the [package architecture](../../../docs/architecture.md#public-and-consumer-surfaces); contract IDs
129
+ and coverage state are recorded in `.sdd/manifest.json`.
130
+
131
+ | Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
132
+ |---|---|---|---|---|---|---|
133
+ | `interpretation-api` | SDK / lifecycle | `initialize()`, `cleanUp()`, `locusUrlUpdate()`, `approvalUrlUpdate()`, `updateCanManageInterpreters()`, `updateHostSIEnabled()`, `updateMeetingSIEnabled()`, `updateInterpretation()`, and `updateSelfInterpretation()` | Maintain meeting-scoped interpretation configuration and Mercury handoff listener ownership; `Meeting` calls these. | `initialize()` installs the listener before self-participant context may be available; cleanup removes it. `updateInterpretation()` takes `{preserveSiEnabled}`. | `src/interpretation/index.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
134
+ | `interpretation-api` | SDK / remote | `querySupportLanguages()` and `getTargetLanguageCode()` | Fetch the languages a host can assign into `supportLanguages`, and map the self interpreter's target language to its `siLanguages` code. | Preserve the `supportLanguages` replacement and language-code matching behavior; the code is `0` when self is not an interpreter. | `src/interpretation/index.ts`, `src/interpretation/siLanguage.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
135
+ | `interpretation-api` | SDK / remote | `getInterpreters()`, `updateInterpreters()`, and `endSimultaneousInterpretation()` | Query and mutate interpreter assignments, or end interpretation, through the current Locus URL. | Preserve request bodies and caller-visible request rejection; these methods do not preflight capability or a missing `locusUrl`. | `src/interpretation/index.ts`, `src/interpretation/interpretation.types.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
136
+ | `interpretation-api` | SDK / remote | `changeDirection()` | Change the configured interpretation direction for the supported current participant context. | Do not imply a separate attendee direction API that code does not expose. | `src/interpretation/index.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
137
+ | `interpretation-api` | SDK / event/remote | `listenToHandoffRequests()`, `handoffInterpreter()`, `requestHandoff()`, `acceptRequest()`, and `declineRequest()` | Receive and act on interpreter handoff approval requests using participant and approval URLs. | Preserve event filtering as implemented; the Mercury callback does not compare `locusUrl`. | `src/interpretation/index.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
138
+ | `interpretation-api` | exported types/models | `InterpreterUsingResource`, `Interpreter`, `SILanguage`, and `SILanguageCollection` | Represent supported-language and interpreter-resource data used by the controller and consumers; only the two interpreter types are exported from `src/index.ts`. | Add fields compatibly; language collection identity remains code-driven. | `src/interpretation/interpretation.types.ts`, `src/interpretation/siLanguage.ts`, `src/interpretation/collection.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
139
+
140
+ 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.
141
+
142
+ | Event literal | Constant / expression | Emission evidence |
143
+ |---|---|---|
144
+ | `HANDOFF_REQUESTS_ARRIVED` | `INTERPRETATION.EVENTS.HANDOFF_REQUESTS_ARRIVED` | `src/interpretation/index.ts` |
145
+ | `meeting:interpretation:handoffRequestsArrived` | `EVENT_TRIGGERS.MEETING_INTERPRETATION_HANDOFF_REQUESTS_ARRIVED` | `src/meeting/index.ts` |
146
+ | `meeting:interpretation:supportLanguagesUpdate` | `EVENT_TRIGGERS.MEETING_INTERPRETATION_SUPPORT_LANGUAGES_UPDATE` | `src/meeting/index.ts` |
147
+ | `meeting:interpretation:update` | `EVENT_TRIGGERS.MEETING_INTERPRETATION_UPDATE` | `src/meeting/index.ts`, `src/meeting/util.ts` |
148
+ | `SUPPORT_LANGUAGES_UPDATE` | `INTERPRETATION.EVENTS.SUPPORT_LANGUAGES_UPDATE` | `src/interpretation/index.ts` |
149
+
150
+ `HANDOFF_REQUESTS_ARRIVED` carries `{actionType, isReceiver, isSender, senderId, receiverId, url}`,
151
+ which `Meeting` passes through; `SUPPORT_LANGUAGES_UPDATE` carries none. `Meeting` emits
152
+ `meeting:interpretation:update` itself after it applies interpretation controls, self
153
+ interpretation, or meeting info. The literals are defined in `src/constants.ts`.
154
+
155
+ Compatibility notes:
156
+
157
+ - 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.
158
+
159
+ ## Dependencies
160
+
161
+ Requires: Parent Meeting/Locus state, approval URL, interpretation collections/types, member/self
162
+ identity, request access, and scoped events. Contracts: provides `interpretation-api`; requires
163
+ `locus-http`, `internal-plugin-mercury-events`, and `webex-core-plugin-host` (`.sdd/manifest.json`).
164
+
165
+ | Dependency | Why it is required | Failure behavior |
166
+ | ---------- | ------------------ | ---------------- |
167
+ | `@webex/webex-core` (`webex-core-plugin-host`) | `WebexPlugin` base class; `this.request` carries every Locus and approval call | Rejections are logged and rethrown |
168
+ | Locus (`locus-http`) | `languages/interpretation`, `interpretation/interpreters`, `controls`, and `participant/<id>/controls` under the meeting's `locusUrl` | Errors are logged and rethrown |
169
+ | Approval service | `approvalUrl` from Locus `services.approval.url` for offers and requests; the event-supplied `url` for accept and decline | Errors are logged and rethrown |
170
+ | `webex.internal.mercury` (`internal-plugin-mercury-events`) | `event:locus.approval_request` carries handoff approvals | No retry; unrelated approvals are ignored |
171
+ | `Meeting`, `LocusInfo`, and `MeetingUtil` (`src/meeting`) | URLs, roles (`MODERATOR` sets `canManageInterpreters`), SI enablement, controls, self interpretation; `webex.meetings.meetingCollection` finds the meeting by `locusUrl` for `updateLocusFromApiResponse` | A meeting that is not found leaves Locus state to the next event |
172
+ | `ampersand-collection` | The `siLanguages` collection | — |
173
+
174
+ ## Requirements
175
+
176
+ | ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
177
+ |---|---|---|---|---|---|---|
178
+ | `INTERPRETATION-R-001` | query supported languages and expose interpretation state: when `shouldQuerySupportLanguages` (`canManageInterpreters`, `hostSIEnabled`, and `locusUrl` all set) becomes true and none are loaded, `querySupportLanguages()` GETs `<locusUrl>/languages/interpretation`, stores `body.siLanguages` in `supportLanguages`, and emits `SUPPORT_LANGUAGES_UPDATE`. | Only the host can manage interpreters (JSDoc of `updateCanManageInterpreters`), and the host needs the language list to assign them when host SI control is on. | `src/interpretation/index.ts` | `test/unit/spec/interpretation/index.ts` | An automatic query that fails is an unhandled rejection | Present |
179
+ | `INTERPRETATION-R-002` | change interpreter language direction: `changeDirection()` rejects without `sourceLanguage` and `targetLanguage` or without `selfParticipantId`; otherwise it PATCHes `<locusUrl>/participant/<selfParticipantId>/controls` with the two languages swapped and the current `isActive` and `order`, then applies the response to the meeting. | Language-direction and interpreter-assignment bodies must match the current Locus interpretation contract. | `src/interpretation/index.ts`, `src/meeting/util.ts` | `test/unit/spec/interpretation/index.ts` | listener initialization before self id and absent Locus-URL filtering need characterization | Present |
180
+ | `INTERPRETATION-R-003` | HTTP failures reject their operations; `initialize()` installs the handoff Mercury listener immediately, before self participant id may be available, and `cleanUp()` removes owned listeners. The callback filters resource/participant roles but does not compare Locus URL. | Handoff listeners and request failures must reflect actual initialization/filter/cleanup behavior rather than an invented subscription or Locus guard. | `src/interpretation/index.ts` | `test/unit/spec/interpretation/index.ts` | listener-before-self and cross-Locus same-participant behavior need characterization | Present |
181
+ | `INTERPRETATION-R-004` | `updateInterpretation(interpretation, {preserveSiEnabled})` replaces `siLanguages` (empty when absent) and sets `siEnabled` from `interpretation.siEnabled` unless `preserveSiEnabled`; `parseInterpretationInfo` seeds meeting-info languages, renaming `languageCode` to `languageName` and `languageGroupId` to `languageCode`, only while the collection is empty and with `preserveSiEnabled`. | Meeting info carries only `siLanguages`, while `siEnabled` is owned by Locus controls (code comment in `parseInterpretationInfo`). | `src/interpretation/index.ts`, `src/meeting/util.ts` | `test/unit/spec/interpretation/index.ts` | none | Present |
182
+ | `INTERPRETATION-R-005` | `updateSelfInterpretation({interpretation, selfParticipantId})` sets `originalLanguage`, `sourceLanguage`, `targetLanguage`, `receiveLanguage`, `order`, `isActive`, and `selfParticipantId`, sets `selfIsInterpreter` to whether a target language exists, and returns whether the target language changed. | `Meeting` re-sends the audio named media group when the interpreter's target language changes (`setUpLocusInfoSelfListener` in `src/meeting/index.ts`). | `src/interpretation/index.ts`, `src/meeting/index.ts` | `test/unit/spec/interpretation/index.ts` | none | Present |
183
+ | `INTERPRETATION-R-006` | `getTargetLanguageCode()` returns the `languageCode` of `targetLanguage` in `siLanguages` when self is an interpreter, else `0`. | `Meeting.setSendNamedMediaGroup` sends the audio to that code's named media group and sends no group for `0` (`src/meeting/index.ts`). | `src/interpretation/index.ts`, `src/meeting/index.ts` | `test/unit/spec/interpretation/index.ts` | none | Present |
184
+ | `INTERPRETATION-R-007` | `updateInterpreters(interpreters)` PATCHes `<locusUrl>/controls` with `{interpretation: {interpreters}}`, and `endSimultaneousInterpretation()` PATCHes it with `{interpretation: {siEnabled: false}}`; both apply the response to the meeting found by `locusUrl`, and resolve the response unchanged when none is found. | Ending is host-only, and Locus then clears SI subscriptions and interpreter roles, which cannot be re-enabled during the meeting (JSDoc of `endSimultaneousInterpretation`); applying the response updates the meeting's Locus info (JSDoc of `updateLocusFromApiResponse`). | `src/interpretation/index.ts`, `src/meeting/util.ts` | `test/unit/spec/interpretation/index.ts` | none | Present |
185
+ | `INTERPRETATION-R-008` | `handoffInterpreter(participantId)` POSTs `{actionType: 'OFFERED', resourceType: 'SiHandover', receivers: [{participantId}]}` to `approvalUrl`; `requestHandoff()` POSTs `{actionType: 'REQUESTED', resourceType: 'SiHandover'}`; `acceptRequest(url)` and `declineRequest(url)` PUT `{actionType: 'ACCEPTED'}` or `{actionType: 'DECLINED'}` to the given url. Each rejects first without its participant id, approval URL, or url. | The active interpreter hands the role to another interpreter of the same group, an inactive interpreter asks for it, and the answer goes to the url of the last approval event (JSDoc of each method). | `src/interpretation/index.ts`, `src/constants.ts` | `test/unit/spec/interpretation/index.ts` | none | Present |
186
+ | `INTERPRETATION-R-009` | The handoff listener emits `HANDOFF_REQUESTS_ARRIVED` only for an approval with `resourceType` `SiHandover` whose first receiver or initiator is self. | Only handoffs this participant sends or must answer reach the application (filter in `listenToHandoffRequests`). | `src/interpretation/index.ts` | `test/unit/spec/interpretation/index.ts` | WHY inferred from the filter | Weak |
187
+
188
+ ## Design overview
189
+
190
+ The controller maintains simultaneous-interpretation languages and participant role state, uses
191
+ `collection.ts` and `siLanguage.ts` for language objects, calls the active Locus URLs directly, and
192
+ filters Mercury handoff approval events by resource and self sender/receiver roles without comparing
193
+ Locus URL.
194
+
195
+ `Meeting` is the only writer of the state. Meeting info sets `meetingSIEnabled` (SI turned on),
196
+ `hostSIEnabled` (SI on and the site allows host interpreter control), and a scheduled
197
+ `selfIsInterpreter`, and seeds `siLanguages`; Locus interpretation controls replace `siLanguages`
198
+ and set `siEnabled`; Locus self interpretation sets the self interpreter's languages, order, and
199
+ `isActive`; the `MODERATOR` role sets `canManageInterpreters`. Locus-mutating requests
200
+ (`updateInterpreters`, `endSimultaneousInterpretation`, `changeDirection`) apply their response to the
201
+ meeting at once through `MeetingUtil.updateLocusFromApiResponse`; handoff requests go to the approval
202
+ service and change state only through later Locus updates.
203
+
204
+ ## Data flow and sequence coverage
205
+
206
+ Call style: in-process method calls on `meeting.simultaneousInterpretation`; outbound HTTPS to
207
+ Locus and the approval service through `this.request`; inbound Mercury `locus.approval_request`
208
+ events and Locus updates through `Meeting`.
209
+
210
+ Sequence coverage:
211
+
212
+ | Operation group | Diagram | Failure coverage |
213
+ |---|---|---|
214
+ | UC-2…UC-4 — interpretation and handoff request groups, including handoff event filtering | Interpretation and handoff primary sequence (diagram 1) | unsupported language/direction, explicit language/participant/approval validation, unguarded Locus-URL interpolation, handoff request rejection, unrelated event handling, and listener cleanup |
215
+ | UC-1 — state updates from Meeting and the automatic language query | Diagram 2 | the query runs once per missing list; a failed automatic query is not caught |
216
+
217
+ ```mermaid
218
+ flowchart LR
219
+ Locus[Locus interpretation state / URLs via Meeting] --> Controller[index.ts]
220
+ Controller --> Languages[collection.ts]
221
+ Languages --> Language[siLanguage.ts]
222
+ Caller[Meeting / host / interpreter] --> Controller
223
+ Controller --> Service[HTTP Locus interpretation and approval URLs]
224
+ Mercury[handoff approval events] --> Controller
225
+ Controller --> Events[support-language / handoff events]
226
+ Controller --> MeetingUtil[updateLocusFromApiResponse]
227
+ ```
228
+
229
+ Diagram 1 — interpretation and handoff primary sequence:
230
+
231
+ ```mermaid
232
+ sequenceDiagram
233
+ participant C as Interpreter, host, or meeting
234
+ participant I as Interpretation index.ts
235
+ participant H as Locus / approval URL
236
+ participant U as MeetingUtil
237
+ participant M as Mercury
238
+ C->>I: set direction, update interpreters, or handoff action
239
+ I->>I: guard required language, participant, or URL
240
+ alt guard fails
241
+ I--xC: rejected promise before any request
242
+ else
243
+ I->>H: HTTP action
244
+ H-->>I: response or rejection
245
+ opt Locus controls or participant controls
246
+ I->>U: updateLocusFromApiResponse(meeting by locusUrl)
247
+ end
248
+ I-->>C: promise result, or the logged and rethrown error
249
+ end
250
+ M-->>I: handoff approval event
251
+ I->>I: compare resourceType and sender/receiver participant ids against selfParticipantId
252
+ alt self is sender or first receiver
253
+ I-->>C: emit the scoped handoff event
254
+ else unrelated approval
255
+ I->>I: ignore the event
256
+ end
257
+ ```
258
+
259
+ Diagram 2 — state updates from `Meeting`:
260
+
261
+ ```mermaid
262
+ sequenceDiagram
263
+ participant Mt as Meeting / MeetingUtil
264
+ participant I as Interpretation
265
+ participant L as Locus
266
+ Mt->>I: updateMeetingSIEnabled, updateHostSIEnabled (meeting info)
267
+ Mt->>I: updateInterpretation(siLanguages, preserveSiEnabled) when empty
268
+ Mt->>I: locusUrlUpdate, approvalUrlUpdate, updateCanManageInterpreters
269
+ opt shouldQuerySupportLanguages became true and supportLanguages unset
270
+ I->>L: GET locusUrl/languages/interpretation
271
+ L-->>I: siLanguages
272
+ I-->>Mt: SUPPORT_LANGUAGES_UPDATE
273
+ end
274
+ Mt->>I: updateInterpretation(controls), updateSelfInterpretation(self)
275
+ I-->>Mt: target language changed?
276
+ ```
277
+
278
+ ## Class and component relationships
279
+
280
+ ```mermaid
281
+ classDiagram
282
+ class WebexPlugin
283
+ class SimultaneousInterpretation {
284
+ siLanguages SILanguageCollection
285
+ locusUrl
286
+ approvalUrl
287
+ selfParticipantId
288
+ isActive
289
+ }
290
+ class SILanguageCollection
291
+ class SILanguage {
292
+ languageName
293
+ languageCode
294
+ }
295
+ class Interpreter
296
+ class InterpreterUsingResource
297
+ WebexPlugin <|-- SimultaneousInterpretation
298
+ WebexPlugin <|-- SILanguage
299
+ SimultaneousInterpretation *-- SILanguageCollection : Languages collection
300
+ SILanguageCollection o-- SILanguage : Language
301
+ SimultaneousInterpretation ..> Interpreter : updateInterpreters
302
+ Interpreter --> InterpreterUsingResource
303
+ SimultaneousInterpretation ..> Mercury : handoff events
304
+ SimultaneousInterpretation ..> Locus : Service requests
305
+ ```
306
+
307
+ The arrows identify ownership and delegation inside `src/interpretation/`; files that only declare types or constants are not presented as transports.
308
+
309
+ ## Use cases and flows
310
+
311
+ | Use case | Actor or caller | Primary steps and outcome | Failure or boundary behavior | Evidence |
312
+ | -------- | --------------- | ------------------------- | ---------------------------- | -------- |
313
+ | `UC-1` | `Meeting` | Initialize meeting-scoped interpretation state and the handoff listener, keep it current from meeting info and Locus, then remove owned listener state during cleanup | A failed automatic language query is not caught | `src/interpretation/index.ts`, `src/meeting/util.ts` |
314
+ | `UC-2` | Host and interpreter | Refresh supported-language objects from Locus and resolve the target language code for the current interpretation direction | The code is `0` when self is not an interpreter | `src/interpretation/index.ts`, `src/interpretation/siLanguage.ts` |
315
+ | `UC-3` | Host or interpreter | Query/update interpreter assignments, end interpretation, or change direction using the current Locus URL | No local capability check; `changeDirection` rejects without languages or self id | `src/interpretation/index.ts` |
316
+ | `UC-4` | Interpreter | Offer, request, accept, or decline an interpreter handoff against the current participant and approval URLs, without assuming an unimplemented Locus-URL event filter | Each method rejects without its input; only self-related approvals emit | `src/interpretation/index.ts` |
317
+
318
+ ### Cross-boundary use-case flow
319
+
320
+ | Boundary | Transport and ordering | Compatibility | Timeout, retry, and recovery |
321
+ | -------- | ---------------------- | ------------- | ---------------------------- |
322
+ | Locus (`UC-2`, `UC-3`) | HTTPS through `this.request`, one request per call | GET `languages/interpretation` and `interpretation/interpreters`; PATCH `controls` and `participant/<id>/controls` | No retry; errors are logged and rethrown |
323
+ | Approval service (`UC-4`) | HTTPS POST to `approvalUrl`, PUT to the event url | `resourceType: 'SiHandover'` and the `INTERPRETATION.ACTION_TYPE` values | No retry |
324
+ | Mercury (`UC-4`) | `event:locus.approval_request`, handled as it arrives | `data.approval.{resourceType, receivers, initiator, actionType, url}` | Unrelated approvals are dropped |
325
+
326
+ ## Client state model
327
+
328
+ Supported languages, interpreters, self interpretation/direction, host/meeting enablement, management capability, and handoff listeners are meeting scoped.
329
+
330
+ | State or slice | Owner | Initial state | Transition triggers | Reset or persistence boundary |
331
+ | -------------- | ---------- | ------------- | ------------------- | ----------------------------- |
332
+ | `siLanguages` collection | `SimultaneousInterpretation` | empty | `updateInterpretation` from Locus controls or meeting info | Replaced as a whole; never persisted |
333
+ | `supportLanguages` | `SimultaneousInterpretation` | unset | `querySupportLanguages` | Queried once while unset |
334
+ | Self interpreter (`originalLanguage`, `sourceLanguage`, `targetLanguage`, `receiveLanguage`, `order`, `isActive`, `selfIsInterpreter`, `selfParticipantId`) | `SimultaneousInterpretation` | unset | `updateSelfInterpretation`; `updateMeetingSIEnabled` also sets `selfIsInterpreter` | Per meeting |
335
+ | Enablement (`meetingSIEnabled`, `hostSIEnabled`, `siEnabled`) | `SimultaneousInterpretation` | unset | Meeting info setters; `updateInterpretation` for `siEnabled` | `siEnabled` kept when `preserveSiEnabled` |
336
+ | `canManageInterpreters` | `SimultaneousInterpretation` | unset | `updateCanManageInterpreters` on role changes | Feeds `shouldQuerySupportLanguages` only |
337
+ | `locusUrl`, `approvalUrl` | `SimultaneousInterpretation` | unset | `locusUrlUpdate`, `approvalUrlUpdate` | — |
338
+ | Mercury handoff listener | `SimultaneousInterpretation` | installed by `initialize` | — | Removed by `cleanUp` |
339
+
340
+ ## Business rules and invariants
341
+
342
+ | ID | Invariant | WHY | Enforcement source | Test evidence |
343
+ | -- | --------- | --- | ------------------ | ------------- |
344
+ | `INV-001` | Direction and handoff actions require current language/interpreter/self data: `changeDirection` needs both languages and self id, `handoffInterpreter` a participant id and approval URL, `requestHandoff` an approval URL, accept and decline a url. | A request without them would target the wrong participant or no approval (guards and their error messages). | `src/interpretation/index.ts` | `test/unit/spec/interpretation/index.ts` |
345
+ | `INV-002` | Only the intended approver/requester transition is applied: a handoff event reaches the application only when self is the first receiver or the initiator. | See `INTERPRETATION-R-009`. | `src/interpretation/index.ts` | `test/unit/spec/interpretation/index.ts` |
346
+ | `INV-003` | Cleanup removes approval listeners: `cleanUp()` stops every listener the controller added. | `Meeting` cleanup must not leave a Mercury listener on an ended meeting (`MeetingUtil.cleanUp`). | `src/interpretation/index.ts`, `src/meeting/util.ts` | `test/unit/spec/interpretation/index.ts` |
347
+ | `INV-004` | `selfIsInterpreter` is true exactly when self has a target language after a self update. | The target language is what an interpreter sends audio to (`INTERPRETATION-R-006`). | `src/interpretation/index.ts` | `test/unit/spec/interpretation/index.ts` |
348
+
349
+ ## Concurrency and reactive flow
350
+
351
+ - Execution model: one JavaScript event loop; requests return promises; the Mercury listener and
352
+ the `change:shouldQuerySupportLanguages` listener run synchronously as events arrive.
353
+ - Listener timing: `initialize()` installs the Mercury subscription immediately, before `selfParticipantId` may be populated. Each callback reads the current id and filters only `resourceType` plus first-receiver/sender participant ids; it performs no Locus-URL comparison. Language and handoff HTTP operations settle their own returned promises.
354
+ - Ordering guarantees: none across calls; Locus-mutating requests apply their own response, and a
355
+ later Locus event may apply it again.
356
+ - Idempotency and retry: the automatic language query runs only while `supportLanguages` is unset;
357
+ nothing is retried.
358
+ - Shared-state protection: none; `Meeting` is the only writer.
359
+
360
+ ## State machine
361
+
362
+ ```mermaid
363
+ stateDiagram-v2
364
+ [*] --> inactive
365
+ inactive --> active: Locus projects self as active interpreter (updateSelfInterpretation)
366
+ active --> inactive: handoff accepted or role removed (Locus self update)
367
+ inactive --> inactive: request / decline without role activation
368
+ ```
369
+
370
+ The active/inactive projection is the concrete `isActive` state maintained in
371
+ `src/interpretation/index.ts` from Locus self updates; handoff requests do not change it directly.
372
+ `siEnabled` follows Locus controls; after `endSimultaneousInterpretation()` Locus reports it false,
373
+ and it cannot be re-enabled during the meeting.
374
+
375
+ ## Caller-visible failure modes
376
+
377
+ | Condition | Signal | Caller recovery |
378
+ |---|---|---|
379
+ | `changeDirection()`, `handoffInterpreter()`, `requestHandoff()`, `acceptRequest()`, or `declineRequest()` lacks the input each method explicitly guards | The method returns a rejected promise before issuing its request. | Supply the language, participant, approval URL, or decision URL required by that operation. |
380
+ | `querySupportLanguages()`, `getInterpreters()`, `updateInterpreters()`, `endSimultaneousInterpretation()`, or `changeDirection()` runs without `locusUrl` | No local pre-rejection occurs; the method builds a URI containing the current value (including `undefined`) and invokes `request()`. | Establish current Locus context before calling and handle the actual request outcome. |
381
+ | Interpretation or handoff HTTP request rejects | The same failure is logged and rethrown to the caller. | Handle the service rejection; retry only as a new caller operation. |
382
+ | Mercury approval has another resource type, or self is neither its first receiver nor its sender | The subscribed controller ignores it and emits no handoff event. A same-participant approval from another Locus is not filtered locally. | No caller action for a participant mismatch; consumers must not rely on this controller for Locus scoping. |
383
+ | The automatic language query fails | Logged as `Meeting:interpretation#querySupportLanguages failed` and rethrown into a listener that does not catch it; `supportLanguages` stays unset. | Call `querySupportLanguages()` again and handle its rejection. |
384
+
385
+ ## Pitfalls and constraints
386
+
387
+ - Host-enabled, meeting-enabled, and self-interpreter state are distinct. Collapsing them yields incorrect controls and handoff eligibility.
388
+ - Verify both typed constants/enums and raw wire values before changing a logical condition in this legacy package.
389
+ - `supportLanguages` (the host's assignable list) and `siLanguages` (the meeting's languages) are
390
+ different; `getTargetLanguageCode()` reads only `siLanguages`.
391
+ - The retained README names `getSupportLanguages()`, `siLanguage.subscribe()`, and
392
+ `siLanguage.unsubscribe()`; none exists.
393
+ - `cleanUp()` stops every listener, including `change:shouldQuerySupportLanguages`, and nothing
394
+ re-installs them on the same instance.
395
+
396
+ ## Module-specific rules
397
+
398
+ - Do: preserve this boundary: refresh supported-language objects from Locus and notify consumers when the catalog changes.
399
+ - Do not: move remote I/O or lifecycle ownership into a passive type, constant, catalog, or normalization file such as `collection.ts`, `siLanguage.ts`, or `interpretation.types.ts`.
400
+ - Do: log a failed request as `Meeting:interpretation#<method> failed` and rethrow it unchanged,
401
+ as every request method does.
402
+ - Do: apply Locus responses of Locus-mutating requests through
403
+ `MeetingUtil.updateLocusFromApiResponse` with the meeting found by `locusUrl` (`INTERPRETATION-R-007`).
404
+
405
+ ## Verification
406
+
407
+ Use the current mirrored suites: `test/unit/spec/interpretation/collection.ts`, `test/unit/spec/interpretation/index.ts`, `test/unit/spec/interpretation/siLanguage.ts`. Characterize the interpretation-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
408
+
409
+ | Behavior / Requirement | Existing test evidence | Gap |
410
+ |---|---|---|
411
+ | `INTERPRETATION-R-001` | `test/unit/spec/interpretation/index.ts` | the automatic query and its conditions are covered; no case for a failed automatic query |
412
+ | `INTERPRETATION-R-002` | `test/unit/spec/interpretation/index.ts` | language-code resolution and each interpreter-assignment and direction request body are covered |
413
+ | `INTERPRETATION-R-003` | `test/unit/spec/interpretation/index.ts` | characterize listener installation before self id, absent Locus filtering, and exact cleanup removal |
414
+ | `INTERPRETATION-R-004` to `INTERPRETATION-R-008` | `test/unit/spec/interpretation/index.ts`, `test/unit/spec/meeting/utils.js` | none; the meeting-info seeding is covered in the meeting util suite |
415
+ | `INTERPRETATION-R-009`, `INV-002` | `test/unit/spec/interpretation/index.ts` | no case for an initiator-only (sender) approval |
416
+ | `INV-001`, `INV-003`, `INV-004` | `test/unit/spec/interpretation/index.ts` | none |
417
+
418
+ Every cited case invokes the named behavior. A module specification is complete only when its
419
+ public surface, invariants, failure modes, and test evidence agree with the implementation. The
420
+ module stays Partial until coverage review and independent validation run on this specification.