@webex/internal-plugin-avatar 3.13.0-next.3 → 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.
- package/.repo-context.json +496 -0
- package/.sdd/manifest.json +425 -0
- package/AGENTS.md +212 -0
- package/dist/avatar.js +1 -1
- package/docs/adr/0001-retain-product-readme.md +99 -0
- package/docs/adr/index.md +25 -0
- package/docs/architecture.md +277 -0
- package/docs/getting-started.md +136 -0
- package/docs/index.md +43 -0
- package/docs/specs/README.md +66 -0
- package/package.json +4 -4
- package/schemas/repo-context.schema.json +796 -0
- package/src/docs/README.md +434 -0
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 1,
|
|
3
|
+
"repository": {
|
|
4
|
+
"name": "@webex/internal-plugin-avatar",
|
|
5
|
+
"purpose": "Internal plugin registered as webex.internal.avatar that resolves Webex users to avatar URLs. retrieveAvatarUrl(user, options) turns a uuid, email, or user object into a uuid through webex.internal.user.asUUID, answers from an in-memory store keyed by uuid and size, and on a miss requests the asked size plus every configured size (40, 50, 80, 110, 135, 192, 640, 1600; default 80) through a batcher that groups lookups into one POST profiles/urls to the avatar service; entries expire after cacheControl seconds (3600 by default), and hideDefaultAvatar makes a default avatar resolve null. setAvatar(file) resizes the image with @webex/helper-image, uploads it as the current user's avatar through the three-phase webex-core upload to profile sessions of the avatar service, clears that user's cached sizes, and resolves the new URL. 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
|
+
"prebuild": {
|
|
19
|
+
"command": "yarn prebuild:modules",
|
|
20
|
+
"source_file": "../../../CONTRIBUTING.md",
|
|
21
|
+
"role": "other"
|
|
22
|
+
},
|
|
23
|
+
"compile": {
|
|
24
|
+
"command": "yarn build",
|
|
25
|
+
"source_file": "package.json",
|
|
26
|
+
"role": "compile",
|
|
27
|
+
"verified_at": "2026-11-12T15:27:46Z"
|
|
28
|
+
},
|
|
29
|
+
"build": {
|
|
30
|
+
"command": "yarn build:src",
|
|
31
|
+
"source_file": "package.json",
|
|
32
|
+
"role": "package",
|
|
33
|
+
"verified_at": "2026-11-12T15:27:26Z"
|
|
34
|
+
},
|
|
35
|
+
"unit-test": {
|
|
36
|
+
"command": "yarn test:unit",
|
|
37
|
+
"source_file": "package.json",
|
|
38
|
+
"role": "unit-test",
|
|
39
|
+
"verified_at": "2026-11-12T15:27:36Z"
|
|
40
|
+
},
|
|
41
|
+
"lint": {
|
|
42
|
+
"command": "yarn test:style",
|
|
43
|
+
"source_file": "package.json",
|
|
44
|
+
"role": "lint",
|
|
45
|
+
"verified_at": "2026-11-12T15:27:44Z"
|
|
46
|
+
},
|
|
47
|
+
"browser-test": {
|
|
48
|
+
"command": "yarn test:browser",
|
|
49
|
+
"source_file": "package.json",
|
|
50
|
+
"role": "other"
|
|
51
|
+
},
|
|
52
|
+
"deploy": {
|
|
53
|
+
"command": "yarn deploy:npm",
|
|
54
|
+
"source_file": "package.json",
|
|
55
|
+
"role": "deploy"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"toolchain": [
|
|
59
|
+
{
|
|
60
|
+
"name": "node",
|
|
61
|
+
"version": ">=16",
|
|
62
|
+
"origin": "repo-config",
|
|
63
|
+
"source_file": "package.json"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "node",
|
|
67
|
+
"version": "22.14",
|
|
68
|
+
"origin": "repo-config",
|
|
69
|
+
"source_file": "../../../AGENTS.md"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "node",
|
|
73
|
+
"version": "lts/jod",
|
|
74
|
+
"origin": "repo-config",
|
|
75
|
+
"source_file": "../../../.nvmrc"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "node",
|
|
79
|
+
"version": "18.x",
|
|
80
|
+
"origin": "repo-config",
|
|
81
|
+
"source_file": "../../../package.json"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "yarn",
|
|
85
|
+
"version": "3.4.1",
|
|
86
|
+
"origin": "repo-config",
|
|
87
|
+
"source_file": "../../../package.json"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "babel",
|
|
91
|
+
"version": "^7.17.10",
|
|
92
|
+
"origin": "repo-config",
|
|
93
|
+
"source_file": "package.json"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "eslint",
|
|
97
|
+
"version": "^8.24.0",
|
|
98
|
+
"origin": "repo-config",
|
|
99
|
+
"source_file": "package.json"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "prettier",
|
|
103
|
+
"version": "^2.7.1",
|
|
104
|
+
"origin": "repo-config",
|
|
105
|
+
"source_file": "package.json"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"tests": {
|
|
109
|
+
"unit": {
|
|
110
|
+
"command_ref": "unit-test",
|
|
111
|
+
"dir": "test/unit/spec",
|
|
112
|
+
"framework": "jest"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"quality_gates": {
|
|
116
|
+
"code_coverage": {
|
|
117
|
+
"origin": "none",
|
|
118
|
+
"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)"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"coverage_status_definitions": {
|
|
122
|
+
"specced": ">=80% public surface specced, drift <5% - spec is authoritative",
|
|
123
|
+
"partial": "40-80% specced - spec is a hint, cross-check code",
|
|
124
|
+
"untracked": "<40% specced - code is the source of truth"
|
|
125
|
+
},
|
|
126
|
+
"spec_source_policy": {
|
|
127
|
+
"mode": "keep-separate",
|
|
128
|
+
"migrated_source_disposition": "retain",
|
|
129
|
+
"disposition_decided_by": "rarajes2@cisco.com",
|
|
130
|
+
"disposition_decided_at": "2026-11-12T15:30:00Z",
|
|
131
|
+
"decided_by": "rarajes2@cisco.com",
|
|
132
|
+
"decided_at": "2026-11-12T15:30:00Z",
|
|
133
|
+
"decision_record": "docs/adr/0001-retain-product-readme.md"
|
|
134
|
+
},
|
|
135
|
+
"spec_sources": [
|
|
136
|
+
{
|
|
137
|
+
"path": "README.md",
|
|
138
|
+
"scope": "repo",
|
|
139
|
+
"role": "reference-only",
|
|
140
|
+
"canonical": false,
|
|
141
|
+
"use_by_agents": "context-only",
|
|
142
|
+
"post_migration_action": "retain",
|
|
143
|
+
"deletion_status": "not-applicable",
|
|
144
|
+
"notes": "npm page, kept unchanged under keep-separate. Its Usage block ends with the placeholder member webex.internal.avatar.WHATEVER and documents no method, option, or result; see docs/adr/0001-retain-product-readme.md."
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"modules": [
|
|
148
|
+
{
|
|
149
|
+
"path": "src",
|
|
150
|
+
"canonical_spec": "src/docs/README.md",
|
|
151
|
+
"coverage_status": "Partial",
|
|
152
|
+
"coverage_evidence": "Field coverage 100% (14/14) assessed 2026-11-12 by the generator; critical field coverage 7/7. test:unit runs test/unit/spec/avatar.js, test/unit/spec/avatar-url-batcher.js, and test/unit/spec/avatar-url-store.js, 23 passing and 1 skipped under Node 22.14 after build:src on 2026-11-12; they cover MOD-004 to MOD-008, MOD-010, MOD-011, INV-002, and INV-004 (retrieval, batching to one request, hideDefaultAvatar, fingerprints, the profiles/urls request, didItemFail, and the store guards). MOD-001, MOD-002, MOD-009, MOD-012, INV-001 (the expiry timer), INV-003 (the HTTP error and missing-size paths; the missing-size case is it.skip), and INV-005 have no unit case. The integration spec test/integration/spec/avatar.js has every case commented out, and test:browser bundles nothing (0 tests, exit 0). build:src, build, and test:style exit 0 (13 warnings, 0 errors before this spec existed). No characterization baseline exists; the module remains Partial pending a characterization baseline and promotion review. Independent validation on 2026-11-12 by the validator runtime passed with 0 Blocking and 0 Important findings. The prior two Important A16 command-catalog findings were fixed by the generator and rechecked in this run: browser-test is catalogued and the failing aggregate test script is described only as not to run. Runtime separation: different-runtime. A characterization baseline and promotion review remain pending.",
|
|
153
|
+
"last_assessed": "2026-11-12",
|
|
154
|
+
"contracts": {
|
|
155
|
+
"provides": [
|
|
156
|
+
"avatar-internal-sdk"
|
|
157
|
+
],
|
|
158
|
+
"requires": [
|
|
159
|
+
"avatar-http",
|
|
160
|
+
"webex-core-plugin-host",
|
|
161
|
+
"webex-core-batcher",
|
|
162
|
+
"webex-core-upload",
|
|
163
|
+
"internal-plugin-user-uuid",
|
|
164
|
+
"internal-plugin-device-identity",
|
|
165
|
+
"helper-image-processing",
|
|
166
|
+
"common-one-flight",
|
|
167
|
+
"common-timers-safe-timeout"
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
"section_profile": {
|
|
171
|
+
"has_tiers": false,
|
|
172
|
+
"has_ui": false,
|
|
173
|
+
"crosses_service_boundaries": true,
|
|
174
|
+
"holds_client_state": true,
|
|
175
|
+
"enforces_domain_rules": true,
|
|
176
|
+
"is_concurrent_async": true,
|
|
177
|
+
"owns_persistence": false,
|
|
178
|
+
"stateful_transitions": false,
|
|
179
|
+
"exposes_wire_protocol": true,
|
|
180
|
+
"ui_multi_screen": false,
|
|
181
|
+
"large_data_model": false,
|
|
182
|
+
"returns_caller_errors": true,
|
|
183
|
+
"module_specific_conventions": true,
|
|
184
|
+
"published_package": true,
|
|
185
|
+
"embedded_in_host": false,
|
|
186
|
+
"has_design_tradeoff": true,
|
|
187
|
+
"resolved_by": "claude-code (code evidence; bootstrap questionnaire)",
|
|
188
|
+
"resolved_at": "2026-11-12T15:35:00Z",
|
|
189
|
+
"has_submodules": false,
|
|
190
|
+
"has_submodules_computed_by": "scripts/module_tree.py",
|
|
191
|
+
"has_submodules_computed_at": "2026-11-12T15:35:00Z"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
"contract_catalog": {
|
|
196
|
+
"index_path": "docs/architecture.md",
|
|
197
|
+
"definitions": {
|
|
198
|
+
"avatar-internal-sdk": {
|
|
199
|
+
"kind": "sdk",
|
|
200
|
+
"publication": "published",
|
|
201
|
+
"source_kind": "repository-path",
|
|
202
|
+
"source": "package.json",
|
|
203
|
+
"summary": "Published npm package (internal plugin). main is dist/index.js and devMain is src/index.js; no type declarations are published. Importing it imports @webex/internal-plugin-user and @webex/internal-plugin-device, then registers Avatar as internal plugin 'avatar' with the avatar config from src/config.js; the first registration of the name wins. The entry exports only the default Avatar class. webex.internal.avatar exposes retrieveAvatarUrl(user, options) and setAvatar(file), the enableThumbnails session property, the store session property, the batcher child, and the underscore-prefixed _fetchAvatarUrl and _fetchAllAvatarUrlSizes; specified in src/docs/README.md."
|
|
204
|
+
},
|
|
205
|
+
"avatar-http": {
|
|
206
|
+
"kind": "http",
|
|
207
|
+
"publication": "internal",
|
|
208
|
+
"source_kind": "external",
|
|
209
|
+
"source": "Avatar service (catalog service name avatar, reached through api: 'avatar' in src/avatar-url-batcher.js and src/avatar.js; route definitions are not in this repository)",
|
|
210
|
+
"summary": "POST /profiles/urls with body [{uuid, sizes}] answering {<uuid>: {<size>: {size, url, defaultAvatar, cacheControl}}}; POST /profile/<userId>/session answering an upload session {id, url}; PUT to the session url with the image bytes; PUT /profile/<userId>/session/<sessionId> answering the new avatar url."
|
|
211
|
+
},
|
|
212
|
+
"webex-core-plugin-host": {
|
|
213
|
+
"kind": "sdk",
|
|
214
|
+
"publication": "published",
|
|
215
|
+
"source_kind": "external",
|
|
216
|
+
"source": "@webex/webex-core (workspace package; module spec consulted: packages/@webex/webex-core/src/docs/README.md MOD-008, MOD-013, MOD-044)",
|
|
217
|
+
"summary": "registerInternalPlugin keys the plugin by its raw name (avatar, first registration wins) and merges its config into the defaults; WebexPlugin supplies webex, children, session properties, namespaced config, logger, request, and upload."
|
|
218
|
+
},
|
|
219
|
+
"webex-core-batcher": {
|
|
220
|
+
"kind": "sdk",
|
|
221
|
+
"publication": "published",
|
|
222
|
+
"source_kind": "external",
|
|
223
|
+
"source": "@webex/webex-core Batcher (module spec consulted: packages/@webex/webex-core/src/docs/README.md MOD-050 to MOD-053; code consulted: packages/@webex/webex-core/src/lib/batcher.js)",
|
|
224
|
+
"summary": "Batcher.request de-duplicates by fingerprint, flushes through a capped debounce read from the subclass namespace config (batcherWait, batcherMaxWait, batcherMaxCalls), maps responses back through getDeferredForResponse, and on failure settles every queued deferred."
|
|
225
|
+
},
|
|
226
|
+
"webex-core-upload": {
|
|
227
|
+
"kind": "sdk",
|
|
228
|
+
"publication": "published",
|
|
229
|
+
"source_kind": "external",
|
|
230
|
+
"source": "@webex/webex-core upload (module spec consulted: packages/@webex/webex-core/src/docs/README.md MOD-038 to MOD-042)",
|
|
231
|
+
"summary": "upload rejects without options.file, runs initialize (POST), upload (PUT, no SDK authorization, retried), and finalize phases, replaces $-prefixed phase keys with functions of the initialize body, and resolves the finalize body merged with its headers."
|
|
232
|
+
},
|
|
233
|
+
"internal-plugin-user-uuid": {
|
|
234
|
+
"kind": "sdk",
|
|
235
|
+
"publication": "published",
|
|
236
|
+
"source_kind": "external",
|
|
237
|
+
"source": "@webex/internal-plugin-user (workspace package; module spec consulted: packages/@webex/internal-plugin-user/src/docs/README.md MOD-002, MOD-004)",
|
|
238
|
+
"summary": "asUUID(user) rejects a missing user, returns a uuid unchanged, and resolves an email through the user batcher."
|
|
239
|
+
},
|
|
240
|
+
"internal-plugin-device-identity": {
|
|
241
|
+
"kind": "sdk",
|
|
242
|
+
"publication": "published",
|
|
243
|
+
"source_kind": "external",
|
|
244
|
+
"source": "@webex/internal-plugin-device (workspace package; module spec consulted: packages/@webex/internal-plugin-device/src/docs/README.md)",
|
|
245
|
+
"summary": "Imported by src/index.js for registration. userId is a registration property read from webex.internal.device by setAvatar."
|
|
246
|
+
},
|
|
247
|
+
"helper-image-processing": {
|
|
248
|
+
"kind": "sdk",
|
|
249
|
+
"publication": "published",
|
|
250
|
+
"source_kind": "external",
|
|
251
|
+
"source": "@webex/helper-image (workspace package; module spec consulted: packages/@webex/helper-image/src/docs/README.md MOD-002, MOD-007 to MOD-009, MOD-013, MOD-014)",
|
|
252
|
+
"summary": "detectFileType(file, logger) resolves a MIME type or null; processImage resolves undefined for a non-image or the triple [thumbnail, fileDimensions, thumbnailDimensions], with an empty thumbnail when enableThumbnails is off; the bundler selects a Node (GraphicsMagick) or browser (canvas) implementation, and only the browser one honors isAvatar."
|
|
253
|
+
},
|
|
254
|
+
"common-one-flight": {
|
|
255
|
+
"kind": "sdk",
|
|
256
|
+
"publication": "published",
|
|
257
|
+
"source_kind": "external",
|
|
258
|
+
"source": "@webex/common (workspace package; module spec consulted: packages/@webex/common/src/docs/README.md; code consulted: packages/@webex/common/src/one-flight.js, src/patterns.js)",
|
|
259
|
+
"summary": "oneFlight keys a flight per instance by method name plus keyFactory(...args) and drops it on settle unless cacheSuccesses or cacheFailures is set; patterns.uuid matches lowercase hex uuids only."
|
|
260
|
+
},
|
|
261
|
+
"common-timers-safe-timeout": {
|
|
262
|
+
"kind": "sdk",
|
|
263
|
+
"publication": "published",
|
|
264
|
+
"source_kind": "external",
|
|
265
|
+
"source": "@webex/common-timers (workspace package; module spec consulted: packages/@webex/common-timers/src/docs/README.md MOD-001, MOD-002)",
|
|
266
|
+
"summary": "safeSetTimeout forwards to setTimeout and unrefs the handle where the platform supports it, so store expiry timers do not keep a Node process alive."
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"spec_policy": {
|
|
271
|
+
"require_what_and_why": true,
|
|
272
|
+
"require_provenance": true,
|
|
273
|
+
"protected_specs": [
|
|
274
|
+
"src/docs/README.md"
|
|
275
|
+
]
|
|
276
|
+
},
|
|
277
|
+
"validation": {
|
|
278
|
+
"generator_runtime": "claude-code",
|
|
279
|
+
"generator_model": "claude-opus-5-5",
|
|
280
|
+
"generator_runtime_source": "host-metadata",
|
|
281
|
+
"source_commit": "6a61caf21b1cd4f005a1013fa4fbe3c92f69abbf",
|
|
282
|
+
"minimum_independence": "different-runtime",
|
|
283
|
+
"blocking_severities": [
|
|
284
|
+
"Blocking"
|
|
285
|
+
],
|
|
286
|
+
"validator_runtime": "Validate internal-plugin-avatar specs",
|
|
287
|
+
"validator_run_id": "01a1d06c-9064-7763-a1da-54a63ad26ec0",
|
|
288
|
+
"validator_runtime_source": "invocation-input",
|
|
289
|
+
"runtime_fallback_tier": "different-runtime"
|
|
290
|
+
},
|
|
291
|
+
"layout": {
|
|
292
|
+
"sdd_root": ".sdd",
|
|
293
|
+
"docs_root": "docs",
|
|
294
|
+
"agent_entry_path": "AGENTS.md",
|
|
295
|
+
"standing_docs_root": "docs",
|
|
296
|
+
"spec_index_path": "docs/specs/README.md",
|
|
297
|
+
"module_docs_strategy": "source-local",
|
|
298
|
+
"module_docs_relative_path": "docs/README.md",
|
|
299
|
+
"module_docs_decision": {
|
|
300
|
+
"basis": "repo-standards-default",
|
|
301
|
+
"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/.",
|
|
302
|
+
"decided_by": "rarajes2@cisco.com (bootstrap questionnaire)",
|
|
303
|
+
"decided_at": "2026-11-12T15:35:00Z"
|
|
304
|
+
},
|
|
305
|
+
"repo_context_decision": {
|
|
306
|
+
"path": ".repo-context.json",
|
|
307
|
+
"schema_path": "schemas/repo-context.schema.json",
|
|
308
|
+
"action": "create",
|
|
309
|
+
"schema_action": "create",
|
|
310
|
+
"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.",
|
|
311
|
+
"decided_by": "rarajes2@cisco.com (bootstrap questionnaire)",
|
|
312
|
+
"decided_at": "2026-11-12T15:35:00Z"
|
|
313
|
+
},
|
|
314
|
+
"artifact_decisions": [
|
|
315
|
+
{
|
|
316
|
+
"path": "docs/service.md",
|
|
317
|
+
"action": "omit",
|
|
318
|
+
"reason": "Library package, not a deployable service. package.json has no start script, container, or deployment descriptor.",
|
|
319
|
+
"decided_by": "claude-code (code evidence)",
|
|
320
|
+
"decided_at": "2026-11-12T15:35:00Z"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"path": "mkdocs.yml",
|
|
324
|
+
"action": "omit",
|
|
325
|
+
"reason": "No package-level documentation site exists. Documentation publishing stays with the workspace.",
|
|
326
|
+
"decided_by": "claude-code (code evidence)",
|
|
327
|
+
"decided_at": "2026-11-12T15:35:00Z"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"path": "api-specs/openapi.yaml",
|
|
331
|
+
"action": "omit",
|
|
332
|
+
"reason": "The package serves no HTTP routes. It is a client of the avatar service; its published surface is the npm export described by avatar-internal-sdk.",
|
|
333
|
+
"decided_by": "claude-code (code evidence)",
|
|
334
|
+
"decided_at": "2026-11-12T15:35:00Z"
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"path": "SECURITY.md",
|
|
338
|
+
"action": "omit",
|
|
339
|
+
"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.",
|
|
340
|
+
"decided_by": "claude-code (code evidence)",
|
|
341
|
+
"decided_at": "2026-11-12T15:35:00Z"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"path": "CONTRIBUTING.md",
|
|
345
|
+
"action": "omit",
|
|
346
|
+
"reason": "Contribution instructions are owned at the workspace root CONTRIBUTING.md.",
|
|
347
|
+
"decided_by": "claude-code (code evidence)",
|
|
348
|
+
"decided_at": "2026-11-12T15:35:00Z"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"path": "CHANGELOG.md",
|
|
352
|
+
"action": "omit",
|
|
353
|
+
"reason": "Changelog generation is owned at the workspace root. This package has no changelog file.",
|
|
354
|
+
"decided_by": "claude-code (code evidence)",
|
|
355
|
+
"decided_at": "2026-11-12T15:35:00Z"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"path": "CTO_CHECKLIST.yml",
|
|
359
|
+
"action": "omit",
|
|
360
|
+
"reason": "The CTO readiness checklist applies to deployable services. This package is a library.",
|
|
361
|
+
"decided_by": "claude-code (code evidence)",
|
|
362
|
+
"decided_at": "2026-11-12T15:35:00Z"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"path": "schemas/cto-checklist.schema.json",
|
|
366
|
+
"action": "omit",
|
|
367
|
+
"reason": "Omitted together with CTO_CHECKLIST.yml.",
|
|
368
|
+
"decided_by": "claude-code (code evidence)",
|
|
369
|
+
"decided_at": "2026-11-12T15:35:00Z"
|
|
370
|
+
}
|
|
371
|
+
],
|
|
372
|
+
"template_roots": {
|
|
373
|
+
"canonical": ".sdd/templates/repo-standards"
|
|
374
|
+
},
|
|
375
|
+
"contract_index_path": "docs/architecture.md",
|
|
376
|
+
"repo_skills_root": ".sdd/skills",
|
|
377
|
+
"monorepo_package": {
|
|
378
|
+
"package_path": "packages/@webex/internal-plugin-avatar",
|
|
379
|
+
"root_manifest_path": "../../../.sdd/manifest.json",
|
|
380
|
+
"templates_root_path": "../../../.sdd/templates/repo-standards"
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
"tooling": {
|
|
384
|
+
"sdlc_skills": {
|
|
385
|
+
"source_ref": "repo-annotation@2.3.1"
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
"coverage_ratchet": {
|
|
389
|
+
"enabled": true,
|
|
390
|
+
"waivers": []
|
|
391
|
+
},
|
|
392
|
+
"substrate": {
|
|
393
|
+
"source": "WebexTools/repo-standards@d89a7fe59126ae3ad9bac9ca352aa7f12b4c85dc",
|
|
394
|
+
"consumed": [
|
|
395
|
+
"@webex/eslint-config-legacy via .eslintrc.js",
|
|
396
|
+
"@webex/babel-config-legacy via babel.config.js",
|
|
397
|
+
"@webex/jest-config-legacy via jest.config.js",
|
|
398
|
+
"@webex/legacy-tools build and test runner via package.json",
|
|
399
|
+
"package README.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": true,
|
|
410
|
+
"caches_data": true,
|
|
411
|
+
"observability_convention": false,
|
|
412
|
+
"deploys_to_infra": false,
|
|
413
|
+
"shared_base_libs": true,
|
|
414
|
+
"is_monorepo": false,
|
|
415
|
+
"multi_platform": true,
|
|
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-12T15:35: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-12T15:52:01Z
|
|
7
|
+
validation_status: pass
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
# AI Agent Instructions
|
|
11
|
+
|
|
12
|
+
Package-scoped SDD entry for `@webex/internal-plugin-avatar`, the internal `avatar` plugin of the SDK
|
|
13
|
+
(it resolves users to avatar URLs through a batched, cached lookup and uploads the current user's new
|
|
14
|
+
avatar). This file orients agents. The monorepo root `AGENTS.md` governs workspace-wide setup.
|
|
15
|
+
|
|
16
|
+
## Working Method
|
|
17
|
+
|
|
18
|
+
- Read the relevant package files before editing. Do not edit blind.
|
|
19
|
+
- Understand the task and affected surfaces before writing code.
|
|
20
|
+
- Prefer focused edits over rewriting whole files.
|
|
21
|
+
- Do not invent commands, paths, exports, method names, or request paths. Verify them from this
|
|
22
|
+
package's source.
|
|
23
|
+
- Test or validate before declaring done.
|
|
24
|
+
- Keep output concise. If something is uncertain, say so instead of guessing.
|
|
25
|
+
|
|
26
|
+
## Canonical Repository Documentation
|
|
27
|
+
|
|
28
|
+
Before changing code or documentation, start with:
|
|
29
|
+
|
|
30
|
+
- [`docs/index.md`](docs/index.md) for package documentation navigation;
|
|
31
|
+
- [`docs/architecture.md`](docs/architecture.md) for package boundaries and interactions;
|
|
32
|
+
- [`docs/specs/README.md`](docs/specs/README.md) for the manifest-backed module and contract registry;
|
|
33
|
+
- the module specification at [`src/docs/README.md`](src/docs/README.md) (Avatar plugin); and
|
|
34
|
+
- [`docs/adr/index.md`](docs/adr/index.md) plus applicable concrete ADRs.
|
|
35
|
+
|
|
36
|
+
Follow `.sdd/manifest.json` for each contract's publication state and canonical source. This package
|
|
37
|
+
publishes an internal SDK surface, so its contract artifact is `package.json` plus the `src/index.js`
|
|
38
|
+
entry. It serves no HTTP, so no OpenAPI applies.
|
|
39
|
+
|
|
40
|
+
## 1. Commands (Run First)
|
|
41
|
+
|
|
42
|
+
Use only documented commands. Do not invent alternatives when a command is missing. Run `yarn` and
|
|
43
|
+
`yarn prebuild:modules` at the workspace root, and the package scripts below from this package
|
|
44
|
+
directory, `packages/@webex/internal-plugin-avatar`, where `package.json` defines them. From the workspace root, `yarn workspace @webex/internal-plugin-avatar <script>` runs the same script.
|
|
45
|
+
|
|
46
|
+
| Task | Command |
|
|
47
|
+
| ---------------------- | ------- |
|
|
48
|
+
| 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/` |
|
|
49
|
+
| Start dev environment | N/A — library package with no start script in `package.json` |
|
|
50
|
+
| Run tests | `yarn test:unit` (after `build:src`; the specs import the package by name, so they test `dist/`) |
|
|
51
|
+
| Run linters | `yarn test:style` |
|
|
52
|
+
| Build/release artifact | `yarn 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 build` runs `yarn 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 test:browser` runs `test/integration/spec` through
|
|
60
|
+
karma but verifies nothing today; see [Getting started](docs/getting-started.md#tests) for its state.
|
|
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-avatar`.
|
|
67
|
+
|
|
68
|
+
Primary outcomes:
|
|
69
|
+
|
|
70
|
+
- Deliver production-safe changes with build, 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. Build, unit tests, and lint 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; 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` |
|
|
88
|
+
| Build tool | yarn workspaces and `@webex/legacy-tools` over babel | yarn `3.4.1` (root `packageManager`), `@babel/core` `^7.17.10` |
|
|
89
|
+
| Test framework | jest through `webex-legacy-tools` and `@webex/jest-config-legacy`, with sinon, `@webex/test-helper-chai`, and `@webex/test-helper-mock-webex` | — |
|
|
90
|
+
| Lint/format | eslint via `@webex/eslint-config-legacy`, prettier | eslint `^8.24.0`, prettier `^2.7.1` |
|
|
91
|
+
|
|
92
|
+
### Project Map
|
|
93
|
+
|
|
94
|
+
- `src/index.js`: imports the user and device plugins, registers internal plugin `avatar` with its
|
|
95
|
+
config, and exports `Avatar` (default only).
|
|
96
|
+
- `src/avatar.js`: `Avatar` — `retrieveAvatarUrl`, `setAvatar`, the `oneFlight` fetch helpers, the
|
|
97
|
+
`batcher` child, and the `store` and `enableThumbnails` session properties.
|
|
98
|
+
- `src/avatar-url-batcher.js`: `AvatarUrlBatcher` — groups lookups into one `POST profiles/urls` and
|
|
99
|
+
maps the response back to each caller.
|
|
100
|
+
- `src/avatar-url-store.js`: `AvatarUrlStore` — in-memory URL cache keyed by uuid and size, with
|
|
101
|
+
expiry timers.
|
|
102
|
+
- `src/config.js`: the `avatar` config (batcher timings, TTL, default size, size list, thumbnail
|
|
103
|
+
bounds).
|
|
104
|
+
- `test/unit/spec/`: unit cases (`avatar.js`, `avatar-url-batcher.js`, `avatar-url-store.js`) run by
|
|
105
|
+
`test:unit`.
|
|
106
|
+
- `test/integration/spec/avatar.js`: user and device setup only; every case is commented out.
|
|
107
|
+
- `process`: package-root module exporting `{browser: true}`; not imported by `src/`.
|
|
108
|
+
- `dist/`: generated build output. Never edit by hand.
|
|
109
|
+
- `README.md`: retained npm page, context only; its Usage block is a placeholder; see
|
|
110
|
+
[ADR-0001](docs/adr/0001-retain-product-readme.md).
|
|
111
|
+
- Spec for every file under `src/`: `src/docs/README.md`.
|
|
112
|
+
|
|
113
|
+
### Critical Constraints
|
|
114
|
+
|
|
115
|
+
- The plugin is `webex.internal.avatar`; `@webex/webex-server` and `@webex/recipe-private-web-client`
|
|
116
|
+
register it by import.
|
|
117
|
+
- Every lookup goes through the batcher, so a burst of `retrieveAvatarUrl` calls sends one request per
|
|
118
|
+
flush (`INV-002` in the module spec).
|
|
119
|
+
- A store miss requests every size in `config.sizes`; one missing size rejects the requested one.
|
|
120
|
+
- Store entries expire on the client TTL (`cacheControl`, seconds), not on the service's cache field
|
|
121
|
+
(`INV-001`).
|
|
122
|
+
- `config.sizes` and the fixed size list in `AvatarUrlStore.remove` must change together.
|
|
123
|
+
|
|
124
|
+
## 4. Testing Workflow
|
|
125
|
+
|
|
126
|
+
Run checks in this order, from the package directory:
|
|
127
|
+
|
|
128
|
+
1. `yarn build:src`
|
|
129
|
+
2. `yarn test:unit`
|
|
130
|
+
3. `yarn test:style`
|
|
131
|
+
|
|
132
|
+
Run `yarn prebuild:modules` once on a fresh checkout so `webex-legacy-tools` and the sibling packages'
|
|
133
|
+
`dist/` exist.
|
|
134
|
+
|
|
135
|
+
Testing rules:
|
|
136
|
+
|
|
137
|
+
- Add or update cases in `test/unit/spec/avatar.js`, `test/unit/spec/avatar-url-batcher.js`, or
|
|
138
|
+
`test/unit/spec/avatar-url-store.js` for every behavior you change.
|
|
139
|
+
- Use `@webex/test-helper-mock-webex` with sinon stubs for `webex.request`, and assert with
|
|
140
|
+
`@webex/test-helper-chai`; use `sinon.useFakeTimers()` for the store TTL.
|
|
141
|
+
- Use `assert.calledOnceWithExactly` for call arguments, and parametrize when more than three cases are
|
|
142
|
+
alike.
|
|
143
|
+
- Cover failure paths and edge cases, not only happy paths.
|
|
144
|
+
- Do not remove tests to make CI pass.
|
|
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` and extends the legacy config.
|
|
154
|
+
- Prefer small functions over large procedural blocks.
|
|
155
|
+
- Make error handling explicit; reject guard failures before touching the store or the network.
|
|
156
|
+
- Keep public interfaces stable unless a breaking change is requested.
|
|
157
|
+
|
|
158
|
+
Pattern example:
|
|
159
|
+
|
|
160
|
+
```text
|
|
161
|
+
Preferred:
|
|
162
|
+
- Request a uuid and size through this.batcher.request so duplicates collapse.
|
|
163
|
+
- Guard store arguments with Promise.reject(new Error('`item.<field>` is required')).
|
|
164
|
+
- Settle every batched deferred, on success, missing size, or HTTP error.
|
|
165
|
+
|
|
166
|
+
Avoid:
|
|
167
|
+
- Calling webex.request for profiles/urls directly.
|
|
168
|
+
- Changing config.sizes without the list in AvatarUrlStore.remove.
|
|
169
|
+
- Treating README.md as a usage reference.
|
|
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 first-party clients that call `webex.internal.avatar` and on the packages that
|
|
185
|
+
register it.
|
|
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 dependencies, or removing a declared one.
|
|
200
|
+
- Renaming or removing a method, the `batcher` child, a session property, or the registered plugin
|
|
201
|
+
name.
|
|
202
|
+
- Changing a request path or body, the size list, the default size, the TTL, or the batcher timings.
|
|
203
|
+
- Changing what `retrieveAvatarUrl` or `setAvatar` resolves, or when the cache is invalidated.
|
|
204
|
+
|
|
205
|
+
### Never
|
|
206
|
+
|
|
207
|
+
- Edit `dist/` by hand.
|
|
208
|
+
- Commit secrets, tokens, or credentials, including in test fixtures.
|
|
209
|
+
- Log user ids, emails, or avatar URLs.
|
|
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/avatar.js
CHANGED
|
@@ -158,7 +158,7 @@ var Avatar = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({
|
|
|
158
158
|
return res.url;
|
|
159
159
|
});
|
|
160
160
|
},
|
|
161
|
-
version: "3.13.0-next.
|
|
161
|
+
version: "3.13.0-next.5"
|
|
162
162
|
}, (0, _applyDecoratedDescriptor2.default)(_obj, "_fetchAllAvatarUrlSizes", [_dec], (0, _getOwnPropertyDescriptor.default)(_obj, "_fetchAllAvatarUrlSizes"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "_fetchAvatarUrl", [_dec2], (0, _getOwnPropertyDescriptor.default)(_obj, "_fetchAvatarUrl"), _obj), _obj));
|
|
163
163
|
var _default2 = exports.default = Avatar;
|
|
164
164
|
//# sourceMappingURL=avatar.js.map
|