@webex/plugin-meetings 3.12.0-llmrefactor.13 → 3.12.0-llmrefactor.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 (88) hide show
  1. package/.sdd/manifest.json +1312 -0
  2. package/.sdd/templates/.source.json +30 -0
  3. package/.sdd/templates/component-repo/module-docs/module-spec-quality.md +111 -0
  4. package/.sdd/templates/component-repo/module-docs/module-spec.template.md +321 -0
  5. package/.sdd/templates/component-repo/reference-docs/adr/_adr-example.md +59 -0
  6. package/.sdd/templates/component-repo/reference-docs/patterns/_pattern-example.md +49 -0
  7. package/.sdd/templates/component-repo/reference-docs/rules/_rule-example.md +42 -0
  8. package/.sdd/templates/component-repo/standing-docs/AGENTS.template.md +120 -0
  9. package/.sdd/templates/component-repo/standing-docs/ARCHITECTURE.template.md +206 -0
  10. package/.sdd/templates/component-repo/standing-docs/CONTRACTS.template.md +90 -0
  11. package/.sdd/templates/component-repo/standing-docs/DATA_MODEL.template.md +68 -0
  12. package/.sdd/templates/component-repo/standing-docs/GETTING_STARTED.template.md +111 -0
  13. package/.sdd/templates/component-repo/standing-docs/GLOSSARY.template.md +57 -0
  14. package/.sdd/templates/component-repo/standing-docs/REVIEW_CHECKLIST.template.md +69 -0
  15. package/.sdd/templates/component-repo/standing-docs/RULES.template.md +96 -0
  16. package/.sdd/templates/component-repo/standing-docs/SECURITY.template.md +84 -0
  17. package/.sdd/templates/component-repo/standing-docs/SERVICE_STATE.template.md +82 -0
  18. package/.sdd/templates/component-repo/standing-docs/SPEC_INDEX.template.md +94 -0
  19. package/.sdd/templates/component-repo/standing-docs/TEST_INDEX.template.md +64 -0
  20. package/.sdd/templates/component-repo/template-map.json +112 -0
  21. package/AGENTS.md +130 -4
  22. package/ai-docs/ARCHITECTURE.md +207 -0
  23. package/ai-docs/CONTRACTS.md +267 -0
  24. package/ai-docs/DATA_MODEL.md +64 -0
  25. package/ai-docs/GETTING_STARTED.md +73 -0
  26. package/ai-docs/GLOSSARY.md +56 -0
  27. package/ai-docs/REVIEW_CHECKLIST.md +45 -0
  28. package/ai-docs/RULES.md +79 -0
  29. package/ai-docs/SECURITY.md +74 -0
  30. package/ai-docs/SERVICE_STATE.md +59 -0
  31. package/ai-docs/SPEC_INDEX.md +85 -0
  32. package/ai-docs/TEST_INDEX.md +45 -0
  33. package/ai-docs/adr/0001-migrate-existing-docs-into-sdd.md +61 -0
  34. package/ai-docs/patterns/defensive-error-propagation.md +55 -0
  35. package/ai-docs/patterns/event-scope-emission.md +46 -0
  36. package/ai-docs/patterns/source-to-test-path-mirroring.md +45 -0
  37. package/ai-docs/patterns/stateless-plugin-request-classes.md +53 -0
  38. package/ai-docs/patterns/typed-constants-and-enum-values.md +47 -0
  39. package/dist/aiEnableRequest/index.js +1 -1
  40. package/dist/breakouts/breakout.js +1 -1
  41. package/dist/breakouts/index.js +1 -1
  42. package/dist/interpretation/index.js +46 -12
  43. package/dist/interpretation/index.js.map +1 -1
  44. package/dist/interpretation/siLanguage.js +1 -1
  45. package/dist/meeting/in-meeting-actions.js +2 -0
  46. package/dist/meeting/in-meeting-actions.js.map +1 -1
  47. package/dist/meeting/index.js +4 -0
  48. package/dist/meeting/index.js.map +1 -1
  49. package/dist/meeting/util.js +3 -1
  50. package/dist/meeting/util.js.map +1 -1
  51. package/dist/meetings/index.js +8 -4
  52. package/dist/meetings/index.js.map +1 -1
  53. package/dist/types/meeting/in-meeting-actions.d.ts +2 -0
  54. package/dist/webinar/index.js +1 -1
  55. package/package.json +20 -20
  56. package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
  57. package/src/annotation/ai-docs/annotation-spec.md +236 -0
  58. package/src/breakouts/ai-docs/breakouts-spec.md +324 -0
  59. package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +243 -0
  60. package/src/hashTree/ai-docs/hash-tree-spec.md +267 -0
  61. package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
  62. package/src/interpretation/ai-docs/interpretation-spec.md +256 -0
  63. package/src/interpretation/index.ts +38 -1
  64. package/src/locus-info/ai-docs/locus-info-spec.md +293 -0
  65. package/src/media/ai-docs/media-spec.md +267 -0
  66. package/src/meeting/ai-docs/meeting-spec.md +401 -0
  67. package/src/meeting/in-meeting-actions.ts +4 -0
  68. package/src/meeting/index.ts +4 -0
  69. package/src/meeting/util.ts +5 -2
  70. package/src/meeting-info/ai-docs/meeting-info-spec.md +261 -0
  71. package/src/meetings/ai-docs/meetings-spec.md +296 -0
  72. package/src/meetings/index.ts +4 -0
  73. package/src/member/ai-docs/member-spec.md +196 -0
  74. package/src/members/ai-docs/members-spec.md +256 -0
  75. package/src/metrics/ai-docs/metrics-spec.md +185 -0
  76. package/src/multistream/ai-docs/multistream-spec.md +292 -0
  77. package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +234 -0
  78. package/src/reachability/ai-docs/reachability-spec.md +261 -0
  79. package/src/reactions/ai-docs/reactions-spec.md +198 -0
  80. package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +272 -0
  81. package/src/recording-controller/ai-docs/recording-controller-spec.md +223 -0
  82. package/src/roap/ai-docs/roap-spec.md +241 -0
  83. package/src/webinar/ai-docs/webinar-spec.md +243 -0
  84. package/test/unit/spec/interpretation/index.ts +93 -0
  85. package/test/unit/spec/meeting/in-meeting-actions.ts +2 -0
  86. package/test/unit/spec/meeting/index.js +5 -0
  87. package/test/unit/spec/meeting/utils.js +26 -15
  88. package/test/unit/spec/meetings/index.js +11 -0
@@ -116,6 +116,7 @@ interface IInMeetingActions {
116
116
  canAttendeeRequestAiAssistantEnabled?: boolean;
117
117
  isAttendeeRequestAiAssistantDeclinedAll?: boolean;
118
118
  isAnonymizeDisplayNamesEnabled?: boolean;
119
+ isSupportParticipantList?: boolean;
119
120
  canViewTheParticipantList?: boolean;
120
121
  }
121
122
  /**
@@ -206,6 +207,7 @@ export default class InMeetingActions implements IInMeetingActions {
206
207
  canChat: any;
207
208
  canDoVideo: any;
208
209
  canAnnotate: any;
210
+ isSupportParticipantList: any;
209
211
  canUseVoip: any;
210
212
  showAutoEndMeetingWarning: any;
211
213
  supportHQV: any;
@@ -912,7 +912,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
912
912
  }, _callee10);
913
913
  }))();
914
914
  },
915
- version: "3.12.0-llmrefactor.13"
915
+ version: "3.12.0-llmrefactor.15"
916
916
  });
917
917
  var _default = exports.default = Webinar;
918
918
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -43,12 +43,12 @@
43
43
  "@webex/eslint-config-legacy": "0.0.0",
44
44
  "@webex/jest-config-legacy": "0.0.0",
45
45
  "@webex/legacy-tools": "0.0.0",
46
- "@webex/plugin-rooms": "3.12.0-llmrefactor.9",
47
- "@webex/test-helper-chai": "3.12.0-llmrefactor.2",
48
- "@webex/test-helper-mocha": "3.12.0-llmrefactor.2",
49
- "@webex/test-helper-mock-webex": "3.12.0-llmrefactor.1",
50
- "@webex/test-helper-retry": "3.12.0-llmrefactor.2",
51
- "@webex/test-helper-test-users": "3.12.0-llmrefactor.0",
46
+ "@webex/plugin-rooms": "3.12.0-llmrefactor.11",
47
+ "@webex/test-helper-chai": "3.12.0-llmrefactor.3",
48
+ "@webex/test-helper-mocha": "3.12.0-llmrefactor.3",
49
+ "@webex/test-helper-mock-webex": "3.12.0-llmrefactor.2",
50
+ "@webex/test-helper-retry": "3.12.0-llmrefactor.3",
51
+ "@webex/test-helper-test-users": "3.12.0-llmrefactor.1",
52
52
  "chai": "^4.3.4",
53
53
  "chai-as-promised": "^7.1.1",
54
54
  "eslint": "^8.24.0",
@@ -60,23 +60,23 @@
60
60
  "typescript": "^4.7.4"
61
61
  },
62
62
  "dependencies": {
63
- "@webex/common": "3.12.0-llmrefactor.2",
63
+ "@webex/common": "3.12.0-llmrefactor.3",
64
64
  "@webex/event-dictionary-ts": "^1.0.2215",
65
65
  "@webex/internal-media-core": "2.30.1",
66
- "@webex/internal-plugin-conversation": "3.12.0-llmrefactor.9",
67
- "@webex/internal-plugin-device": "3.12.0-llmrefactor.7",
68
- "@webex/internal-plugin-llm": "3.12.0-llmrefactor.9",
69
- "@webex/internal-plugin-mercury": "3.12.0-llmrefactor.9",
70
- "@webex/internal-plugin-metrics": "3.12.0-llmrefactor.7",
71
- "@webex/internal-plugin-support": "3.12.0-llmrefactor.9",
72
- "@webex/internal-plugin-user": "3.12.0-llmrefactor.7",
73
- "@webex/internal-plugin-voicea": "3.12.0-llmrefactor.11",
74
- "@webex/media-helpers": "3.12.0-llmrefactor.5",
75
- "@webex/plugin-people": "3.12.0-llmrefactor.9",
76
- "@webex/plugin-rooms": "3.12.0-llmrefactor.9",
66
+ "@webex/internal-plugin-conversation": "3.12.0-llmrefactor.11",
67
+ "@webex/internal-plugin-device": "3.12.0-llmrefactor.9",
68
+ "@webex/internal-plugin-llm": "3.12.0-llmrefactor.11",
69
+ "@webex/internal-plugin-mercury": "3.12.0-llmrefactor.11",
70
+ "@webex/internal-plugin-metrics": "3.12.0-llmrefactor.9",
71
+ "@webex/internal-plugin-support": "3.12.0-llmrefactor.11",
72
+ "@webex/internal-plugin-user": "3.12.0-llmrefactor.9",
73
+ "@webex/internal-plugin-voicea": "3.12.0-llmrefactor.13",
74
+ "@webex/media-helpers": "3.12.0-llmrefactor.6",
75
+ "@webex/plugin-people": "3.12.0-llmrefactor.11",
76
+ "@webex/plugin-rooms": "3.12.0-llmrefactor.11",
77
77
  "@webex/ts-sdp": "^1.8.1",
78
78
  "@webex/web-capabilities": "^1.13.1",
79
- "@webex/webex-core": "3.12.0-llmrefactor.7",
79
+ "@webex/webex-core": "3.12.0-llmrefactor.9",
80
80
  "ampersand-collection": "^2.0.2",
81
81
  "bowser": "^2.11.0",
82
82
  "btoa": "^1.2.1",
@@ -94,5 +94,5 @@
94
94
  "//": [
95
95
  "TODO: upgrade jwt-decode when moving to node 18"
96
96
  ],
97
- "version": "3.12.0-llmrefactor.13"
97
+ "version": "3.12.0-llmrefactor.15"
98
98
  }
@@ -0,0 +1,223 @@
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
+ # AI ENABLE REQUEST — 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/aiEnableRequest/`.
13
+
14
+ ## Metadata
15
+
16
+ | Field | Value |
17
+ |---|---|
18
+ | Module id | `aiEnableRequest` |
19
+ | Source path(s) | `src/aiEnableRequest/` |
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
+ | Retained AI Assistant enable-request guide | overview / API / behavior / tests | used and verified; event catalog, initiator/approver operations, and example workflow were moved into requirements, sequence, state, and use cases |
36
+ | Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
37
+
38
+ ## Overview
39
+
40
+ `src/aiEnableRequest/` contains 3 direct source/reference file(s) and has 2 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 the meeting-scoped approval workflow used when a participant requests host approval to enable AI Assistant.
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/aiEnableRequest/
54
+ ├── README.md — retained legacy reference input
55
+ ├── index.ts — module facade/controller or primary exports
56
+ ├── utils.ts — normalization/helper functions
57
+ └── ai-docs/ai-enable-request-spec.md — canonical module specification
58
+ ```
59
+
60
+ ## Key Files (source of truth)
61
+
62
+ | File | Holds |
63
+ |---|---|
64
+ | `src/aiEnableRequest/README.md` | retained legacy reference input |
65
+ | `src/aiEnableRequest/index.ts` | module facade/controller or primary exports |
66
+ | `src/aiEnableRequest/utils.ts` | normalization/helper functions |
67
+ | `test/unit/spec/aiEnableRequest/index.ts` and 1 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
+ | `aiEnableRequest.1` | SDK / in-process | `approvalUrlUpdate()`, `locusUrlUpdate()`, and `selfParticipantIdUpdate()` | Keep the listener and outgoing approval actions scoped to the current meeting participant and URLs. | Preserve setter names and the one-listener side effect of `selfParticipantIdUpdate()`. | `src/aiEnableRequest/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
74
+ | `aiEnableRequest.2` | SDK / event | `listenToApprovalRequests()` and `APPROVAL_REQUEST_ARRIVED` | Filter Mercury approval events by resource, Locus, and participant role before exposing them to Meeting. | Preserve the once-only registration guard and `DECLINED_ALL` observer behavior. | `src/aiEnableRequest/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
75
+ | `aiEnableRequest.3` | SDK / remote | `requestEnableAIAssistant()` and `sendApprovalRequest()` | POST a `REQUESTED` action using the current approval URL and self participant as initiator. | Preserve HTTP verb, body roles, action value, and returned request promise. | `src/aiEnableRequest/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
76
+ | `aiEnableRequest.4` | SDK / remote | `acceptEnableAIAssistantRequest()`, `declineEnableAIAssistantRequest()`, and `declineAllEnableAIAssistantRequests()` | PUT the approver decision to the URL supplied by the incoming approval event. | Preserve all three action values and participant-id placement in the request body. | `src/aiEnableRequest/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
77
+ | `aiEnableRequest.5` | exported utility | `getAIEnablementApprover()` | Select the capable moderator, otherwise the lexicographically first capable cohost, or `null`. | The current utility does not exclude the requesting/self participant. | `src/aiEnableRequest/utils.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
78
+
79
+ Compatibility notes:
80
+ - 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.
81
+
82
+ ## Requires (dependencies)
83
+
84
+ Meeting self/host/cohost identity and policy, Locus/approval URLs, request access, Mercury/approval events, and scoped event utilities.
85
+
86
+ ## Requirements
87
+
88
+ | ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
89
+ |---|---|---|---|---|---|---|
90
+ | `AI-ENABLE-REQUEST-R-001` | select the eligible AI-enablement approver. | Owns the meeting-scoped approval workflow used when a participant requests host approval to enable AI Assistant. | `src/aiEnableRequest/utils.ts` | `test/unit/spec/aiEnableRequest/utils.ts` | none | PRESENT |
91
+ | `AI-ENABLE-REQUEST-R-002` | request AI Assistant enablement approval. | The exact initiator/approver roles and action value determine which participant can respond to the enablement request. | `src/aiEnableRequest/index.ts`, `src/aiEnableRequest/utils.ts` | `test/unit/spec/aiEnableRequest/index.ts` | requester/self exclusion is not implemented by `getAIEnablementApprover`; retain as an explicit product-policy gap | PRESENT |
92
+ | `AI-ENABLE-REQUEST-R-003` | HTTP rejections propagate through the returned promise, while unrelated Mercury approval events are ignored and the single listener is installed only once. | The listener must not emit another meeting’s approval or multiply registrations, while callers still need the original HTTP failure. | `src/aiEnableRequest/` | `test/unit/spec/aiEnableRequest/index.ts` | none | PRESENT |
93
+
94
+ ## Design Overview
95
+
96
+ AIEnableRequest owns one Mercury approval listener and the HTTP writes to the current Locus approval URL. `utils.ts` only selects an eligible approver from roster data; it is not a transport.
97
+
98
+ ## Data Flow
99
+
100
+ ```mermaid
101
+ flowchart LR
102
+ Roster[Meeting roster] --> Selector[utils.ts: approver selection]
103
+ Caller[Meeting / consumer] --> Controller[index.ts: approval workflow]
104
+ Selector --> Caller
105
+ Mercury[Mercury approval events] --> Controller
106
+ Controller --> Approval[HTTP request to approvalUrl]
107
+ Controller --> Event[APPROVAL_REQUEST_ARRIVED]
108
+ ```
109
+
110
+ ## Sequence Diagram(s)
111
+
112
+ Sequence coverage:
113
+
114
+ | Operation group | Diagram | Failure coverage |
115
+ |---|---|---|
116
+ | UC-1…UC-4 — AI approval operation groups | AI approval primary sequence | Mercury filtering, missing context, and HTTP action rejection |
117
+ | UC-1…UC-4 — AI approval alternate/failure paths | AI approval alternate/failure sequence | missing approval URL/participant context, HTTP rejection, or a Mercury event for another Locus |
118
+
119
+ ### AI approval primary sequence
120
+
121
+ ```mermaid
122
+ sequenceDiagram
123
+ participant C as Meeting / consumer
124
+ participant A as AIEnableRequest index.ts
125
+ participant M as Mercury
126
+ participant H as approvalUrl
127
+ M-->>A: approval-request event
128
+ A->>A: filter resourceType, locusUrl, and participant ids
129
+ A-->>C: APPROVAL_REQUEST_ARRIVED when relevant
130
+ C->>A: request / accept / decline
131
+ A->>H: POST or PUT action payload
132
+ H-->>A: response or rejection
133
+ A-->>C: settle the request promise
134
+ ```
135
+
136
+ ### AI approval alternate/failure sequence
137
+
138
+ ```mermaid
139
+ sequenceDiagram
140
+ participant M as Mercury
141
+ participant A as AIEnableRequest
142
+ participant C as Meeting / consumer
143
+ M-->>A: approval-request event
144
+ A->>A: compare resourceType, locusUrl, initiator, and approver ids
145
+ alt event belongs to this meeting and participant context
146
+ A-->>C: emit APPROVAL_REQUEST_ARRIVED
147
+ else event belongs to another Locus or participant
148
+ A->>A: ignore the event
149
+ end
150
+ ```
151
+
152
+ ## Class / Component Relationships
153
+
154
+ ```mermaid
155
+ classDiagram
156
+ class Roster
157
+ class Selector
158
+ class Caller
159
+ class Controller
160
+ class Mercury
161
+ class Approval
162
+ class Event
163
+ Roster --> Selector
164
+ Caller --> Controller
165
+ Selector --> Caller
166
+ Mercury --> Controller
167
+ Controller --> Approval
168
+ Controller --> Event
169
+ ```
170
+
171
+ The arrows identify ownership and delegation inside `src/aiEnableRequest/`; files that only declare types or constants are not presented as transports.
172
+
173
+ ## Use Cases
174
+
175
+ - **UC-1:** Select a capable moderator or the lexicographically first capable cohost with `getAIEnablementApprover`; return `null` when neither exists. Evidence: `src/aiEnableRequest/utils.ts`.
176
+ - **UC-2:** On the first `selfParticipantIdUpdate()`, call `listenToApprovalRequests()` and retain the one-listener guard for later identity updates. Evidence: `src/aiEnableRequest/index.ts`.
177
+ - **UC-3:** Filter Mercury approval events to the current Locus and expose only requests relevant to the self initiator, self approver, or all observers of `DECLINED_ALL`. Evidence: `src/aiEnableRequest/index.ts`.
178
+ - **UC-4:** POST an enablement request, then PUT accept, decline, or decline-all decisions using the exact initiator/approver ids required by each action. Evidence: `src/aiEnableRequest/index.ts`.
179
+
180
+ ## State Model
181
+
182
+ Approval and Locus URLs, self participant id, listener registrations, and active request context are meeting scoped.
183
+
184
+ ## Business Rules & Invariants
185
+
186
+ - The selector prefers a capable moderator and otherwise the lexicographically first capable cohost; it does not exclude self/requester. Initiator and approver ids are preserved, and decision actions target the supplied approval request URL. Enforced under `src/aiEnableRequest/`.
187
+
188
+ ## Concurrency & Reactive Flow
189
+
190
+ - Mercury approval events are filtered against the controller's current Locus, self participant, initiator, and approver ids before emission. `selfParticipantIdUpdate()` calls `listenToApprovalRequests()` only while `hasSubscribedToEvents` is false, so later participant updates refresh matching context without registering a duplicate listener.
191
+
192
+ ## Error Handling & Failure Modes
193
+
194
+ | Condition | Signal | Caller recovery |
195
+ |---|---|---|
196
+ | An approval action request rejects | The promise returned by `request`, `accept`, `decline`, or `declineAll` rejects with the HTTP failure. | Correct the request context or retry under the caller's policy. |
197
+ | A Mercury approval event targets another Locus or participant context | The listener ignores it and emits no `APPROVAL_REQUEST_ARRIVED` event. | No caller action; wait for a matching event. |
198
+ | An eligible approver is found | `getAIEnablementApprover` returns a capable moderator or the sorted-first capable cohost; it does not exclude self/requester. | Apply any requester-exclusion policy outside this utility if the product requires it. |
199
+
200
+ ## Pitfalls
201
+
202
+ - The approver is derived from current meeting roster/roles. Caching it across host/cohost changes can send a request to an ineligible participant.
203
+ - Verify both typed constants/enums and raw wire values before changing a logical condition in this legacy package.
204
+
205
+ ## Module Do's / Don'ts
206
+
207
+ - DO preserve this boundary: select a capable moderator or sorted-first capable cohost with `getAIEnablementApprover`; do not document requester exclusion unless code adds it.
208
+ - DON'T move remote I/O or lifecycle ownership into a passive type, constant, catalog, or normalization file.
209
+
210
+ ## Test-Case Strategy (module)
211
+
212
+ Use the current mirrored suites: `test/unit/spec/aiEnableRequest/index.ts`, `test/unit/spec/aiEnableRequest/utils.ts`. Characterize the aiEnableRequest-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
213
+
214
+ | Behavior / Requirement | Existing test evidence | Gap |
215
+ |---|---|---|
216
+ | `AI-ENABLE-REQUEST-R-001` | `test/unit/spec/aiEnableRequest/utils.ts` | cover moderator, sorted cohost, no candidate, and self/requester candidate selection |
217
+ | `AI-ENABLE-REQUEST-R-002` | `test/unit/spec/aiEnableRequest/index.ts` | add an explicit assertion that each decision method preserves its PUT action and participant roles on request rejection |
218
+ | `AI-ENABLE-REQUEST-R-003` | `test/unit/spec/aiEnableRequest/index.ts` | cover a second `selfParticipantIdUpdate()` and prove it does not install another Mercury listener |
219
+
220
+ ## Traceability
221
+
222
+ - Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
223
+ - Coverage state and contracts baseline: `../../../.sdd/manifest.json`
@@ -0,0 +1,236 @@
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
+ # ANNOTATION — 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/annotation/`.
13
+
14
+ ## Metadata
15
+
16
+ | Field | Value |
17
+ |---|---|
18
+ | Module id | `annotation` |
19
+ | Source path(s) | `src/annotation/` |
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 annotation controller/types/constants and tests |
36
+ | Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
37
+
38
+ ## Overview
39
+
40
+ `src/annotation/` contains 3 direct source/reference file(s) and has 1 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 annotation approval requests, Mercury/LLM listener registration, encrypted stroke relay, and the emitted annotation command/stroke events.
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/annotation/
54
+ ├── annotation.types.ts — module type declarations
55
+ ├── constants.ts — module constants and wire values
56
+ ├── index.ts — module facade/controller or primary exports
57
+ └── ai-docs/annotation-spec.md — canonical module specification
58
+ ```
59
+
60
+ ## Key Files (source of truth)
61
+
62
+ | File | Holds |
63
+ |---|---|
64
+ | `src/annotation/annotation.types.ts` | module type declarations |
65
+ | `src/annotation/constants.ts` | module constants and wire values |
66
+ | `src/annotation/index.ts` | module facade/controller or primary exports |
67
+ | `test/unit/spec/annotation/index.ts` | mirrored characterization/unit coverage |
68
+
69
+ ## Public Surface
70
+
71
+ | Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
72
+ |---|---|---|---|---|---|---|
73
+ | `annotation.1` | SDK / lifecycle | `locusUrlUpdate()`, `approvalUrlUpdate()`, and `deregisterEvents()` | Store Locus/approval URLs, install listeners from `locusUrlUpdate()`, and remove the exact Mercury/LLM listeners on teardown. | `approvalUrlUpdate()` only assigns `approvalUrl`; preserve the once-only listener guard owned by `locusUrlUpdate()` and the three event topics. | `src/annotation/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
74
+ | `annotation.2` | SDK / remote | `approveAnnotation()`, `cancelApproveAnnotation()`, and `closeAnnotation()` | POST requested/closed share-annotation actions or PUT cancellation using the current approval context. | Preserve action/resource values, share instance id, and optional receiver routing. | `src/annotation/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
75
+ | `annotation.3` | SDK / remote | `acceptRequest()` and `declineRequest()` | PUT a presenter decision to the URL carried by an incoming approval. | Preserve the accepted/declined action values and direct request-promise result. | `src/annotation/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
76
+ | `annotation.4` | SDK / relay | `sendStrokeData()` and `ANNOTATION_STROKE_DATA` | Encrypt outbound stroke content, publish it on the selected LLM socket, decrypt inbound content, and emit the scoped stroke event. | Preserve sequence increments, relay/message fields, and the initial disconnected no-op. | `src/annotation/index.ts`, `src/annotation/constants.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
77
+ | `annotation.5` | exported constants/types | `EVENT_TRIGGERS`, `ANNOTATION_RESOURCE_TYPE`, `ANNOTATION_RELAY_TYPES`, `ANNOTATION_STATUS`, `ANNOTATION_POLICY`, `ANNOTATION_REQUEST_TYPE`, `ANNOTATION_ACTION_TYPE`, `ANNOTATION`, `StrokeData`, `RequestData`, `CommandRequestBody`, `IAnnotationChannel`, and `AnnotationInfo` | Share the exact approval and relay vocabulary used by Meeting, Webinar, and consumers. | Add fields compatibly; existing raw action, relay, resource, and event values are wire-sensitive. | `src/annotation/constants.ts`, `src/annotation/annotation.types.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
78
+
79
+ ### Emitted events
80
+
81
+ 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.
82
+
83
+ | Event literal | Constant / expression | Emission evidence |
84
+ |---|---|---|
85
+ | `annotation:command` | `EVENT_TRIGGERS.ANNOTATION_COMMAND` | `src/annotation/index.ts` |
86
+ | `annotation:strokeData` | `EVENT_TRIGGERS.ANNOTATION_STROKE_DATA` | `src/annotation/index.ts` |
87
+ | `meeting:updateAnnotationInfo` | `EVENT_TRIGGERS.MEETING_UPDATE_ANNOTATION_INFO` | `src/meeting/index.ts` |
88
+
89
+ Compatibility notes:
90
+ - 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.
91
+
92
+ ## Requires (dependencies)
93
+
94
+ Approval and Locus URLs, Mercury, LLM sockets/bindings, Webex encryption, annotation constants/types, and participant/device/share identity supplied by callers.
95
+
96
+ ## Requirements
97
+
98
+ | ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
99
+ |---|---|---|---|---|---|---|
100
+ | `ANNOTATION-R-001` | `locusUrlUpdate()` assigns `locusUrl` and registers the Mercury approval listener plus default/practice-session LLM relay listeners once; `approvalUrlUpdate()` only assigns `approvalUrl`; `deregisterEvents()` removes the callbacks and clears the subscription flag. | Duplicate subscriptions would emit the same annotation event more than once, while attributing registration to the approval URL setter invents a side effect. | `src/annotation/index.ts` | `test/unit/spec/annotation/index.ts` | none | PRESENT |
101
+ | `ANNOTATION-R-002` | Approval methods send the declared action/resource body to the supplied approval URL; stroke sends encrypt content, choose the connected practice-session socket or default socket, and increment `seqNum` after publication. | Approval routing and relay sequence fields are service-visible protocol values and must remain stable. | `src/annotation/index.ts`, `src/annotation/annotation.types.ts` | `test/unit/spec/annotation/index.ts` | late socket selection after encryption and rejected encryption/decryption promises need explicit race/error coverage | PRESENT |
102
+ | `ANNOTATION-R-003` | Approval methods return their request promises; disconnected stroke sends return without work; stroke encryption/decryption uses asynchronous callbacks without a returned caller promise or module retry; deregistration removes the installed Mercury/LLM callbacks. | Callers must not assume encryption failures are converted into approval-style promise rejections or that disconnected strokes are queued. | `src/annotation/` | `test/unit/spec/annotation/index.ts` | none | PRESENT |
103
+
104
+ ## Design Overview
105
+
106
+ The controller subscribes directly to Mercury approval and LLM relay events, performs approval HTTP operations, and encrypts/decrypts relay content before exposing annotation command/stroke events.
107
+
108
+ ## Data Flow
109
+
110
+ ```mermaid
111
+ flowchart LR
112
+ Locus[Locus approval events] --> Controller[index.ts]
113
+ Caller[Meeting / annotation consumer] --> Controller
114
+ Controller --> Approval[HTTP approvalUrl]
115
+ Controller --> Crypto[Webex encryption]
116
+ Crypto --> LLM[LLM relay WebSocket]
117
+ LLM --> Controller
118
+ Controller --> Events[annotation command / stroke events]
119
+ ```
120
+
121
+ ## Sequence Diagram(s)
122
+
123
+ Sequence coverage:
124
+
125
+ | Operation group | Diagram | Failure coverage |
126
+ |---|---|---|
127
+ | UC-1…UC-4 — annotation approval and relay operation groups | Annotation approval and relay primary sequence | approval HTTP rejection, disconnected relay skip, and asynchronous encryption/decryption failure |
128
+ | UC-2 — approval and disconnected-send behavior | Annotation approval and relay alternate/failure sequence | request rejection or initial LLM connectivity false |
129
+
130
+ ### Annotation approval and relay primary sequence
131
+
132
+ ```mermaid
133
+ sequenceDiagram
134
+ participant C as Annotation consumer
135
+ participant A as Annotation index.ts
136
+ participant E as Encryption
137
+ participant L as LLM relay socket
138
+ C->>A: send command or stroke data
139
+ A->>E: encrypt relay payload
140
+ E-->>A: encrypted content
141
+ A->>L: socket.send relay event
142
+ L-->>A: relay event
143
+ A->>E: decrypt content
144
+ E-->>A: annotation payload
145
+ A-->>C: scoped annotation event
146
+ ```
147
+
148
+ ### Annotation approval and relay alternate/failure sequence
149
+
150
+ ```mermaid
151
+ sequenceDiagram
152
+ participant C as Annotation consumer
153
+ participant A as Annotation index.ts
154
+ participant H as Webex request / LLM
155
+ alt approval action
156
+ C->>A: accept / decline / request / cancel / close
157
+ A->>H: HTTP request with action/resource body
158
+ H-->>C: returned request promise outcome
159
+ else sendStrokeData while LLM disconnected
160
+ C->>A: sendStrokeData(stroke)
161
+ A-->>C: return without encryption or socket send
162
+ end
163
+ ```
164
+
165
+ ## Class / Component Relationships
166
+
167
+ ```mermaid
168
+ classDiagram
169
+ class Locus
170
+ class Controller
171
+ class Caller
172
+ class Approval
173
+ class Crypto
174
+ class LLM
175
+ class Events
176
+ Locus --> Controller
177
+ Caller --> Controller
178
+ Controller --> Approval
179
+ Controller --> Crypto
180
+ Crypto --> LLM
181
+ LLM --> Controller
182
+ Controller --> Events
183
+ ```
184
+
185
+ The arrows identify ownership and delegation inside `src/annotation/`; files that only declare types or constants are not presented as transports.
186
+
187
+ ## Use Cases
188
+
189
+ - **UC-1:** Register the approval and default/practice-session relay listeners once when `locusUrlUpdate()` establishes context; update `approvalUrl` independently without registering listeners, then remove installed listeners with `deregisterEvents()`. Evidence: `src/annotation/index.ts`.
190
+ - **UC-2:** Request, cancel, or close annotation for a share instance, optionally routing the request to a specific participant/device. Evidence: `src/annotation/index.ts`.
191
+ - **UC-3:** Accept or decline a presenter approval request by PUTting the exact action to the event-provided URL. Evidence: `src/annotation/index.ts`.
192
+ - **UC-4:** Skip a stroke while LLM is disconnected; otherwise encrypt, select the current practice/default socket after encryption, publish with the next sequence, then decrypt and emit received stroke data. Evidence: `src/annotation/index.ts`.
193
+
194
+ ## State Model
195
+
196
+ The controller stores `seqNum`, `hasSubscribedToEvents`, `approvalUrl`, `locusUrl`, and `deviceUrl`. `seqNum` starts at 1 and increments after each published stroke; `hasSubscribedToEvents` only records whether this controller installed its Mercury/LLM callbacks. The module does not transition between `NO_ANNOTATION` and `RUNNING_ANNOTATION`; those constants are not consumed by current source or tests.
197
+
198
+ ## Business Rules & Invariants
199
+
200
+ - Approval calls use their supplied approval URL and declared action/resource values. Stroke publication is skipped only when the initial LLM connectivity check is false; relay types and sequence fields use the declared wire values. Enforced under `src/annotation/`.
201
+
202
+ ## Concurrency & Reactive Flow
203
+
204
+ - Stroke encryption completes asynchronously. `sendStrokeData` checks LLM connectivity before encryption, while `publishEncrypted` selects the current practice-session/default socket when encryption resolves; the controller has no cancellation or supersession guard.
205
+
206
+ ## Protocol / Wire Format
207
+
208
+ - `index.ts` constructs approval bodies and LLM `publishRequest` envelopes from the request/event/channel types and constants under `src/annotation/`. Preserve action/resource/relay values, receiver and route fields, sequence fields, and encryption metadata.
209
+
210
+ ## Error Handling & Failure Modes
211
+
212
+ | Condition | Signal | Caller recovery |
213
+ |---|---|---|
214
+ | Approval request rejects | The approval method's returned promise rejects with the request failure. | Correct the URL/body or retry under the caller's policy. |
215
+ | LLM is disconnected at the initial stroke-send check | `sendStrokeData` returns `undefined` without encryption or socket send. | Reinvoke only after connectivity is restored. |
216
+ | Stroke encrypt/decrypt rejects | The controller installs no catch and `sendStrokeData` returns no promise, so the failure is not converted into a caller-facing annotation result. | Observe the owning encryption/runtime failure path; do not assume a module retry. |
217
+
218
+ ## Pitfalls
219
+
220
+ - `ANNOTATION_STATUS.NO_ANNOTATION` and `RUNNING_ANNOTATION` are declarations only; do not treat them as a live controller lifecycle without a consuming transition path.
221
+ - Verify both typed constants/enums and raw wire values before changing a logical condition in this legacy package.
222
+
223
+ ## Test-Case Strategy (module)
224
+
225
+ Use the current mirrored suites: `test/unit/spec/annotation/index.ts`. Characterize the annotation-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
226
+
227
+ | Behavior / Requirement | Existing test evidence | Gap |
228
+ |---|---|---|
229
+ | `ANNOTATION-R-001` | `test/unit/spec/annotation/index.ts` | cover every owned Mercury/LLM topic and action/event payload |
230
+ | `ANNOTATION-R-002` | `test/unit/spec/annotation/index.ts` | cover receiver-present and receiver-absent bodies for requested/canceled/closed actions |
231
+ | `ANNOTATION-R-003` | `test/unit/spec/annotation/index.ts` | assert deregistration removes all three owned listeners and a disconnected stroke performs no encryption or send |
232
+
233
+ ## Traceability
234
+
235
+ - Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
236
+ - Coverage state and contracts baseline: `../../../.sdd/manifest.json`