@webex/internal-plugin-presence 3.13.0-next.4 → 3.13.0-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.repo-context.json +477 -0
- package/.sdd/manifest.json +428 -0
- package/AGENTS.md +208 -0
- package/dist/presence.js +1 -1
- package/docs/adr/0001-retain-product-readme.md +98 -0
- package/docs/adr/index.md +25 -0
- package/docs/architecture.md +266 -0
- package/docs/getting-started.md +134 -0
- package/docs/index.md +44 -0
- package/docs/specs/README.md +70 -0
- package/package.json +4 -4
- package/schemas/repo-context.schema.json +796 -0
- package/src/docs/README.md +515 -0
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 1,
|
|
3
|
+
"repository": {
|
|
4
|
+
"name": "@webex/internal-plugin-presence",
|
|
5
|
+
"purpose": "Internal plugin registered as webex.internal.presence for the presence service (catalog name apheleia). get() reads one user's composed presence; list() reads many through a Batcher that folds lookups into POST compositions; subscribe() POSTs subscriptions in batches of 50 and unsubscribe() sends subscriptionTtl 0; setStatus() POSTs events for the device user, without a label for dnd; enable(), disable(), and isEnabled() set and read the user-presence-enabled toggle through the feature plugin. Registration adds an inbound transform that copies body.eventType to body.status. An optional PresenceWorker, started by initializeWorker() or config.presence.initializeWorker, counts enqueue/dequeue watchers, fetches stale presence after a 300 ms debounce, subscribes users watched for a minute, renews watched subscriptions, listens to the Mercury event apheleia.subscription_update, expires update times after 10 minutes, and reports every change as an 'updated' event with a subscription, presence, or delete envelope. It stores nothing.",
|
|
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 workspace @webex/internal-plugin-presence build",
|
|
25
|
+
"source_file": "package.json",
|
|
26
|
+
"role": "compile",
|
|
27
|
+
"verified_at": "2026-11-12T12:58:11Z"
|
|
28
|
+
},
|
|
29
|
+
"build": {
|
|
30
|
+
"command": "yarn workspace @webex/internal-plugin-presence build:src",
|
|
31
|
+
"source_file": "../../../AGENTS.md",
|
|
32
|
+
"role": "package",
|
|
33
|
+
"verified_at": "2026-11-12T12:58:11Z"
|
|
34
|
+
},
|
|
35
|
+
"unit-test": {
|
|
36
|
+
"command": "yarn workspace @webex/internal-plugin-presence test:unit",
|
|
37
|
+
"source_file": "../../../AGENTS.md",
|
|
38
|
+
"role": "unit-test",
|
|
39
|
+
"verified_at": "2026-11-12T12:58:11Z"
|
|
40
|
+
},
|
|
41
|
+
"lint": {
|
|
42
|
+
"command": "yarn workspace @webex/internal-plugin-presence test:style",
|
|
43
|
+
"source_file": "package.json",
|
|
44
|
+
"role": "lint",
|
|
45
|
+
"verified_at": "2026-11-12T12:58:11Z"
|
|
46
|
+
},
|
|
47
|
+
"deploy": {
|
|
48
|
+
"command": "yarn workspace @webex/internal-plugin-presence deploy:npm",
|
|
49
|
+
"source_file": "package.json",
|
|
50
|
+
"role": "deploy"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"toolchain": [
|
|
54
|
+
{
|
|
55
|
+
"name": "node",
|
|
56
|
+
"version": ">=16",
|
|
57
|
+
"origin": "repo-config",
|
|
58
|
+
"source_file": "package.json"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "node",
|
|
62
|
+
"version": "22.14",
|
|
63
|
+
"origin": "repo-config",
|
|
64
|
+
"source_file": "../../../AGENTS.md"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "node",
|
|
68
|
+
"version": "lts/jod",
|
|
69
|
+
"origin": "repo-config",
|
|
70
|
+
"source_file": "../../../.nvmrc"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "node",
|
|
74
|
+
"version": "18.x",
|
|
75
|
+
"origin": "repo-config",
|
|
76
|
+
"source_file": "../../../package.json"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "yarn",
|
|
80
|
+
"version": "3.4.1",
|
|
81
|
+
"origin": "repo-config",
|
|
82
|
+
"source_file": "../../../package.json"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "babel",
|
|
86
|
+
"version": "^7.17.10",
|
|
87
|
+
"origin": "repo-config",
|
|
88
|
+
"source_file": "package.json"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "eslint",
|
|
92
|
+
"version": "^8.24.0",
|
|
93
|
+
"origin": "repo-config",
|
|
94
|
+
"source_file": "package.json"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "prettier",
|
|
98
|
+
"version": "^2.7.1",
|
|
99
|
+
"origin": "repo-config",
|
|
100
|
+
"source_file": "package.json"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"tests": {
|
|
104
|
+
"unit": {
|
|
105
|
+
"command_ref": "unit-test",
|
|
106
|
+
"dir": "test/unit/spec",
|
|
107
|
+
"framework": "jest"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"quality_gates": {
|
|
111
|
+
"code_coverage": {
|
|
112
|
+
"origin": "none",
|
|
113
|
+
"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)"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"coverage_status_definitions": {
|
|
117
|
+
"specced": ">=80% public surface specced, drift <5% - spec is authoritative",
|
|
118
|
+
"partial": "40-80% specced - spec is a hint, cross-check code",
|
|
119
|
+
"untracked": "<40% specced - code is the source of truth"
|
|
120
|
+
},
|
|
121
|
+
"spec_source_policy": {
|
|
122
|
+
"mode": "keep-separate",
|
|
123
|
+
"migrated_source_disposition": "retain",
|
|
124
|
+
"disposition_decided_by": "rarajes2@cisco.com",
|
|
125
|
+
"disposition_decided_at": "2026-11-12T12:46:09Z",
|
|
126
|
+
"decided_by": "rarajes2@cisco.com",
|
|
127
|
+
"decided_at": "2026-11-12T12:46:09Z",
|
|
128
|
+
"decision_record": "docs/adr/0001-retain-product-readme.md"
|
|
129
|
+
},
|
|
130
|
+
"spec_sources": [
|
|
131
|
+
{
|
|
132
|
+
"path": "README.md",
|
|
133
|
+
"scope": "repo",
|
|
134
|
+
"role": "reference-only",
|
|
135
|
+
"canonical": false,
|
|
136
|
+
"use_by_agents": "context-only",
|
|
137
|
+
"post_migration_action": "retain",
|
|
138
|
+
"deletion_status": "not-applicable",
|
|
139
|
+
"notes": "npm page, kept unchanged under keep-separate. Its Usage block ends with the placeholder member webex.internal.presence.WHATEVER and documents no method, event, or configuration; see docs/adr/0001-retain-product-readme.md."
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"modules": [
|
|
143
|
+
{
|
|
144
|
+
"path": "src",
|
|
145
|
+
"canonical_spec": "src/docs/README.md",
|
|
146
|
+
"coverage_status": "Partial",
|
|
147
|
+
"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/presence.js and test/unit/spec/presence-worker.js under Node 22.14 after build:src on 2026-11-12 and reports 2 skipped suites and 29 skipped cases: both suites are describe.skip because @webex/test-helper-mock-webex mounts a child named presence at webex.presence, not webex.internal.presence. No requirement or invariant has a running test. The integration spec test/integration/spec/presence.js is describe.skip (SPARK-413317) and 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 ran on 2026-11-12 (validator runtime 01a1cfda-147b-79f2-a595-31f4dfab09c2) and is blocked: 1 Blocking, 1 Important. A1-001, the missing rationale for omitting label on a dnd setStatus, stays open: rarajes2@cisco.com answered on 2026-11-12T13:10:05Z that the rationale is not known, so MOD-010 and INV-003 still record it as unknown. IMP-001 is an accepted warning (rarajes2@cisco.com, 2026-11-12T13:10:05Z): the workspace-qualified form (yarn workspace @webex/internal-plugin-presence 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. Held at Partial pending a confirmed dnd rationale, running unit cases, a characterization baseline, and promotion review.",
|
|
148
|
+
"last_assessed": "2026-11-12",
|
|
149
|
+
"contracts": {
|
|
150
|
+
"provides": [
|
|
151
|
+
"presence-internal-sdk"
|
|
152
|
+
],
|
|
153
|
+
"requires": [
|
|
154
|
+
"apheleia-presence-http",
|
|
155
|
+
"mercury-apheleia-subscription-update",
|
|
156
|
+
"webex-core-plugin-host",
|
|
157
|
+
"webex-core-batcher",
|
|
158
|
+
"webex-core-payload-transformer",
|
|
159
|
+
"webex-core-services",
|
|
160
|
+
"internal-plugin-feature-toggles",
|
|
161
|
+
"internal-plugin-mercury-connection",
|
|
162
|
+
"internal-plugin-device-identity",
|
|
163
|
+
"lodash"
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
"section_profile": {
|
|
167
|
+
"has_tiers": false,
|
|
168
|
+
"has_ui": false,
|
|
169
|
+
"crosses_service_boundaries": true,
|
|
170
|
+
"holds_client_state": true,
|
|
171
|
+
"enforces_domain_rules": true,
|
|
172
|
+
"is_concurrent_async": true,
|
|
173
|
+
"owns_persistence": false,
|
|
174
|
+
"stateful_transitions": true,
|
|
175
|
+
"exposes_wire_protocol": true,
|
|
176
|
+
"ui_multi_screen": false,
|
|
177
|
+
"large_data_model": false,
|
|
178
|
+
"returns_caller_errors": true,
|
|
179
|
+
"module_specific_conventions": true,
|
|
180
|
+
"published_package": true,
|
|
181
|
+
"embedded_in_host": false,
|
|
182
|
+
"has_design_tradeoff": true,
|
|
183
|
+
"resolved_by": "claude-code (code evidence; bootstrap questionnaire)",
|
|
184
|
+
"resolved_at": "2026-11-12T12:46:09Z",
|
|
185
|
+
"has_submodules": false,
|
|
186
|
+
"has_submodules_computed_by": "scripts/module_tree.py",
|
|
187
|
+
"has_submodules_computed_at": "2026-11-12T12:46:09Z"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
"contract_catalog": {
|
|
192
|
+
"index_path": "docs/architecture.md",
|
|
193
|
+
"definitions": {
|
|
194
|
+
"presence-internal-sdk": {
|
|
195
|
+
"kind": "sdk",
|
|
196
|
+
"publication": "published",
|
|
197
|
+
"source_kind": "repository-path",
|
|
198
|
+
"source": "package.json",
|
|
199
|
+
"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 Presence as internal plugin 'presence' with config {presence: {batcherWait: 50, batcherMaxCalls: 50, batcherMaxWait: 150}} and the inbound payloadTransformer predicate and transform normalizeSingleStatusResponse; the first registration of the name wins. The entry exports only the default Presence class. webex.internal.presence exposes enable, disable, isEnabled, get, list, subscribe, unsubscribe, setStatus, initializeWorker, enqueue, dequeue, emitEvent, and the 'updated' event with {type: subscription|presence|delete, payload}; specified in src/docs/README.md."
|
|
200
|
+
},
|
|
201
|
+
"apheleia-presence-http": {
|
|
202
|
+
"kind": "http",
|
|
203
|
+
"publication": "internal",
|
|
204
|
+
"source_kind": "external",
|
|
205
|
+
"source": "Presence service (catalog service name apheleia, reached through api: 'apheleia' and service: 'apheleia' in src/presence.js and src/presence-batcher.js; route definitions are not in this repository)",
|
|
206
|
+
"summary": "GET compositions?userId=<id> resolves one presence status object; POST compositions {subjects} resolves {statusList}; POST subscriptions {subjects, subscriptionTtl, includeStatus: true} resolves {responses: [{subject, responseCode, subscriptionTtl, status}]}, and subscriptionTtl 0 ends subscriptions; POST events {subject, eventType, label (absent for dnd), ttl} resolves a body with eventType and subject."
|
|
207
|
+
},
|
|
208
|
+
"mercury-apheleia-subscription-update": {
|
|
209
|
+
"kind": "event",
|
|
210
|
+
"publication": "internal",
|
|
211
|
+
"source_kind": "external",
|
|
212
|
+
"source": "Presence service push through Mercury (event name in src/constants.js; payload definition is not in this repository)",
|
|
213
|
+
"summary": "Mercury envelope whose data.eventType is apheleia.subscription_update, emitted by Mercury as event:apheleia.subscription_update; the worker reads data.subject and forwards data unchanged."
|
|
214
|
+
},
|
|
215
|
+
"webex-core-plugin-host": {
|
|
216
|
+
"kind": "sdk",
|
|
217
|
+
"publication": "published",
|
|
218
|
+
"source_kind": "external",
|
|
219
|
+
"source": "@webex/webex-core (workspace package; module spec consulted: packages/@webex/webex-core/src/docs/README.md)",
|
|
220
|
+
"summary": "registerInternalPlugin keys the plugin by its raw name (presence, first registration wins) and merges its config and payloadTransformer entries into the global defaults (MOD-008); WebexPlugin supplies webex, namespaced config (config.presence), trigger, and request; webex.ready and the ready event fire once the SDK is ready."
|
|
221
|
+
},
|
|
222
|
+
"webex-core-batcher": {
|
|
223
|
+
"kind": "sdk",
|
|
224
|
+
"publication": "published",
|
|
225
|
+
"source_kind": "external",
|
|
226
|
+
"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)",
|
|
227
|
+
"summary": "request(item) shares one promise per fingerprint; a capped debounce flushes at most batcherMaxCalls items using batcherWait and batcherMaxWait from the subclass namespace; a WebexHttpError whose options.body has no map, or any other flush error, rejects every queued item; a response item with no pending fingerprint throws Could not find pending request for received response."
|
|
228
|
+
},
|
|
229
|
+
"webex-core-payload-transformer": {
|
|
230
|
+
"kind": "sdk",
|
|
231
|
+
"publication": "published",
|
|
232
|
+
"source_kind": "external",
|
|
233
|
+
"source": "@webex/webex-core transform pipeline (module spec consulted: packages/@webex/webex-core/src/docs/README.md MOD-037; interceptors spec consulted: packages/@webex/webex-core/src/interceptors/docs/README.md INT-018)",
|
|
234
|
+
"summary": "transform('inbound', response) runs on every inbound response and error unless the request sets disableTransform; every predicate whose direction matches is tested, and each match applies every transform with the predicate's name."
|
|
235
|
+
},
|
|
236
|
+
"webex-core-services": {
|
|
237
|
+
"kind": "sdk",
|
|
238
|
+
"publication": "published",
|
|
239
|
+
"source_kind": "external",
|
|
240
|
+
"source": "@webex/webex-core services plugin (services spec consulted: packages/@webex/webex-core/src/lib/services/docs/README.md SVC-022)",
|
|
241
|
+
"summary": "ServiceInterceptor maps api to service, requires resource and service, waits for the service, and joins its catalog URL with the resource."
|
|
242
|
+
},
|
|
243
|
+
"internal-plugin-feature-toggles": {
|
|
244
|
+
"kind": "sdk",
|
|
245
|
+
"publication": "published",
|
|
246
|
+
"source_kind": "external",
|
|
247
|
+
"source": "@webex/internal-plugin-feature (workspace package, not declared in package.json; module spec consulted: packages/@webex/internal-plugin-feature/src/docs/README.md MOD-003, MOD-004, MOD-006)",
|
|
248
|
+
"summary": "getFeature('user', key) resolves the record value or null; setFeature('user', key, value) POSTs {key, mutable: true, val} to features/users/<userId>/user and resolves the merged record."
|
|
249
|
+
},
|
|
250
|
+
"internal-plugin-mercury-connection": {
|
|
251
|
+
"kind": "sdk",
|
|
252
|
+
"publication": "published",
|
|
253
|
+
"source_kind": "external",
|
|
254
|
+
"source": "@webex/internal-plugin-mercury (workspace package; module spec consulted, stale on its session model: packages/@webex/internal-plugin-mercury/src/docs/README.md MOD-009; code consulted: packages/@webex/internal-plugin-mercury/src/mercury.js)",
|
|
255
|
+
"summary": "connected is a boolean; connect() resolves at once when connected, registers the device first otherwise, and shares one in-flight promise; an envelope with a dotted data.eventType is emitted as event, event:<namespace>, and event:<eventType>."
|
|
256
|
+
},
|
|
257
|
+
"internal-plugin-device-identity": {
|
|
258
|
+
"kind": "sdk",
|
|
259
|
+
"publication": "published",
|
|
260
|
+
"source_kind": "external",
|
|
261
|
+
"source": "@webex/internal-plugin-device (workspace package; module spec consulted: packages/@webex/internal-plugin-device/src/docs/README.md)",
|
|
262
|
+
"summary": "Imported for its registration side effect. userId is a registration DTO property set from the WDM body."
|
|
263
|
+
},
|
|
264
|
+
"lodash": {
|
|
265
|
+
"kind": "sdk",
|
|
266
|
+
"publication": "published",
|
|
267
|
+
"source_kind": "external",
|
|
268
|
+
"source": "lodash@^4.17.21 (npm)",
|
|
269
|
+
"summary": "has tests the transform predicate path; debounce delays the worker fetch until 300 ms after the last enqueue that needs one."
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"spec_policy": {
|
|
274
|
+
"require_what_and_why": true,
|
|
275
|
+
"require_provenance": true,
|
|
276
|
+
"protected_specs": [
|
|
277
|
+
"src/docs/README.md"
|
|
278
|
+
]
|
|
279
|
+
},
|
|
280
|
+
"validation": {
|
|
281
|
+
"generator_runtime": "claude-code",
|
|
282
|
+
"generator_model": "claude-opus-5-5",
|
|
283
|
+
"generator_runtime_source": "host-metadata",
|
|
284
|
+
"source_commit": "fed37cf37c466344411833d640975e6fea9881b6",
|
|
285
|
+
"minimum_independence": "different-runtime",
|
|
286
|
+
"blocking_severities": [
|
|
287
|
+
"Blocking"
|
|
288
|
+
],
|
|
289
|
+
"validator_runtime": "01a1cfda-147b-79f2-a595-31f4dfab09c2",
|
|
290
|
+
"validator_runtime_source": "invocation-input",
|
|
291
|
+
"validator_run_id": "01a1cfda-147b-79f2-a595-31f4dfab09c2",
|
|
292
|
+
"runtime_fallback_tier": "different-runtime"
|
|
293
|
+
},
|
|
294
|
+
"layout": {
|
|
295
|
+
"sdd_root": ".sdd",
|
|
296
|
+
"docs_root": "docs",
|
|
297
|
+
"agent_entry_path": "AGENTS.md",
|
|
298
|
+
"standing_docs_root": "docs",
|
|
299
|
+
"spec_index_path": "docs/specs/README.md",
|
|
300
|
+
"module_docs_strategy": "source-local",
|
|
301
|
+
"module_docs_relative_path": "docs/README.md",
|
|
302
|
+
"module_docs_decision": {
|
|
303
|
+
"basis": "repo-standards-default",
|
|
304
|
+
"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/.",
|
|
305
|
+
"decided_by": "rarajes2@cisco.com (bootstrap questionnaire)",
|
|
306
|
+
"decided_at": "2026-11-12T12:46:09Z"
|
|
307
|
+
},
|
|
308
|
+
"repo_context_decision": {
|
|
309
|
+
"path": ".repo-context.json",
|
|
310
|
+
"schema_path": "schemas/repo-context.schema.json",
|
|
311
|
+
"action": "create",
|
|
312
|
+
"schema_action": "create",
|
|
313
|
+
"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.",
|
|
314
|
+
"decided_by": "rarajes2@cisco.com (bootstrap questionnaire)",
|
|
315
|
+
"decided_at": "2026-11-12T12:46:09Z"
|
|
316
|
+
},
|
|
317
|
+
"artifact_decisions": [
|
|
318
|
+
{
|
|
319
|
+
"path": "docs/service.md",
|
|
320
|
+
"action": "omit",
|
|
321
|
+
"reason": "Library package, not a deployable service. package.json has no start script, container, or deployment descriptor.",
|
|
322
|
+
"decided_by": "claude-code (code evidence)",
|
|
323
|
+
"decided_at": "2026-11-12T12:46:09Z"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"path": "mkdocs.yml",
|
|
327
|
+
"action": "omit",
|
|
328
|
+
"reason": "No package-level documentation site exists. Documentation publishing stays with the workspace.",
|
|
329
|
+
"decided_by": "claude-code (code evidence)",
|
|
330
|
+
"decided_at": "2026-11-12T12:46:09Z"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"path": "api-specs/openapi.yaml",
|
|
334
|
+
"action": "omit",
|
|
335
|
+
"reason": "The package serves no HTTP routes. It is a client of the presence service; its published surface is the npm export described by presence-internal-sdk.",
|
|
336
|
+
"decided_by": "claude-code (code evidence)",
|
|
337
|
+
"decided_at": "2026-11-12T12:46:09Z"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"path": "SECURITY.md",
|
|
341
|
+
"action": "omit",
|
|
342
|
+
"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.",
|
|
343
|
+
"decided_by": "claude-code (code evidence)",
|
|
344
|
+
"decided_at": "2026-11-12T12:46:09Z"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"path": "CONTRIBUTING.md",
|
|
348
|
+
"action": "omit",
|
|
349
|
+
"reason": "Contribution instructions are owned at the workspace root CONTRIBUTING.md.",
|
|
350
|
+
"decided_by": "claude-code (code evidence)",
|
|
351
|
+
"decided_at": "2026-11-12T12:46:09Z"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"path": "CHANGELOG.md",
|
|
355
|
+
"action": "omit",
|
|
356
|
+
"reason": "Changelog generation is owned at the workspace root. This package has no changelog file.",
|
|
357
|
+
"decided_by": "claude-code (code evidence)",
|
|
358
|
+
"decided_at": "2026-11-12T12:46:09Z"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
"path": "CTO_CHECKLIST.yml",
|
|
362
|
+
"action": "omit",
|
|
363
|
+
"reason": "The CTO readiness checklist applies to deployable services. This package is a library.",
|
|
364
|
+
"decided_by": "claude-code (code evidence)",
|
|
365
|
+
"decided_at": "2026-11-12T12:46:09Z"
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"path": "schemas/cto-checklist.schema.json",
|
|
369
|
+
"action": "omit",
|
|
370
|
+
"reason": "Omitted together with CTO_CHECKLIST.yml.",
|
|
371
|
+
"decided_by": "claude-code (code evidence)",
|
|
372
|
+
"decided_at": "2026-11-12T12:46:09Z"
|
|
373
|
+
}
|
|
374
|
+
],
|
|
375
|
+
"template_roots": {
|
|
376
|
+
"canonical": ".sdd/templates/repo-standards"
|
|
377
|
+
},
|
|
378
|
+
"contract_index_path": "docs/architecture.md",
|
|
379
|
+
"repo_skills_root": ".sdd/skills",
|
|
380
|
+
"monorepo_package": {
|
|
381
|
+
"package_path": "packages/@webex/internal-plugin-presence",
|
|
382
|
+
"root_manifest_path": "../../../.sdd/manifest.json",
|
|
383
|
+
"templates_root_path": "../../../.sdd/templates/repo-standards"
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
"tooling": {
|
|
387
|
+
"sdlc_skills": {
|
|
388
|
+
"source_ref": "repo-annotation@2.3.1"
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
"coverage_ratchet": {
|
|
392
|
+
"enabled": true,
|
|
393
|
+
"waivers": []
|
|
394
|
+
},
|
|
395
|
+
"substrate": {
|
|
396
|
+
"source": "WebexTools/repo-standards@d89a7fe59126ae3ad9bac9ca352aa7f12b4c85dc",
|
|
397
|
+
"consumed": [
|
|
398
|
+
"@webex/eslint-config-legacy via .eslintrc.js",
|
|
399
|
+
"@webex/babel-config-legacy via babel.config.js",
|
|
400
|
+
"@webex/jest-config-legacy via jest.config.js",
|
|
401
|
+
"@webex/legacy-tools build and test runner via package.json",
|
|
402
|
+
"package README.md (context only)",
|
|
403
|
+
"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)"
|
|
404
|
+
],
|
|
405
|
+
"compliance_tier": "baseline"
|
|
406
|
+
},
|
|
407
|
+
"section_profiles": {
|
|
408
|
+
"repo": {
|
|
409
|
+
"owns_datastore": false,
|
|
410
|
+
"holds_client_state": true,
|
|
411
|
+
"components_interact": true,
|
|
412
|
+
"domain_data_across_components": true,
|
|
413
|
+
"caches_data": false,
|
|
414
|
+
"observability_convention": false,
|
|
415
|
+
"deploys_to_infra": false,
|
|
416
|
+
"shared_base_libs": true,
|
|
417
|
+
"is_monorepo": false,
|
|
418
|
+
"multi_platform": false,
|
|
419
|
+
"published_package": true,
|
|
420
|
+
"embedded_in_host": false,
|
|
421
|
+
"cross_repo_deps_material": true,
|
|
422
|
+
"security_arch_warranted": true,
|
|
423
|
+
"exposes_commands_or_artifacts": true
|
|
424
|
+
},
|
|
425
|
+
"resolved_by": "claude-code (code evidence; bootstrap questionnaire)",
|
|
426
|
+
"resolved_at": "2026-11-12T12:46:09Z"
|
|
427
|
+
}
|
|
428
|
+
}
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
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-12T13:05:26Z
|
|
7
|
+
validation_status: blocked
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
# AI Agent Instructions
|
|
11
|
+
|
|
12
|
+
Package-scoped SDD entry for `@webex/internal-plugin-presence`, the internal `presence` plugin of the
|
|
13
|
+
SDK (it reads, subscribes to, and sets user presence on the presence service, switches the presence
|
|
14
|
+
feature toggle, and runs an optional worker that keeps shown users' presence current). This file
|
|
15
|
+
orients agents. The monorepo root `AGENTS.md` governs workspace-wide setup.
|
|
16
|
+
|
|
17
|
+
## Working Method
|
|
18
|
+
|
|
19
|
+
- Read the relevant package files before editing. Do not edit blind.
|
|
20
|
+
- Understand the task and affected surfaces before writing code.
|
|
21
|
+
- Prefer focused edits over rewriting whole files.
|
|
22
|
+
- Do not invent commands, paths, exports, event names, or 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) (Presence 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); 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 workspace @webex/internal-plugin-presence test:unit` (after `build:src`; the specs import the package by name, so they test `dist/`) |
|
|
51
|
+
| Run linters | `yarn workspace @webex/internal-plugin-presence test:style` |
|
|
52
|
+
| Build/release artifact | `yarn workspace @webex/internal-plugin-presence 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-presence build` runs `yarn build:src` and produces the same
|
|
56
|
+
output; the package emits no type declarations.
|
|
57
|
+
|
|
58
|
+
Every unit case is skipped today, so `test:unit` passing proves nothing about behavior; see
|
|
59
|
+
[Getting started](docs/getting-started.md#tests). Do not use the aggregate `test` script: it calls
|
|
60
|
+
`test:integration`, which this package does not define. `test:browser` runs the skipped live-service
|
|
61
|
+
spec in `test/integration/spec/presence.js` through karma.
|
|
62
|
+
|
|
63
|
+
If a required command is unknown, stop and ask for the exact command.
|
|
64
|
+
|
|
65
|
+
## 2. Agent Persona and Scope
|
|
66
|
+
|
|
67
|
+
You are the Webex JS SDK engineering assistant for `@webex/internal-plugin-presence`.
|
|
68
|
+
|
|
69
|
+
Primary outcomes:
|
|
70
|
+
|
|
71
|
+
- Deliver production-safe changes with build, unit tests, and lint passing.
|
|
72
|
+
- Preserve existing behavior unless a change request explicitly requires a behavior change.
|
|
73
|
+
- Keep docs and configuration aligned with code changes.
|
|
74
|
+
|
|
75
|
+
Definition of done:
|
|
76
|
+
|
|
77
|
+
1. Requested change is implemented.
|
|
78
|
+
2. Build, unit tests, and lint pass locally.
|
|
79
|
+
3. Updated docs cover new behavior, including the owning module spec.
|
|
80
|
+
4. PR summary includes risks and rollback notes.
|
|
81
|
+
|
|
82
|
+
## 3. Repository Knowledge
|
|
83
|
+
|
|
84
|
+
### Tech Stack
|
|
85
|
+
|
|
86
|
+
| Area | Tooling | Version |
|
|
87
|
+
| ---------------- | ------- | ------- |
|
|
88
|
+
| Language runtime | node; JavaScript sources | 22.14 (workspace root `AGENTS.md`; `.nvmrc` `lts/jod`); package `engines` accepts `>=16`; the workspace root `package.json` `engines.node` reads `18.x` |
|
|
89
|
+
| Build tool | yarn workspaces and `@webex/legacy-tools` over babel | yarn `3.4.1` (root `packageManager`), `@babel/core` `^7.17.10` |
|
|
90
|
+
| Test framework | jest through `webex-legacy-tools` and `@webex/jest-config-legacy`, with sinon, `@webex/test-helper-chai`, and `@webex/test-helper-mock-webex` | — |
|
|
91
|
+
| Lint/format | eslint via `@webex/eslint-config-legacy`, prettier | eslint `^8.24.0`, prettier `^2.7.1` |
|
|
92
|
+
|
|
93
|
+
### Project Map
|
|
94
|
+
|
|
95
|
+
- `src/index.js`: imports the device plugin, registers internal plugin `presence` with its inbound
|
|
96
|
+
transform and config, and default-exports `Presence`.
|
|
97
|
+
- `src/presence.js`: `Presence`, with the feature toggle, the presence service requests, `emitEvent`,
|
|
98
|
+
and the worker entry points. Spec: `src/docs/README.md`.
|
|
99
|
+
- `src/presence-batcher.js`: `PresenceBatcher`, which batches `list` lookups.
|
|
100
|
+
- `src/presence-worker.js`: `PresenceWorker`, the watch, fetch, subscribe, renew, and expiry upkeep.
|
|
101
|
+
- `src/constants.js`: worker timings, event names, and envelope types.
|
|
102
|
+
- `src/config.js`: `config.presence` batcher defaults.
|
|
103
|
+
- `test/unit/spec/presence.js`, `test/unit/spec/presence-worker.js`: unit cases, all skipped.
|
|
104
|
+
- `test/integration/spec/presence.js`: live-service cases, skipped.
|
|
105
|
+
- `process`: package-root module exporting `{browser: true}`; not imported by `src/`.
|
|
106
|
+
- `dist/`: generated build output. Never edit by hand.
|
|
107
|
+
- `README.md`: retained npm page, context only; its Usage block is a placeholder; see
|
|
108
|
+
[ADR-0001](docs/adr/0001-retain-product-readme.md).
|
|
109
|
+
|
|
110
|
+
### Critical Constraints
|
|
111
|
+
|
|
112
|
+
- The plugin is `webex.internal.presence`; clients listen to its `updated` event and switch on the
|
|
113
|
+
envelope `type` (`subscription`, `presence`, `delete`).
|
|
114
|
+
- `subscribe` must keep at most 50 subjects per request, and `setStatus` must leave out `label` only
|
|
115
|
+
for `dnd`.
|
|
116
|
+
- The worker keeps times and counts only; presence objects belong to the client.
|
|
117
|
+
- The inbound transform runs on every SDK response; keep its predicate narrow.
|
|
118
|
+
|
|
119
|
+
## 4. Testing Workflow
|
|
120
|
+
|
|
121
|
+
Run checks in this order:
|
|
122
|
+
|
|
123
|
+
1. `yarn workspace @webex/internal-plugin-presence build:src`
|
|
124
|
+
2. `yarn workspace @webex/internal-plugin-presence test:unit`
|
|
125
|
+
3. `yarn workspace @webex/internal-plugin-presence test:style`
|
|
126
|
+
|
|
127
|
+
Run `yarn prebuild:modules` once on a fresh checkout so `webex-legacy-tools` and the sibling packages'
|
|
128
|
+
`dist/` exist.
|
|
129
|
+
|
|
130
|
+
Testing rules:
|
|
131
|
+
|
|
132
|
+
- Add or update cases in `test/unit/spec/presence.js` or `test/unit/spec/presence-worker.js` for every
|
|
133
|
+
behavior you change, in a suite that actually runs. `@webex/test-helper-mock-webex` mounts a child
|
|
134
|
+
named `presence` at `webex.presence`, not `webex.internal.presence`, which is why both suites are
|
|
135
|
+
skipped; a running case must mount the plugin under another name or construct the class directly.
|
|
136
|
+
- Use sinon stubs for `webex.request`, `webex.internal.mercury`, and `webex.internal.feature`, and
|
|
137
|
+
assert with `@webex/test-helper-chai`.
|
|
138
|
+
- Use `sinon.useFakeTimers()` for the worker's debounce and interval, `assert.calledOnceWithExactly`
|
|
139
|
+
for call arguments, and parametrize when more than three cases are alike.
|
|
140
|
+
- Cover failure paths and edge cases, not only happy paths.
|
|
141
|
+
- Do not remove tests to make CI pass.
|
|
142
|
+
|
|
143
|
+
No coverage gate applies to this package; do not infer one.
|
|
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; keep argument failures as rejected promises.
|
|
153
|
+
- Keep public interfaces stable unless a breaking change is requested.
|
|
154
|
+
|
|
155
|
+
Pattern example:
|
|
156
|
+
|
|
157
|
+
```text
|
|
158
|
+
Preferred:
|
|
159
|
+
- Report a new worker change through emitEvent(PRESENCE_UPDATE, {type: ENVELOPE_TYPE.<type>, payload}).
|
|
160
|
+
- Put a new timing in src/constants.js and reference it from the worker.
|
|
161
|
+
|
|
162
|
+
Avoid:
|
|
163
|
+
- Storing presence objects in the worker.
|
|
164
|
+
- Starting another interval or Mercury listener without a way to stop it.
|
|
165
|
+
- Treating README.md as a usage reference.
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## 6. Git Workflow
|
|
169
|
+
|
|
170
|
+
- Branch naming: no package convention is defined; follow the workspace `CONTRIBUTING.md`.
|
|
171
|
+
- Commit format: conventional commits (`feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `chore:`), which
|
|
172
|
+
the workspace `CONTRIBUTING.md` requires for pull requests.
|
|
173
|
+
- Keep commits focused and reversible.
|
|
174
|
+
- Rebase on the target branch before opening a pull request.
|
|
175
|
+
|
|
176
|
+
PR checklist:
|
|
177
|
+
|
|
178
|
+
- What changed and why.
|
|
179
|
+
- Tests run and results.
|
|
180
|
+
- Risk and impact on first-party clients that call `webex.internal.presence` or handle its
|
|
181
|
+
`updated` event.
|
|
182
|
+
- Rollback approach.
|
|
183
|
+
|
|
184
|
+
## 7. Boundaries and Escalation
|
|
185
|
+
|
|
186
|
+
### Always
|
|
187
|
+
|
|
188
|
+
- Prefer existing patterns over introducing new architecture.
|
|
189
|
+
- Keep changes minimal for the requested scope.
|
|
190
|
+
- Call out assumptions and unknowns explicitly.
|
|
191
|
+
- Update the owning module spec in the same change that alters observable behavior.
|
|
192
|
+
|
|
193
|
+
### Ask First
|
|
194
|
+
|
|
195
|
+
- Adding dependencies, including declaring `@webex/internal-plugin-feature`.
|
|
196
|
+
- Renaming or removing a method, the `updated` event, an envelope type, a config default, or the
|
|
197
|
+
registered plugin name.
|
|
198
|
+
- Changing a resource, a request body, the subscribe batch size, or a worker timing.
|
|
199
|
+
- Changing or widening the inbound transform.
|
|
200
|
+
|
|
201
|
+
### Never
|
|
202
|
+
|
|
203
|
+
- Edit `dist/` by hand.
|
|
204
|
+
- Commit secrets, tokens, or credentials, including in test fixtures.
|
|
205
|
+
- Log presence data, statuses, or user ids.
|
|
206
|
+
- Add a `.sdd/templates` directory, a copy of the templates, or a link to them in this package. The
|
|
207
|
+
templates live once at the monorepo root, `../../../.sdd/templates/repo-standards`, and
|
|
208
|
+
`.sdd/manifest.json` refers to them through `layout.monorepo_package`.
|
package/dist/presence.js
CHANGED
|
@@ -277,7 +277,7 @@ var Presence = _webexCore.WebexPlugin.extend({
|
|
|
277
277
|
dequeue: function dequeue(id) {
|
|
278
278
|
return this.worker.dequeue(id);
|
|
279
279
|
},
|
|
280
|
-
version: "3.13.0-next.
|
|
280
|
+
version: "3.13.0-next.5"
|
|
281
281
|
});
|
|
282
282
|
var _default2 = exports.default = Presence;
|
|
283
283
|
//# sourceMappingURL=presence.js.map
|