@webex/plugin-device-manager 3.13.0-next.1 → 3.13.0-next.10

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,407 @@
1
+ {
2
+ "manifest_version": 1,
3
+ "repository": {
4
+ "name": "@webex/plugin-device-manager",
5
+ "purpose": "Public plugin registered as webex.devicemanager that manages the user's Webex room devices and Lyra spaces: refresh lists the recent auxiliary devices from WDM (devices/auxiliary) into a module-level collection that getAll reads, upsert and remove add and delete WDM entries, search finds devices through the directory search plugin, get resolves the Lyra endpoint for an ultrasound token, requestPin and pair run a Lyra PIN challenge and record the paired device on the instance, bindSpace and unbindSpace bind a conversation to the paired device, getAudioState and the mute and volume methods call the Lyra device API for the paired device and reject without one, while putAudioState passes the caller's space and audio state to Lyra with no pairing guard. A Mercury lyra.space_updated listener drops a pairing Lyra no longer verifies. User-assigned device names are decrypted through the encryption plugin. Argument and pairing guards log and reject with DeviceManager#method messages; Lyra, search, and WDM failures are logged and rejected, except that audio failures reject unlogged, refresh logs and resolves undefined, and the Mercury handler logs and resolves; a failed name decryption logs and yields undefined; nothing is persisted.",
6
+ "category": "cat2-legacy",
7
+ "primary_languages": [
8
+ "javascript"
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
+ "compile": {
19
+ "command": "yarn workspace @webex/plugin-device-manager build",
20
+ "source_file": "package.json",
21
+ "role": "compile"
22
+ },
23
+ "build": {
24
+ "command": "yarn workspace @webex/plugin-device-manager build:src",
25
+ "source_file": "package.json",
26
+ "role": "package"
27
+ },
28
+ "unit-test": {
29
+ "command": "yarn workspace @webex/plugin-device-manager test:unit",
30
+ "source_file": "package.json",
31
+ "role": "unit-test"
32
+ },
33
+ "lint": {
34
+ "command": "yarn workspace @webex/plugin-device-manager test:style",
35
+ "source_file": "package.json",
36
+ "role": "lint"
37
+ },
38
+ "browser-test": {
39
+ "command": "yarn workspace @webex/plugin-device-manager test:browser",
40
+ "source_file": "package.json",
41
+ "role": "other"
42
+ },
43
+ "deploy": {
44
+ "command": "yarn workspace @webex/plugin-device-manager deploy:npm",
45
+ "source_file": "package.json",
46
+ "role": "deploy"
47
+ }
48
+ },
49
+ "tests": {
50
+ "unit": {
51
+ "command_ref": "unit-test",
52
+ "dir": "test/unit/spec",
53
+ "framework": "jest"
54
+ }
55
+ },
56
+ "toolchain": [
57
+ {
58
+ "name": "node",
59
+ "version": ">=16",
60
+ "origin": "repo-config",
61
+ "source_file": "package.json"
62
+ },
63
+ {
64
+ "name": "node",
65
+ "version": "22.14",
66
+ "origin": "repo-config",
67
+ "source_file": "../../../AGENTS.md"
68
+ },
69
+ {
70
+ "name": "node",
71
+ "version": "lts/jod",
72
+ "origin": "repo-config",
73
+ "source_file": "../../../.nvmrc"
74
+ },
75
+ {
76
+ "name": "node",
77
+ "version": "18.x",
78
+ "origin": "repo-config",
79
+ "source_file": "../../../package.json"
80
+ },
81
+ {
82
+ "name": "yarn",
83
+ "version": "3.4.1",
84
+ "origin": "repo-config",
85
+ "source_file": "../../../package.json"
86
+ },
87
+ {
88
+ "name": "babel",
89
+ "version": "^7.17.10",
90
+ "origin": "repo-config",
91
+ "source_file": "package.json"
92
+ },
93
+ {
94
+ "name": "eslint",
95
+ "version": "^8.24.0",
96
+ "origin": "repo-config",
97
+ "source_file": "package.json"
98
+ },
99
+ {
100
+ "name": "prettier",
101
+ "version": "^2.7.1",
102
+ "origin": "repo-config",
103
+ "source_file": "package.json"
104
+ }
105
+ ],
106
+ "quality_gates": {
107
+ "code_coverage": {
108
+ "origin": "none",
109
+ "declared_by": "rarajes2@cisco.com via the 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)"
110
+ }
111
+ },
112
+ "coverage_status_definitions": {
113
+ "specced": ">=80% public surface specced, drift <5% - spec is authoritative",
114
+ "partial": "40-80% specced - spec is a hint, cross-check code",
115
+ "untracked": "<40% specced - code is the source of truth"
116
+ },
117
+ "spec_source_policy": {
118
+ "mode": "keep-separate",
119
+ "migrated_source_disposition": "retain",
120
+ "disposition_decided_by": "rarajes2@cisco.com",
121
+ "disposition_decided_at": "2026-11-13T02:25:00Z",
122
+ "decided_by": "rarajes2@cisco.com",
123
+ "decided_at": "2026-11-13T02:25:00Z",
124
+ "decision_record": "docs/adr/0001-retain-product-readme.md"
125
+ },
126
+ "spec_sources": [
127
+ {
128
+ "path": "README.md",
129
+ "scope": "repo",
130
+ "role": "reference-only",
131
+ "canonical": false,
132
+ "use_by_agents": "context-only",
133
+ "post_migration_action": "retain",
134
+ "deletion_status": "not-applicable",
135
+ "notes": "npm page, kept unchanged under keep-separate. It warns that the plugin is under active development with breaking changes. Its samples command (samples:devicemanager) is not defined in the workspace package.json, its connect snippet reads an undeclared webex, and its Typical flow chains methods on the array that getAll returns, so none of its examples run. It omits get, upsert, remove, getAudioState, putAudioState, setVolume, getPairedDevice, getPairedMethod, and setPairedMethod. See docs/adr/0001-retain-product-readme.md."
136
+ }
137
+ ],
138
+ "modules": [
139
+ {
140
+ "path": "src",
141
+ "canonical_spec": "src/docs/README.md",
142
+ "coverage_status": "Partial",
143
+ "coverage_evidence": "Field coverage 100% (15/15) assessed 2026-11-13 by the generator; critical field coverage 7/7. test:unit runs 14 passing jest cases in test/unit/spec/index.js covering getPairedDevice (MOD-016) and the paired-method accessors (MOD-017) only; registration, the WDM requests, search, get, the PIN flow, unpair, binding, audio, the Mercury handler, and name decryption (MOD-001, MOD-003 to MOD-015, MOD-018) and INV-001 and INV-003 to INV-006 have no unit case. The package has no integration spec; test:browser collects nothing and exits 0. build:src, build, test:unit, and test:style exit 0 (5 require-jsdoc warnings). Independent validation passed on 2026-11-13 with validator runtime 01a1d2c4-873e-7eb1-bbd2-4e40457e8616 and no findings. The prior code/spec findings were corrected, and the protected-spec drift-fix was explicitly approved through reconciliation. The module remains Partial pending unit cases, a characterization baseline, and promotion review.",
144
+ "last_assessed": "2026-11-13",
145
+ "contracts": {
146
+ "provides": [
147
+ "device-manager-public-sdk"
148
+ ],
149
+ "requires": [
150
+ "wdm-auxiliary-devices-http",
151
+ "lyra-internal-sdk",
152
+ "search-internal-sdk",
153
+ "mercury-lyra-space-events",
154
+ "internal-plugin-encryption-kms",
155
+ "internal-plugin-device-registration",
156
+ "webex-core-plugin-host",
157
+ "webex-core-services"
158
+ ]
159
+ },
160
+ "section_profile": {
161
+ "has_tiers": false,
162
+ "has_ui": false,
163
+ "crosses_service_boundaries": true,
164
+ "holds_client_state": true,
165
+ "enforces_domain_rules": true,
166
+ "is_concurrent_async": true,
167
+ "owns_persistence": false,
168
+ "stateful_transitions": true,
169
+ "exposes_wire_protocol": true,
170
+ "ui_multi_screen": false,
171
+ "large_data_model": false,
172
+ "returns_caller_errors": true,
173
+ "module_specific_conventions": true,
174
+ "published_package": true,
175
+ "embedded_in_host": false,
176
+ "has_design_tradeoff": true,
177
+ "resolved_by": "claude-code (code evidence; bootstrap questionnaire)",
178
+ "resolved_at": "2026-11-13T02:25:00Z",
179
+ "has_submodules": false,
180
+ "has_submodules_computed_by": "scripts/module_tree.py",
181
+ "has_submodules_computed_at": "2026-11-13T02:25:00Z"
182
+ }
183
+ }
184
+ ],
185
+ "contract_catalog": {
186
+ "index_path": "docs/architecture.md",
187
+ "definitions": {
188
+ "device-manager-public-sdk": {
189
+ "kind": "sdk",
190
+ "publication": "published",
191
+ "source_kind": "repository-path",
192
+ "source": "package.json",
193
+ "summary": "Published npm package (public plugin). main is dist/index.js and devMain is src/index.js; no type declarations are published. Importing it imports @webex/internal-plugin-device and registers DeviceManager as public plugin 'devicemanager' with config {}; src/device-manager.js also imports @webex/internal-plugin-lyra and @webex/internal-plugin-search. The first registration of the name wins. The entry exports the default DeviceManager and the named config. webex.devicemanager exposes getAll, refresh, search, upsert, get, remove, requestPin, pair, unpair, bindSpace, unbindSpace, getAudioState, putAudioState, mute, unmute, increaseVolume, decreaseVolume, setVolume, getPairedDevice, getPairedMethod, and setPairedMethod; specified in src/docs/README.md."
194
+ },
195
+ "wdm-auxiliary-devices-http": {
196
+ "kind": "http",
197
+ "publication": "internal",
198
+ "source_kind": "external",
199
+ "source": "WDM auxiliary devices API (catalog service name wdm, reached through api: 'wdm' in src/device-manager.js; route definitions are not in this repository)",
200
+ "summary": "GET devices/auxiliary answering {items: [device]}; PUT devices/auxiliary/Room/<id> with no body answering the added device; DELETE devices/auxiliary/<id>. A device carries id or identity.id, deviceClass, deviceInfo.machineType, and metadata.encryptedUserAssignedName with metadata.encryptionKeyUrl."
201
+ },
202
+ "lyra-internal-sdk": {
203
+ "kind": "sdk",
204
+ "publication": "published",
205
+ "source_kind": "external",
206
+ "source": "@webex/internal-plugin-lyra (workspace package; module spec consulted: packages/@webex/internal-plugin-lyra/src/docs/README.md MOD-003, MOD-005 to MOD-007, MOD-010, MOD-012, MOD-014, MOD-015, INV-001)",
207
+ "summary": "webex.internal.lyra.getAdvertisedEndpoint(token); space.get, join, leave, bindConversation, and unbindConversation; device.getAudioState, putAudioState, mute, unmute, increaseVolume, decreaseVolume, and setVolume. join, leave, and the bindings take a space whose url is the relative /spaces/<id>; this package passes the paired device (the space Lyra returned) to device.getAudioState and the mute and volume methods, and the caller's space to device.putAudioState. Its import registers the mercury and encryption plugins."
208
+ },
209
+ "search-internal-sdk": {
210
+ "kind": "sdk",
211
+ "publication": "published",
212
+ "source_kind": "external",
213
+ "source": "@webex/internal-plugin-search (workspace package; module spec consulted: packages/@webex/internal-plugin-search/src/docs/README.md MOD-004, UC-001)",
214
+ "summary": "webex.internal.search.people(options) POSTs options to argonaut directory and resolves the body; this package sends searchType DEVICE_SEARCH, searchEntity device, includePeople false, includeRooms true, queryString, and a v4 searchId."
215
+ },
216
+ "mercury-lyra-space-events": {
217
+ "kind": "event",
218
+ "publication": "internal",
219
+ "source_kind": "external",
220
+ "source": "@webex/internal-plugin-mercury (workspace package; module spec consulted for the emit scheme: packages/@webex/internal-plugin-mercury/src/docs/README.md MOD-009; code consulted: src/mercury.js)",
221
+ "summary": "webex.internal.mercury emits event:lyra.space_updated for an envelope whose data.eventType is lyra.space_updated; this package reads only data.spaceUrl. The mercury spec is stale on sessions, which this package does not use."
222
+ },
223
+ "internal-plugin-encryption-kms": {
224
+ "kind": "sdk",
225
+ "publication": "published",
226
+ "source_kind": "external",
227
+ "source": "@webex/internal-plugin-encryption (workspace package; no spec exists; code consulted: packages/@webex/internal-plugin-encryption/src/encryption.js)",
228
+ "summary": "webex.internal.encryption.decryptText(key, ciphertext) fetches the KMS key and resolves the plaintext; used for user-assigned device names. Not declared in package.json; registered through the Lyra plugin's import."
229
+ },
230
+ "internal-plugin-device-registration": {
231
+ "kind": "sdk",
232
+ "publication": "published",
233
+ "source_kind": "external",
234
+ "source": "@webex/internal-plugin-device (workspace package; module spec consulted: packages/@webex/internal-plugin-device/src/docs/README.md MOD-001)",
235
+ "summary": "Importing the package registers internal plugin device; the Lyra plugin sends webex.internal.device.url when this package joins and leaves spaces."
236
+ },
237
+ "webex-core-plugin-host": {
238
+ "kind": "sdk",
239
+ "publication": "published",
240
+ "source_kind": "external",
241
+ "source": "@webex/webex-core (workspace package; module spec consulted: packages/@webex/webex-core/src/docs/README.md MOD-013, MOD-014, MOD-028, MOD-043)",
242
+ "summary": "registerPlugin keys a public plugin by its raw name (devicemanager, first registration wins) and adds webex.<name> to later instances; WebexPlugin supplies webex, logger (falling back to console), config by namespace, and request, the one entry for plugin HTTP traffic."
243
+ },
244
+ "webex-core-services": {
245
+ "kind": "sdk",
246
+ "publication": "published",
247
+ "source_kind": "external",
248
+ "source": "@webex/webex-core services plugin (services spec consulted: packages/@webex/webex-core/src/lib/services/docs/README.md SVC-012, SVC-022)",
249
+ "summary": "webex.internal.services.waitForCatalog('postauth') resolves when the postauth catalog is ready or rejects after 60 seconds by default; get('wdm') returns the WDM service URL; a request with api and resource is joined to the catalog URL."
250
+ }
251
+ }
252
+ },
253
+ "spec_policy": {
254
+ "require_what_and_why": true,
255
+ "require_provenance": true,
256
+ "protected_specs": [
257
+ "src/docs/README.md"
258
+ ]
259
+ },
260
+ "validation": {
261
+ "generator_runtime": "claude-code",
262
+ "generator_model": "claude-opus-5-5",
263
+ "generator_runtime_source": "host-metadata",
264
+ "source_commit": "c22331c97be69968deddf2f8d55d26c84ae2c1ac",
265
+ "minimum_independence": "different-runtime",
266
+ "blocking_severities": [
267
+ "Blocking"
268
+ ],
269
+ "validator_runtime": "01a1d2c4-873e-7eb1-bbd2-4e40457e8616",
270
+ "validator_runtime_source": "invocation-input",
271
+ "runtime_fallback_tier": "different-runtime"
272
+ },
273
+ "layout": {
274
+ "sdd_root": ".sdd",
275
+ "docs_root": "docs",
276
+ "agent_entry_path": "AGENTS.md",
277
+ "standing_docs_root": "docs",
278
+ "spec_index_path": "docs/specs/README.md",
279
+ "module_docs_strategy": "source-local",
280
+ "module_docs_relative_path": "docs/README.md",
281
+ "module_docs_decision": {
282
+ "basis": "repo-standards-default",
283
+ "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, so Markdown under src/ does not enter dist/.",
284
+ "decided_by": "rarajes2@cisco.com (bootstrap questionnaire)",
285
+ "decided_at": "2026-11-13T02:25:00Z"
286
+ },
287
+ "repo_context_decision": {
288
+ "path": ".repo-context.json",
289
+ "schema_path": "schemas/repo-context.schema.json",
290
+ "action": "create",
291
+ "schema_action": "create",
292
+ "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.",
293
+ "decided_by": "rarajes2@cisco.com (bootstrap questionnaire)",
294
+ "decided_at": "2026-11-13T02:25:00Z"
295
+ },
296
+ "artifact_decisions": [
297
+ {
298
+ "path": "docs/service.md",
299
+ "action": "omit",
300
+ "reason": "Library package, not a deployable service. package.json has no start script, container, or deployment descriptor.",
301
+ "decided_by": "claude-code (code evidence)",
302
+ "decided_at": "2026-11-13T02:25:00Z"
303
+ },
304
+ {
305
+ "path": "mkdocs.yml",
306
+ "action": "omit",
307
+ "reason": "No package-level documentation site exists. Documentation publishing stays with the workspace.",
308
+ "decided_by": "claude-code (code evidence)",
309
+ "decided_at": "2026-11-13T02:25:00Z"
310
+ },
311
+ {
312
+ "path": "api-specs/openapi.yaml",
313
+ "action": "omit",
314
+ "reason": "The package serves no HTTP routes. It is a client of the WDM auxiliary devices API and, through internal plugins, of the Lyra, directory search, and KMS services; its published surface is the npm export described by device-manager-public-sdk.",
315
+ "decided_by": "claude-code (code evidence)",
316
+ "decided_at": "2026-11-13T02:25:00Z"
317
+ },
318
+ {
319
+ "path": "SECURITY.md",
320
+ "action": "omit",
321
+ "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.",
322
+ "decided_by": "claude-code (code evidence)",
323
+ "decided_at": "2026-11-13T02:25:00Z"
324
+ },
325
+ {
326
+ "path": "CONTRIBUTING.md",
327
+ "action": "omit",
328
+ "reason": "Contribution instructions are owned at the workspace root CONTRIBUTING.md.",
329
+ "decided_by": "claude-code (code evidence)",
330
+ "decided_at": "2026-11-13T02:25:00Z"
331
+ },
332
+ {
333
+ "path": "CHANGELOG.md",
334
+ "action": "omit",
335
+ "reason": "Changelog generation is owned at the workspace root. This package has no changelog file.",
336
+ "decided_by": "claude-code (code evidence)",
337
+ "decided_at": "2026-11-13T02:25:00Z"
338
+ },
339
+ {
340
+ "path": "CTO_CHECKLIST.yml",
341
+ "action": "omit",
342
+ "reason": "The CTO readiness checklist applies to deployable services. This package is a library.",
343
+ "decided_by": "claude-code (code evidence)",
344
+ "decided_at": "2026-11-13T02:25:00Z"
345
+ },
346
+ {
347
+ "path": "schemas/cto-checklist.schema.json",
348
+ "action": "omit",
349
+ "reason": "Omitted together with CTO_CHECKLIST.yml.",
350
+ "decided_by": "claude-code (code evidence)",
351
+ "decided_at": "2026-11-13T02:25:00Z"
352
+ }
353
+ ],
354
+ "template_roots": {
355
+ "canonical": ".sdd/templates/repo-standards"
356
+ },
357
+ "contract_index_path": "docs/architecture.md",
358
+ "repo_skills_root": ".sdd/skills",
359
+ "monorepo_package": {
360
+ "package_path": "packages/@webex/plugin-device-manager",
361
+ "root_manifest_path": "../../../.sdd/manifest.json",
362
+ "templates_root_path": "../../../.sdd/templates/repo-standards"
363
+ }
364
+ },
365
+ "tooling": {
366
+ "sdlc_skills": {
367
+ "source_ref": "repo-annotation@2.3.1"
368
+ }
369
+ },
370
+ "coverage_ratchet": {
371
+ "enabled": true,
372
+ "waivers": []
373
+ },
374
+ "substrate": {
375
+ "source": "WebexTools/repo-standards@d89a7fe59126ae3ad9bac9ca352aa7f12b4c85dc",
376
+ "consumed": [
377
+ "@webex/eslint-config-legacy via .eslintrc.js",
378
+ "@webex/babel-config-legacy via babel.config.js",
379
+ "@webex/jest-config-legacy via jest.config.js",
380
+ "@webex/legacy-tools build and test runner via package.json",
381
+ "package README.md (context only)",
382
+ "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)"
383
+ ],
384
+ "compliance_tier": "baseline"
385
+ },
386
+ "section_profiles": {
387
+ "repo": {
388
+ "owns_datastore": false,
389
+ "holds_client_state": true,
390
+ "components_interact": true,
391
+ "domain_data_across_components": true,
392
+ "caches_data": true,
393
+ "observability_convention": true,
394
+ "deploys_to_infra": false,
395
+ "shared_base_libs": true,
396
+ "is_monorepo": false,
397
+ "multi_platform": false,
398
+ "published_package": true,
399
+ "embedded_in_host": false,
400
+ "cross_repo_deps_material": true,
401
+ "security_arch_warranted": true,
402
+ "exposes_commands_or_artifacts": true
403
+ },
404
+ "resolved_by": "claude-code (code evidence; bootstrap questionnaire)",
405
+ "resolved_at": "2026-11-13T02:25:00Z"
406
+ }
407
+ }
package/AGENTS.md ADDED
@@ -0,0 +1,214 @@
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-13T03:13:49Z
7
+ validation_status: pass
8
+ -->
9
+
10
+ # AI Agent Instructions
11
+
12
+ Package-scoped SDD entry for `@webex/plugin-device-manager`, the public `devicemanager` plugin of the
13
+ SDK (it lists the user's room devices and Lyra spaces, pairs with one by PIN, binds a conversation to
14
+ it, and controls its audio). This file orients agents. The monorepo root `AGENTS.md` governs
15
+ 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, method names, or request paths. Verify them from this
23
+ package's source.
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) (Device Manager plugin); and
35
+ - [`docs/adr/index.md`](docs/adr/index.md) plus applicable concrete ADRs.
36
+
37
+ Follow `.sdd/manifest.json` for each contract's publication state and canonical source. This package
38
+ publishes a public SDK surface, so its contract artifact is `package.json` plus the `src/index.js`
39
+ entry. It serves no HTTP, so no OpenAPI applies.
40
+
41
+ ## 1. Commands (Run First)
42
+
43
+ Use only documented commands. Do not invent alternatives when a command is missing. Run everything from the workspace root: `yarn` to install, and
44
+ `yarn workspace @webex/plugin-device-manager <script>` for the package scripts below.
45
+
46
+ | Task | Command |
47
+ | ---------------------- | ------- |
48
+ | Install dependencies | `yarn` (workspace root; the deploy workflow runs the same command) |
49
+ | Start dev environment | N/A — library package with no start script in `package.json` |
50
+ | Run tests | `yarn workspace @webex/plugin-device-manager test:unit` |
51
+ | Run linters | `yarn workspace @webex/plugin-device-manager test:style` |
52
+ | Build/release artifact | `yarn workspace @webex/plugin-device-manager build:src` (JavaScript and source maps to `dist/`) |
53
+ | Format code | N/A — no format script; `prettier` is a devDependency used through eslint |
54
+
55
+ `yarn workspace @webex/plugin-device-manager build` runs `build:src` and produces the same output; the package emits no type
56
+ declarations.
57
+
58
+ Do not use the aggregate `test` script: after lint and unit tests it calls `test:integration`, which
59
+ this package does not define, and exits 1. `yarn workspace @webex/plugin-device-manager test:browser` exits 0 without running anything,
60
+ because the package has no `test/integration` directory; see
61
+ [Getting started](docs/getting-started.md#tests).
62
+
63
+ If a required command is unknown, stop and ask for the exact command.
64
+
65
+ ## 2. Agent Persona and Scope
66
+
67
+ You are the Webex JS SDK engineering assistant for `@webex/plugin-device-manager`.
68
+
69
+ Primary outcomes:
70
+
71
+ - Deliver production-safe changes with build, lint, and unit tests passing.
72
+ - Preserve existing behavior unless a change request explicitly requires a behavior change.
73
+ - Keep docs and configuration aligned with code changes.
74
+
75
+ Definition of done:
76
+
77
+ 1. Requested change is implemented.
78
+ 2. Build, lint, and unit tests pass locally.
79
+ 3. Updated docs cover new behavior, including the owning module spec.
80
+ 4. PR summary includes risks and rollback notes.
81
+
82
+ ## 3. Repository Knowledge
83
+
84
+ ### Tech Stack
85
+
86
+ | Area | Tooling | Version |
87
+ | ---------------- | ------- | ------- |
88
+ | Language runtime | node; JavaScript sources | 22.14 (workspace root `AGENTS.md`; `.nvmrc` `lts/jod`); package `engines` accepts `>=16`; the workspace root `package.json` `engines.node` reads `18.x` |
89
+ | Build tool | yarn workspaces and `@webex/legacy-tools` over babel | yarn `3.4.1` (root `packageManager`), `@babel/core` `^7.17.10` |
90
+ | Test framework | jest through `webex-legacy-tools test --unit --runner jest`, with sinon and `@webex/test-helper-chai` | `@webex/jest-config-legacy` (`workspace:*`) |
91
+ | Lint/format | eslint via `@webex/eslint-config-legacy`, prettier | eslint `^8.24.0`, prettier `^2.7.1` |
92
+
93
+ ### Project Map
94
+
95
+ - `src/index.js`: imports the device plugin, registers public plugin `devicemanager` with config
96
+ `{}`, and exports `DeviceManager` (default) and `config`.
97
+ - `src/device-manager.js`: `DeviceManager` — recent devices, search, PIN pairing, binding, audio, the
98
+ `lyra.space_updated` handler, and name decryption.
99
+ - `src/collection.js`: `DeviceCollection`, the device list shared by every instance in the process.
100
+ - `src/constants.js`, `src/config.js`: constants and the empty plugin config.
101
+ - `test/unit/spec/index.js`: unit cases for `getPairedDevice` and the paired-method accessors.
102
+ - `webex.js`, `sample/`: a browser harness and page for manual trials; nothing builds or runs them.
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; its sample script and chained usage do not run; see
106
+ [ADR-0001](docs/adr/0001-retain-product-readme.md).
107
+ - Spec for every file under `src/`: `src/docs/README.md`.
108
+
109
+ ### Critical Constraints
110
+
111
+ - The plugin is `webex.devicemanager`; `webex` and `webex-node` register it by import (`MOD-001` in
112
+ the module spec).
113
+ - `unpair`, the binding methods, and every audio method except `putAudioState` need a paired device
114
+ and reject without one; `putAudioState` sends the caller's space with no guard (`INV-001`).
115
+ - Audio failures reject unlogged; `refresh` logs a failure and resolves `undefined` (`INV-006`).
116
+ - Only `upsert` sets the paired device, always from the pending PIN device (`INV-003`); `pair` relies
117
+ on this.
118
+ - The device list is one object per loaded module, shared by every instance (`INV-004`).
119
+ - Lyra join, leave, and binding calls take relative `/spaces/<id>` URLs (`INV-005`).
120
+
121
+ ## 4. Testing Workflow
122
+
123
+ Run checks in this order, from the workspace root:
124
+
125
+ 1. `yarn workspace @webex/plugin-device-manager build:src`
126
+ 2. `yarn workspace @webex/plugin-device-manager test:unit`
127
+ 3. `yarn workspace @webex/plugin-device-manager test:style`
128
+
129
+ Fresh-checkout workspace setup (building `webex-legacy-tools` and sibling `dist/`) is owned by the
130
+ workspace root; see [Prebuilding](../../../CONTRIBUTING.md#prebuilding).
131
+
132
+ Testing rules:
133
+
134
+ - Add or update tests in `test/unit/spec` for every behavior change; most methods have no unit case
135
+ today, so pin current behavior first.
136
+ - Use sinon stubs for `webex.request`, `webex.internal.lyra`, `webex.internal.search`,
137
+ `webex.internal.encryption`, and `webex.internal.services`, and a stub `internal.mercury.on`, as the
138
+ existing spec does; assert with `@webex/test-helper-chai`.
139
+ - Use `assert.calledOnceWithExactly` for request and Lyra arguments, and parametrize when more than
140
+ three cases are alike, such as the pairing guards of the six guarded audio methods.
141
+ - `DeviceCollection` is shared module state: restore or reset it between cases.
142
+ - Cover failure paths and edge cases, not only happy paths, such as a wrong PIN and a failed refresh.
143
+ - Do not remove tests to make CI pass.
144
+
145
+ No coverage gate applies to this package; do not infer one.
146
+
147
+ ## 5. Code Style and Patterns
148
+
149
+ Coding expectations:
150
+
151
+ - Follow repository style rules and static analysis output. The local `.eslintrc.js` sets
152
+ `root: true` and extends the legacy config.
153
+ - Prefer small functions over large procedural blocks.
154
+ - Make error handling explicit.
155
+ - Keep public interfaces stable unless a breaking change is requested.
156
+
157
+ Pattern example:
158
+
159
+ ```text
160
+ Preferred:
161
+ - In the fifteen guarded methods (INV-006), guard at the top: this.logger.error('DeviceManager#mute: ...') and return Promise.reject(new Error(same message)).
162
+ - Build Lyra spaces as {url: `/spaces/${id}`, id} for join, leave, and bindings.
163
+ - Resolve ids with device.id || (device.identity && device.identity.id).
164
+
165
+ Avoid:
166
+ - Calling Lyra or WDM URLs directly instead of going through webex.internal.lyra or webex.request with api 'wdm'.
167
+ - Changing pairing state anywhere other than requestPin, upsert, bindSpace, unbindSpace, and the Mercury handler.
168
+ - Copying the README usage chain, which calls methods on getAll()'s array.
169
+ - Adding guards, log lines, or rejections to getAll, refresh, putAudioState, or the paired-device and paired-method accessors.
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 applications that call `webex.devicemanager`, and on the `webex` and
185
+ `webex-node` bundles.
186
+ - Rollback approach.
187
+
188
+ ## 7. Boundaries and Escalation
189
+
190
+ ### Always
191
+
192
+ - Prefer existing patterns over introducing new architecture.
193
+ - Keep changes minimal for the requested scope.
194
+ - Call out assumptions and unknowns explicitly.
195
+ - Update the owning module spec in the same change that alters observable behavior.
196
+
197
+ ### Ask First
198
+
199
+ - Adding or removing dependencies, including declaring the mercury and encryption plugins the code
200
+ already uses.
201
+ - Renaming or removing a method, an option, or the registered plugin name.
202
+ - Changing the pairing transitions, including the recorded `upsert`, `unpair`, and Mercury-handler
203
+ behavior, since callers may rely on it.
204
+ - Making the device list per instance, or changing what `refresh` stores or resolves.
205
+
206
+ ### Never
207
+
208
+ - Edit `dist/` by hand.
209
+ - Commit secrets, tokens, or credentials, including in test fixtures.
210
+ - Log PINs, decrypted device names, KMS key URLs, ultrasound tokens, or search queries through
211
+ `webex.logger`.
212
+ - Add a `.sdd/templates` directory, a copy of the templates, or a link to them in this package. The
213
+ templates live once at the monorepo root, `../../../.sdd/templates/repo-standards`, and
214
+ `.sdd/manifest.json` refers to them through `layout.monorepo_package`.
@@ -555,7 +555,7 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
555
555
  setPairedMethod: function setPairedMethod(pairedMethod) {
556
556
  this._pairedMethod = pairedMethod;
557
557
  },
558
- version: "3.13.0-next.1"
558
+ version: "3.13.0-next.10"
559
559
  });
560
560
  var _default = exports.default = DeviceManager;
561
561
  //# sourceMappingURL=device-manager.js.map