@webex/internal-plugin-support 3.12.0 → 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,430 @@
1
+ {
2
+ "manifest_version": 1,
3
+ "repository": {
4
+ "name": "@webex/internal-plugin-support",
5
+ "purpose": "Internal plugin registered as webex.internal.support for support and log-upload endpoints. getFeedbackUrl() POSTs users/deskFeedbackUrl and getSupportUrl() GETs users/deskSupportUrl on the conversation service, each resolving body.url. submitLogs() takes the SDK logger's full or incremental (diff) log text, or caller-supplied logs, and uploads it through webex.upload to the clientLogs service in three phases (logs/urls, PUT to the returned tempURL, logs/meta with a key-value metadata array), authorizing with the user token or, failing that, a client token; it advances the logger's last-submitted index on success and, for a failed diff upload with retryFailedLogUploadsAtNextInterval, rolls the logger back so the next diff resends the span. It stores nothing itself.",
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/internal-plugin-support build",
20
+ "source_file": "package.json",
21
+ "role": "compile",
22
+ "verified_at": "2026-11-12T11:55:58Z"
23
+ },
24
+ "build": {
25
+ "command": "yarn workspace @webex/internal-plugin-support build:src",
26
+ "source_file": "../../../AGENTS.md",
27
+ "role": "package",
28
+ "verified_at": "2026-11-12T11:55:58Z"
29
+ },
30
+ "unit-test": {
31
+ "command": "yarn workspace @webex/internal-plugin-support test:unit",
32
+ "source_file": "../../../AGENTS.md",
33
+ "role": "unit-test",
34
+ "verified_at": "2026-11-12T11:55:58Z"
35
+ },
36
+ "lint": {
37
+ "command": "yarn workspace @webex/internal-plugin-support test:style",
38
+ "source_file": "package.json",
39
+ "role": "lint",
40
+ "verified_at": "2026-11-12T11:55:58Z"
41
+ },
42
+ "deploy": {
43
+ "command": "yarn workspace @webex/internal-plugin-support deploy:npm",
44
+ "source_file": "package.json",
45
+ "role": "deploy"
46
+ }
47
+ },
48
+ "toolchain": [
49
+ {
50
+ "name": "node",
51
+ "version": ">=18",
52
+ "origin": "repo-config",
53
+ "source_file": "package.json"
54
+ },
55
+ {
56
+ "name": "node",
57
+ "version": "22.14",
58
+ "origin": "repo-config",
59
+ "source_file": "../../../AGENTS.md"
60
+ },
61
+ {
62
+ "name": "node",
63
+ "version": "lts/jod",
64
+ "origin": "repo-config",
65
+ "source_file": "../../../.nvmrc"
66
+ },
67
+ {
68
+ "name": "node",
69
+ "version": "18.x",
70
+ "origin": "repo-config",
71
+ "source_file": "../../../package.json"
72
+ },
73
+ {
74
+ "name": "yarn",
75
+ "version": "3.4.1",
76
+ "origin": "repo-config",
77
+ "source_file": "../../../package.json"
78
+ },
79
+ {
80
+ "name": "babel",
81
+ "version": "^7.17.10",
82
+ "origin": "repo-config",
83
+ "source_file": "package.json"
84
+ },
85
+ {
86
+ "name": "eslint",
87
+ "version": "^8.24.0",
88
+ "origin": "repo-config",
89
+ "source_file": "package.json"
90
+ },
91
+ {
92
+ "name": "prettier",
93
+ "version": "^2.7.1",
94
+ "origin": "repo-config",
95
+ "source_file": "package.json"
96
+ }
97
+ ],
98
+ "tests": {
99
+ "unit": {
100
+ "command_ref": "unit-test",
101
+ "dir": "test/unit/spec",
102
+ "framework": "jest"
103
+ }
104
+ },
105
+ "quality_gates": {
106
+ "code_coverage": {
107
+ "origin": "none",
108
+ "declared_by": "rarajes2@cisco.com via the approved bootstrap file-touch plan (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)"
109
+ }
110
+ },
111
+ "coverage_status_definitions": {
112
+ "specced": ">=80% public surface specced, drift <5% - spec is authoritative",
113
+ "partial": "40-80% specced - spec is a hint, cross-check code",
114
+ "untracked": "<40% specced - code is the source of truth"
115
+ },
116
+ "spec_source_policy": {
117
+ "mode": "keep-separate",
118
+ "migrated_source_disposition": "retain",
119
+ "disposition_decided_by": "rarajes2@cisco.com",
120
+ "disposition_decided_at": "2026-11-12T11:54:25Z",
121
+ "decided_by": "rarajes2@cisco.com",
122
+ "decided_at": "2026-11-12T11:54:25Z",
123
+ "decision_record": "docs/adr/0001-retain-product-readme.md"
124
+ },
125
+ "spec_sources": [
126
+ {
127
+ "path": "README.md",
128
+ "scope": "repo",
129
+ "role": "reference-only",
130
+ "canonical": false,
131
+ "use_by_agents": "context-only",
132
+ "post_migration_action": "retain",
133
+ "deletion_status": "not-applicable",
134
+ "notes": "npm page, kept unchanged under keep-separate. Its Usage block ends with the placeholder member webex.internal.support.WHATEVER and documents no method, option, result, or the log upload; see docs/adr/0001-retain-product-readme.md."
135
+ }
136
+ ],
137
+ "modules": [
138
+ {
139
+ "path": "src",
140
+ "canonical_spec": "src/docs/README.md",
141
+ "coverage_status": "Partial",
142
+ "coverage_evidence": "Field coverage 100% (15/15) assessed 2026-11-12 by the generator; critical field coverage 8/8. test:unit runs test/unit/spec/support.js, 43 of 43 passing under Node 22.14 after build:src on 2026-11-12; it covers MOD-005 and MOD-007 to MOD-010 and INV-001 to INV-004. MOD-001 to MOD-004, MOD-006's client-token fallback, and INV-005 have no test. The integration spec test/integration/spec/support.js runs only under test:browser, which bundles nothing (0 tests, exit 0). build:src and test:style exit 0. No characterization baseline exists. Independent validation passed with warnings on 2026-11-12 (validator runtime 01a1cfae-ad4f-7710-befe-9beb15f9c6b4; 0 Blocking and one Important command-source finding covering five entries). Held at Partial pending a characterization baseline and promotion review. B11-001 is an accepted warning (rarajes2@cisco.com, 2026-11-12T12:27:40Z): the workspace-qualified form (yarn workspace @webex/internal-plugin-support followed by the script name) stays recorded for compile, build, unit-test, lint, and deploy, whose cited source files hold the scripts or the generic pattern rather than the exact strings.",
143
+ "last_assessed": "2026-11-12",
144
+ "contracts": {
145
+ "provides": [
146
+ "support-internal-sdk"
147
+ ],
148
+ "requires": [
149
+ "client-logs-http",
150
+ "conversation-desk-urls-http",
151
+ "webex-core-plugin-host",
152
+ "webex-core-upload",
153
+ "webex-core-credentials",
154
+ "webex-core-auth-interceptor",
155
+ "webex-core-services",
156
+ "plugin-logger-buffers",
157
+ "internal-plugin-device-identity",
158
+ "lodash",
159
+ "uuid"
160
+ ]
161
+ },
162
+ "section_profile": {
163
+ "has_tiers": false,
164
+ "has_ui": false,
165
+ "crosses_service_boundaries": true,
166
+ "holds_client_state": true,
167
+ "enforces_domain_rules": true,
168
+ "is_concurrent_async": true,
169
+ "owns_persistence": false,
170
+ "stateful_transitions": true,
171
+ "exposes_wire_protocol": true,
172
+ "ui_multi_screen": false,
173
+ "large_data_model": false,
174
+ "returns_caller_errors": true,
175
+ "module_specific_conventions": true,
176
+ "published_package": true,
177
+ "embedded_in_host": false,
178
+ "has_design_tradeoff": true,
179
+ "resolved_by": "claude-code (code evidence; bootstrap questionnaire)",
180
+ "resolved_at": "2026-11-12T11:54:25Z",
181
+ "has_submodules": false,
182
+ "has_submodules_computed_by": "scripts/module_tree.py",
183
+ "has_submodules_computed_at": "2026-11-12T11:54:25Z"
184
+ }
185
+ }
186
+ ],
187
+ "contract_catalog": {
188
+ "index_path": "docs/architecture.md",
189
+ "definitions": {
190
+ "support-internal-sdk": {
191
+ "kind": "sdk",
192
+ "publication": "published",
193
+ "source_kind": "repository-path",
194
+ "source": "package.json",
195
+ "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-device, then registers Support as internal plugin 'support' with config {device: {preDiscoveryServices: {atlas, atlasServiceUrl, clientLogs, clientLogsServiceUrl}}, support: {appType: '', appVersion: '', languageCode: '', incrementalLogs: false}}; the first registration of the name wins. The entry exports only the default Support class. webex.internal.support exposes getFeedbackUrl, getSupportUrl, submitLogs, and the underscore-prefixed _constructFileMetadata; specified in src/docs/README.md."
196
+ },
197
+ "client-logs-http": {
198
+ "kind": "http",
199
+ "publication": "internal",
200
+ "source_kind": "external",
201
+ "source": "Client logs service (catalog service name clientLogs in src/support.js; route definitions are not in this repository)",
202
+ "summary": "Three-phase upload driven by webex.upload: POST logs/urls with body {file: <filename>, uploadProtocol: 'content-length'} resolves a session with tempURL, logFilename, and userId; PUT <tempURL> with the log text and no SDK authorization; POST logs/meta with {filename: <logFilename>, data: [{key, value}], userId}. The first and last phases carry the caller-chosen authorization header. The resolved value is the logs/meta response body merged with its headers; in-repo consumers read url, userId, and trackingid."
203
+ },
204
+ "conversation-desk-urls-http": {
205
+ "kind": "http",
206
+ "publication": "internal",
207
+ "source_kind": "external",
208
+ "source": "Conversation service (catalog service name conversation, reached through api: 'conversation' in src/support.js; route definitions are not in this repository)",
209
+ "summary": "POST users/deskFeedbackUrl with {appVersion, appType, feedbackId, languageCode, ...caller options} and GET users/deskSupportUrl with query languageCode; both responses carry body.url."
210
+ },
211
+ "webex-core-plugin-host": {
212
+ "kind": "sdk",
213
+ "publication": "published",
214
+ "source_kind": "external",
215
+ "source": "@webex/webex-core (workspace package; module spec consulted: packages/@webex/webex-core/src/docs/README.md)",
216
+ "summary": "registerInternalPlugin keys the plugin by its raw name (support, first registration wins) and merges its config into the defaults; WebexPlugin supplies webex, namespaced config, logger, and request, which proxies webex.request; webex.sessionId is <trackingIdPrefix>_<trackingIdBase or a v4 uuid>, with _<trackingIdSuffix> when configured."
217
+ },
218
+ "webex-core-upload": {
219
+ "kind": "sdk",
220
+ "publication": "published",
221
+ "source_kind": "external",
222
+ "source": "@webex/webex-core upload (module spec consulted: packages/@webex/webex-core/src/docs/README.md MOD-038 to MOD-042; code consulted: packages/@webex/webex-core/src/webex-core.js)",
223
+ "summary": "upload rejects with `options.file` is required without a file; fills initialize (POST, uploadProtocol content-length), upload (PUT, json false, withCredentials false, body file, authorization undefined), and finalize (POST) from the top-level options; replaces $-prefixed phase keys with their result on the initialize body; aborts with DELETE when file.byteLength exceeds fileUploadSizeLimit; retries the upload phase; resolves the finalize body merged with its headers."
224
+ },
225
+ "webex-core-credentials": {
226
+ "kind": "sdk",
227
+ "publication": "published",
228
+ "source_kind": "external",
229
+ "source": "@webex/webex-core credentials (credentials spec consulted: packages/@webex/webex-core/src/lib/credentials/docs/README.md MOD-007, MOD-031, MOD-039)",
230
+ "summary": "getUserToken resolves a user Token and rejects when the state cannot authorize; getClientToken POSTs a client_credentials grant and returns an uncached Token; Token.toString returns '<token_type> <access_token>' and throws cannot stringify Token when either is missing."
231
+ },
232
+ "webex-core-auth-interceptor": {
233
+ "kind": "sdk",
234
+ "publication": "published",
235
+ "source_kind": "external",
236
+ "source": "@webex/webex-core AuthInterceptor (interceptors spec consulted: packages/@webex/webex-core/src/interceptors/docs/README.md INT-007; code consulted: packages/@webex/webex-core/src/interceptors/auth.js)",
237
+ "summary": "A request that already has an authorization header keeps it (a falsy value is deleted); on a 401, unless options.shouldRefreshAccessToken is false, the interceptor deletes authorization, refreshes when canRefresh, and replays. No code reads shouldAttemptReauth as an option."
238
+ },
239
+ "webex-core-services": {
240
+ "kind": "sdk",
241
+ "publication": "published",
242
+ "source_kind": "external",
243
+ "source": "@webex/webex-core services plugin (services spec consulted: packages/@webex/webex-core/src/lib/services/docs/README.md SVC-022)",
244
+ "summary": "ServiceInterceptor maps api to service, requires resource and service, waits for the service, and joins its catalog URL with the resource; it leaves a request with uri unchanged."
245
+ },
246
+ "plugin-logger-buffers": {
247
+ "kind": "sdk",
248
+ "publication": "published",
249
+ "source_kind": "external",
250
+ "source": "@webex/plugin-logger (workspace package, not declared in package.json; module spec consulted: packages/@webex/plugin-logger/src/docs/README.md MOD-011, MOD-012; code consulted: packages/@webex/plugin-logger/src/logger.js)",
251
+ "summary": "webex.logger exposes buffer, sdkBuffer, and clientBuffer; formatLogs({diff}) returns the buffered entries joined by newlines, and with diff only the entries from nextIndex onward while advancing nextIndex; updateLastSubmittedIndex sets lastSubmitted to nextIndex; resetBufferToLastSuccessfulUpload sets nextIndex back to lastSubmitted; error logs a line."
252
+ },
253
+ "internal-plugin-device-identity": {
254
+ "kind": "sdk",
255
+ "publication": "published",
256
+ "source_kind": "external",
257
+ "source": "@webex/internal-plugin-device (workspace package; module spec consulted: packages/@webex/internal-plugin-device/src/docs/README.md; code consulted: packages/@webex/internal-plugin-device/src/device.js)",
258
+ "summary": "Imported for its registration side effect. userId is a declared string property; orgId is not declared and exists only as an extra property kept from the registration body because Device sets extraProperties: 'allow'."
259
+ },
260
+ "lodash": {
261
+ "kind": "sdk",
262
+ "publication": "published",
263
+ "source_kind": "external",
264
+ "source": "lodash@^4.17.21 (npm)",
265
+ "summary": "defaults fills undefined properties of its first argument in place; used for the feedback body and the upload options."
266
+ },
267
+ "uuid": {
268
+ "kind": "sdk",
269
+ "publication": "published",
270
+ "source_kind": "external",
271
+ "source": "uuid@^3.3.2 (npm)",
272
+ "summary": "v4 generates the feedbackId of getFeedbackUrl when the caller passes none."
273
+ }
274
+ }
275
+ },
276
+ "spec_policy": {
277
+ "require_what_and_why": true,
278
+ "require_provenance": true,
279
+ "protected_specs": [
280
+ "src/docs/README.md"
281
+ ]
282
+ },
283
+ "validation": {
284
+ "generator_runtime": "claude-code",
285
+ "generator_model": "claude-opus-5-5",
286
+ "generator_runtime_source": "host-metadata",
287
+ "source_commit": "3377fcc30e7eb51d1567b80e0ded50a8adaed4bd",
288
+ "minimum_independence": "different-runtime",
289
+ "blocking_severities": [
290
+ "Blocking"
291
+ ],
292
+ "validator_runtime": "01a1cfae-ad4f-7710-befe-9beb15f9c6b4",
293
+ "validator_runtime_source": "invocation-input",
294
+ "runtime_fallback_tier": "different-runtime"
295
+ },
296
+ "layout": {
297
+ "sdd_root": ".sdd",
298
+ "docs_root": "docs",
299
+ "agent_entry_path": "AGENTS.md",
300
+ "standing_docs_root": "docs",
301
+ "spec_index_path": "docs/specs/README.md",
302
+ "module_docs_strategy": "source-local",
303
+ "module_docs_relative_path": "docs/README.md",
304
+ "module_docs_decision": {
305
+ "basis": "repo-standards-default",
306
+ "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/.",
307
+ "decided_by": "rarajes2@cisco.com (bootstrap questionnaire)",
308
+ "decided_at": "2026-11-12T11:54:25Z"
309
+ },
310
+ "repo_context_decision": {
311
+ "path": ".repo-context.json",
312
+ "schema_path": "schemas/repo-context.schema.json",
313
+ "action": "create",
314
+ "schema_action": "create",
315
+ "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.",
316
+ "decided_by": "rarajes2@cisco.com (bootstrap questionnaire)",
317
+ "decided_at": "2026-11-12T11:54:25Z"
318
+ },
319
+ "artifact_decisions": [
320
+ {
321
+ "path": "docs/service.md",
322
+ "action": "omit",
323
+ "reason": "Library package, not a deployable service. package.json has no start script, container, or deployment descriptor.",
324
+ "decided_by": "claude-code (code evidence)",
325
+ "decided_at": "2026-11-12T11:54:25Z"
326
+ },
327
+ {
328
+ "path": "mkdocs.yml",
329
+ "action": "omit",
330
+ "reason": "No package-level documentation site exists. Documentation publishing stays with the workspace.",
331
+ "decided_by": "claude-code (code evidence)",
332
+ "decided_at": "2026-11-12T11:54:25Z"
333
+ },
334
+ {
335
+ "path": "api-specs/openapi.yaml",
336
+ "action": "omit",
337
+ "reason": "The package serves no HTTP routes. It is a client of the client logs and conversation services; its published surface is the npm export described by support-internal-sdk.",
338
+ "decided_by": "claude-code (code evidence)",
339
+ "decided_at": "2026-11-12T11:54:25Z"
340
+ },
341
+ {
342
+ "path": "SECURITY.md",
343
+ "action": "omit",
344
+ "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.",
345
+ "decided_by": "claude-code (code evidence)",
346
+ "decided_at": "2026-11-12T11:54:25Z"
347
+ },
348
+ {
349
+ "path": "CONTRIBUTING.md",
350
+ "action": "omit",
351
+ "reason": "Contribution instructions are owned at the workspace root CONTRIBUTING.md.",
352
+ "decided_by": "claude-code (code evidence)",
353
+ "decided_at": "2026-11-12T11:54:25Z"
354
+ },
355
+ {
356
+ "path": "CHANGELOG.md",
357
+ "action": "omit",
358
+ "reason": "Changelog generation is owned at the workspace root. This package has no changelog file.",
359
+ "decided_by": "claude-code (code evidence)",
360
+ "decided_at": "2026-11-12T11:54:25Z"
361
+ },
362
+ {
363
+ "path": "CTO_CHECKLIST.yml",
364
+ "action": "omit",
365
+ "reason": "The CTO readiness checklist applies to deployable services. This package is a library.",
366
+ "decided_by": "claude-code (code evidence)",
367
+ "decided_at": "2026-11-12T11:54:25Z"
368
+ },
369
+ {
370
+ "path": "schemas/cto-checklist.schema.json",
371
+ "action": "omit",
372
+ "reason": "Omitted together with CTO_CHECKLIST.yml.",
373
+ "decided_by": "claude-code (code evidence)",
374
+ "decided_at": "2026-11-12T11:54:25Z"
375
+ }
376
+ ],
377
+ "template_roots": {
378
+ "canonical": ".sdd/templates/repo-standards"
379
+ },
380
+ "contract_index_path": "docs/architecture.md",
381
+ "repo_skills_root": ".sdd/skills",
382
+ "monorepo_package": {
383
+ "package_path": "packages/@webex/internal-plugin-support",
384
+ "root_manifest_path": "../../../.sdd/manifest.json",
385
+ "templates_root_path": "../../../.sdd/templates/repo-standards"
386
+ }
387
+ },
388
+ "tooling": {
389
+ "sdlc_skills": {
390
+ "source_ref": "repo-annotation@2.3.1"
391
+ }
392
+ },
393
+ "coverage_ratchet": {
394
+ "enabled": true,
395
+ "waivers": []
396
+ },
397
+ "substrate": {
398
+ "source": "WebexTools/repo-standards@d89a7fe59126ae3ad9bac9ca352aa7f12b4c85dc",
399
+ "consumed": [
400
+ "@webex/eslint-config-legacy via .eslintrc.js",
401
+ "@webex/babel-config-legacy via babel.config.js",
402
+ "@webex/jest-config-legacy via jest.config.js",
403
+ "@webex/legacy-tools build and test runner via package.json",
404
+ "package README.md (context only)",
405
+ "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)"
406
+ ],
407
+ "compliance_tier": "baseline"
408
+ },
409
+ "section_profiles": {
410
+ "repo": {
411
+ "owns_datastore": false,
412
+ "holds_client_state": true,
413
+ "components_interact": true,
414
+ "domain_data_across_components": true,
415
+ "caches_data": false,
416
+ "observability_convention": true,
417
+ "deploys_to_infra": false,
418
+ "shared_base_libs": true,
419
+ "is_monorepo": false,
420
+ "multi_platform": false,
421
+ "published_package": true,
422
+ "embedded_in_host": false,
423
+ "cross_repo_deps_material": true,
424
+ "security_arch_warranted": true,
425
+ "exposes_commands_or_artifacts": true
426
+ },
427
+ "resolved_by": "claude-code (code evidence; bootstrap questionnaire)",
428
+ "resolved_at": "2026-11-12T11:54:25Z"
429
+ }
430
+ }
package/AGENTS.md ADDED
@@ -0,0 +1,197 @@
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-12T12:27:40Z
7
+ validation_status: pass-with-warnings
8
+ -->
9
+
10
+ # AI Agent Instructions
11
+
12
+ Package-scoped SDD entry for `@webex/internal-plugin-support`, the internal `support` plugin of the SDK
13
+ (it uploads the SDK's logs to the client logs service with call and identity metadata, and fetches the
14
+ desk feedback and support URLs). 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, metadata keys, or resource 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) (Support 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 an internal 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 workspace
44
+ commands from the monorepo root.
45
+
46
+ | Task | Command |
47
+ | ---------------------- | ------- |
48
+ | Install dependencies | `yarn` (workspace root; the deploy workflow runs the same command). Fresh-checkout workspace setup (building `webex-legacy-tools` and sibling `dist/`) is owned by the workspace root; see [Prebuilding](../../../CONTRIBUTING.md#prebuilding) |
49
+ | Start dev environment | N/A — library package with no start script in `package.json` |
50
+ | Run tests | `yarn workspace @webex/internal-plugin-support test:unit` (after `build:src`; the spec imports the package by name, so it tests `dist/`) |
51
+ | Run linters | `yarn workspace @webex/internal-plugin-support test:style` |
52
+ | Build/release artifact | `yarn workspace @webex/internal-plugin-support 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/internal-plugin-support build` runs `yarn build:src` and produces the same
56
+ output; the package emits no type declarations.
57
+
58
+ Do not use the aggregate `test` script: it calls `test:integration`, which this package does not
59
+ define. `test:browser` runs the live-service spec in `test/integration/spec/support.js` through karma;
60
+ 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-support`.
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 `>=18`; 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 device plugin, registers internal plugin `support` with its config, and
95
+ default-exports `Support`.
96
+ - `src/support.js`: `Support`, with `getFeedbackUrl`, `getSupportUrl`, `submitLogs`, and
97
+ `_constructFileMetadata`. Spec: `src/docs/README.md`.
98
+ - `src/config.js`: `config.support` defaults and `config.device.preDiscoveryServices` entries.
99
+ - `test/unit/spec/support.js`: unit cases run by `test:unit`.
100
+ - `test/integration/spec/support.js`: live-service case run only by `test:browser`.
101
+ - `process`: package-root module exporting `{browser: true}`; not imported by `src/`.
102
+ - `dist/`: generated build output. Never edit by hand.
103
+ - `README.md`: retained npm page, context only; its Usage block is a placeholder; see
104
+ [ADR-0001](docs/adr/0001-retain-product-readme.md).
105
+
106
+ ### Critical Constraints
107
+
108
+ - The plugin is `webex.internal.support`; `@webex/calling`, `@webex/contact-center`, and
109
+ `@webex/plugin-meetings` call `submitLogs` and read `url`, `userId`, and `trackingid` from its result.
110
+ - `submitLogs` must commit the logger index only after a resolved upload, and roll it back only for a
111
+ failed diff upload with `retryFailedLogUploadsAtNextInterval`.
112
+ - `submitLogs` must reject with the upload error; callers report it.
113
+ - Metadata keys outside the fixed list in `src/support.js` are dropped; consumers rely on the key names.
114
+
115
+ ## 4. Testing Workflow
116
+
117
+ Run checks in this order:
118
+
119
+ 1. `yarn workspace @webex/internal-plugin-support build:src`
120
+ 2. `yarn workspace @webex/internal-plugin-support test:unit`
121
+ 3. `yarn workspace @webex/internal-plugin-support test:style`
122
+
123
+ Testing rules:
124
+
125
+ - Add or update cases in `test/unit/spec/support.js` for every behavior you change.
126
+ - Use `@webex/test-helper-mock-webex` with sinon stubs for `webex.upload`, `webex.request`,
127
+ `webex.credentials`, and `webex.logger`, and assert with `@webex/test-helper-chai`.
128
+ - Use `assert.calledOnceWithExactly` for call arguments, and parametrize when more than three cases are
129
+ alike, as the existing type and reset cases do.
130
+ - Cover failure paths and edge cases, not only happy paths.
131
+ - Do not remove tests to make CI pass.
132
+
133
+ No coverage gate applies to this package; do not infer one.
134
+
135
+ ## 5. Code Style and Patterns
136
+
137
+ Coding expectations:
138
+
139
+ - Follow repository style rules and static analysis output. The local `.eslintrc.js` sets
140
+ `root: true` and extends the legacy config.
141
+ - Prefer small functions over large procedural blocks.
142
+ - Make error handling explicit; keep rejecting with the original upload error.
143
+ - Keep public interfaces stable unless a breaking change is requested.
144
+
145
+ Pattern example:
146
+
147
+ ```text
148
+ Preferred:
149
+ - Add a metadata tag by adding its key to the list in _constructFileMetadata and a unit case for it.
150
+ - Let webex.upload run the phases; pass per-phase values through $-prefixed keys.
151
+
152
+ Avoid:
153
+ - Retrying the upload inside submitLogs.
154
+ - Calling formatLogs before the logger buffers exist.
155
+ - Treating README.md as a usage reference.
156
+ ```
157
+
158
+ ## 6. Git Workflow
159
+
160
+ - Branch naming: no package convention is defined; follow the workspace `CONTRIBUTING.md`.
161
+ - Commit format: conventional commits (`feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `chore:`), which
162
+ the workspace `CONTRIBUTING.md` requires for pull requests.
163
+ - Keep commits focused and reversible.
164
+ - Rebase on the target branch before opening a pull request.
165
+
166
+ PR checklist:
167
+
168
+ - What changed and why.
169
+ - Tests run and results.
170
+ - Risk and impact on `@webex/calling`, `@webex/contact-center`, `@webex/plugin-meetings`, and
171
+ first-party clients that call `webex.internal.support`.
172
+ - Rollback approach.
173
+
174
+ ## 7. Boundaries and Escalation
175
+
176
+ ### Always
177
+
178
+ - Prefer existing patterns over introducing new architecture.
179
+ - Keep changes minimal for the requested scope.
180
+ - Call out assumptions and unknowns explicitly.
181
+ - Update the owning module spec in the same change that alters observable behavior.
182
+
183
+ ### Ask First
184
+
185
+ - Adding dependencies.
186
+ - Renaming or removing a method, a metadata key, a config default, or the registered plugin name.
187
+ - Changing a resource, an upload phase option, or the service a request addresses.
188
+ - Changing the token choice or when the logger index is committed or rolled back.
189
+
190
+ ### Never
191
+
192
+ - Edit `dist/` by hand.
193
+ - Commit secrets, tokens, or credentials, including in test fixtures.
194
+ - Log log text, metadata values, tokens, user ids, or org ids.
195
+ - Add a `.sdd/templates` directory, a copy of the templates, or a link to them in this package. The
196
+ templates live once at the monorepo root, `../../../.sdd/templates/repo-standards`, and
197
+ `.sdd/manifest.json` refers to them through `layout.monorepo_package`.