@webex/plugin-meetings 3.13.0-next.12 → 3.13.0-next.14

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,347 @@
1
+ ---
2
+ type: Module Spec
3
+ title: 'Member specification'
4
+ description: Responsibilities, boundaries, design, state, invariants, and verification for the Member participant model of plugin-meetings.
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
+ # Member
17
+
18
+ This source-local document at `src/member/docs/README.md` owns the stable specification for
19
+ **Member**, the client model of one Locus participant in a meeting roster. `Members` builds one
20
+ `Member` per participant and keeps it in its `membersCollection`; applications read the members through
21
+ `meeting.members`. Ground every claim in package evidence and link to the
22
+ [package architecture](../../../docs/architecture.md) instead of repeating broader facts. No service
23
+ specification exists because this package is a library. The roster collection, its requests, and its
24
+ events are specified in the [Members specification](../../members/docs/README.md).
25
+
26
+ Related context: [documentation index](../../../docs/index.md) ·
27
+ [package agent instructions](../../../AGENTS.md)
28
+
29
+ ## Metadata
30
+
31
+ | Field | Value |
32
+ | ----- | ----- |
33
+ | Owner | @webex/web-client, @webex/web-sdk |
34
+ | Source path | `src/member` |
35
+ | Resource kind | module |
36
+ | Status | Draft |
37
+ | Last verified | 2026-11-16 at `0b8c34db7f` |
38
+ | Module id | `plugin-meetings/member` |
39
+ | Parent spec | — |
40
+ | Doc kind | Module spec |
41
+ | Coverage score | Pending coverage assessment |
42
+ | Validation status | not-run |
43
+
44
+ ## Applicability
45
+
46
+ | Condition ID | Status | Evidence or reason | Owned section |
47
+ | ------------------------------------ | ---------- | ------------------ | ------------- |
48
+ | `module.has_tiers` | N/A | No tier policy exists in `package.json` or `.sdd/manifest.json` | Tier |
49
+ | `module.has_ui` | N/A | `src/member/index.ts` is a data model with no rendering | UI use-case flow |
50
+ | `module.crosses_service_boundaries` | N/A | `src/member/index.ts` and `src/member/util.ts` make no request and handle no event; Locus traffic is owned by `src/members/index.ts` and `src/locus-info/index.ts` | Cross-boundary use-case flow |
51
+ | `module.holds_client_state` | Applicable | Each Member holds the derived participant projection, the pairing fields, and the host, self, and content-sharing flags (`src/member/index.ts`) | Client state model |
52
+ | `module.enforces_domain_rules` | Applicable | Status, mute, role, capability, removability, and mutability derivation rules in `src/member/util.ts` | Business rules and invariants |
53
+ | `module.is_concurrent_async` | N/A | Every function in `src/member/index.ts` and `src/member/util.ts` is synchronous; no promise, timer, or listener exists | Concurrency and reactive flow |
54
+ | `module.owns_persistence` | N/A | Members live in memory only, inside the collection of `src/members/collection.ts` | Data, schema, and migration discipline |
55
+ | `module.stateful_transitions` | N/A | A Member is rebuilt per update rather than transitioned; the lobby and meeting status is a derived value, not a state machine (`src/member/index.ts`) | State machine |
56
+ | `module.exposes_wire_protocol` | N/A | The participant shapes in `src/member/types.ts` describe Locus input that `src/locus-info/index.ts` receives; this module serializes nothing | Protocol and wire format |
57
+ | `module.ui_multi_screen` | N/A | No UI | UI flow |
58
+ | `module.large_data_model` | N/A | One model class; its fields are listed under Public surface and Client state model (`src/member/index.ts`) | Data model |
59
+ | `module.returns_caller_errors` | N/A | The only throws are synchronous ParameterError guards for an absent participant in `src/member/util.ts`; they are recorded under Requirements and Pitfalls and constraints | Caller-visible failure modes |
60
+ | `module.module_specific_conventions` | N/A | No convention beyond the package rules in `AGENTS.md` | Module-specific rules |
61
+ | `module.published_package` | N/A | Member is not a named export of `src/index.ts`; the package contract is owned at package level in `package.json` | Export stability |
62
+ | `module.embedded_in_host` | N/A | No host theme or embed API | Host integration and theming |
63
+ | `module.has_design_tradeoff` | N/A | No recorded trade-off beyond replacement on update, which is described under Design overview (`src/members/index.ts`) | Key design trade-off |
64
+ | `module.has_submodules` | N/A | The src/member directory has no child module in `.sdd/manifest.json` | Sub-modules |
65
+
66
+ ## Evidence register
67
+
68
+ Requirements cite current implementation and mirrored unit-test paths. Code wins when prose and code
69
+ conflict; commit and PR history are excluded as evidence by repository-owner decision. Missing test
70
+ evidence is stated as a gap rather than inferred.
71
+
72
+ | Evidence | What it establishes |
73
+ | -------- | ------------------- |
74
+ | `src/member/index.ts` | The Member class (default export) and the MemberId type: field defaults, the constructor order processParticipant, processParticipantOptions, processMember, and the public setIsContentSharing, setIsHost, setIsSelf, processPairedDevice, processIsContentSharing, and processIsRecording |
75
+ | `src/member/util.ts` | MemberUtil: every derivation helper, which ones throw ParameterError for an absent participant, and which return false, null, undefined, an empty array, or NOT_IN_MEETING |
76
+ | `src/member/types.ts` | Participant input shapes and the ServerRoles and MediaStatus enums; the comment that MediaStatus values are inherited from Locus and must not change, and that participant.moderator is deprecated by Locus in favor of role control |
77
+ | `src/members/index.ts` | The only constructor call site: update builds a new Member for every added or updated participant; constructMembers keeps only pairedWith.memberId; updateRelationsBetweenMembers fills pairing; locusSelfUpdate, locusHostUpdate, and locusMediaSharesUpdate call the setters; the comment that member ids must equal participant ids |
78
+ | `src/members/collection.ts` | MembersCollection stores Member objects by id |
79
+ | `src/meeting/index.ts` | Meeting reads isInMeeting, isInLobby, isSelf, isPairedWithSelf, and isAudioMuted of members |
80
+ | `src/aiEnableRequest/utils.ts` | getAIEnablementApprover picks a moderator, else the first cohost by id, whose canApproveAIEnablement is true |
81
+ | `src/common/errors/parameter.ts` | ParameterError extends Error with sdkMessage, error, and code |
82
+ | `README.md` | The application-facing Member property list, and the 0.109.0 note that participant email was removed to reduce PII |
83
+ | `test/unit/spec/member/index.js` | Constructor property presence and that processParticipant and processMember call the expected MemberUtil helpers |
84
+ | `test/unit/spec/member/util.js` | MemberUtil helper cases, including the ParameterError guards and the extractCsis cases |
85
+ | `test/unit/spec/members/index.js` | Pairing cases that assert pairedWith.participantUrl and pairedWith.memberId after a roster update |
86
+ | `src/member/util.ts` | Observation, no stated WHY: isRemovable is false for a guest, the self, or a CALL type, else true only in the meeting; isMutable is true only in the meeting, not muted, not CALL, and for the self or a device. Why these combinations is not stated in code or tests |
87
+ | `src/member/index.ts` | Observation, no stated WHY: isSelf, isHost, and isContentSharing are computed only for USER type participants, while isRecording is computed for every participant |
88
+ | `src/member/util.ts` | Observation, no stated WHY: the second branch of isNotAdmitted compares a negated status with IN_MEETING, which is always false, so only the waiting-guest-in-lobby branch can return true |
89
+ | `src/members/index.ts` | Observation, no stated WHY: Members passes a whiteboardSharingId option that the Member constructor never reads |
90
+
91
+ ## Purpose and boundary
92
+
93
+ - Responsibility: builds the normalized client projection for one Locus participant, a `Member`,
94
+ and holds the few flags that `Members` changes on it later.
95
+ - In scope: the `Member` fields and their derivation from a Locus `Participant` (`src/member/util.ts`);
96
+ the participant input types and the role and media enums (`src/member/types.ts`); the in-place
97
+ setters and processors `Members` calls.
98
+ - Out of scope: storing, adding, removing, and finding members, the roster events, and every request
99
+ about a member ([Members specification](../../members/docs/README.md)); parsing Locus into
100
+ participants ([LocusInfo specification](../../locus-info/docs/README.md)); the Locus service itself.
101
+ - Consumers: `src/members/index.ts` and `src/members/collection.ts` (construction and storage);
102
+ `src/meeting/index.ts` and `src/aiEnableRequest/utils.ts` (read fields); applications through
103
+ `meeting.members.membersCollection`.
104
+
105
+ ## Structure and key files
106
+
107
+ `src/member` contains 3 direct source files (`index.ts`, `types.ts`, `util.ts`) plus this specification, and
108
+ has 2 mirrored unit-test files under `test/unit/spec/member`. Pairing behavior is also exercised by
109
+ the members suite, because only `Members` resolves it.
110
+
111
+ TypeScript in the Node 22.14 Yarn workspace; the module uses no Webex core or plugin abstraction
112
+ (`Member` is a plain class). Tests are Mocha with Sinon and `@webex/test-helper-chai`, run by
113
+ `test:unit` (`webex-legacy-tools test --unit --runner mocha` in `package.json`). Build target:
114
+ `yarn workspace @webex/plugin-meetings build:src`.
115
+
116
+ | File | Holds |
117
+ | ---- | ----- |
118
+ | `src/member/index.ts` | The module's primary export: the `Member` class and the `MemberId` type; field defaults, construction order, and the public setters and processors |
119
+ | `src/member/types.ts` | Module type declarations: the Locus `Participant` input shapes, `ServerRoles`, `MediaStatus`, `IExternalRoles`, and `IMediaStatus` |
120
+ | `src/member/util.ts` | `MemberUtil` normalization/helper functions that derive each field from a participant |
121
+ | `test/unit/spec/member/index.js`, `test/unit/spec/member/util.js` | Mirrored unit coverage: Member construction calls and the `MemberUtil` helper cases |
122
+ | `src/member/docs/README.md` | This module specification |
123
+
124
+ ## Public surface
125
+
126
+ | Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
127
+ |---|---|---|---|---|---|---|
128
+ | `member-model` | SDK model | `Member` construction from a `Participant` (`new Member(participant, options)`) and its fields: `id`, `name`, `participant`, `status`, `isInLobby`, `isInMeeting`, `isNotAdmitted`, mute, hand, brb, role, capability, assignment, device, guest, and pairing fields | Normalize participant person/device, roles, controls, status, media, and identifiers into the roster model. | Preserve the observable member fields consumed by `MembersCollection`, `Meeting`, and applications (the README Member property list); `associatedUser` is deprecated in favor of `associatedUsers`. | `src/member/index.ts`, `src/member/types.ts` | [architecture](../../../docs/architecture.md) |
129
+ | `member-model` | SDK mutation | `processPairedDevice()`, `setIsHost()`, and `setIsSelf()` | Record the paired-device participant URL, and set the host and self flags that `Members` decides from Locus context. | `processPairedDevice` sets only `pairedWith.participantUrl`; the setters assign the flag and never throw. | `src/member/index.ts`, `src/member/util.ts` | [architecture](../../../docs/architecture.md) |
130
+ | `member-model` | SDK mutation | `setIsContentSharing()`, `processIsContentSharing()`, and `processIsRecording()` | Project current share and recording state onto the member without owning their transport. | Preserve the boolean projection rules: content sharing only for USER participants, recording for every participant; synchronous updates. | `src/member/index.ts` | [architecture](../../../docs/architecture.md) |
131
+ | `member-model` | exported participant contracts | `MemberId`, `IExternalRoles`, `ServerRoles`, `ServerRoleShape`, `MediaStatus`, `IMediaStatus`, `Csi`, `Direction`, `ParticipantUrl`, `MediaSession`, `Intent`, `ParticipantDevice`, `ParticipantPerson`, `ParticipantMediaStatus`, `ParticipantControls`, and `Participant` | Share the exact participant input vocabulary used by Locus parsing and roster reconciliation. | Add fields compatibly; role, direction, and media raw values remain package contracts (`MediaStatus` values are inherited from Locus). | `src/member/types.ts`, `src/member/index.ts` | [architecture](../../../docs/architecture.md) |
132
+ | `member-model` | internal helpers | `MemberUtil` (default export of `src/member/util.ts`), including `extractCsis()` used by `Members` for CSI lookup | Derive every Member field from a participant. | Internal to the package; reached by `src/members/index.ts`, not by applications. | `src/member/util.ts` | [architecture](../../../docs/architecture.md) |
133
+
134
+ Compatibility notes:
135
+
136
+ - Prefer additive options and payload fields. Preserve property names, the synchronous
137
+ throw-or-sentinel semantics, and the replacement-on-update timing. `Member` is not a named export of
138
+ `src/index.ts`; route public changes through the owning `Members` collection.
139
+
140
+ Contract ID `member-model` is indexed in the
141
+ [package architecture](../../../docs/architecture.md) and registered in `.sdd/manifest.json`.
142
+
143
+ ## Dependencies
144
+
145
+ Member requires Locus participant payloads, the member normalization utilities, and shared
146
+ constants; it calls no service.
147
+
148
+ | Dependency | Why it is required | Failure behavior |
149
+ | ---------- | ------------------ | ---------------- |
150
+ | `src/member/util.ts` (`MemberUtil`) | Every derived field | Helpers that guard an absent participant throw `ParameterError` |
151
+ | `src/constants.ts` | `MEETINGS` namespace, status values (`IN_LOBBY`, `IN_MEETING`, `NOT_IN_MEETING`), Locus states (`JOINED`, `IDLE`, `LEFT`), intents (`WAIT`, `OBSERVE`), participant types (`USER`, `RESOURCE_ROOM`), `CALL`, and media status keys | — |
152
+ | `src/common/errors/parameter.ts` | `ParameterError` for absent participants | — |
153
+ | Locus participant payload (from `src/locus-info/index.ts` through `src/members/index.ts`) | The input of every Member | Missing optional fragments yield null, false, or undefined fields |
154
+
155
+ ## Requirements
156
+
157
+ | ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
158
+ |---|---|---|---|---|---|---|
159
+ | `MEMBER-R-001` | `new Member(participant, options)` constructs a member from participant data: it keeps the raw Locus participant on `participant`, derives every participant field in `processParticipant`, applies the `selfId`, `hostId`, `contentSharingId`, `recordingId`, and `type` options in `processParticipantOptions`, then derives `isRemovable`, `isMutable`, and `mediaStatus` in `processMember`. A falsy participant skips the first two steps and the constructor throws `ParameterError` from `extractMediaStatus`. | Builds the normalized client projection for one Locus participant that `Members` stores; the README lists these fields as the application-facing Member surface. | `src/member/index.ts`, `src/member/util.ts`, `src/members/index.ts` | `test/unit/spec/member/index.js` | The constructor throw for a falsy participant has no test; `Members` never passes one | PRESENT |
160
+ | `MEMBER-R-002` | Identity, roles, controls-derived flags, status, and media properties are computed once, at construction. Locus updates are not applied in place: `Members` builds a new Member for every added or updated participant and replaces the collection entry, carrying over only `pairedWith.memberId`. | Roster consumers rely on stable synchronous participant projections even as Locus fields arrive incrementally; rebuilding from the latest participant keeps every derived field consistent with one payload. | `src/member/index.ts`, `src/member/util.ts`, `src/members/index.ts` | `test/unit/spec/member/index.js`, `test/unit/spec/members/index.js` | No case asserts that an update replaces the Member object; malformed paired-device and role inputs return undefined or false rather than throw, and no case covers them | PRESENT |
161
+ | `MEMBER-R-003` | Missing participant input has helper-specific synchronous outcomes: `canReclaimHost`, `isAudioMuted`, `isVideoMuted`, `isHandRaised`, `isBreakoutsSupported`, `isSupportsSingleUserAutoEndMeeting`, `isInterpretationSupported`, `isLiveAnnotationSupported`, `isRecording`, and `extractMediaStatus` throw `ParameterError`; `canApproveAIEnablement` and `isAttendeeAssignmentProhibited` return `false`; `extractId`, `extractName`, and `getRecordingMember` return `null`; `extractPairedWithParticipantUrl` returns `undefined` and `extractCsis` an empty array; `extractStatus` returns `_NOT_IN_MEETING_`; `isUser`, `isGuest`, `isDevice`, `isModerator`, and `isSame` return the falsy input itself; `isBrb` throws a `TypeError`. The module owns no asynchronous resource, listener, or timer. | Callers must preserve each helper's implemented sentinel or exception instead of treating all malformed or partial participant data as one failure contract. | `src/member/util.ts`, `src/member/index.ts` | `test/unit/spec/member/index.js`, `test/unit/spec/member/util.js` | The `isBrb` TypeError and the falsy-passthrough helpers have no absent-participant case | PRESENT |
162
+ | `MEMBER-R-004` | `id` is `participant.id` (`extractId`). | `Members` keys its collection by this id and removes members by the Locus `removedParticipantIds`; its code comment states it depends on member ids being participant ids. | `src/member/util.ts`, `src/members/index.ts` | `test/unit/spec/members/index.js` | None | PRESENT |
163
+ | `MEMBER-R-005` | `status` is `IN_MEETING` when the participant has devices and state `JOINED`; `IN_LOBBY` when state is `IDLE` and a device intent is `WAIT` or `OBSERVE`; otherwise, or without devices, `NOT_IN_MEETING`. `isInLobby` and `isInMeeting` follow from `status`. `isNotAdmitted` is computed last, from `isGuest` and `status`: true for a guest whose first device intent is `WAIT` while in the lobby. | `Meeting` counts members that are in the meeting or in the lobby and checks `isInMeeting` before transferring the host; the README promises that a not-admitted member also has `isInLobby` true. | `src/member/util.ts`, `src/member/index.ts`, `src/meeting/index.ts` | None found | `extractStatus` and `isNotAdmitted` have no unit case | PRESENT |
164
+ | `MEMBER-R-006` | `isAudioMuted` and `isVideoMuted` are true when the Locus control `controls.audio.muted` or `controls.video.muted` is true; else true when the participant's own status is `RECVONLY` and false when `SENDRECV`; else the control value itself (possibly `undefined`). `mediaStatus` is `{audio: status.audioStatus, video: status.videoStatus}`. | The code comments separate a remote mute (server control) from a local mute (the participant's media direction); `Meeting` reads `isAudioMuted` to find another unmuted member. | `src/member/util.ts`, `src/meeting/index.ts` | `test/unit/spec/member/util.js` | None | PRESENT |
165
+ | `MEMBER-R-007` | `roles` is `{cohost, moderator, presenter}`, each true when `controls.role.roles` holds an entry of that `ServerRoles` type with `hasRole` true; `isModerator` is the raw `participant.moderator`. | `src/member/types.ts` records that Locus deprecates `participant.moderator` in favor of role control; `getAIEnablementApprover` and the meeting utilities read the role entries. | `src/member/util.ts`, `src/member/types.ts`, `src/aiEnableRequest/utils.ts` | `test/unit/spec/member/util.js`, `test/unit/spec/member/index.js` | None | PRESENT |
166
+ | `MEMBER-R-008` | `processPairedDevice` sets `pairedWith.participantUrl` to the `associatedWith` of the last `OBSERVE` intent across `devices[].intents[]`, and leaves `pairedWith.memberId` undefined. | The code comment: the member for the paired device might not exist yet, so `Members` sets the member id only after the whole collection is updated. | `src/member/index.ts`, `src/member/util.ts`, `src/members/index.ts` | `test/unit/spec/members/index.js` | `extractPairedWithParticipantUrl` has no direct unit case | PRESENT |
167
+ | `MEMBER-R-009` | Capability and policy flags read Locus negative flags: `supportsBreakouts`, `supportsSingleUserAutoEndMeeting`, `supportsInterpretation`, `supportLiveAnnotation`, and `canApproveAIEnablement` are the negation of `doesNotSupportBreakouts`, `doesNotSupportSingleUserAutoEndMeeting`, `doesNotSupportSiInterpreter`, `annotatorAssignmentNotAllowed`, and `attendeeRequestAiAssistantNotAllowed`; `canReclaimHost` is `canReclaimHostRole` or false; `isAttendeeAssignmentProhibited` is coerced to a boolean, while `isModeratorAssignmentProhibited` and `isPresenterAssignmentProhibited` are the raw values. | An absent negative flag must read as allowed (the unit cases assert true for an undefined flag); `getAIEnablementApprover` chooses the approver from `canApproveAIEnablement`. | `src/member/util.ts`, `src/aiEnableRequest/utils.ts` | `test/unit/spec/member/util.js`, `test/unit/spec/member/index.js` | WHY of the negative-flag reading is inferred from the field names and tests | Weak |
168
+ | `MEMBER-R-010` | `isSelf`, `isHost`, `isContentSharing`, and `isRecording` compare the `selfId`, `hostId`, `contentSharingId`, and `recordingId` options with `participant.id` or `participant.person.id` (`isSame`). | The `isSame` JSDoc: there are multiple ids that can be used for a participant. | `src/member/util.ts`, `src/member/index.ts` | None found | `isSame` has no unit case | PRESENT |
169
+ | `MEMBER-R-011` | `setIsSelf`, `setIsHost`, and `setIsContentSharing` assign the flag on an existing Member; `Members` calls them from its self, host, and media-share updates, and its relation pass writes `associatedUsers`, `associatedUser`, `isPairedWithSelf`, `isHost`, and `pairedWith.memberId` directly. | Self, host, and share changes arrive as Locus updates separate from participant updates, so `Members` changes those flags without rebuilding the member. | `src/member/index.ts`, `src/members/index.ts` | `test/unit/spec/members/index.js` | None | PRESENT |
170
+
171
+ ## Design overview
172
+
173
+ `Member` is a local participant model. `util.ts` synchronously normalizes Locus participant/person/device fields into the model and `types.ts` defines shapes; the module performs no request or event transport.
174
+
175
+ The constructor fixes every field to a default (`null` for most flags, `false` for `canReclaimHost`,
176
+ `isBrb`, and `isPairedWithSelf`, an empty `associatedUsers` set) and then runs three steps whose order
177
+ matters: participant fields first, then the option-based flags, then `isRemovable`, `isMutable`, and
178
+ `mediaStatus`, which read the earlier results (code comments "must be done last" and "must occur
179
+ after"). Ownership of change is split: the participant-derived fields belong to construction, and
180
+ `Members` replaces the whole object on every Locus participant update; the host, self, content-sharing,
181
+ and pairing fields are the only ones `Members` changes in place, because they depend on context or on
182
+ other members.
183
+
184
+ ## Data flow and sequence coverage
185
+
186
+ Call style: synchronous in-process calls. `Members` constructs a Member from a Locus participant it
187
+ received through `Meeting` and `LocusInfo`; the Member calls `MemberUtil` helpers. No transport is
188
+ involved.
189
+
190
+ | Operation group | Diagram | Failure coverage |
191
+ |---|---|---|
192
+ | UC-1…UC-2 — member projection construction and replacement operation group | Member projection primary sequence | malformed participant input throws synchronously; synchronous projection replacement on every update without transport or cleanup |
193
+ | UC-1…UC-2 — member projection alternate/failure paths | Member projection primary sequence, alt branches | absent participant (ParameterError), partial/malformed participant data, or absent optional person/device fields |
194
+ | UC-2…UC-3 — in-place host, self, content, and pairing updates | Member in-place flag update sequence | no failure path: the setters assign the flag; pairing is cleared when the participant URL disappears |
195
+
196
+ ```mermaid
197
+ flowchart LR
198
+ LocusParticipant[Raw participant/person/device data] --> Util[util.ts normalization]
199
+ Types[types.ts] --> Util
200
+ Util --> Member[index.ts model]
201
+ Member --> Parent[Members collection / Meeting]
202
+ ```
203
+
204
+ Member projection primary sequence:
205
+
206
+ ```mermaid
207
+ sequenceDiagram
208
+ participant P as Members collection
209
+ participant M as Member
210
+ participant U as member/util.ts
211
+ P->>M: new Member(raw Locus participant, options)
212
+ alt participant is absent
213
+ M->>M: skip participant and option processing
214
+ M->>U: extractMediaStatus(undefined)
215
+ U--xP: synchronous ParameterError out of the constructor
216
+ else participant is present
217
+ M->>U: derive identity, roles, controls, status, and media fields
218
+ alt sentinel-returning helper receives partial input
219
+ U-->>M: false, null, undefined, or _NOT_IN_MEETING_
220
+ else complete input
221
+ U-->>M: normalized values and optional-field defaults
222
+ end
223
+ M-->>P: current participant projection
224
+ P->>P: replace the collection entry, keeping pairedWith.memberId
225
+ end
226
+ ```
227
+
228
+ Member in-place flag update sequence:
229
+
230
+ ```mermaid
231
+ sequenceDiagram
232
+ participant S as Members
233
+ participant M as existing Member
234
+ participant D as paired device Member
235
+ S->>M: setIsSelf / setIsHost / setIsContentSharing(flag)
236
+ S->>S: updateRelationsBetweenMembers after the collection update
237
+ alt pairedWith.participantUrl set and memberId unknown
238
+ S->>M: pairedWith.memberId = device id
239
+ S->>D: add to associatedUsers, copy isSelf to isPairedWithSelf and isHost
240
+ else participantUrl no longer set
241
+ S->>D: remove from associatedUsers, reset isPairedWithSelf and isHost
242
+ S->>M: pairedWith.memberId = undefined
243
+ end
244
+ ```
245
+
246
+ ## Class and component relationships
247
+
248
+ ```mermaid
249
+ classDiagram
250
+ class LocusParticipant
251
+ class Util
252
+ class Types
253
+ class Member {
254
+ id
255
+ participant
256
+ roles
257
+ mediaStatus
258
+ pairedWith
259
+ associatedUsers
260
+ setIsContentSharing(flag)
261
+ setIsHost(flag)
262
+ setIsSelf(flag)
263
+ processPairedDevice(participant)
264
+ processIsContentSharing(participant, sharingId)
265
+ processIsRecording(participant, recordingId)
266
+ }
267
+ class Parent
268
+ Member --> LocusParticipant : keeps participant
269
+ Member ..> Util : derives fields
270
+ Util ..> Types
271
+ Parent o-- Member : MembersCollection
272
+ ```
273
+
274
+ The arrows identify ownership and delegation inside `src/member/`; files that only declare types or constants are not presented as transports.
275
+ `Parent` is `MembersCollection` in `src/members/collection.ts`, owned by `Members`.
276
+
277
+ ## Use cases and flows
278
+
279
+ | Use case | Actor or caller | Primary steps and outcome | Failure or boundary behavior | Evidence |
280
+ | -------- | --------------- | ------------------------- | ---------------------------- | -------- |
281
+ | `UC-1` | `Members` on a Locus participant update | Normalize a `Participant` with person, device, role, controls, status, and media data into one local `Member` projection, built anew for each update | A falsy participant throws `ParameterError`; missing optional fragments give null, false, or undefined fields | `src/member/index.ts`, `src/members/index.ts` |
282
+ | `UC-2` | `Members` when Locus self, host, or pairing context changes | Recompute host/self/paired-device flags: new Members compare `selfId` and `hostId`; existing ones get `setIsSelf` and `setIsHost`; pairing is resolved after the collection update | Each helper keeps its synchronous `ParameterError`, `false`, `null`, or `_NOT_IN_MEETING_` outcome for absent/partial input | `src/member/index.ts`, `src/member/util.ts`, `src/members/index.ts` |
283
+ | `UC-3` | `Members` on a media-share or recording change | Update content-sharing and recording projections without performing I/O; roster requests and update events remain owned by `src/members/` | Content sharing is set only for USER participants at construction | `src/member/index.ts`, `src/members/index.ts` |
284
+
285
+ <!-- Include if: the module holds client-side state. [condition-id: module.holds_client_state] -->
286
+
287
+ ## Client state model
288
+
289
+ One in-memory participant projection is held per Member. It is not updated in place as Locus data
290
+ changes: each participant update builds a new Member that replaces the old one; only the flags below
291
+ marked as set by `Members` change in place.
292
+
293
+ | State or slice | Owner | Initial state | Transition triggers | Reset or persistence boundary |
294
+ | -------------- | ---------- | ------------- | ------------------- | ----------------------------- |
295
+ | Participant-derived fields (`id`, `name`, mute, hand, brb, roles, capability and assignment flags, `status`, `isInLobby`, `isInMeeting`, `isNotAdmitted`, `isRemovable`, `isMutable`, `mediaStatus`) | Member | Defaults, then derived in the constructor | None after construction | Replaced with the whole Member on the next participant update; dropped when the participant is removed |
296
+ | `isSelf`, `isHost`, `isContentSharing`, `isRecording` | Member, set by `Members` | `null`, then derived from options for the participant | `setIsSelf`, `setIsHost`, `setIsContentSharing` from the self, host, and media-share updates | Recomputed from options on the next rebuild |
297
+ | `pairedWith` (`participantUrl`, `memberId`) | Member, `memberId` set by `Members` | Both undefined, then `participantUrl` from the OBSERVE intent | `updateRelationsBetweenMembers` | `memberId` is carried over on rebuild and cleared when `participantUrl` is gone |
298
+ | `associatedUsers`, `associatedUser`, `isPairedWithSelf` (device side) | Member, set by `Members` | Empty set, `null`, `false` | `updateRelationsBetweenMembers` | Reset when the paired user's participant URL disappears; a rebuilt device starts empty again |
299
+
300
+ <!-- Include if: the module enforces domain rules or entity invariants. [condition-id: module.enforces_domain_rules] -->
301
+
302
+ ## Business rules and invariants
303
+
304
+ | ID | Invariant | WHY | Enforcement source | Test evidence |
305
+ | -- | --------- | --- | ------------------ | ------------- |
306
+ | `INV-001` | Participant identity and role/media/control fields derive from the newest participant payload each time a Member is built; removed PII such as participant email is not reintroduced: neither `ParticipantPerson` nor `Member` has an email field. | The README 0.109.0 note: participant email was removed to reduce PII, and callers look up details by participant identity. | `src/member/types.ts`, `src/member/index.ts` | None found |
307
+ | `INV-002` | `isInLobby` and `isInMeeting` are never both true; both follow only from `status`. | A member is in exactly one of lobby, meeting, or neither, and `Meeting` counts them by these flags. | `src/member/index.ts` | None found |
308
+ | `INV-003` | The module performs no request, emits no event, and holds no listener or timer. | Roster requests and events are owned by `Members`, so a Member can be rebuilt freely. | `src/member/index.ts`, `src/member/util.ts` | `test/unit/spec/member/index.js` |
309
+
310
+ ## Pitfalls and constraints
311
+
312
+ - A participant can expose identity, person, device, and media fragments at different times; treat missing optional fragments as incomplete state, not deletion.
313
+ - Public behavior may be reachable through a parent `Meeting`/`Meetings` object even when the source helper is not exported directly.
314
+ - A reference held to a Member goes stale after the next participant update, because `Members`
315
+ replaces the object (`src/members/index.ts`).
316
+ - `isUser`, `isGuest`, `isDevice`, `isModerator`, `isSame`, and the moderator and presenter assignment
317
+ flags can return `undefined` or `null` instead of a boolean (`src/member/util.ts`).
318
+ - The second branch of `isNotAdmitted` is always false; only a waiting guest in the lobby is not
319
+ admitted (`src/member/util.ts`).
320
+ - Constructing a Member without a participant throws; `isBrb` on an absent participant throws a
321
+ `TypeError`, not `ParameterError` (`src/member/util.ts`).
322
+ - `src/members/types.ts` declares a second `ServerRoles` enum with the same values; the member one is
323
+ the one `src/meeting/util.ts` imports.
324
+
325
+ ## Verification
326
+
327
+ Use the current mirrored suites: `test/unit/spec/member/index.js` and `test/unit/spec/member/util.js`,
328
+ which import `src/member` through the package path. Pairing is covered only by
329
+ `test/unit/spec/members/index.js`. Characterize the member-specific use cases above and each listed
330
+ synchronous outcome; the module owns no cleanup or async resource to test.
331
+
332
+ | Behavior / Requirement | Existing test evidence | Gap |
333
+ |---|---|---|
334
+ | `MEMBER-R-001` | `test/unit/spec/member/index.js` | cover participant construction field values and the constructor throw for a falsy participant |
335
+ | `MEMBER-R-002` | `test/unit/spec/member/index.js`, `test/unit/spec/members/index.js` | no case asserts replacement of the Member on update; malformed paired-device and role inputs have no case |
336
+ | `MEMBER-R-003` | `test/unit/spec/member/index.js`, `test/unit/spec/member/util.js` | assert the per-helper matrix: the `ParameterError` guards are covered except `isRecording`; `canApproveAIEnablement` false is covered; the `null`, falsy-passthrough, and `isBrb` TypeError outcomes for an absent participant are not |
337
+ | `MEMBER-R-004` | `test/unit/spec/members/index.js` | none |
338
+ | `MEMBER-R-005` | none found | `extractStatus`, `processStatus`, and `isNotAdmitted` have no unit case |
339
+ | `MEMBER-R-006` | `test/unit/spec/member/util.js` | none |
340
+ | `MEMBER-R-007` | `test/unit/spec/member/util.js`, `test/unit/spec/member/index.js` | none |
341
+ | `MEMBER-R-008` | `test/unit/spec/members/index.js` | no direct case for `extractPairedWithParticipantUrl` |
342
+ | `MEMBER-R-009` | `test/unit/spec/member/util.js`, `test/unit/spec/member/index.js` | none |
343
+ | `MEMBER-R-010` | none found | `isSame` and the USER-only gating have no unit case |
344
+ | `MEMBER-R-011` | `test/unit/spec/members/index.js` | the setters themselves have no direct case |
345
+
346
+ A module specification is complete only when its public surface, invariants, failure modes, and test
347
+ evidence agree with the implementation.