@webex/plugin-encryption 3.13.0-next.1 → 3.13.0-next.11

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,425 @@
1
+ {
2
+ "manifest_version": 1,
3
+ "repository": {
4
+ "name": "@webex/plugin-encryption",
5
+ "purpose": "Public Webex JS SDK plugin registered as webex.cypher that downloads and decrypts encrypted Webex files. downloadAndDecryptFile reads the KMS key URI and the JWE-encrypted SCR from the keyUri and JWE query parameters of the file URL, or from the options, asks webex.internal.encryption to decrypt the SCR with the KMS key, and returns the internal download of the file decrypted with that SCR, either directly from the URL (the default) or through the Webex files service. register and deregister register the SDK device with WDM through webex.internal.device and track the result in a registered flag. The package main, src/webex.js, is a small CommonJS Webex constructor that loads only the authorization, internal encryption, and cypher plugins; the workspace also builds it as the UMD encryption bundle.",
6
+ "category": "cat2-legacy",
7
+ "primary_languages": [
8
+ "typescript",
9
+ "javascript"
10
+ ]
11
+ },
12
+ "topology": "Orchestrator-plus-components",
13
+ "commands": {
14
+ "install": {
15
+ "command": "yarn",
16
+ "source_file": "../../../.github/workflows/deploy.yml",
17
+ "role": "install"
18
+ },
19
+ "compile": {
20
+ "command": "yarn workspace @webex/plugin-encryption build",
21
+ "source_file": "package.json",
22
+ "role": "compile"
23
+ },
24
+ "build": {
25
+ "command": "yarn workspace @webex/plugin-encryption build:src",
26
+ "source_file": "package.json",
27
+ "role": "package"
28
+ },
29
+ "unit-test": {
30
+ "command": "yarn workspace @webex/plugin-encryption test:unit",
31
+ "source_file": "package.json",
32
+ "role": "unit-test"
33
+ },
34
+ "lint": {
35
+ "command": "yarn workspace @webex/plugin-encryption test:style",
36
+ "source_file": "package.json",
37
+ "role": "lint"
38
+ },
39
+ "browser-test": {
40
+ "command": "yarn workspace @webex/plugin-encryption test:browser",
41
+ "source_file": "package.json",
42
+ "role": "other"
43
+ },
44
+ "docs-build": {
45
+ "command": "yarn workspace @webex/plugin-encryption build:docs",
46
+ "source_file": "package.json",
47
+ "role": "other"
48
+ },
49
+ "deploy": {
50
+ "command": "yarn workspace @webex/plugin-encryption deploy:npm",
51
+ "source_file": "package.json",
52
+ "role": "deploy"
53
+ }
54
+ },
55
+ "tests": {
56
+ "unit": {
57
+ "command_ref": "unit-test",
58
+ "dir": "test/unit/spec",
59
+ "framework": "jest"
60
+ }
61
+ },
62
+ "toolchain": [
63
+ {
64
+ "name": "node",
65
+ "version": ">=16",
66
+ "origin": "repo-config",
67
+ "source_file": "package.json"
68
+ },
69
+ {
70
+ "name": "node",
71
+ "version": "22.14",
72
+ "origin": "repo-config",
73
+ "source_file": "../../../AGENTS.md"
74
+ },
75
+ {
76
+ "name": "node",
77
+ "version": "lts/jod",
78
+ "origin": "repo-config",
79
+ "source_file": "../../../.nvmrc"
80
+ },
81
+ {
82
+ "name": "node",
83
+ "version": "18.x",
84
+ "origin": "repo-config",
85
+ "source_file": "../../../package.json"
86
+ },
87
+ {
88
+ "name": "yarn",
89
+ "version": "3.4.1",
90
+ "origin": "repo-config",
91
+ "source_file": "../../../package.json"
92
+ },
93
+ {
94
+ "name": "typescript",
95
+ "version": "^4.9.5",
96
+ "origin": "repo-config",
97
+ "source_file": "package.json"
98
+ },
99
+ {
100
+ "name": "babel",
101
+ "version": "^7.22.11",
102
+ "origin": "repo-config",
103
+ "source_file": "package.json"
104
+ },
105
+ {
106
+ "name": "eslint",
107
+ "version": "^8.24.0",
108
+ "origin": "repo-config",
109
+ "source_file": "package.json"
110
+ },
111
+ {
112
+ "name": "prettier",
113
+ "version": "^2.7.1",
114
+ "origin": "repo-config",
115
+ "source_file": "package.json"
116
+ },
117
+ {
118
+ "name": "typedoc",
119
+ "version": "0.23.26",
120
+ "origin": "repo-config",
121
+ "source_file": "package.json"
122
+ }
123
+ ],
124
+ "quality_gates": {
125
+ "code_coverage": {
126
+ "origin": "repo-config",
127
+ "source_file": "jest.config.js",
128
+ "min": 85,
129
+ "kind": "unit-test",
130
+ "applies_to": "total",
131
+ "enforced": true
132
+ }
133
+ },
134
+ "coverage_status_definitions": {
135
+ "specced": ">=80% public surface specced, drift <5% - spec is authoritative",
136
+ "partial": "40-80% specced - spec is a hint, cross-check code",
137
+ "untracked": "<40% specced - code is the source of truth"
138
+ },
139
+ "spec_source_policy": {
140
+ "mode": "keep-separate",
141
+ "migrated_source_disposition": "retain",
142
+ "disposition_decided_by": "rarajes2@cisco.com",
143
+ "disposition_decided_at": "2026-11-16T06:56:00Z",
144
+ "decided_by": "rarajes2@cisco.com",
145
+ "decided_at": "2026-11-16T06:56:00Z",
146
+ "decision_record": "docs/adr/0001-retain-product-docs.md"
147
+ },
148
+ "spec_sources": [
149
+ {
150
+ "path": "README.md",
151
+ "scope": "repo",
152
+ "role": "reference-only",
153
+ "canonical": false,
154
+ "use_by_agents": "context-only",
155
+ "post_migration_action": "retain",
156
+ "deletion_status": "not-applicable",
157
+ "notes": "npm page, kept unchanged under keep-separate. Its install, CDN, and sample-code sections agree with src/webex.js and src/cypher/index.ts. Its KMS certificate validation section describes config.encryption fields owned by @webex/internal-plugin-encryption, not this package. Its Development section names a src/@webex/plugin-encryption folder that does not exist. See docs/adr/0001-retain-product-docs.md."
158
+ },
159
+ {
160
+ "path": "developer-quickstart.md",
161
+ "scope": "repo",
162
+ "role": "reference-only",
163
+ "canonical": false,
164
+ "use_by_agents": "context-only",
165
+ "post_migration_action": "retain",
166
+ "deletion_status": "not-applicable",
167
+ "notes": "Guide for the encryption sample app in the workspace docs/samples/plugin-encryption, kept unchanged. Its token, init, register, and decrypt snippets agree with the code; its build steps are workspace scripts. See docs/adr/0001-retain-product-docs.md."
168
+ }
169
+ ],
170
+ "modules": [
171
+ {
172
+ "path": "src",
173
+ "canonical_spec": "src/docs/README.md",
174
+ "coverage_status": "Partial",
175
+ "coverage_evidence": "Field coverage 100% (16/16 applicable; data, schema, and migration discipline not applicable) assessed 2026-11-16 by the generator; critical field coverage 7/7. build:src and test:unit pass: 1 suite, 11 of 11 jest cases (2026-11-16T06:52:35Z), with statements 96.95% and branches 95.65% over the two measured files against the enforced 85% threshold. The unit cases cover register, deregister, and the downloadAndDecryptFile happy path, options fallback, missing values, and failures by substring; there is no unit case for plugin registration, the invalid-URL path, the URL-wins and one-value cases, the standalone constructor, or the four known defects. Generator probes against the built dist found four behaviors the owner records as known defects, not promises: unwrapped download errors, unobservable progress events, types disagreeing with main, and Webex.init merging src/webex-config.ts under config.default so its defaults are not applied. test:browser runs nothing (no test/integration). test:style exits 0 (6 warnings in src/webex.js, plus File ignored for src/docs/README.md; 2026-11-16T07:06:32Z). Independent validation passed on 2026-11-16 by validator runtime 01a1e332-5dfd-75c0-a6ab-fce7e722caa5: 0 Blocking, 0 findings. The module remains Partial pending the documented test gaps, a characterization baseline, and promotion review.",
176
+ "last_assessed": "2026-11-16",
177
+ "contracts": {
178
+ "provides": [
179
+ "plugin-encryption-sdk",
180
+ "encryption-umd-entry",
181
+ "encrypted-attachment-url"
182
+ ],
183
+ "requires": [
184
+ "internal-plugin-encryption-sdk",
185
+ "internal-plugin-device-registration",
186
+ "webex-core-plugin-host",
187
+ "plugin-authorization-entry"
188
+ ]
189
+ },
190
+ "section_profile": {
191
+ "has_tiers": false,
192
+ "has_ui": false,
193
+ "crosses_service_boundaries": true,
194
+ "holds_client_state": true,
195
+ "enforces_domain_rules": true,
196
+ "is_concurrent_async": true,
197
+ "owns_persistence": false,
198
+ "stateful_transitions": true,
199
+ "exposes_wire_protocol": true,
200
+ "ui_multi_screen": false,
201
+ "large_data_model": false,
202
+ "returns_caller_errors": true,
203
+ "module_specific_conventions": true,
204
+ "published_package": true,
205
+ "embedded_in_host": false,
206
+ "has_design_tradeoff": true,
207
+ "resolved_by": "claude-code (code evidence; bootstrap questionnaire)",
208
+ "resolved_at": "2026-11-16T06:56:00Z",
209
+ "has_submodules": false,
210
+ "has_submodules_computed_by": "scripts/module_tree.py",
211
+ "has_submodules_computed_at": "2026-11-16T06:56:00Z"
212
+ }
213
+ }
214
+ ],
215
+ "contract_catalog": {
216
+ "index_path": "docs/architecture.md",
217
+ "definitions": {
218
+ "plugin-encryption-sdk": {
219
+ "kind": "sdk",
220
+ "publication": "published",
221
+ "source_kind": "repository-path",
222
+ "source": "package.json",
223
+ "summary": "Published npm package @webex/plugin-encryption. main and exports['.'] are dist/webex.js (src/webex.js), whose CommonJS export is a Webex constructor with Webex.init(attrs); devMain is src/index.ts and types is dist/types/index.d.ts, which declares the default export Cypher and the types FileDownloadOptions and IEncryption, so the declared default does not match the runtime main. Importing src/index.ts registers public plugin cypher with config {cypher: {}}. webex.cypher exposes register(), deregister(), downloadAndDecryptFile(fileUri, {useFileService, keyUri, jwe}), and the public registered flag. Specified in src/docs/README.md."
224
+ },
225
+ "encryption-umd-entry": {
226
+ "kind": "file",
227
+ "publication": "published",
228
+ "source_kind": "repository-path",
229
+ "source": "src/webex.js",
230
+ "summary": "The workspace webpack.config.js builds its UMD entry encryption, library name Webex, from this file; the webex package ships it as umd/encryption.min.js (webex module spec MOD-019 names this package as the owner of its behavior). It requires the polyfill when needed, @webex/plugin-authorization, @webex/internal-plugin-encryption, and ./index, then extends WebexCore with version PACKAGE_VERSION."
231
+ },
232
+ "encrypted-attachment-url": {
233
+ "kind": "http",
234
+ "publication": "internal",
235
+ "source_kind": "repository-path",
236
+ "source": "src/cypher/index.ts",
237
+ "summary": "An encrypted attachment URL is an absolute https file URL whose case-sensitive query parameters keyUri (the KMS key URI) and JWE (the compact JWE of the file SCR) carry the decryption inputs. downloadAndDecryptFile reads both with URLSearchParams.get, and GETs the whole URL, query included, through webex.internal.encryption.download."
238
+ },
239
+ "internal-plugin-encryption-sdk": {
240
+ "kind": "sdk",
241
+ "publication": "published",
242
+ "source_kind": "external",
243
+ "source": "@webex/internal-plugin-encryption (workspace package; module spec consulted: packages/@webex/internal-plugin-encryption/src/docs/README.md MOD-007, MOD-009, MOD-010)",
244
+ "summary": "webex.internal.encryption.decryptScr(key, cipherScr) resolves the key through getKey (key cache, then KMS) and resolves SCR.fromJWE. download(fileUrl, scr, options) rejects without both arguments, defaults useFileService to true, rejects a direct URL that does not start with https:// when useFileService is false, otherwise looks up the download URL with POST /v1/download/endpoints and falls back to the original URL, GETs the bytes, emits progress events on its returned promise, and resolves decryptBinary(scr, body)."
245
+ },
246
+ "internal-plugin-device-registration": {
247
+ "kind": "sdk",
248
+ "publication": "published",
249
+ "source_kind": "external",
250
+ "source": "@webex/internal-plugin-device (workspace package, not declared in package.json; module spec consulted: packages/@webex/internal-plugin-device/src/docs/README.md MOD-001, MOD-005, MOD-011)",
251
+ "summary": "webex.internal.device.register() registers with WDM, or refreshes when already registered; unregister() resolves at once when unregistered, otherwise DELETEs the device and clears local state, and a 404 clears local state but still rejects. The device plugin's onBeforeLogout hook calls unregister()."
252
+ },
253
+ "webex-core-plugin-host": {
254
+ "kind": "sdk",
255
+ "publication": "published",
256
+ "source_kind": "external",
257
+ "source": "@webex/webex-core (workspace package; module spec consulted: packages/@webex/webex-core/src/docs/README.md MOD-008, MOD-009, MOD-013, MOD-044)",
258
+ "summary": "registerPlugin(name, ctor, {config}) returns without change when the name is already registered unless replace is set, and merges config into the default config; WebexPlugin.config reads the lowercased namespace key of webex.config; the default config uses memory storage adapters; WebexCore.extend builds a constructor whose instances carry the public plugins registered before it; MemoryStoreAdapter is re-exported."
259
+ },
260
+ "plugin-authorization-entry": {
261
+ "kind": "sdk",
262
+ "publication": "published",
263
+ "source_kind": "external",
264
+ "source": "@webex/plugin-authorization (workspace package, not declared in package.json; module spec consulted: packages/@webex/plugin-authorization/src/docs/README.md)",
265
+ "summary": "Importing the package loads the Node or browser authorization plugin, chosen by its browser field; each imports @webex/internal-plugin-device and registers public plugin authorization."
266
+ }
267
+ }
268
+ },
269
+ "spec_policy": {
270
+ "require_what_and_why": true,
271
+ "require_provenance": true,
272
+ "protected_specs": [
273
+ "src/docs/README.md"
274
+ ]
275
+ },
276
+ "validation": {
277
+ "generator_runtime": "claude-code",
278
+ "generator_model": "claude-opus-5-5",
279
+ "generator_runtime_source": "host-metadata",
280
+ "source_commit": "d5b58d84f152969a44cb4999fc54a9bdd7bd4456",
281
+ "base_ref": "next",
282
+ "minimum_independence": "different-runtime",
283
+ "blocking_severities": [
284
+ "Blocking"
285
+ ],
286
+ "validator_runtime": "01a1e332-5dfd-75c0-a6ab-fce7e722caa5",
287
+ "validator_runtime_source": "invocation-input",
288
+ "runtime_fallback_tier": "different-runtime"
289
+ },
290
+ "layout": {
291
+ "sdd_root": ".sdd",
292
+ "docs_root": "docs",
293
+ "agent_entry_path": "AGENTS.md",
294
+ "standing_docs_root": "docs",
295
+ "spec_index_path": "docs/specs/README.md",
296
+ "module_docs_strategy": "source-local",
297
+ "module_docs_relative_path": "docs/README.md",
298
+ "module_docs_decision": {
299
+ "basis": "repo-standards-default",
300
+ "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 compiles -js -ts only and yarn workspace @webex/plugin-encryption build emits declarations for src (tsconfig.json include), so Markdown under src/ does not enter dist/.",
301
+ "decided_by": "rarajes2@cisco.com (bootstrap questionnaire)",
302
+ "decided_at": "2026-11-16T06:56:00Z"
303
+ },
304
+ "repo_context_decision": {
305
+ "path": ".repo-context.json",
306
+ "schema_path": "schemas/repo-context.schema.json",
307
+ "action": "create",
308
+ "schema_action": "create",
309
+ "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.",
310
+ "decided_by": "rarajes2@cisco.com (bootstrap questionnaire)",
311
+ "decided_at": "2026-11-16T06:56:00Z"
312
+ },
313
+ "artifact_decisions": [
314
+ {
315
+ "path": "docs/service.md",
316
+ "action": "omit",
317
+ "reason": "Library package, not a deployable service. package.json has no start script, container, or deployment descriptor.",
318
+ "decided_by": "claude-code (code evidence)",
319
+ "decided_at": "2026-11-16T06:56:00Z"
320
+ },
321
+ {
322
+ "path": "mkdocs.yml",
323
+ "action": "omit",
324
+ "reason": "No package-level documentation site exists. The build:docs typedoc output and documentation publishing stay with the workspace.",
325
+ "decided_by": "claude-code (code evidence)",
326
+ "decided_at": "2026-11-16T06:56:00Z"
327
+ },
328
+ {
329
+ "path": "api-specs/openapi.yaml",
330
+ "action": "omit",
331
+ "reason": "The package serves no HTTP routes. It reaches KMS, WDM, and file hosts only through internal plugins; its published surface is the npm export described by plugin-encryption-sdk.",
332
+ "decided_by": "claude-code (code evidence)",
333
+ "decided_at": "2026-11-16T06:56:00Z"
334
+ },
335
+ {
336
+ "path": "SECURITY.md",
337
+ "action": "omit",
338
+ "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.",
339
+ "decided_by": "claude-code (code evidence)",
340
+ "decided_at": "2026-11-16T06:56:00Z"
341
+ },
342
+ {
343
+ "path": "CONTRIBUTING.md",
344
+ "action": "omit",
345
+ "reason": "Contribution instructions are owned at the workspace root CONTRIBUTING.md.",
346
+ "decided_by": "claude-code (code evidence)",
347
+ "decided_at": "2026-11-16T06:56:00Z"
348
+ },
349
+ {
350
+ "path": "CHANGELOG.md",
351
+ "action": "omit",
352
+ "reason": "Changelog generation is owned at the workspace root. This package has no changelog file.",
353
+ "decided_by": "claude-code (code evidence)",
354
+ "decided_at": "2026-11-16T06:56:00Z"
355
+ },
356
+ {
357
+ "path": "CTO_CHECKLIST.yml",
358
+ "action": "omit",
359
+ "reason": "The CTO readiness checklist applies to deployable services. This package is a library.",
360
+ "decided_by": "claude-code (code evidence)",
361
+ "decided_at": "2026-11-16T06:56:00Z"
362
+ },
363
+ {
364
+ "path": "schemas/cto-checklist.schema.json",
365
+ "action": "omit",
366
+ "reason": "Omitted together with CTO_CHECKLIST.yml.",
367
+ "decided_by": "claude-code (code evidence)",
368
+ "decided_at": "2026-11-16T06:56:00Z"
369
+ }
370
+ ],
371
+ "template_roots": {
372
+ "canonical": ".sdd/templates/repo-standards"
373
+ },
374
+ "contract_index_path": "docs/architecture.md",
375
+ "repo_skills_root": ".sdd/skills",
376
+ "monorepo_package": {
377
+ "package_path": "packages/@webex/plugin-encryption",
378
+ "root_manifest_path": "../../../.sdd/manifest.json",
379
+ "templates_root_path": "../../../.sdd/templates/repo-standards"
380
+ }
381
+ },
382
+ "tooling": {
383
+ "sdlc_skills": {
384
+ "source_ref": "repo-annotation@2.3.1"
385
+ }
386
+ },
387
+ "coverage_ratchet": {
388
+ "enabled": true,
389
+ "waivers": []
390
+ },
391
+ "substrate": {
392
+ "source": "WebexTools/repo-standards@d89a7fe59126ae3ad9bac9ca352aa7f12b4c85dc",
393
+ "consumed": [
394
+ "@webex/eslint-config-legacy via .eslintrc.js",
395
+ "@webex/babel-config-legacy inject-package-version plugin via babel.config.js",
396
+ "@webex/jest-config-legacy via jest.config.js",
397
+ "@webex/legacy-tools build and test runner via package.json",
398
+ "workspace tsconfig.json via the package tsconfig.json extends",
399
+ "package README.md and developer-quickstart.md (context only)",
400
+ "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)"
401
+ ],
402
+ "compliance_tier": "baseline"
403
+ },
404
+ "section_profiles": {
405
+ "repo": {
406
+ "owns_datastore": false,
407
+ "holds_client_state": true,
408
+ "components_interact": true,
409
+ "domain_data_across_components": false,
410
+ "caches_data": false,
411
+ "observability_convention": true,
412
+ "deploys_to_infra": false,
413
+ "shared_base_libs": true,
414
+ "is_monorepo": false,
415
+ "multi_platform": false,
416
+ "published_package": true,
417
+ "embedded_in_host": false,
418
+ "cross_repo_deps_material": true,
419
+ "security_arch_warranted": true,
420
+ "exposes_commands_or_artifacts": true
421
+ },
422
+ "resolved_by": "claude-code (code evidence; bootstrap questionnaire)",
423
+ "resolved_at": "2026-11-16T06:56:00Z"
424
+ }
425
+ }
package/AGENTS.md ADDED
@@ -0,0 +1,212 @@
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-16T07:57:20Z
7
+ validation_status: pass
8
+ -->
9
+
10
+ # AI Agent Instructions
11
+
12
+ Package-scoped SDD entry for `@webex/plugin-encryption`, the public `cypher` plugin of the SDK (it
13
+ downloads and decrypts encrypted Webex files through `webex.internal.encryption` and registers the
14
+ device) and its small standalone `Webex` constructor. This file orients agents. The monorepo root
15
+ `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, method names, option fields, or URL parameters. Verify them
23
+ from this 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) (Cypher 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/webex.js` main
39
+ and the `src/index.ts` typed 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 every command from the
44
+ workspace root: `yarn` to install, and `yarn workspace @webex/plugin-encryption <script>` for the package scripts below, which `package.json` defines.
45
+ Fresh-checkout workspace setup (building `webex-legacy-tools` and sibling `dist/`) is owned by the workspace root; see
46
+ [Prebuilding](../../../CONTRIBUTING.md#prebuilding).
47
+
48
+ | Task | Command |
49
+ | ---------------------- | ------- |
50
+ | Install dependencies | `yarn` (workspace root) |
51
+ | Start dev environment | N/A — library package with no start script in `package.json` |
52
+ | Run tests | `yarn workspace @webex/plugin-encryption build:src`, then `yarn workspace @webex/plugin-encryption test:unit` (Jest enforces an 85% global coverage threshold) |
53
+ | Run linters | `yarn workspace @webex/plugin-encryption test:style` |
54
+ | Build/release artifact | `yarn workspace @webex/plugin-encryption build:src` (JavaScript, source maps, and `dist/types` declarations) |
55
+ | Format code | N/A — no format script; `prettier` is a devDependency used through eslint |
56
+
57
+ `yarn workspace @webex/plugin-encryption build` emits only the declarations and is the last step of `build:src`. `yarn workspace @webex/plugin-encryption test:browser`
58
+ runs nothing because the package has no `test/integration` directory. `yarn workspace @webex/plugin-encryption build:docs` writes typedoc
59
+ output to the workspace `docs/` folder, outside this package. There is no aggregate `test` script and
60
+ no `test:integration` script.
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/plugin-encryption`.
67
+
68
+ Primary outcomes:
69
+
70
+ - Deliver production-safe changes with build, lint, and unit tests (with coverage) 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. Build, lint, and unit tests pass locally, and the coverage threshold is met.
78
+ 3. Updated docs cover new behavior, including the owning module spec and the README sample code when
79
+ the API changes.
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; TypeScript sources plus two JavaScript files | 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, `@webex/legacy-tools` over babel, and `tsc` for declarations | yarn `3.4.1` (root `packageManager`), `@babel/core` `^7.22.11`, typescript `^4.9.5` |
90
+ | Test framework | jest through `webex-legacy-tools`, with `@webex/test-helper-mock-webex` | `@webex/jest-config-legacy` (`workspace:*`) extended by the local `jest.config.js` |
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.ts`: registers public plugin `cypher`; exports the default `Cypher` and the types.
96
+ - `src/cypher/index.ts`: `Cypher` — `register`, `deregister`, `downloadAndDecryptFile`, `registered`.
97
+ - `src/cypher/types.ts`, `src/cypher/constants.ts`, `src/types.ts`: option and interface types,
98
+ constants, the parent `webex` shape.
99
+ - `src/config.ts`: registered config `{cypher: {}}`.
100
+ - `src/webex.js`, `src/webex-config.ts`: the standalone `Webex` constructor (package `main`, and the
101
+ workspace UMD `encryption` entry) and its intended defaults.
102
+ - `test/unit/spec/cypher/index.ts`: the unit cases.
103
+ - `dist/`: generated build output. Never edit by hand.
104
+ - `README.md`, `developer-quickstart.md`: retained product docs, context only; see
105
+ [ADR-0001](docs/adr/0001-retain-product-docs.md).
106
+ - Spec for every file under `src/`: `src/docs/README.md`.
107
+
108
+ ### Critical Constraints
109
+
110
+ - The plugin does no cryptography; keys, SCR decryption, and downloads go through
111
+ `webex.internal.encryption` (module Design overview), and it never stores or logs the key URI,
112
+ JWE, SCR, or file bytes (`INV-003`).
113
+ - The key URI and JWE come as one pair from the URL or from the options (`INV-001`).
114
+ - `register()` and `deregister()` change `registered` only after a successful device call
115
+ (`INV-002`); the field is public and writable, so callers can also change it directly.
116
+ - `Webex.init` does not apply `src/webex-config.ts` today, and the published `types` disagree with
117
+ `main` on the default export; both are among the module spec's known defects (Evidence register), not promises.
118
+
119
+ ## 4. Testing Workflow
120
+
121
+ Run checks in this order, from the workspace root:
122
+
123
+ 1. `yarn workspace @webex/plugin-encryption build:src`
124
+ 2. `yarn workspace @webex/plugin-encryption test:unit`
125
+ 3. `yarn workspace @webex/plugin-encryption test:style`
126
+
127
+ The unit spec imports `@webex/internal-plugin-encryption` and `@webex/test-helper-mock-webex` by
128
+ name, which load their `dist/`, so they must be built first; on a fresh or outdated checkout follow
129
+ the root [Prebuilding](../../../CONTRIBUTING.md#prebuilding) setup.
130
+
131
+ Testing rules:
132
+
133
+ - Add or update tests in `test/unit/spec/cypher/index.ts` for every behavior change; the URL-wins and
134
+ one-value cases, the invalid URL, the error shapes, and the standalone constructor have no unit case
135
+ today, so pin current behavior first.
136
+ - Use the file's existing style: `MockWebex` with `Cypher` and the internal encryption plugin as
137
+ children, `jest.fn()` stubs for `decryptScr`, `download`, `device.register`, and `device.unregister`.
138
+ - Assert exact calls (`toHaveBeenCalledWith`) and exact error messages, and parametrize when more than
139
+ three cases are alike.
140
+ - Use fake timers for any time-dependent behavior.
141
+ - Keep the 85% global coverage threshold in `jest.config.js` met; it measures only files the spec
142
+ loads.
143
+ - Do not remove tests to make CI pass.
144
+
145
+ ## 5. Code Style and Patterns
146
+
147
+ Coding expectations:
148
+
149
+ - Follow repository style rules and static analysis output. The local `.eslintrc.js` sets
150
+ `root: true` and extends the legacy config.
151
+ - Prefer small functions over large procedural blocks.
152
+ - Make error handling explicit.
153
+ - Keep public interfaces stable unless a breaking change is requested.
154
+
155
+ Pattern example:
156
+
157
+ ```text
158
+ Preferred:
159
+ - Delegate to this.$webex.internal.encryption and this.$webex.internal.device; keep Cypher thin.
160
+ - Log with this.$webex.logger and a 'Cypher:' prefix; log error messages, not inputs.
161
+ - Reject with an Error whose message says what failed, and keep the original as cause.
162
+
163
+ Avoid:
164
+ - Fetching keys, decrypting, or downloading inside Cypher.
165
+ - Mixing a key URI from the URL with a JWE from the options.
166
+ - Logging key URIs, JWEs, SCRs, file bytes, or tokens.
167
+ ```
168
+
169
+ ## 6. Git Workflow
170
+
171
+ - Branch naming: no package convention is defined; follow the workspace `CONTRIBUTING.md`.
172
+ - Commit format: conventional commits (`feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `chore:`), which
173
+ the workspace `CONTRIBUTING.md` requires for pull requests.
174
+ - Keep commits focused and reversible.
175
+ - Rebase on the target branch before opening a pull request.
176
+
177
+ PR checklist:
178
+
179
+ - What changed and why.
180
+ - Tests run and results, including the coverage summary.
181
+ - Risk and impact on applications using `webex.cypher`, the UMD `encryption` bundle, and the `webex`
182
+ and `webex-node` packages.
183
+ - Rollback approach.
184
+
185
+ ## 7. Boundaries and Escalation
186
+
187
+ ### Always
188
+
189
+ - Prefer existing patterns over introducing new architecture.
190
+ - Keep changes minimal for the requested scope.
191
+ - Call out assumptions and unknowns explicitly.
192
+ - Update the owning module spec in the same change that alters observable behavior.
193
+
194
+ ### Ask First
195
+
196
+ - Adding or removing dependencies, including declaring `@webex/plugin-authorization`, `lodash`, or
197
+ `@babel/polyfill`.
198
+ - Making `Webex.init` apply `src/webex-config.ts`, or changing those defaults.
199
+ - Changing `package.json` `main`, `exports`, or `types`.
200
+ - Changing the error messages or wrapping of `downloadAndDecryptFile`, or the `useFileService` default.
201
+ - Renaming or removing a method, an option field, the `keyUri` or `JWE` query names, or the registered
202
+ plugin name.
203
+
204
+ ### Never
205
+
206
+ - Edit `dist/` by hand.
207
+ - Commit secrets, tokens, credentials, or private keys, including in test fixtures.
208
+ - Log key URIs, JWEs, SCRs, file bytes, or bearer tokens through `webex.logger`.
209
+ - Lower the coverage threshold to make CI pass.
210
+ - Add a `.sdd/templates` directory, a copy of the templates, or a link to them in this package. The
211
+ templates live once at the monorepo root, `../../../.sdd/templates/repo-standards`, and
212
+ `.sdd/manifest.json` refers to them through `layout.monorepo_package`.
package/dist/webex.js CHANGED
@@ -21,7 +21,7 @@ const WebexCore = require('@webex/webex-core').default;
21
21
  const config = require('./webex-config');
22
22
  const Webex = WebexCore.extend({
23
23
  webex: true,
24
- version: `3.13.0-next.1`
24
+ version: `3.13.0-next.11`
25
25
  });
26
26
  Webex.init = function init(attrs = {}) {
27
27
  attrs.config = merge({}, config, attrs.config); // eslint-disable-line no-param-reassign