@webex/internal-plugin-voicea 3.13.0-next.4 → 3.13.0-next.5

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.
@@ -0,0 +1,402 @@
1
+ {
2
+ "manifest_version": 1,
3
+ "repository": {
4
+ "name": "@webex/internal-plugin-voicea",
5
+ "purpose": "Internal plugin registered as webex.internal.voicea (required by the webex package and used by plugin-meetings). It is a factory: createChannel(llmChannel?) returns a VoiceaChannel per meeting, which borrows a caller-owned LLM data channel. A channel PUTs Locus controls to turn captions, transcription, and manual captions on and to set the spoken language; announces the client to the voicea service, requests caption languages, sends manual captions, and manages the transcription subchannel over the LLM channel; re-emits inbound relay events as voicea:* and aibridge:* events; and rebinds to another LLM channel while restoring captions. It stores nothing and owns no connection.",
6
+ "category": "cat2-legacy",
7
+ "primary_languages": [
8
+ "typescript"
9
+ ]
10
+ },
11
+ "topology": "Orchestrator-plus-components",
12
+ "commands": {
13
+ "install": {
14
+ "command": "yarn",
15
+ "source_file": "../../../.github/workflows/deploy.yml",
16
+ "role": "install"
17
+ },
18
+ "prebuild": {
19
+ "command": "yarn prebuild:modules",
20
+ "source_file": "../../../CONTRIBUTING.md",
21
+ "role": "other"
22
+ },
23
+ "compile": {
24
+ "command": "yarn workspace @webex/internal-plugin-voicea build",
25
+ "source_file": "package.json",
26
+ "role": "compile",
27
+ "verified_at": "2026-11-12T09:07:12Z"
28
+ },
29
+ "build": {
30
+ "command": "yarn workspace @webex/internal-plugin-voicea build:src",
31
+ "source_file": "../../../AGENTS.md",
32
+ "role": "package",
33
+ "verified_at": "2026-11-12T09:07:16Z"
34
+ },
35
+ "unit-test": {
36
+ "command": "yarn workspace @webex/internal-plugin-voicea test:unit",
37
+ "source_file": "../../../AGENTS.md",
38
+ "role": "unit-test",
39
+ "verified_at": "2026-11-12T09:07:18Z"
40
+ },
41
+ "lint": {
42
+ "command": "yarn workspace @webex/internal-plugin-voicea test:style",
43
+ "source_file": "package.json",
44
+ "role": "lint",
45
+ "verified_at": "2026-11-12T09:07:21Z"
46
+ },
47
+ "deploy": {
48
+ "command": "yarn workspace @webex/internal-plugin-voicea deploy:npm",
49
+ "source_file": "package.json",
50
+ "role": "deploy"
51
+ }
52
+ },
53
+ "toolchain": [
54
+ {
55
+ "name": "node",
56
+ "version": ">=18",
57
+ "origin": "repo-config",
58
+ "source_file": "package.json"
59
+ },
60
+ {
61
+ "name": "node",
62
+ "version": "22.14",
63
+ "origin": "repo-config",
64
+ "source_file": "../../../AGENTS.md"
65
+ },
66
+ {
67
+ "name": "node",
68
+ "version": "lts/jod",
69
+ "origin": "repo-config",
70
+ "source_file": "../../../.nvmrc"
71
+ },
72
+ {
73
+ "name": "node",
74
+ "version": "18.x",
75
+ "origin": "repo-config",
76
+ "source_file": "../../../package.json"
77
+ },
78
+ {
79
+ "name": "yarn",
80
+ "version": "3.4.1",
81
+ "origin": "repo-config",
82
+ "source_file": "../../../package.json"
83
+ },
84
+ {
85
+ "name": "babel",
86
+ "version": "^7.17.10",
87
+ "origin": "repo-config",
88
+ "source_file": "package.json"
89
+ },
90
+ {
91
+ "name": "eslint",
92
+ "version": "^8.24.0",
93
+ "origin": "repo-config",
94
+ "source_file": "package.json"
95
+ },
96
+ {
97
+ "name": "prettier",
98
+ "version": "^2.7.1",
99
+ "origin": "repo-config",
100
+ "source_file": "package.json"
101
+ },
102
+ {
103
+ "name": "sinon",
104
+ "version": "^9.2.4",
105
+ "origin": "repo-config",
106
+ "source_file": "package.json"
107
+ }
108
+ ],
109
+ "tests": {
110
+ "unit": {
111
+ "command_ref": "unit-test",
112
+ "dir": "test/unit/spec",
113
+ "framework": "jest"
114
+ }
115
+ },
116
+ "quality_gates": {
117
+ "code_coverage": {
118
+ "origin": "none",
119
+ "declared_by": "rarajes2@cisco.com via bootstrap questionnaire (generator check: test:unit runs webex-legacy-tools with --runner jest; jest.config.js re-exports @webex/jest-config-legacy, which sets no coverageThreshold; package.json defines no coverage script)"
120
+ }
121
+ },
122
+ "coverage_status_definitions": {
123
+ "specced": ">=80% public surface specced, drift <5% - spec is authoritative",
124
+ "partial": "40-80% specced - spec is a hint, cross-check code",
125
+ "untracked": "<40% specced - code is the source of truth"
126
+ },
127
+ "spec_source_policy": {
128
+ "mode": "keep-separate",
129
+ "migrated_source_disposition": "retain",
130
+ "disposition_decided_by": "rarajes2@cisco.com",
131
+ "disposition_decided_at": "2026-11-12T08:36:43Z",
132
+ "decided_by": "rarajes2@cisco.com",
133
+ "decided_at": "2026-11-12T08:36:43Z",
134
+ "decision_record": "docs/adr/0001-retain-product-readme.md"
135
+ },
136
+ "spec_sources": [
137
+ {
138
+ "path": "README.md",
139
+ "scope": "repo",
140
+ "role": "reference-only",
141
+ "canonical": false,
142
+ "use_by_agents": "context-only",
143
+ "post_migration_action": "retain",
144
+ "deletion_status": "not-applicable",
145
+ "notes": "npm usage page, kept unchanged under keep-separate. Partly stale: it documents webex.internal.voicea.registerAndConnect, which no longer exists, calls channel methods on the plugin, and names voicea:spokenLanguageSet instead of voicea:spokenLanguageUpdate; see docs/adr/0001-retain-product-readme.md."
146
+ }
147
+ ],
148
+ "modules": [
149
+ {
150
+ "path": "src",
151
+ "canonical_spec": "src/docs/README.md",
152
+ "coverage_status": "Partial",
153
+ "coverage_evidence": "Field coverage 93.3% (14/15) assessed 2026-11-12 by the generator; critical field coverage 8/8. The one WEAK field is test strategy: 84 unit cases in three suites pass under Node 22.14 after build:src and cover createChannel, the constructor, every relay type, announce, language requests, manual captions, the four Locus control methods, subchannel subscriptions, switchLLMChannel (11 cases), and deregisterEvents, but registration through src/index.ts, the trackingId prefix, the turnOnCaptions request body, the toggleManualCaption status leak without a channel, re-binding the same channel after deregisterEvents, and the formatter's 0:60 rounding edge have no case, and no characterization baseline exists. Independent validation reran 2026-11-12 using validator runtime 01a1cef2-ab9c-7f50-baf4-643aeae8b469 and passed with warnings: 0 Blocking and 1 Important command-source finding. Generated-doc conformance has 0 Blocking findings and confirms the questionnaire gate; the orchestrator-root check passes when run against the worktree root. The remaining command-source finding is documented as an accepted Important warning because the workspace-qualified command form is retained by developer decision.",
154
+ "last_assessed": "2026-11-12",
155
+ "contracts": {
156
+ "provides": [
157
+ "voicea-internal-sdk"
158
+ ],
159
+ "requires": [
160
+ "locus-controls",
161
+ "voicea-relay-data-channel",
162
+ "webex-core-plugin-host",
163
+ "internal-plugin-llm-channel",
164
+ "internal-plugin-mercury-events",
165
+ "uuid"
166
+ ]
167
+ },
168
+ "section_profile": {
169
+ "has_tiers": false,
170
+ "has_ui": false,
171
+ "crosses_service_boundaries": true,
172
+ "holds_client_state": true,
173
+ "enforces_domain_rules": true,
174
+ "is_concurrent_async": true,
175
+ "owns_persistence": false,
176
+ "stateful_transitions": true,
177
+ "exposes_wire_protocol": true,
178
+ "ui_multi_screen": false,
179
+ "large_data_model": false,
180
+ "returns_caller_errors": true,
181
+ "module_specific_conventions": true,
182
+ "published_package": true,
183
+ "embedded_in_host": false,
184
+ "has_design_tradeoff": true,
185
+ "resolved_by": "claude-code (code evidence; bootstrap questionnaire)",
186
+ "resolved_at": "2026-11-12T08:36:43Z",
187
+ "has_submodules": false,
188
+ "has_submodules_computed_by": "scripts/module_tree.py",
189
+ "has_submodules_computed_at": "2026-11-12T08:36:43Z"
190
+ }
191
+ }
192
+ ],
193
+ "contract_catalog": {
194
+ "index_path": "docs/architecture.md",
195
+ "definitions": {
196
+ "voicea-internal-sdk": {
197
+ "kind": "sdk",
198
+ "publication": "published",
199
+ "source_kind": "repository-path",
200
+ "source": "package.json",
201
+ "summary": "Published npm package (internal plugin). main is dist/index.js, types is dist/types/index.d.ts, and devMain names src/index.js although the entry is src/index.ts. Importing it registers VoiceaPlugin as internal plugin 'voicea' with empty options; the first registration of the name wins. Exports: default and named VoiceaPlugin, VoiceaChannel, EVENT_TRIGGERS, TURN_ON_CAPTION_STATUS, and the types MeetingTranscriptPayload and SpeakerNameUpdatePayload. webex.internal.voicea.createChannel(llmChannel?) returns a VoiceaChannel; its methods and the voicea:* and aibridge:newManualCaption events are specified in src/docs/README.md."
202
+ },
203
+ "locus-controls": {
204
+ "kind": "http",
205
+ "publication": "internal",
206
+ "source_kind": "external",
207
+ "source": "Locus controls endpoint (<locusUrl>/controls/, where locusUrl comes from the bound LLM channel; route definitions are not in this repository)",
208
+ "summary": "PUT bodies: {transcribe: {caption: true}, languageCode}; {transcribe: {transcribing}, spokenLanguage}; {transcribe: {spokenLanguage, languageAssignment?}}; {manualCaption: {enable}}. Sent through webex.request."
209
+ },
210
+ "voicea-relay-data-channel": {
211
+ "kind": "event",
212
+ "publication": "internal",
213
+ "source_kind": "external",
214
+ "source": "Voicea service and AI bridge relay over the LLM data channel (relay types in src/constants.ts; service definitions are not in this repository)",
215
+ "summary": "Outbound publishRequest frames with relayType client.annc (clientPayload version v2), voicea.transl.req, and client.manual_transcription, plus subchannelSubscriptionRequest; id is the shared sequence number and trackingId is <trackingIdPrefix>_<uuid>. Inbound relay events voicea.annc, voicea.transl.rsp, voicea.transcription, voicea.update_speakername, aibridge.manual_transcription, and client.manual_transcription."
216
+ },
217
+ "webex-core-plugin-host": {
218
+ "kind": "sdk",
219
+ "publication": "published",
220
+ "source_kind": "external",
221
+ "source": "@webex/webex-core (workspace package; module spec consulted: packages/@webex/webex-core/src/docs/README.md)",
222
+ "summary": "registerInternalPlugin (first-wins, no proxies) registers the factory; WebexPlugin supplies webex and request, which createChannel binds into each channel; the named config export supplies trackingIdPrefix (default webex-js-sdk) for outbound frames."
223
+ },
224
+ "internal-plugin-llm-channel": {
225
+ "kind": "sdk",
226
+ "publication": "published",
227
+ "source_kind": "external",
228
+ "source": "@webex/internal-plugin-llm LLMChannel (workspace package; module spec consulted: packages/@webex/internal-plugin-llm/src/docs/README.md, found stale on the plugin shape; code consulted: packages/@webex/internal-plugin-llm/src/llm-plugin.ts and src/llm.ts)",
229
+ "summary": "Imported only as a type. The caller supplies a caller-owned LLMChannel from webex.internal.llm.createChannel(); voicea uses isConnected, getSocket().send, getBinding, getLocusUrl, getDatachannelUrl, isDataChannelTokenEnabled, and on, once, and off for event:relay.event and online."
230
+ },
231
+ "internal-plugin-mercury-events": {
232
+ "kind": "sdk",
233
+ "publication": "published",
234
+ "source_kind": "external",
235
+ "source": "@webex/internal-plugin-mercury (workspace package, reached through LLMChannel; module spec consulted: packages/@webex/internal-plugin-mercury/src/docs/README.md)",
236
+ "summary": "LLMChannel connects on the default session, whose events carry no suffix, so inbound relay frames arrive as event:relay.event and connection as online. Declared in package.json dependencies but imported only by the unit specs."
237
+ },
238
+ "uuid": {
239
+ "kind": "sdk",
240
+ "publication": "published",
241
+ "source_kind": "external",
242
+ "source": "uuid@^3.3.2 (npm)",
243
+ "summary": "uuid.v4 generates trackingId suffixes, translation-request ids, and manual-caption ids."
244
+ }
245
+ }
246
+ },
247
+ "spec_policy": {
248
+ "require_what_and_why": true,
249
+ "require_provenance": true,
250
+ "protected_specs": [
251
+ "src/docs/README.md"
252
+ ]
253
+ },
254
+ "validation": {
255
+ "generator_runtime": "claude-code",
256
+ "generator_model": "claude-opus-5-5",
257
+ "generator_runtime_source": "host-metadata",
258
+ "source_commit": "ecd5af12a1abf47fc6ed7dd72cb308b259d45fb8",
259
+ "minimum_independence": "different-runtime",
260
+ "blocking_severities": [
261
+ "Blocking"
262
+ ],
263
+ "validator_runtime": "01a1cef2-ab9c-7f50-baf4-643aeae8b469",
264
+ "validator_runtime_source": "host-metadata",
265
+ "runtime_fallback_tier": "different-runtime"
266
+ },
267
+ "layout": {
268
+ "sdd_root": ".sdd",
269
+ "docs_root": "docs",
270
+ "agent_entry_path": "AGENTS.md",
271
+ "standing_docs_root": "docs",
272
+ "spec_index_path": "docs/specs/README.md",
273
+ "module_docs_strategy": "source-local",
274
+ "module_docs_relative_path": "docs/README.md",
275
+ "module_docs_decision": {
276
+ "basis": "repo-standards-default",
277
+ "reason": "No module-local documentation existed. The source-local default gives src/docs/README.md. test:style runs eslint ./src/**/*.*, and the shared @webex/eslint-config-legacy ignore patterns exclude docs/** and *.md; build:src processes -js -ts only and tsconfig.json emits declarations only, so Markdown under src/ does not enter the build output.",
278
+ "decided_by": "rarajes2@cisco.com (bootstrap questionnaire)",
279
+ "decided_at": "2026-11-12T08:36:43Z"
280
+ },
281
+ "repo_context_decision": {
282
+ "path": ".repo-context.json",
283
+ "schema_path": "schemas/repo-context.schema.json",
284
+ "action": "create",
285
+ "schema_action": "create",
286
+ "reason": "Neither the operational context nor its schema existed in this package. The context is created from package evidence and the schema is copied from the repository-root .sdd/templates/repo-standards/schemas/repo-context.schema.json.",
287
+ "decided_by": "rarajes2@cisco.com (bootstrap questionnaire)",
288
+ "decided_at": "2026-11-12T08:36:43Z"
289
+ },
290
+ "artifact_decisions": [
291
+ {
292
+ "path": "docs/service.md",
293
+ "action": "omit",
294
+ "reason": "Library package, not a deployable service. package.json has no start script, container, or deployment descriptor.",
295
+ "decided_by": "claude-code (code evidence)",
296
+ "decided_at": "2026-11-12T08:36:43Z"
297
+ },
298
+ {
299
+ "path": "mkdocs.yml",
300
+ "action": "omit",
301
+ "reason": "No package-level documentation site exists. Documentation publishing stays with the workspace.",
302
+ "decided_by": "claude-code (code evidence)",
303
+ "decided_at": "2026-11-12T08:36:43Z"
304
+ },
305
+ {
306
+ "path": "api-specs/openapi.yaml",
307
+ "action": "omit",
308
+ "reason": "The package serves no HTTP routes. It is a client of Locus controls and the voicea relay; its published surface is the npm export described by voicea-internal-sdk.",
309
+ "decided_by": "claude-code (code evidence)",
310
+ "decided_at": "2026-11-12T08:36:43Z"
311
+ },
312
+ {
313
+ "path": "SECURITY.md",
314
+ "action": "omit",
315
+ "reason": "No package-level security policy exists. The workspace owns security policy, and a per-package copy would duplicate it; security architecture is described in docs/architecture.md.",
316
+ "decided_by": "claude-code (code evidence)",
317
+ "decided_at": "2026-11-12T08:36:43Z"
318
+ },
319
+ {
320
+ "path": "CONTRIBUTING.md",
321
+ "action": "omit",
322
+ "reason": "Contribution instructions are owned at the workspace root CONTRIBUTING.md.",
323
+ "decided_by": "claude-code (code evidence)",
324
+ "decided_at": "2026-11-12T08:36:43Z"
325
+ },
326
+ {
327
+ "path": "CHANGELOG.md",
328
+ "action": "omit",
329
+ "reason": "Changelog generation is owned at the workspace root. This package has no changelog file.",
330
+ "decided_by": "claude-code (code evidence)",
331
+ "decided_at": "2026-11-12T08:36:43Z"
332
+ },
333
+ {
334
+ "path": "CTO_CHECKLIST.yml",
335
+ "action": "omit",
336
+ "reason": "The CTO readiness checklist applies to deployable services. This package is a library.",
337
+ "decided_by": "claude-code (code evidence)",
338
+ "decided_at": "2026-11-12T08:36:43Z"
339
+ },
340
+ {
341
+ "path": "schemas/cto-checklist.schema.json",
342
+ "action": "omit",
343
+ "reason": "Omitted together with CTO_CHECKLIST.yml.",
344
+ "decided_by": "claude-code (code evidence)",
345
+ "decided_at": "2026-11-12T08:36:43Z"
346
+ }
347
+ ],
348
+ "template_roots": {
349
+ "canonical": ".sdd/templates/repo-standards"
350
+ },
351
+ "contract_index_path": "docs/architecture.md",
352
+ "repo_skills_root": ".sdd/skills",
353
+ "monorepo_package": {
354
+ "package_path": "packages/@webex/internal-plugin-voicea",
355
+ "root_manifest_path": "../../../.sdd/manifest.json",
356
+ "templates_root_path": "../../../.sdd/templates/repo-standards"
357
+ }
358
+ },
359
+ "tooling": {
360
+ "sdlc_skills": {
361
+ "source_ref": "repo-annotation@2.3.1"
362
+ }
363
+ },
364
+ "coverage_ratchet": {
365
+ "enabled": true,
366
+ "waivers": []
367
+ },
368
+ "substrate": {
369
+ "source": "WebexTools/repo-standards@d89a7fe59126ae3ad9bac9ca352aa7f12b4c85dc",
370
+ "consumed": [
371
+ "@webex/eslint-config-legacy via .eslintrc.js",
372
+ "@webex/babel-config-legacy via babel.config.js",
373
+ "@webex/jest-config-legacy via jest.config.js",
374
+ "@webex/legacy-tools build and test runner via package.json",
375
+ "workspace tsconfig.json via tsconfig.json (emitDeclarationOnly)",
376
+ "package README.md (context only)",
377
+ "Repo Standards templates at the monorepo root .sdd/templates/repo-standards, referred to through layout.monorepo_package.templates_root_path (this package holds no templates)"
378
+ ],
379
+ "compliance_tier": "baseline"
380
+ },
381
+ "section_profiles": {
382
+ "repo": {
383
+ "owns_datastore": false,
384
+ "holds_client_state": true,
385
+ "components_interact": true,
386
+ "domain_data_across_components": true,
387
+ "caches_data": false,
388
+ "observability_convention": false,
389
+ "deploys_to_infra": false,
390
+ "shared_base_libs": true,
391
+ "is_monorepo": false,
392
+ "multi_platform": false,
393
+ "published_package": true,
394
+ "embedded_in_host": false,
395
+ "cross_repo_deps_material": true,
396
+ "security_arch_warranted": true,
397
+ "exposes_commands_or_artifacts": true
398
+ },
399
+ "resolved_by": "claude-code (code evidence; bootstrap questionnaire)",
400
+ "resolved_at": "2026-11-12T08:36:43Z"
401
+ }
402
+ }
package/AGENTS.md ADDED
@@ -0,0 +1,211 @@
1
+ <!-- sdd-generated-metadata
2
+ doc_kind: agent-entry
3
+ generated_from: agents@0.3.0
4
+ generated_by: claude-code
5
+ approved_by: rarajes2@cisco.com
6
+ updated_at: 2026-11-12T09:22:36Z
7
+ validation_status: pass-with-warnings
8
+ -->
9
+
10
+ # AI Agent Instructions
11
+
12
+ Package-scoped SDD entry for `@webex/internal-plugin-voicea`, the internal `voicea` plugin of the SDK
13
+ (a factory for `VoiceaChannel`, which drives meeting captions, transcription, and manual captions
14
+ through Locus and talks to the voicea service over a caller-owned LLM data channel). This file orients
15
+ agents. The monorepo root `AGENTS.md` governs workspace-wide setup.
16
+
17
+ ## Working Method
18
+
19
+ - Read the relevant package files before editing. Do not edit blind.
20
+ - Understand the task and affected surfaces before writing code.
21
+ - Prefer focused edits over rewriting whole files.
22
+ - Do not invent commands, paths, exports, event names, or relay types. Verify them from this
23
+ package's source and tests.
24
+ - Test or validate before declaring done.
25
+ - Keep output concise. If something is uncertain, say so instead of guessing.
26
+
27
+ ## Canonical Repository Documentation
28
+
29
+ Before changing code or documentation, start with:
30
+
31
+ - [`docs/index.md`](docs/index.md) for package documentation navigation;
32
+ - [`docs/architecture.md`](docs/architecture.md) for package boundaries and interactions;
33
+ - [`docs/specs/README.md`](docs/specs/README.md) for the manifest-backed module and contract registry;
34
+ - the module specification at [`src/docs/README.md`](src/docs/README.md) (voicea caption and
35
+ transcription channel); and
36
+ - [`docs/adr/index.md`](docs/adr/index.md) plus applicable concrete ADRs.
37
+
38
+ Follow `.sdd/manifest.json` for each contract's publication state and canonical source. This package
39
+ publishes an internal SDK surface, so its contract artifact is `package.json` plus the `src/index.ts`
40
+ entry. It serves no HTTP, so no OpenAPI applies.
41
+
42
+ ## 1. Commands (Run First)
43
+
44
+ Use only documented commands. Do not invent alternatives when a command is missing. Run workspace
45
+ commands from the monorepo root.
46
+
47
+ | Task | Command |
48
+ | ---------------------- | ------- |
49
+ | Install dependencies | `yarn` (workspace root; the deploy workflow runs the same command); on a fresh checkout run `yarn prebuild:modules` once, because `yarn` does not build `@webex/legacy-tools` or sibling `dist/` |
50
+ | Start dev environment | N/A — library package with no start script in `package.json` |
51
+ | Run tests | `yarn workspace @webex/internal-plugin-voicea test:unit` (jest) |
52
+ | Run linters | `yarn workspace @webex/internal-plugin-voicea test:style` |
53
+ | Build/release artifact | `yarn workspace @webex/internal-plugin-voicea build:src` (JavaScript to `dist/`, then declarations) |
54
+ | Format code | N/A — no format script; `prettier` is a devDependency used through eslint |
55
+
56
+ `yarn workspace @webex/internal-plugin-voicea build` runs `tsc` alone (type check and declarations
57
+ only, through the workspace `emitDeclarationOnly`); `build:src` runs it after writing `dist/`.
58
+
59
+ Do not use the aggregate `test` script: it calls `test:integration`, which this package does not
60
+ define. `test:browser` finds no `test/integration` directory and verifies nothing.
61
+
62
+ If a required command is unknown, stop and ask for the exact command.
63
+
64
+ ## 2. Agent Persona and Scope
65
+
66
+ You are the Webex JS SDK engineering assistant for `@webex/internal-plugin-voicea`.
67
+
68
+ Primary outcomes:
69
+
70
+ - Deliver production-safe changes with unit tests and lint passing.
71
+ - Preserve existing behavior unless a change request explicitly requires a behavior change.
72
+ - Keep docs and configuration aligned with code changes.
73
+
74
+ Definition of done:
75
+
76
+ 1. Requested change is implemented.
77
+ 2. Relevant tests, lint, and build checks pass locally.
78
+ 3. Updated docs cover new behavior, including the owning module spec.
79
+ 4. PR summary includes risks and rollback notes.
80
+
81
+ ## 3. Repository Knowledge
82
+
83
+ ### Tech Stack
84
+
85
+ | Area | Tooling | Version |
86
+ | ---------------- | ------- | ------- |
87
+ | Language runtime | node; TypeScript sources | 22.14 (workspace root `AGENTS.md`; `.nvmrc` `lts/jod`); package `engines` accepts `>=18`; the workspace root `package.json` `engines.node` still reads `18.x`, which conflicts with the other pins |
88
+ | Build tool | yarn workspaces, `@webex/legacy-tools` over babel, and `tsc` for declarations | yarn `3.4.1` (root `packageManager`), `@babel/core` `^7.17.10` |
89
+ | Test framework | jest via `webex-legacy-tools` (`test:unit`); chai, sinon, `@webex/test-helper-mock-webex`, `@webex/test-helper-mock-web-socket` | sinon `^9.2.4` |
90
+ | Lint/format | eslint via `@webex/eslint-config-legacy` (TypeScript override), prettier | eslint `^8.24.0`, prettier `^2.7.1` |
91
+
92
+ ### Project Map
93
+
94
+ - `src/index.ts`: registers internal plugin `voicea` and re-exports `VoiceaPlugin` (default and named),
95
+ `VoiceaChannel`, `EVENT_TRIGGERS`, `TURN_ON_CAPTION_STATUS`, and two payload types.
96
+ - `src/voicea-plugin.ts`: `VoiceaPlugin`, whose only method is `createChannel(llmChannel?)`.
97
+ - `src/voicea.ts`: `VoiceaChannel`, where all behavior lives. Spec: `src/docs/README.md`.
98
+ - `src/constants.ts`: event names, relay types, transcription types, status values.
99
+ - `src/voicea.types.ts`: payload types and the `IVoiceaChannel` interface.
100
+ - `src/utils.ts`: the `m:ss` timestamp formatter.
101
+ - `test/unit/spec/voicea.js`, `test/unit/spec/voicea-plugin.js`, `test/unit/spec/utils.js`: the unit
102
+ specs (84 cases); they import `src` directly.
103
+ - `process`: package-root module exporting `{browser: true}`; not imported by `src/`.
104
+ - `dist/`: generated build output. Never edit by hand.
105
+ - `README.md`: retained npm page, context only and partly stale (it still documents
106
+ `registerAndConnect`); see [ADR-0001](docs/adr/0001-retain-product-readme.md).
107
+
108
+ ### Critical Constraints
109
+
110
+ - The LLM channel belongs to the caller. `VoiceaChannel` borrows it and must never connect,
111
+ disconnect, or tear it down.
112
+ - Methods live on `VoiceaChannel`, not on `webex.internal.voicea`; the plugin only creates channels.
113
+ - plugin-meetings listens to `EVENT_TRIGGERS` values and reads `TURN_ON_CAPTION_STATUS` and
114
+ `MeetingTranscriptPayload`. Treat their values and shapes as a contract.
115
+ - Every outbound data-channel frame uses the shared sequence number as `id` and advances it.
116
+ - `switchLLMChannel` is a reconciler; keep it idempotent so repeated or late calls converge.
117
+ - `deregisterEvents` keeps the LLM channel reference, so switching back to that same channel does not
118
+ resubscribe to relay events.
119
+ - `toggleManualCaption` sets its status before checking for a channel; a missing channel leaves it
120
+ stuck at `sending`.
121
+
122
+ ## 4. Testing Workflow
123
+
124
+ Run checks in this order:
125
+
126
+ 1. `yarn workspace @webex/internal-plugin-voicea build:src`
127
+ 2. `yarn workspace @webex/internal-plugin-voicea test:unit`
128
+ 3. `yarn workspace @webex/internal-plugin-voicea test:style`
129
+
130
+ Step 1 type-checks the sources through `tsc` and keeps `dist/` current for packages that depend on
131
+ this one. The specs import `src` directly, but they load `@webex/internal-plugin-mercury` and
132
+ `@webex/internal-plugin-llm` from those packages' `dist/`, so run `yarn prebuild:modules` once on a
133
+ fresh checkout.
134
+
135
+ Testing rules:
136
+
137
+ - Add or update unit cases for every behavior change, next to the matching `describe` block.
138
+ - Use the existing `createMockLLMChannel` helper and the stub request function instead of a real LLM
139
+ channel.
140
+ - Use `assert.calledOnceWithExactly` for frames and payloads, and parametrize when more than three
141
+ cases are alike.
142
+ - Cover failure paths and edge cases, not only happy paths.
143
+ - Do not remove tests to make CI pass.
144
+ - Use `sinon.useFakeTimers()` when a case depends on time.
145
+
146
+ No coverage gate applies to this package; do not infer one.
147
+
148
+ ## 5. Code Style and Patterns
149
+
150
+ Coding expectations:
151
+
152
+ - Follow repository style rules and static analysis output. The local `.eslintrc.js` sets
153
+ `root: true`; `.ts` files get the shared TypeScript and prettier override.
154
+ - Prefer small functions over large procedural blocks.
155
+ - Make error handling explicit; keep the existing error messages, which the unit tests match on.
156
+ - Keep public interfaces stable unless a breaking change is requested.
157
+
158
+ Pattern example:
159
+
160
+ ```text
161
+ Preferred:
162
+ - Add an event name to EVENT_TRIGGERS and a relay type to AIBRIDGE_RELAY_TYPES in src/constants.ts.
163
+ - Reach the LLM channel through requireLLMChannel() and check isLLMConnected() before sending.
164
+ - Keep per-meeting state in VoiceaChannel, never in VoiceaPlugin.
165
+
166
+ Avoid:
167
+ - Treating README.md as the method, event, or connection reference.
168
+ - Changing a status flag before the checks that can throw.
169
+ - Reading webex.config from VoiceaChannel; it holds only the request function and the LLM channel.
170
+ ```
171
+
172
+ ## 6. Git Workflow
173
+
174
+ - Branch naming: no package convention is defined; follow the workspace `CONTRIBUTING.md`.
175
+ - Commit format: conventional commits (`feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `chore:`), which
176
+ the workspace `CONTRIBUTING.md` requires for pull requests.
177
+ - Keep commits focused and reversible.
178
+ - Rebase on the target branch before opening a pull request.
179
+
180
+ PR checklist:
181
+
182
+ - What changed and why.
183
+ - Tests run and results.
184
+ - Risk and impact on plugin-meetings captions, transcription, manual captions, and channel switching.
185
+ - Rollback approach.
186
+
187
+ ## 7. Boundaries and Escalation
188
+
189
+ ### Always
190
+
191
+ - Prefer existing patterns over introducing new architecture.
192
+ - Keep changes minimal for the requested scope.
193
+ - Call out assumptions and unknowns explicitly.
194
+ - Update the owning module spec in the same change that alters observable behavior.
195
+
196
+ ### Ask First
197
+
198
+ - Adding dependencies.
199
+ - Renaming or removing an `EVENT_TRIGGERS` value, an exported constant, or an exported type.
200
+ - Changing a Locus `controls` body, a relay type, or a frame shape.
201
+ - Changing `switchLLMChannel` or `deregisterEvents` semantics.
202
+ - Changing the registered plugin name.
203
+
204
+ ### Never
205
+
206
+ - Edit `dist/` by hand.
207
+ - Commit secrets, tokens, or credentials, including in test fixtures.
208
+ - Log transcripts, highlights, speaker names, or manual-caption text.
209
+ - Add a `.sdd/templates` directory, a copy of the templates, or a link to them in this package. The
210
+ templates live once at the monorepo root, `../../../.sdd/templates/repo-standards`, and
211
+ `.sdd/manifest.json` refers to them through `layout.monorepo_package`.