@webex/internal-plugin-dss 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.
@@ -0,0 +1,103 @@
1
+ ---
2
+ type: ADR
3
+ title: ADR-0001 - Retain the product README
4
+ description: SDD onboarding keeps README.md as product documentation and routes it only as context.
5
+ tags: [adr]
6
+ timestamp: 2026-11-12T10:05:00Z
7
+ status: accepted
8
+ ---
9
+ <!-- sdd-generated-metadata
10
+ doc_kind: standing-doc
11
+ generated_from: adr@0.3.0
12
+ generated_by: claude-code
13
+ approved_by: rarajes2@cisco.com
14
+ updated_at: 2026-11-12T10:21:50Z
15
+ validation_status: pass-with-warnings
16
+ -->
17
+
18
+ # ADR-0001 - Retain the product README
19
+
20
+ | Field | Value |
21
+ | ------------- | ----- |
22
+ | Status | Accepted |
23
+ | Decision date | 2026-11-12 |
24
+ | Deciders | rarajes2@cisco.com (bootstrap questionnaire) |
25
+ | Supersedes | N/A |
26
+ | Superseded by | N/A |
27
+
28
+ ## Context
29
+
30
+ Onboarding found one existing document, `README.md`. It is the npm usage page: an install command,
31
+ register and unregister examples, and examples of `lookupDetail`, `lookup`, `lookupByEmail`, and
32
+ `search`. No other intent, design, or AI-authored spec exists in this package.
33
+
34
+ Several of its claims no longer match the code:
35
+
36
+ | README claim | Code |
37
+ | ------------ | ---- |
38
+ | `lookup({ids: [...]})` looks up several identities in one call | `lookup` takes one `id` (`LookupOptions` in `src/types.ts`) and resolves one entity or `null`; several ids are combined only by the batcher (`src/dss.ts`) |
39
+ | `lookupByEmail({emails: [...]})` looks up several emails | `lookupByEmail` takes one `email` (`LookupByEmailOptions`) and resolves one entity or `null` (`src/dss.ts`) |
40
+ | `register()` and `unregister()` connect to and disconnect from mercury | `register` connects; `unregister` only removes the two mercury listeners and resets `registered` (`src/dss.ts`) |
41
+ | `search` is called with a bare `PERSON` value | No `PERSON` binding is exported; `src/index.ts` exports only the default `DSS`, and the values are the strings in `SearchType` (`src/types.ts`) |
42
+ | The methods listed | It omits `lookupByPhoneNumbers`, `searchPlaces`, the `shouldBatch` option of `lookup`, the `search` device flags, and the `dss:*` events (`src/dss.ts`, `src/constants.ts`) |
43
+
44
+ ## Decision
45
+
46
+ Keep `README.md` unchanged. Do not migrate it into the module specification. Record
47
+ `spec_source_policy.mode` as `keep-separate` with `migrated_source_disposition` `retain`, and route
48
+ `README.md` in `spec_sources` as `reference-only` and `context-only`.
49
+
50
+ The canonical behavior is `src/` plus `test/`. Where the README differs from code, code wins and the
51
+ module specification follows code.
52
+
53
+ ## Why
54
+
55
+ The README is the npm-facing page. Correcting it is a product-doc change, not a requirement of making
56
+ the package SDD-ready, and the other onboarded packages in this workspace kept their READMEs the same
57
+ way. The module specification records the current method signatures, resources, events, and result
58
+ shapes, so nothing in the README needs to be preserved by migration.
59
+
60
+ ## Alternatives considered
61
+
62
+ | Alternative | Why it was not selected |
63
+ | ----------- | ----------------------- |
64
+ | Migrate the README into `src/docs/README.md` and delete it | Several call signatures in it are stale, so migrating them would carry wrong content; deletion was not requested |
65
+ | Reconcile the README with the module specification in place | Reconciling would preserve stale wording in the canonical spec; the developer chose `keep-separate` |
66
+ | Correct the README during onboarding | Onboarding writes the SDD tree only and does not edit `README.md` |
67
+
68
+ ## Consequences
69
+
70
+ **Positive:**
71
+
72
+ - The npm page stays stable for consumers.
73
+ - The module specification is the single behavioral reference.
74
+
75
+ **Negative / tradeoffs:**
76
+
77
+ - Agents must not treat `README.md` as the reference for method signatures or the `unregister`
78
+ behavior.
79
+ - The stale README remains until a maintainer makes a separate product-doc change.
80
+
81
+ ## Constraint on future changes
82
+
83
+ Do not delete `README.md` as part of spec maintenance. If its usage text changes, keep the module
84
+ specification aligned with code rather than with the README.
85
+
86
+ ## Follow-up
87
+
88
+ - [ ] A maintainer may correct the README `lookup` and `lookupByEmail` signatures, the `unregister`
89
+ description, and add the missing methods in a separate product-doc change.
90
+
91
+ ## Revisit when
92
+
93
+ - A maintainer rewrites the README to match the single-value `lookup` and `lookupByEmail` options and
94
+ documents `lookupByPhoneNumbers` and `searchPlaces`.
95
+
96
+ ## References
97
+
98
+ - `README.md`
99
+ - `src/index.ts`
100
+ - `src/dss.ts`
101
+ - `src/constants.ts`
102
+ - `src/types.ts`
103
+ - `.sdd/manifest.json` `spec_source_policy`
@@ -0,0 +1,25 @@
1
+ <!-- sdd-generated-metadata
2
+ doc_kind: standing-doc
3
+ generated_from: adr-index@0.3.0
4
+ generated_by: claude-code
5
+ approved_by: rarajes2@cisco.com
6
+ updated_at: 2026-11-12T10:21:50Z
7
+ validation_status: pass-with-warnings
8
+ -->
9
+
10
+ # Architectural decision records
11
+
12
+ Numbered, append-only records of structural decisions affecting this package and its documentation.
13
+ Add a concrete ADR (for example, `0042-cache-policy.md`) when a decision is non-obvious, hard to
14
+ reverse, or worth explaining to a future contributor. Do not edit an accepted decision in place when
15
+ its outcome changes; supersede it with a new ADR and link both records.
16
+
17
+ ## Index
18
+
19
+ - [ADR-0001 - Retain the product README](0001-retain-product-readme.md) — accepted 2026-11-12
20
+
21
+ Add new entries as ADRs are accepted. Keep this list in numeric order.
22
+
23
+ Each ADR should state its context, decision, alternatives, consequences, and the condition that would
24
+ cause the team to revisit it. Record the deciders, any superseded decision, and the constraint future
25
+ changes must preserve.
@@ -0,0 +1,275 @@
1
+ ---
2
+ type: Architecture
3
+ title: '@webex/internal-plugin-dss architecture'
4
+ description: Package-wide boundaries, resources, interactions, dependencies, and cross-cutting architecture.
5
+ tags: [architecture]
6
+ ---
7
+ <!-- sdd-generated-metadata
8
+ doc_kind: standing-doc
9
+ generated_from: architecture@0.3.0
10
+ generated_by: claude-code
11
+ approved_by: rarajes2@cisco.com
12
+ updated_at: 2026-11-12T10:21:50Z
13
+ validation_status: pass-with-warnings
14
+ -->
15
+
16
+ # @webex/internal-plugin-dss architecture
17
+
18
+ Canonical architecture for this package. Flow behavior lives in the
19
+ [DSS plugin specification](../src/docs/README.md). This page owns package boundaries, the plugin
20
+ registration, the contract index, and how the package meets the rest of the SDK.
21
+
22
+ Related context: [specification registry](specs/README.md) ·
23
+ [package agent instructions](../AGENTS.md)
24
+
25
+ ## Applicability
26
+
27
+ | Condition ID | Status | Evidence or reason | Owned section |
28
+ | ------------------------------------ | ---------- | ------------------ | ------------- |
29
+ | `repo.owns_datastore` | N/A | No database, file store, or migration in `src/dss.ts` | Repository data and schema |
30
+ | `repo.holds_client_state` | Applicable | The `registered` flag, the per-resource batchers, and per-query listeners and timers in `src/dss.ts` | Client state model |
31
+ | `repo.components_interact` | Applicable | `src/dss.ts` drives mercury, the webex-core `Batcher`, and `webex.request` | Dependency and interaction topology |
32
+ | `repo.domain_data_across_components` | Applicable | Directory entities, emails, and phone numbers pass between the caller, the Directory Search Service, and mercury in `src/dss.ts` | Object and data ownership |
33
+ | `repo.caches_data` | N/A | `src/dss.ts` keeps no result cache; the batcher holds only pending requests | Caching catalog |
34
+ | `repo.observability_convention` | Applicable | Log lines through `this.logger` with the `DSS-><method>#<LEVEL>` prefix in `src/dss.ts` | Observability patterns |
35
+ | `repo.deploys_to_infra` | N/A | Library published to npm (`package.json`). No service runtime | Runtime and infrastructure |
36
+ | `repo.shared_base_libs` | Applicable | Extends WebexPlugin and Batcher from webex-core and uses the legacy build, lint, and test stack (`babel.config.js`, `jest.config.js`, `.eslintrc.js`) | Shared and base libraries |
37
+ | `repo.is_monorepo` | N/A | This SDD root is one package. The workspace around it is out of scope | Package map and inter-package dependencies |
38
+ | `repo.multi_platform` | N/A | `src/dss.ts` uses no platform-specific API; `process` declares only `{browser: true}` | Platform matrix |
39
+ | `repo.published_package` | Applicable | `package.json` name is @webex/internal-plugin-dss and deploy:npm publishes it | Release and versioning |
40
+ | `repo.embedded_in_host` | N/A | No host theme or embed API in `src/dss.ts` | Host integration and theming |
41
+ | `repo.exposes_commands_or_artifacts` | Applicable | build:src in `package.json` writes dist | Commands and generated artifacts |
42
+ | `repo.cross_repo_deps_material` | Applicable | Behavior depends on the Directory Search Service (`src/dss.ts`, `src/constants.ts`) | Cross-repository topology |
43
+ | `repo.security_arch_warranted` | Applicable | Organization directory data (names, emails, phone numbers) passes through `src/dss.ts` | Security architecture |
44
+
45
+ ## Design overview
46
+
47
+ `@webex/internal-plugin-dss` is a published TypeScript library with one module. Importing it
48
+ registers `DSS` as the internal plugin `dss`, reached as `webex.internal.dss`, with a default
49
+ `requestTimeout` of 6000 ms and batcher limits of 50 ms, 50 values, and 150 ms. Inside this
50
+ repository only the `webex` bundle loads it (`packages/webex/src/webex.js`); first-party clients call
51
+ its methods.
52
+
53
+ The plugin queries the Directory Search Service for the user's organization: lookups by identity id,
54
+ email, or phone number, and searches for people, devices, rooms, robots, and places. A query is an
55
+ HTTP POST to the `directorySearch` service whose response the plugin never reads; the result comes
56
+ back as numbered pages over the shared mercury socket. The plugin matches pages to the query by the
57
+ request id it sent, waits for the page marked `finished` and every earlier sequence, and resolves the
58
+ concatenated result. An inactivity timer rejects a query that goes silent with `DssTimeoutError`.
59
+ `lookup` calls are batched per resource by default.
60
+
61
+ `register()` must run first: it connects mercury and subscribes to the two directory events. The
62
+ package serves no routes and persists nothing.
63
+
64
+ ## Resource inventory and responsibilities
65
+
66
+ | Resource | Kind | Responsibility | Owner | Source | Detailed specification |
67
+ | -------- | ---- | -------------- | ----- | ------ | ---------------------- |
68
+ | DSS plugin | package (one module) | Registration, directory lookups and searches, page assembly, inactivity timeout, lookup batching | @webex/web-sdk | `src` | [`src/docs/README.md`](../src/docs/README.md) |
69
+
70
+ ## Interaction and execution flows
71
+
72
+ Representative end-to-end flow: a client registers once, looks up several people, and receives one
73
+ entity or `null` per id.
74
+
75
+ ```mermaid
76
+ flowchart LR
77
+ Client[First-party client] -->|register| Plugin[webex.internal.dss]
78
+ Plugin -->|connect, on| Merc[webex.internal.mercury]
79
+ Client -->|lookup id per person| Plugin
80
+ Plugin -->|queue per resource| Batcher[DssBatcher]
81
+ Batcher -->|one query with lookupValues| Plugin
82
+ Plugin -->|POST lookup via webex.request| DSS[Directory Search Service]
83
+ DSS -->|result pages| Merc
84
+ Merc -->|event:directory.lookup| Plugin
85
+ Plugin -->|entity or null per caller| Client
86
+ ```
87
+
88
+ | From | To | Interaction or transport | Purpose | Failure or compatibility behavior |
89
+ | ---- | -- | ------------------------ | ------- | --------------------------------- |
90
+ | Client | `webex.internal.dss` | In-process calls | Register, look up, search | Rejections propagate; not found resolves `null` |
91
+ | `DSS` | Directory Search Service | HTTPS POST through `webex.request` | Start a lookup or search | Response not read; no retry here; webex-core interceptors apply |
92
+ | Directory Search Service | `DSS` | Mercury `event:directory.lookup`, `event:directory.search` | Result pages | Inactivity timeout after `requestTimeout` |
93
+ | `DSS` | `DssBatcher` | In-process | Coalesce `lookup` calls per resource | A failed query rejects every caller in the batch |
94
+
95
+ ## Dependency topology
96
+
97
+ | Dependency | Type | Used by | Purpose | Version, failure, or fallback policy |
98
+ | ---------- | ---- | ------- | ------- | ------------------------------------ |
99
+ | `@webex/webex-core` | Internal | `src/index.ts`, `src/dss.ts`, `src/dss-batcher.ts` | Registration, plugin base, `Batcher`, `webex.request`, config lookup | `workspace:*` in `package.json` |
100
+ | `@webex/internal-plugin-mercury` | Internal | `src/dss.ts` | Registration side effect; connect and event subscription | `workspace:*` |
101
+ | `@webex/internal-plugin-device` | Internal, undeclared | `src/dss.ts` | `webex.internal.device.orgId` | Not in `package.json`; the host must load it |
102
+ | `@webex/common` | Internal | `src/dss-errors.ts` | `Exception` | `workspace:*` |
103
+ | `@webex/common-timers` | Internal | `src/dss.ts` | `Timer` | `workspace:*` |
104
+ | `uuid` | External | `src/dss.ts` | Request ids | `^3.3.2` in `package.json` |
105
+ | `lodash` | External | `src/dss.ts` | `get`, `range`, `isEqual` | `^4.17.21` |
106
+ | Directory Search Service | External service | `src/dss.ts` | Lookups, searches, and result pages | Resolved through the service catalog as `directorySearch` |
107
+
108
+ No import cycle exists: none of the packages this one imports imports it back.
109
+
110
+ ## Public and consumer surfaces
111
+
112
+ | Surface | Type | Owner | Consumers | Compatibility policy | Source |
113
+ | ------- | ---- | ----- | --------- | -------------------- | ------ |
114
+ | `dss-internal-sdk` — package @webex/internal-plugin-dss, `webex.internal.dss`, its methods, `DssTimeoutError` rejections, and `dss:*` events | SDK, published to npm, internal | DSS plugin | First-party clients; in this repository the `webex` bundle loads it without calling it | The README states that internal plugins do not strictly follow semantic versioning; no deprecation rule is declared | `package.json`, `src/index.ts`, `src/dss.ts`, `src/constants.ts`, `src/types.ts`, `src/dss-errors.ts` |
115
+
116
+ The DSS request bodies, the mercury page envelopes, and the result paths are protocols this package
117
+ speaks with the service, described under *Protocol and wire format* in the
118
+ [module specification](../src/docs/README.md#protocol-and-wire-format). The other contracts this
119
+ package requires are registered in `.sdd/manifest.json` `contract_catalog`.
120
+
121
+ ## Client state model
122
+
123
+ | State or slice | Owner | Transition triggers | Persistence or reset boundary |
124
+ | -------------- | ----- | ------------------- | ----------------------------- |
125
+ | `registered` | `DSS` | `register`, `unregister` | In memory |
126
+ | `batchers` (one per resource) | `DSS` | First `lookup` on a resource | Never cleared |
127
+ | Per-query listener, timer, and page store | `DSS` query closure | Pages, completion, expiry | Ends with the query |
128
+ | Mercury connection | `@webex/internal-plugin-mercury` | `register` connects it | Never disconnected by this package |
129
+
130
+ Full detail is in the module specification's *Client state model*.
131
+
132
+ ## Cross-cutting architecture
133
+
134
+ ### Security
135
+
136
+ - Trust boundaries and identity flow: see [Security architecture](#security-architecture).
137
+ - Sensitive surfaces and data classes: organization directory entities, email addresses, phone
138
+ numbers, and search query strings.
139
+ - Encryption and secret boundaries: see [Security architecture](#security-architecture).
140
+
141
+ ### Observability and operations
142
+
143
+ - Logging and correlation: see [Observability patterns](#observability-patterns).
144
+ - Metrics, traces, and audit signals: see [Observability patterns](#observability-patterns).
145
+ - Ownership and operational entry points: `.github/CODEOWNERS` at the workspace root has no line for
146
+ this package, so its default rule assigns it to `@webex/web-sdk`. No dashboards or runbooks are
147
+ recorded in this package.
148
+
149
+ ### Quality attributes
150
+
151
+ - Compatibility: clients rely on the registered name `dss`, the method signatures and resolve
152
+ shapes, the `DssTimeoutError` message, and the default timeout and batcher limits.
153
+ - Footprint: seven source files; runtime imports are webex-core, mercury, common, common-timers,
154
+ uuid, and lodash.
155
+ - Test confidence: 60 of 61 unit cases pass (1 skipped); registration through the entry, the
156
+ connect-failure path, HTTP failure, and a batch timeout have no running case. No coverage threshold
157
+ is enforced.
158
+
159
+ ## Dependency and interaction topology
160
+
161
+ ```mermaid
162
+ flowchart LR
163
+ Index[src/index.ts] -->|registerInternalPlugin dss| Core[webex-core]
164
+ Index --> Config[src/config.ts]
165
+ Index --> Plugin[src/dss.ts]
166
+ Plugin -->|extends WebexPlugin, webex.request| Core
167
+ Plugin --> Batcher[src/dss-batcher.ts]
168
+ Batcher -->|extends Batcher| Core
169
+ Plugin -->|import, connect, on, off| Merc[internal-plugin-mercury]
170
+ Plugin -->|Timer| Timers[common-timers]
171
+ Plugin --> Errors[src/dss-errors.ts]
172
+ Errors -->|Exception| Common[common]
173
+ Plugin --> Const[src/constants.ts]
174
+ Plugin --> Types[src/types.ts]
175
+ Plugin -.->|webex.internal.device.orgId| Device[internal-plugin-device]
176
+ ```
177
+
178
+ | From | To | Kind | Purpose | Ordering or failure boundary |
179
+ | ---- | -- | ---- | ------- | ---------------------------- |
180
+ | `src/index.ts` | webex-core | Call at import | Register `dss` | First registration wins |
181
+ | `src/dss.ts` | mercury | Calls and listeners | Connect and receive pages | `register` before queries |
182
+ | `src/dss.ts` | `webex.request` | Call, not awaited | DSS POST | A rejection is not observed |
183
+ | `src/dss-batcher.ts` | `src/dss.ts` | `parent._request` | Send a batch | Rejection fails the batch |
184
+ | `src/dss.ts` | `webex.internal.device` | Property read, no import | `orgId` for resource paths | The host must have registered the device |
185
+
186
+ ## Object and data ownership
187
+
188
+ | Object or state | System of record | May write | May read | Movement or lifecycle |
189
+ | --------------- | ---------------- | --------- | -------- | --------------------- |
190
+ | Directory entities (people, machines, contacts, devices, rooms, places) | Directory Search Service and its providers (`CI_USER`, `CI_MACHINE`, `CONTACTS`, `CSDM`) | — | This package, then the caller | Returned per query; not stored here |
191
+ | Organization id | Device registration (WDM) | `@webex/internal-plugin-device` | This package | Read on each query |
192
+ | Lookup values and query strings | The caller | The caller | This package, the service | Sent per query; not stored here |
193
+
194
+ ## Observability patterns
195
+
196
+ | Signal | Convention or required fields | Propagation or naming rule | Primary evidence |
197
+ | ------- | ----------------------------- | -------------------------- | ---------------- |
198
+ | Logs | `this.logger.error` and `this.logger.info` with the prefix `DSS-><method>#ERROR` or `#INFO` (one `dss->register#INFO` line is lowercase); messages carry error messages or counts, never lookup values or entities | No correlation id is logged; the request id travels only in the body and in `DssTimeoutError` | `src/dss.ts` |
199
+ | Metrics | None | — | `src/dss.ts` |
200
+ | Traces | None | — | `src/dss.ts` |
201
+ | Audit | None | — | `src/dss.ts` |
202
+
203
+ ## Shared and base libraries
204
+
205
+ | Library | Inherited responsibility | Consumers | Version floor | Compatibility rule |
206
+ | ------- | ------------------------ | --------- | ------------- | ------------------ |
207
+ | `@webex/webex-core` `WebexPlugin` | `webex`, `logger`, `config`, ampersand events | `DSS` | `workspace:*` | Keep namespace `DSS` so `this.config` reads `webex.config.dss` |
208
+ | `@webex/webex-core` `Batcher` | Debounce, duplicate sharing, deferreds | `DssBatcher` | `workspace:*` | Keep namespace `DSS` so the batcher limits come from `webex.config.dss` |
209
+ | `@webex/common` `Exception` | Message from `parse`, `name` from the class | `DssTimeoutError` | `workspace:*` | Keep the message format; tests match it |
210
+ | `@webex/common-timers` `Timer` | Start, reset, cancel | `DSS` | `workspace:*` | `reset` and `cancel` only while running |
211
+ | `@webex/babel-config-legacy`, `@webex/eslint-config-legacy`, `@webex/jest-config-legacy`, `@webex/legacy-tools` | Build, lint, and test stack through one-line config files | Package tooling | `workspace:*` | Do not fork the config locally |
212
+
213
+ ## Release and versioning
214
+
215
+ | Artifact | Publish target | Versioning rule | Deprecation window | Changelog or migration obligation |
216
+ | -------- | -------------- | --------------- | ------------------ | --------------------------------- |
217
+ | @webex/internal-plugin-dss | npm through `deploy:npm` | Internal plugin; the README says semantic versioning is not strictly followed | None declared | None declared in the package; the workspace owns changelog generation |
218
+
219
+ ## Commands and generated artifacts
220
+
221
+ | Command or artifact | Owner | Inputs | Output or side effect | Compatibility boundary |
222
+ | ------------------- | ----- | ------ | --------------------- | ---------------------- |
223
+ | `yarn workspace @webex/internal-plugin-dss build:src` | Package scripts | `src` | Writes `dist/` (JavaScript and source maps) through `webex-legacy-tools` | `dist/` is generated and never edited by hand |
224
+ | `yarn workspace @webex/internal-plugin-dss build` | Package scripts | `src` | Runs `build:src` | Same output |
225
+ | `yarn workspace @webex/internal-plugin-dss test:unit` | Package scripts | `test/unit/spec` | Jest run | The spec imports this package's `dist/` by name |
226
+ | `yarn workspace @webex/internal-plugin-dss test:style` | Package scripts | `src` | ESLint run | The shared config ignores `docs/**` and `*.md` |
227
+
228
+ ## Cross-repository topology
229
+
230
+ | Repository or external system | Relationship | Exchanged contract or artifact | Owner | Sequencing constraint |
231
+ | ----------------------------- | ------------- | ------------------------------ | ----- | --------------------- |
232
+ | `@webex/webex-core` (workspace sibling; module spec consulted) | Consumes | `registerInternalPlugin`, `WebexPlugin`, `Batcher`, `webex.request`, `canAuthorize` | @webex/web-sdk | None beyond registration |
233
+ | `@webex/internal-plugin-mercury` (workspace sibling; module spec consulted and stale on sessions, code used) | Consumes | `connect`, `on`, `off`, emitted event names | @webex/web-sdk | `register` connects before pages can arrive |
234
+ | `@webex/internal-plugin-device` (workspace sibling; spec consulted and silent on `orgId`, code used) | Consumes | `orgId` | @webex/web-sdk | Device registered before queries |
235
+ | `@webex/common`, `@webex/common-timers` (workspace siblings; module specs consulted) | Consumes | `Exception`, `Timer` | @webex/web-sdk | None |
236
+ | `webex` (workspace sibling) | Consumed by | The plugin registration through `require` | @webex/web-sdk | None |
237
+ | Directory Search Service | Consumes | Lookup and search POSTs and result pages | Not recorded in this repository | Mercury connected first |
238
+
239
+ ## Security architecture
240
+
241
+ ```mermaid
242
+ flowchart LR
243
+ Client[Client] -->|ids, emails, numbers, query| Plugin[DSS]
244
+ Plugin -->|POST with user token via webex.request| Svc[Directory Search Service]
245
+ Svc -->|result pages over authenticated mercury socket| Plugin
246
+ Plugin -->|entities| Client
247
+ ```
248
+
249
+ - This package holds no credential or key. Queries reuse `webex.request`, which adds the user's
250
+ authorization through webex-core; `register` refuses to run when the SDK cannot authorize.
251
+ - Every query is scoped to the organization id from the registered device (`INV-006` in the module
252
+ spec); the service decides what that user may see.
253
+ - Entities are passed to the caller and kept only until the query resolves; the logging rule is
254
+ under [Observability patterns](#observability-patterns).
255
+
256
+ ## Domain language
257
+
258
+ | Term | Repository-specific meaning | Authoritative source |
259
+ | ---- | --------------------------- | -------------------- |
260
+ | DSS | Directory Search Service, reached through the service catalog as `directorySearch` | `src/constants.ts` |
261
+ | Lookup | A query for known identities by id, email, or phone number | `src/dss.ts` |
262
+ | Search | A query string matched against entities of the requested types, or against places | `src/dss.ts` |
263
+ | Entity provider type | The directory source of an identity: `CI_USER`, `CI_MACHINE`, `CONTACTS`, `CSDM` | `src/types.ts` |
264
+ | Search type | `PERSON`, `CALLING_SERVICE`, `EXTERNAL_CALLING`, `ROOM`, `ROBOT` | `src/types.ts` |
265
+ | Page | One mercury payload for a query, carrying `requestId` and `sequence`; the last has `finished` | `src/dss.ts` |
266
+ | Lookup values | The list of ids, emails, or numbers sent in one lookup body | `src/constants.ts` |
267
+ | Batcher | The per-resource `DssBatcher` that coalesces `lookup` calls | `src/dss-batcher.ts` |
268
+
269
+ ## References and maintenance
270
+
271
+ - Decisions: [adr/](adr/index.md)
272
+ - Instantiated specifications and routing: [specs/README.md](specs/README.md)
273
+ - Repository rules and patterns: [package agent instructions](../AGENTS.md)
274
+ - Update this document in the same change that alters package boundaries, resource ownership,
275
+ cross-resource interaction, or cross-cutting architecture.
@@ -0,0 +1,126 @@
1
+ ---
2
+ type: Getting Started
3
+ title: Getting started
4
+ description: Local setup, build, run, and test routing for @webex/internal-plugin-dss.
5
+ tags: [onboarding]
6
+ ---
7
+ <!-- sdd-generated-metadata
8
+ doc_kind: standing-doc
9
+ generated_from: getting-started@0.3.0
10
+ generated_by: claude-code
11
+ approved_by: rarajes2@cisco.com
12
+ updated_at: 2026-11-12T10:21:50Z
13
+ validation_status: pass-with-warnings
14
+ -->
15
+
16
+ # Getting started
17
+
18
+ Onboarding for **@webex/internal-plugin-dss**, a package inside the `webex-js-sdk` Yarn workspace.
19
+ Run every command from the workspace root.
20
+
21
+ ## Prerequisites
22
+
23
+ | Tool or access | Version or requirement |
24
+ | -------------- | ---------------------- |
25
+ | Node.js | Use 22.14: the workspace root `AGENTS.md` requires it and the workspace `.nvmrc` selects `lts/jod` (Node 22). This package's `engines` accepts `>=16`. The workspace root `package.json` `engines.node` reads `18.x`, which conflicts with the other two; the unit tests pass on 22.14 |
26
+ | Yarn | `yarn@3.4.1` (`packageManager` in the workspace root `package.json`) |
27
+ | Registry or account access | N/A for building and unit tests |
28
+
29
+ ## Install
30
+
31
+ ```bash
32
+ yarn
33
+ ```
34
+
35
+ The workspace `deploy.yml` workflow installs with the same command.
36
+
37
+ On a fresh checkout, prebuild the workspace before the first package build. `yarn` does not build
38
+ `@webex/legacy-tools`, whose `webex-legacy-tools` binary runs this package's build and tests, or the
39
+ sibling packages' `dist/`, which the unit specs load:
40
+
41
+ ```bash
42
+ yarn prebuild:modules
43
+ ```
44
+
45
+ It runs `yarn`, then builds the tools, the legacy tools, `@webex/webex-core`, and every package, in
46
+ that order (root `package.json`; see the workspace `CONTRIBUTING.md` "Prebuilding").
47
+
48
+ ## Build
49
+
50
+ ```bash
51
+ yarn workspace @webex/internal-plugin-dss build:src
52
+ ```
53
+
54
+ `build:src` writes JavaScript and source maps for the seven source files to `dist/` through
55
+ `webex-legacy-tools`. `dist/` is ignored by Git. The `build` script runs `yarn build:src`; the
56
+ package has no `tsconfig.json` and emits no type declarations.
57
+
58
+ ```bash
59
+ yarn workspace @webex/internal-plugin-dss build
60
+ ```
61
+
62
+ ## Run
63
+
64
+ N/A — this is a library with no start script. Importing `@webex/internal-plugin-dss` registers
65
+ `webex.internal.dss`; call `register()` before any lookup or search, because results arrive over
66
+ mercury.
67
+
68
+ ## Tests
69
+
70
+ ```bash
71
+ yarn workspace @webex/internal-plugin-dss build:src
72
+ yarn workspace @webex/internal-plugin-dss test:unit
73
+ yarn workspace @webex/internal-plugin-dss test:style
74
+ ```
75
+
76
+ | Tier | Command | Test location | Framework | External dependencies |
77
+ | ---- | ------- | ------------- | --------- | --------------------- |
78
+ | Unit | `yarn workspace @webex/internal-plugin-dss test:unit` | `test/unit/spec` | jest runner through `webex-legacy-tools`, with chai, chai-as-promised, sinon, and `@webex/test-helper-mock-webex` | This package's built `dist/`, which `test/unit/spec/dss.ts` imports by package name, and the sibling packages' `dist/` |
79
+
80
+ - Coverage or quality gate: none; the legacy Jest configuration sets no threshold and the package
81
+ defines no coverage script
82
+ - Enforcement source: N/A
83
+ - Test environment or QA dependencies: none for unit tests
84
+
85
+ Run `build:src` before `test:unit`: `test/unit/spec/dss.ts` imports this package by name, which
86
+ resolves to `dist/index.js`, so a stale `dist/` tests old code. `test:unit` runs two suites with 61
87
+ cases, one of them skipped (`it.skip` in the `#_batchedLookup` block).
88
+
89
+ `test:browser` runs `webex-legacy-tools test --integration --runner karma` over
90
+ `test/integration/spec/dss.js`, a MockWebex spec with a stub mercury. On 2026-11-12 under Node 22.14
91
+ the karma bundle failed to parse `isbot` (an ES module in the workspace `node_modules`), so the run
92
+ reported "0 tests completed" and still exited zero. The spec also expects `unregister()` to call
93
+ `mercury.disconnect`, which `src/dss.ts` never does, so it would fail once it bundles. It is not
94
+ listed in the table above because it verifies nothing today.
95
+
96
+ `yarn workspace @webex/internal-plugin-dss test` chains style, unit, `test:integration`, and browser
97
+ runs, and stops at `test:integration`, which is not defined in this package's `package.json`.
98
+
99
+ ## Configuration and secrets
100
+
101
+ - Required configuration: none; the defaults under `webex.config.dss` are `requestTimeout` 6000 ms,
102
+ `batcherWait` 50 ms, `batcherMaxCalls` 50, and `batcherMaxWait` 150 ms (`src/config.ts`)
103
+ - Secret source: N/A; the package holds no secret
104
+ - Package or artifact access: N/A
105
+ - Required neighboring packages: `@webex/webex-core`, `@webex/internal-plugin-mercury`,
106
+ `@webex/common`, and `@webex/common-timers` resolve through the workspace; the host must also
107
+ provide `webex.internal.device` with an `orgId`, because every resource path embeds it
108
+ - Platform, simulator, device, or SDK setup: none
109
+ - Never commit credentials or copy production secrets into a local config.
110
+
111
+ ## First-run verification
112
+
113
+ 1. Run `yarn workspace @webex/internal-plugin-dss build:src`.
114
+ 2. Run `yarn workspace @webex/internal-plugin-dss test:unit` and check that two suites pass with 60
115
+ passed and 1 skipped of 61 cases.
116
+ 3. Run `yarn workspace @webex/internal-plugin-dss test:style`.
117
+
118
+ Expected result: all three commands exit zero. `test:style` prints warnings but no errors: three in
119
+ `src/dss-errors.ts` (`import/prefer-default-export`, `require-jsdoc`, `class-methods-use-this`),
120
+ `no-restricted-exports` in `src/index.ts`, and "File ignored" for `src/docs/README.md`.
121
+
122
+ ## Next steps
123
+
124
+ - [Package architecture](architecture.md)
125
+ - [Specification registry](specs/README.md)
126
+ - [Documentation index](index.md)
package/docs/index.md ADDED
@@ -0,0 +1,44 @@
1
+ ---
2
+ okf_version: '0.1'
3
+ ---
4
+ <!-- sdd-generated-metadata
5
+ doc_kind: standing-doc
6
+ generated_from: docs-index@0.3.0
7
+ generated_by: claude-code
8
+ approved_by: rarajes2@cisco.com
9
+ updated_at: 2026-11-12T10:21:50Z
10
+ validation_status: pass-with-warnings
11
+ -->
12
+
13
+ # @webex/internal-plugin-dss documentation
14
+
15
+ Doc map for developers and agents working on the Directory Search Service (DSS) plugin.
16
+
17
+ ## Start here
18
+
19
+ - [Getting started](getting-started.md)
20
+ - [Package architecture](architecture.md)
21
+
22
+ ## Decisions
23
+
24
+ - [adr/](adr/index.md) — architectural decision records
25
+
26
+ ## Specifications and contracts
27
+
28
+ - [architecture.md](architecture.md) — canonical package architecture and contract index
29
+ - [specs/README.md](specs/README.md) — manifest-backed module and contract registry
30
+ - [`src/docs/README.md`](../src/docs/README.md) — the DSS plugin specification beside its code
31
+ - [adr/](adr/index.md) — concrete architectural decisions; blank ADR templates remain under the
32
+ monorepo root `.sdd/`
33
+
34
+ This package is a library, so there is no service specification and no OpenAPI document. Exact
35
+ contract details live in the native sources linked from the architecture index: `package.json` and
36
+ `src/index.ts` for the package, `src/dss.ts` for the API, `src/dss-batcher.ts` for lookup batching,
37
+ and `src/constants.ts`, `src/types.ts`, and `src/dss-errors.ts` for event names, result paths, option
38
+ types, and the timeout error.
39
+
40
+ ## Related repository resources
41
+
42
+ - [`README.md`](../README.md) — retained npm usage page; context only and partly stale, see
43
+ [ADR-0001](adr/0001-retain-product-readme.md)
44
+ - [`AGENTS.md`](../AGENTS.md) — agent instructions for this package
@@ -0,0 +1,71 @@
1
+ ---
2
+ type: Reference
3
+ title: Specification registry
4
+ description: Canonical specification registry and change-routing guide.
5
+ tags: [specifications, registry]
6
+ ---
7
+ <!-- sdd-generated-metadata
8
+ doc_kind: standing-doc
9
+ generated_from: spec-index@0.3.0
10
+ generated_by: claude-code
11
+ approved_by: rarajes2@cisco.com
12
+ updated_at: 2026-11-12T10:36:02Z
13
+ validation_status: pass-with-warnings
14
+ -->
15
+
16
+ # Specification registry
17
+
18
+ Use this page to find the canonical package architecture and every instantiated module specification
19
+ plus native contract. Keep technical facts in one owning document and use this page only for
20
+ navigation, ownership, status, and change/test routing.
21
+
22
+ Start with the [package architecture](../architecture.md). No service specification exists because this
23
+ package is a library.
24
+
25
+ ## Document roles
26
+
27
+ | Document | Canonical ownership |
28
+ | -------- | ------------------- |
29
+ | [Package architecture](../architecture.md) | Package boundaries, resource inventory, interactions, dependency topology, and cross-cutting architecture |
30
+ | Module specifications | Stable behavior and design at each manifest-routed `<module-path>/docs/README.md` |
31
+ | [ADR](../adr/index.md) | A durable decision, its deciders, rationale, consequences, and supersession lineage |
32
+
33
+ ## Instantiated specification registry
34
+
35
+ | Resource | Role | Canonical path | Owner | Status | Last verified |
36
+ | -------- | ---- | -------------- | ----- | ------ | ------------- |
37
+ | Package | Architecture | `docs/architecture.md` | @webex/web-sdk | Draft | 2026-11-12 |
38
+ | DSS plugin | Module | `src/docs/README.md` | @webex/web-sdk | Draft | 2026-11-12 |
39
+ | Retain the product README | ADR | `docs/adr/0001-retain-product-readme.md` | @webex/web-sdk | Accepted | 2026-11-12 |
40
+
41
+ ### Module registry
42
+
43
+ | Module | Responsibility | Manifest coverage state | Start here |
44
+ | --- | --- | --- | --- |
45
+ | `src/` | `webex.internal.dss`: mercury registration, Directory Search Service lookups and searches, assembly of sequenced result pages with an inactivity timeout, and per-resource lookup batching | Partial | `src/docs/README.md` |
46
+
47
+ Generator-side field measurement for the module is complete (93.3%, assessed 2026-11-12).
48
+ Independent
49
+ semantic validation passed with warnings on 2026-11-12 under validator runtime
50
+ `01a1cf44-b40f-7ee2-ab94-d19b99d9fd43` (0 Blocking, 1 Important finding: the accepted
51
+ command-source warning for the workspace-qualified command form). A characterization baseline and
52
+ promotion past Partial remain pending.
53
+
54
+ ## Change and verification routing
55
+
56
+ | Change affects | Load and update | Verification route |
57
+ | -------------- | --------------- | ------------------ |
58
+ | Package boundaries or cross-cutting architecture | `docs/architecture.md` and applicable ADRs | `yarn workspace @webex/internal-plugin-dss test:unit` after `build:src`, and the module spec |
59
+ | A stable code, package, or component boundary | `src/docs/README.md` | Module tests plus affected contracts |
60
+ | A public method, event, resource path, result path, or the timeout error | The owning architecture section, `src/docs/README.md`, and the native definition in `src/dss.ts`, `src/dss-batcher.ts`, `src/constants.ts`, `src/types.ts`, `src/dss-errors.ts`, or `package.json` | Unit tests; check first-party clients that call `webex.internal.dss` |
61
+
62
+ ## Module and contract registration
63
+
64
+ The module specification is generated at the exact `modules[].canonical_spec` path recorded in
65
+ `.sdd/manifest.json`. Register every module and submodule in the Module registry above in manifest tree
66
+ order.
67
+
68
+ Contracts are registered in `.sdd/manifest.json` `contract_catalog` and indexed in
69
+ [`docs/architecture.md`](../architecture.md#public-and-consumer-surfaces) with a stable ID, publication
70
+ state, native source, and owning module. This page provides navigation and ownership rather than a copied
71
+ contract.