@webex/internal-plugin-llm 3.12.0-next.65 → 3.12.0-next.67
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 +416 -0
- package/.sdd/manifest.json +355 -0
- package/AGENTS.md +198 -0
- package/docs/adr/0001-retain-product-readme.md +94 -0
- package/docs/adr/index.md +22 -0
- package/docs/architecture.md +279 -0
- package/docs/getting-started.md +104 -0
- package/docs/index.md +47 -0
- package/docs/specs/README.md +73 -0
- package/package.json +2 -2
- package/schemas/repo-context.schema.json +796 -0
- package/src/docs/README.md +522 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Architecture
|
|
3
|
+
title: '@webex/internal-plugin-llm 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-cowork
|
|
11
|
+
approved_by: akulakum@cisco.com
|
|
12
|
+
updated_at: 2026-10-08T10:12:58Z
|
|
13
|
+
validation_status: pass-with-warnings
|
|
14
|
+
-->
|
|
15
|
+
|
|
16
|
+
# @webex/internal-plugin-llm architecture
|
|
17
|
+
|
|
18
|
+
Canonical architecture for this package. LLM channel behavior lives in the
|
|
19
|
+
[LLM channel plugin specification](../src/docs/README.md). This page owns package boundaries, the
|
|
20
|
+
plugin 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/` | Repository data and schema |
|
|
30
|
+
| `repo.holds_client_state` | Applicable | `LLMChannel` keeps a per-session `connections` map in memory | Client state model |
|
|
31
|
+
| `repo.components_interact` | Applicable | `src/index.ts` registers `src/llm.ts`, which imports `src/constants.ts` and `src/llm.types.ts` | Dependency and interaction topology |
|
|
32
|
+
| `repo.domain_data_across_components` | N/A | One class owns all state; no record is shared across resources | Object and data ownership |
|
|
33
|
+
| `repo.caches_data` | Applicable | `datachannelTokens` in `src/llm.ts` caches data-channel tokens by key | Caching catalog |
|
|
34
|
+
| `repo.observability_convention` | Applicable | `llm#<method> -->` log prefixes and latency timing returned to callers | Observability patterns |
|
|
35
|
+
| `repo.deploys_to_infra` | N/A | Library published to npm. No service runtime. | Runtime and infrastructure |
|
|
36
|
+
| `repo.shared_base_libs` | Applicable | Inherits Mercury and the legacy build, lint, and test stack | 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 | No platform-specific file or `browser` field; platform WebSocket selection is in Mercury | Platform matrix |
|
|
39
|
+
| `repo.published_package` | Applicable | `package.json` `name` is `@webex/internal-plugin-llm` and `deploy:npm` publishes it | Release and versioning |
|
|
40
|
+
| `repo.embedded_in_host` | N/A | No host theme or embed API | Host integration and theming |
|
|
41
|
+
| `repo.exposes_commands_or_artifacts` | Applicable | `build:src` writes `dist/` | Commands and generated artifacts |
|
|
42
|
+
| `repo.cross_repo_deps_material` | Applicable | Behavior depends on the Mercury superclass and on callers in sibling packages | Cross-repository topology |
|
|
43
|
+
| `repo.security_arch_warranted` | Applicable | Data-channel tokens cross to the data-channel service in a request header | Security architecture |
|
|
44
|
+
|
|
45
|
+
## Design overview
|
|
46
|
+
|
|
47
|
+
`@webex/internal-plugin-llm` is a published library with one module. Importing it registers
|
|
48
|
+
`LLMChannel` as the internal plugin `llm`, so every webex instance has `webex.internal.llm`. A
|
|
49
|
+
meeting calls `registerAndConnect` with its locus and data-channel URLs, then listens on
|
|
50
|
+
`webex.internal.llm` for `online` and `event:<type>` events.
|
|
51
|
+
|
|
52
|
+
`LLMChannel` adds an HTTP registration step, per-session metadata, an ownership model, and a token
|
|
53
|
+
cache on top of the Mercury plugin it extends. Mercury owns the socket, retries, keepalive, and event
|
|
54
|
+
emission. Keeping the subclass thin means LLM sockets behave like every other Mercury socket.
|
|
55
|
+
|
|
56
|
+
The package makes outbound HTTP and WebSocket calls only. It serves no routes and persists nothing.
|
|
57
|
+
|
|
58
|
+
## Resource inventory and responsibilities
|
|
59
|
+
|
|
60
|
+
| Resource | Kind | Responsibility | Owner | Source | Detailed specification |
|
|
61
|
+
| -------- | ---- | -------------- | ----- | ------ | ---------------------- |
|
|
62
|
+
| LLM channel plugin | module | Registration, session metadata, ownership, tokens, URL lookup | @webex/web-client, @webex/web-sdk | `src/` | `src/docs/README.md` |
|
|
63
|
+
| Published package | package | npm entry points and the registration side effect | @webex/web-client, @webex/web-sdk | `package.json` | `docs/architecture.md` |
|
|
64
|
+
|
|
65
|
+
## Interaction and execution flows
|
|
66
|
+
|
|
67
|
+
```mermaid
|
|
68
|
+
flowchart LR
|
|
69
|
+
importer[Package importer]
|
|
70
|
+
index[src_index_ts]
|
|
71
|
+
core[webex_core_registerInternalPlugin]
|
|
72
|
+
llm[src_llm_ts LLMChannel]
|
|
73
|
+
mercury[Mercury superclass]
|
|
74
|
+
dc[Data-channel service]
|
|
75
|
+
ws[LLM WebSocket service]
|
|
76
|
+
meetings[plugin-meetings]
|
|
77
|
+
importer --> index
|
|
78
|
+
index --> core
|
|
79
|
+
index --> llm
|
|
80
|
+
meetings -->|registerAndConnect, tokens, disconnectLLM| llm
|
|
81
|
+
llm -->|HTTP POST registration| dc
|
|
82
|
+
llm -->|connect and disconnect| mercury
|
|
83
|
+
mercury -->|WebSocket| ws
|
|
84
|
+
mercury -->|online and event emits| meetings
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
| From | To | Interaction or transport | Purpose | Failure or compatibility behavior |
|
|
88
|
+
| ---- | -- | ------------------------ | ------- | --------------------------------- |
|
|
89
|
+
| Importer | `src/index.ts` | package import | Register the plugin | Without the import, `webex.internal.llm` is absent |
|
|
90
|
+
| plugin-meetings | `webex.internal.llm` | method calls and event listeners | Connect sessions, manage tokens and ownership | See the module spec failure modes |
|
|
91
|
+
| `src/llm.ts` | Data-channel service | HTTP POST | Obtain socket URL and binding | Request errors reject `registerAndConnect` |
|
|
92
|
+
| `src/llm.ts` | Mercury superclass | inherited method calls | Open and close sockets | Connect errors reject with `timing` |
|
|
93
|
+
| Mercury superclass | plugin-meetings | events on `webex.internal.llm` | Deliver online state and envelopes | Default session unsuffixed; others suffixed |
|
|
94
|
+
|
|
95
|
+
## Dependency topology
|
|
96
|
+
|
|
97
|
+
| Dependency | Type | Used by | Purpose | Version, failure, or fallback policy |
|
|
98
|
+
| ---------- | ---- | ------- | ------- | ------------------------------------ |
|
|
99
|
+
| `@webex/internal-plugin-mercury` | Internal | `src` | Superclass; inherited behavior is under Shared and base libraries | `workspace:*` in `package.json` |
|
|
100
|
+
| `@webex/webex-core` | Internal | `src` | Plugin registration, request, logger, config | Resolved through the workspace; not listed in `package.json` |
|
|
101
|
+
| `@webex/internal-plugin-device` | Internal | `src` | `device.url` for the registration body | Loaded by Mercury's barrel |
|
|
102
|
+
| `@webex/internal-plugin-feature` | Internal | `src` | JWT data-channel toggle | Loaded by Mercury's barrel |
|
|
103
|
+
|
|
104
|
+
Ordering constraint: Mercury's barrel imports the device, feature, and metrics plugins first, and
|
|
105
|
+
`src/llm.ts` imports Mercury, so those plugins are registered before `llm`. No dependency cycle exists
|
|
106
|
+
inside the package.
|
|
107
|
+
|
|
108
|
+
## Public and consumer surfaces
|
|
109
|
+
|
|
110
|
+
| Surface | Type | Owner | Consumers | Compatibility policy | Source |
|
|
111
|
+
| ------- | ---- | ----- | --------- | -------------------- | ------ |
|
|
112
|
+
| `llm-sdk` (published) | SDK | LLM channel plugin | plugin-meetings, internal-plugin-voicea | Internal plugin; README says semver is not strictly followed | `package.json` |
|
|
113
|
+
| `llm-plugin-events` (published) | Event | LLM channel plugin | plugin-meetings | Inherited Mercury event names; renaming is breaking | `src/llm.ts` |
|
|
114
|
+
| `llm-datachannel-protocol` (internal) | RPC | LLM channel plugin | Data-channel service | Must match the service request and response | `src/llm.ts` |
|
|
115
|
+
| `mercury-plugin-base` (required) | SDK | sibling package internal-plugin-mercury | LLM channel plugin | Superclass; method changes ship together | `@webex/internal-plugin-mercury` |
|
|
116
|
+
| `webex-core-plugin-host` (required) | RPC | sibling package webex-core | LLM channel plugin | External | `@webex/webex-core` |
|
|
117
|
+
| `webex-device-registration` (required) | SDK | sibling package internal-plugin-device | LLM channel plugin | External | `@webex/internal-plugin-device` |
|
|
118
|
+
| `webex-feature-toggles` (required) | SDK | sibling package internal-plugin-feature | LLM channel plugin | External | `@webex/internal-plugin-feature` |
|
|
119
|
+
|
|
120
|
+
`llm-sdk` entry points: `main` `dist/index.js` and `devMain` `src/index.ts`. No HTTP surface is
|
|
121
|
+
served, so `api-specs/openapi.yaml` is omitted.
|
|
122
|
+
|
|
123
|
+
## Client state model
|
|
124
|
+
|
|
125
|
+
| State or slice | Owner | Transition triggers | Persistence or reset boundary |
|
|
126
|
+
| -------------- | ----- | ------------------- | ----------------------------- |
|
|
127
|
+
| Session map `connections` | LLM channel plugin | register, owner and handler setters, disconnect | In memory per webex instance; cleared by `disconnectAllLLM` |
|
|
128
|
+
| Sockets per session | Mercury superclass | connect, close, disconnect | Owned by Mercury |
|
|
129
|
+
|
|
130
|
+
Slice detail is in the module spec.
|
|
131
|
+
|
|
132
|
+
## Cross-cutting architecture
|
|
133
|
+
|
|
134
|
+
### Security
|
|
135
|
+
|
|
136
|
+
- Trust boundaries and identity flow: see Security architecture.
|
|
137
|
+
- Sensitive surfaces and data classes: data-channel tokens and envelope content; controls and gaps
|
|
138
|
+
are in Security architecture.
|
|
139
|
+
- Encryption and secret boundaries: transport encryption is whatever scheme the caller-supplied and
|
|
140
|
+
service-returned URLs use; tokens are held only in memory.
|
|
141
|
+
|
|
142
|
+
### Observability and operations
|
|
143
|
+
|
|
144
|
+
- Logging and correlation: conventions are under Observability patterns.
|
|
145
|
+
- Metrics, traces, and audit signals: listed under Observability patterns.
|
|
146
|
+
- Ownership and operational entry points: no runtime to deploy or monitor; owners are listed in
|
|
147
|
+
References and maintenance.
|
|
148
|
+
|
|
149
|
+
### Quality attributes
|
|
150
|
+
|
|
151
|
+
- Availability: sockets reconnect through Mercury; registration is not retried here.
|
|
152
|
+
- Compatibility: session ids, token keys, and event names are relied on by plugin-meetings.
|
|
153
|
+
- Isolation: ownership checks keep one meeting from tearing down another meeting's session.
|
|
154
|
+
|
|
155
|
+
## Dependency and interaction topology
|
|
156
|
+
|
|
157
|
+
```mermaid
|
|
158
|
+
flowchart TD
|
|
159
|
+
indexTs[src_index_ts]
|
|
160
|
+
llmTs[src_llm_ts]
|
|
161
|
+
typesTs[src_llm_types_ts]
|
|
162
|
+
constTs[src_constants_ts]
|
|
163
|
+
indexTs --> llmTs
|
|
164
|
+
indexTs --> typesTs
|
|
165
|
+
indexTs --> constTs
|
|
166
|
+
llmTs --> typesTs
|
|
167
|
+
llmTs --> constTs
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
| From | To | Kind | Purpose | Ordering or failure boundary |
|
|
171
|
+
| ---- | -- | ---- | ------- | ---------------------------- |
|
|
172
|
+
| `src/index.ts` | `src/llm.ts` | Import | Register the class and its `config` | Registration runs at import time |
|
|
173
|
+
| `src/llm.ts` | `src/constants.ts` | Import | Namespace, session ids, toggle and query names | Load-time only |
|
|
174
|
+
| `src/llm.ts` | `src/llm.types.ts` | Import | Token enum and interface | Load-time only |
|
|
175
|
+
|
|
176
|
+
## Caching catalog
|
|
177
|
+
|
|
178
|
+
| Cache | Owner | Backend | Contents | TTL or bound | Invalidation trigger | Failure behavior |
|
|
179
|
+
| ----- | ----- | ------- | -------- | ------------ | -------------------- | ---------------- |
|
|
180
|
+
| `datachannelTokens` | LLM channel plugin | In-memory object | Data-channel token per token key | No TTL; unbounded keys | `clearDatachannelToken` by the owner only; disconnects do not clear it | A miss or non-owner read returns `undefined` |
|
|
181
|
+
|
|
182
|
+
## Observability patterns
|
|
183
|
+
|
|
184
|
+
| Signal | Convention or required fields | Propagation or naming rule | Primary evidence |
|
|
185
|
+
| ------ | ----------------------------- | -------------------------- | ---------------- |
|
|
186
|
+
| Logs | `llm#<method> -->` prefix with the session id; inherited Mercury lines use the `llm` namespace | Through `this.logger`; tokens are not logged | `src/llm.ts` |
|
|
187
|
+
| Metrics | N/A — no metric is submitted here; `registerAndConnect` returns latency fields that callers report | Field names are in the module spec | `src/llm.ts` |
|
|
188
|
+
| Traces | N/A — no spans | — | `src/llm.ts` |
|
|
189
|
+
| Audit | N/A — no audited actions | — | `src/llm.ts` |
|
|
190
|
+
|
|
191
|
+
## Shared and base libraries
|
|
192
|
+
|
|
193
|
+
| Library | Inherited responsibility | Consumers | Version floor | Compatibility rule |
|
|
194
|
+
| ------- | ------------------------ | --------- | ------------- | ------------------ |
|
|
195
|
+
| Mercury from `@webex/internal-plugin-mercury` | Socket lifecycle, retries, keepalive, event emission | `src/llm.ts` | workspace | Change socket behavior in Mercury |
|
|
196
|
+
| `WebexPlugin` from `@webex/webex-core` (through Mercury) | `this.config` bound to `config.llm`, `this.request`, `this.logger` | `src/llm.ts` | workspace | Follow webex-core plugin conventions |
|
|
197
|
+
| `@webex/babel-config-legacy`, `@webex/eslint-config-legacy`, `@webex/jest-config-legacy` | Build, lint, and Jest config passthroughs | `babel.config.js`, `.eslintrc.js`, `jest.config.js` | workspace | Change upstream, not in the passthrough files |
|
|
198
|
+
| `@webex/legacy-tools` | `webex-legacy-tools` build and test runners | `package.json` scripts | workspace | Scripts call it; do not replace locally |
|
|
199
|
+
|
|
200
|
+
## Release and versioning
|
|
201
|
+
|
|
202
|
+
| Artifact | Publish target | Versioning rule | Deprecation window | Changelog or migration obligation |
|
|
203
|
+
| -------- | -------------- | --------------- | ------------------ | --------------------------------- |
|
|
204
|
+
| `@webex/internal-plugin-llm` | npm, through the `deploy:npm` script, which wraps Yarn's npm publish | Workspace release tooling; README says the internal plugin does not strictly follow semver | None declared in code | No package-local changelog; workspace tooling owns it |
|
|
205
|
+
|
|
206
|
+
## Commands and generated artifacts
|
|
207
|
+
|
|
208
|
+
| Command or artifact | Owner | Inputs | Output or side effect | Compatibility boundary |
|
|
209
|
+
| ------------------- | ----- | ------ | --------------------- | ---------------------- |
|
|
210
|
+
| `yarn install` | workspace | root `package.json` and lockfile | workspace `node_modules` | Run from the workspace root |
|
|
211
|
+
| `yarn workspace @webex/internal-plugin-llm build` | package | `src/` | `dist/` through `build:src` | `dist/` is never edited by hand |
|
|
212
|
+
| `yarn workspace @webex/internal-plugin-llm build:src` | package | `src/` (`.js` and `.ts`) | `dist/` with source maps | Markdown under `src/` is not processed |
|
|
213
|
+
| `yarn workspace @webex/internal-plugin-llm test:unit` | package | `test/unit/spec/` | jest result | — |
|
|
214
|
+
| `yarn workspace @webex/internal-plugin-llm test:browser` | package | integration files only | karma result; no files today | See Getting started |
|
|
215
|
+
| `yarn workspace @webex/internal-plugin-llm test:style` | package | files under `src/` | eslint result | Markdown is reported as ignored |
|
|
216
|
+
| `yarn workspace @webex/internal-plugin-llm deploy:npm` | package | `dist/`, `package.json` | npm publish | Release pipeline only |
|
|
217
|
+
|
|
218
|
+
## Cross-repository topology
|
|
219
|
+
|
|
220
|
+
| Repository or external system | Relationship | Exchanged contract or artifact | Owner | Sequencing constraint |
|
|
221
|
+
| ----------------------------- | ------------ | ------------------------------ | ----- | --------------------- |
|
|
222
|
+
| Sibling package internal-plugin-mercury | Consumes | `mercury-plugin-base` | @webex/web-client, @webex/web-sdk | Superclass changes ship with LLM checks |
|
|
223
|
+
| Sibling package webex-core | Consumes | `webex-core-plugin-host` | @webex/web-client, @webex/web-sdk | Plugin host must exist before registration |
|
|
224
|
+
| Sibling package internal-plugin-device | Consumes | `webex-device-registration` | @webex/web-client, @webex/web-sdk | Device URL must exist before registration |
|
|
225
|
+
| Sibling package internal-plugin-feature | Consumes | `webex-feature-toggles` | @webex/web-sdk (CODEOWNERS default rule) | Toggle read on each call |
|
|
226
|
+
| Sibling package plugin-meetings | Provides | `llm-sdk`, `llm-plugin-events` | @webex/web-client, @webex/web-sdk | Method and session-id changes ship with meetings changes |
|
|
227
|
+
| Sibling package internal-plugin-voicea | Provides | `llm-sdk` (`LLM_PRACTICE_SESSION`) | @webex/web-client, @webex/web-sdk | Constant changes ship together |
|
|
228
|
+
| Data-channel service | Coordinates | `llm-datachannel-protocol` | External Webex service; owner not recorded in this repository | Request and response fields must match |
|
|
229
|
+
|
|
230
|
+
These are sibling workspace packages and an external service outside this package-scoped SDD root.
|
|
231
|
+
|
|
232
|
+
## Security architecture
|
|
233
|
+
|
|
234
|
+
Threats addressed: data-channel token leakage across meetings, and tokens reaching the network
|
|
235
|
+
outside the JWT flow.
|
|
236
|
+
|
|
237
|
+
```mermaid
|
|
238
|
+
flowchart LR
|
|
239
|
+
meeting[plugin-meetings] -->|setDatachannelToken with owner id| cache[datachannelTokens]
|
|
240
|
+
meeting -->|token argument| llm[LLMChannel register]
|
|
241
|
+
toggle[JWT toggle] --> llm
|
|
242
|
+
llm -->|Data-Channel-Auth-Token header| dc[Data-channel service]
|
|
243
|
+
handler[caller refresh handler] -->|new token| meeting
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Controls in this package:
|
|
247
|
+
|
|
248
|
+
- The token is sent only as a request header, and only when the JWT toggle is on (module spec
|
|
249
|
+
`INV-004`). It is never added to a URL or a log line.
|
|
250
|
+
- Owner-meeting checks guard token reads and writes, refresh-handler writes, and single-session
|
|
251
|
+
disconnect (module spec `INV-002`).
|
|
252
|
+
- Token refresh is delegated to the caller's handler; this package does not request tokens itself.
|
|
253
|
+
|
|
254
|
+
Known gaps are recorded where the code lives: the omitted-owner path, the unguarded
|
|
255
|
+
`disconnectAllLLM`, and token-key ownership in the module spec Pitfalls.
|
|
256
|
+
|
|
257
|
+
The workspace root `SECURITY.md` is the security policy; this package adds none.
|
|
258
|
+
|
|
259
|
+
## Domain language
|
|
260
|
+
|
|
261
|
+
| Term | Repository-specific meaning | Authoritative source |
|
|
262
|
+
| ---- | --------------------------- | -------------------- |
|
|
263
|
+
| LLM channel | The data-channel WebSocket a meeting uses, opened by `LLMChannel` | `src/llm.ts` |
|
|
264
|
+
| Session | One connection keyed by session id; default `llm-default-session` | `src/constants.ts` |
|
|
265
|
+
| Data-channel URL | The registration URL a meeting supplies; also the key for request lookup | `src/llm.ts` |
|
|
266
|
+
| Binding | The value returned by registration and kept per session | `src/llm.ts` |
|
|
267
|
+
| Owner meeting | The meeting id allowed to change or close a session | `src/llm.ts` |
|
|
268
|
+
| Token key | The key in the token cache; the built-in keys are the `DataChannelTokenType` values | `src/llm.types.ts` |
|
|
269
|
+
| Subscription-aware subchannel | A subchannel named in the `subscriptionAwareSubchannels` query | `src/constants.ts` |
|
|
270
|
+
|
|
271
|
+
## References and maintenance
|
|
272
|
+
|
|
273
|
+
- Decisions: [adr/](adr/), including [ADR 0001](adr/0001-retain-product-readme.md)
|
|
274
|
+
- Instantiated specifications and routing: [specs/README.md](specs/README.md)
|
|
275
|
+
- Module spec: `src/docs/README.md`
|
|
276
|
+
- Owner: `@webex/web-client @webex/web-sdk` in the monorepo `.github/CODEOWNERS`
|
|
277
|
+
- Manifest: `.sdd/manifest.json`
|
|
278
|
+
- Update this document in the same change that alters package boundaries, contracts, or
|
|
279
|
+
cross-cutting behavior.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Getting Started
|
|
3
|
+
title: Getting started
|
|
4
|
+
description: Local setup, build, run, and test routing for @webex/internal-plugin-llm.
|
|
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-cowork
|
|
11
|
+
approved_by: akulakum@cisco.com
|
|
12
|
+
updated_at: 2026-10-08T10:12:58Z
|
|
13
|
+
validation_status: pass-with-warnings
|
|
14
|
+
-->
|
|
15
|
+
|
|
16
|
+
# Getting started
|
|
17
|
+
|
|
18
|
+
Onboarding for **@webex/internal-plugin-llm**. Commands run from the webex-js-sdk workspace root.
|
|
19
|
+
|
|
20
|
+
## Prerequisites
|
|
21
|
+
|
|
22
|
+
| Tool or access | Version or requirement |
|
|
23
|
+
| -------------- | ---------------------- |
|
|
24
|
+
| Node.js | `>=18`, declared in `package.json` `engines` |
|
|
25
|
+
| Yarn | Workspaces are used, so install from the workspace root rather than this directory |
|
|
26
|
+
| Browser for `test:browser` | Only to exercise the karma runner that `test:browser` starts through `@webex/legacy-tools` |
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
The repository is already cloned when you are reading this file. Dependencies are resolved for the
|
|
31
|
+
whole workspace:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
yarn install
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Build
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
yarn workspace @webex/internal-plugin-llm build
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`scripts.build` runs `build:src`, which uses the `@webex/legacy-tools` builder to compile `.js` and
|
|
44
|
+
`.ts` files from `src/` into `dist/` with source maps. The manifest records `build:src` as the
|
|
45
|
+
compile role and `build` as the package role.
|
|
46
|
+
|
|
47
|
+
## Run
|
|
48
|
+
|
|
49
|
+
N/A — library package with no start script. Import the package from a consumer; plugin-meetings
|
|
50
|
+
imports it so that `webex.internal.llm` exists.
|
|
51
|
+
|
|
52
|
+
## Tests
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
yarn workspace @webex/internal-plugin-llm test:unit
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
| Tier | Command | Test location | Framework | External dependencies |
|
|
59
|
+
| ---- | ------- | ------------- | --------- | --------------------- |
|
|
60
|
+
| Unit | `yarn workspace @webex/internal-plugin-llm test:unit` | `test/unit/spec` | jest, chai, sinon, `@webex/test-helper-mock-webex` | None |
|
|
61
|
+
| Browser (karma) | `yarn workspace @webex/internal-plugin-llm test:browser` | integration files only; none exist | karma | A browser |
|
|
62
|
+
| Lint | `yarn workspace @webex/internal-plugin-llm test:style` | `src/` | eslint | None |
|
|
63
|
+
|
|
64
|
+
- The browser run is manifest `commands.browser-test` with role `other`, because the SDD manifest
|
|
65
|
+
`tests` schema allows only `unit`, `integration`, `e2e`, and `qa`.
|
|
66
|
+
- `test:browser` passes only `--integration`. The legacy-tools runner then collects files from
|
|
67
|
+
`test/integration/spec`, which does not exist, so the run executes no tests. It does not run the
|
|
68
|
+
unit spec.
|
|
69
|
+
- No standalone integration tier exists: `package.json` does not define `test:integration`.
|
|
70
|
+
- Do not use the `package.json` script `test` as a verification command; it chains the undefined
|
|
71
|
+
`test:integration`.
|
|
72
|
+
- Coverage or quality gate: N/A — no coverage threshold.
|
|
73
|
+
- Enforcement source: none. `jest.config.js` re-exports `@webex/jest-config-legacy`, which sets
|
|
74
|
+
`collectCoverage: false` and no `coverageThreshold`, and `package.json` has no coverage script.
|
|
75
|
+
- Test environment or QA dependencies: none.
|
|
76
|
+
|
|
77
|
+
## Configuration and secrets
|
|
78
|
+
|
|
79
|
+
- Required configuration: none to build or unit-test. At runtime, `config.llm` defaults come from
|
|
80
|
+
`src/llm.ts`, and the environment variables `MERCURY_PING_INTERVAL`, `MERCURY_PONG_TIMEOUT`,
|
|
81
|
+
`MERCURY_BACKOFF_TIME_MAX`, `MERCURY_BACKOFF_TIME_RESET`, and `MERCURY_FORCE_CLOSE_DELAY` override
|
|
82
|
+
them. The JWT data-channel flow follows the developer feature toggle described in the module spec.
|
|
83
|
+
- Secret source: data-channel tokens come from the calling meeting at runtime; this package reads no
|
|
84
|
+
secret from files or the environment.
|
|
85
|
+
- Package or artifact access: N/A — workspace dependencies only.
|
|
86
|
+
- Required neighboring repositories or workspace layout: the webex-js-sdk workspace, because
|
|
87
|
+
internal-plugin-mercury is a `workspace:*` dependency.
|
|
88
|
+
- Platform, simulator, device, or SDK setup: N/A.
|
|
89
|
+
- Never commit credentials or copy production secrets into a local config.
|
|
90
|
+
|
|
91
|
+
## First-run verification
|
|
92
|
+
|
|
93
|
+
1. Run `yarn install` from the workspace root.
|
|
94
|
+
2. Run `yarn workspace @webex/internal-plugin-llm build` and check that `dist/index.js` exists.
|
|
95
|
+
3. Run `yarn workspace @webex/internal-plugin-llm test:unit`.
|
|
96
|
+
|
|
97
|
+
Expected result: jest reports the `plugin-llm` suite passing with no failures.
|
|
98
|
+
|
|
99
|
+
## Next steps
|
|
100
|
+
|
|
101
|
+
- [Package architecture](architecture.md)
|
|
102
|
+
- [Specification registry](specs/README.md)
|
|
103
|
+
- [Documentation index](index.md)
|
|
104
|
+
- [LLM channel plugin specification](../src/docs/README.md)
|
package/docs/index.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
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-cowork
|
|
8
|
+
approved_by: akulakum@cisco.com
|
|
9
|
+
updated_at: 2026-10-08T10:12:58Z
|
|
10
|
+
validation_status: pass-with-warnings
|
|
11
|
+
-->
|
|
12
|
+
|
|
13
|
+
# @webex/internal-plugin-llm documentation
|
|
14
|
+
|
|
15
|
+
Doc map for developers and agents.
|
|
16
|
+
|
|
17
|
+
This package is the Webex JS SDK's LLM data-channel connection manager. It registers
|
|
18
|
+
`webex.internal.llm`, registers each session with the data-channel service, connects the returned
|
|
19
|
+
WebSocket through the Mercury plugin it extends, and tracks session ownership and data-channel tokens.
|
|
20
|
+
|
|
21
|
+
## Start here
|
|
22
|
+
|
|
23
|
+
- [Getting started](getting-started.md)
|
|
24
|
+
- [Package architecture](architecture.md)
|
|
25
|
+
- [LLM channel plugin specification](../src/docs/README.md) — behavior of `src/`
|
|
26
|
+
|
|
27
|
+
## Decisions
|
|
28
|
+
|
|
29
|
+
- [adr/](adr/) — architectural decision records
|
|
30
|
+
|
|
31
|
+
## Specifications and contracts
|
|
32
|
+
|
|
33
|
+
- [architecture.md](architecture.md) — canonical package-wide architecture and contract index
|
|
34
|
+
- [specs/README.md](specs/README.md) — manifest-backed module and contract registry
|
|
35
|
+
- `src/docs/README.md` — the owning specification beside the module's code
|
|
36
|
+
- [adr/](adr/) — concrete architectural decisions
|
|
37
|
+
|
|
38
|
+
No deployable service exists in this package, so no service specification is generated. The
|
|
39
|
+
published contracts are an npm/SDK surface whose authoritative source is `package.json` with
|
|
40
|
+
`src/index.ts`, and the plugin event set whose source is `src/llm.ts`. No OpenAPI document applies.
|
|
41
|
+
|
|
42
|
+
## Related repository resources
|
|
43
|
+
|
|
44
|
+
- `README.md` — the package's npm-facing usage page, retained separately from this generated
|
|
45
|
+
documentation set. See [ADR 0001](adr/0001-retain-product-readme.md).
|
|
46
|
+
|
|
47
|
+
No `ci/`, `operate/`, `diagrams/`, or runbook directories exist in this package.
|
|
@@ -0,0 +1,73 @@
|
|
|
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-cowork
|
|
11
|
+
approved_by: akulakum@cisco.com
|
|
12
|
+
updated_at: 2026-10-08T10:12:58Z
|
|
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
|
+
and native contract. Keep technical facts in the owning document.
|
|
20
|
+
|
|
21
|
+
Start with the [package architecture](../architecture.md). No service specification exists: this
|
|
22
|
+
package is a library published to npm, so that artifact is omitted in `.sdd/manifest.json`.
|
|
23
|
+
|
|
24
|
+
## Document roles
|
|
25
|
+
|
|
26
|
+
| Document | Canonical ownership |
|
|
27
|
+
| -------- | ------------------- |
|
|
28
|
+
| [Package architecture](../architecture.md) | Package boundaries, resource inventory, interactions, dependency topology, contract index, and cross-cutting architecture |
|
|
29
|
+
| Service specification | Not applicable — no deployable service exists in this package |
|
|
30
|
+
| Module specifications | Stable behavior and design at each manifest-routed module spec |
|
|
31
|
+
| [ADR](../adr/) | A durable decision, its deciders, rationale, and consequences |
|
|
32
|
+
|
|
33
|
+
## Instantiated specification registry
|
|
34
|
+
|
|
35
|
+
| Resource | Role | Canonical path | Owner | Status | Last verified |
|
|
36
|
+
| -------- | ---- | -------------- | ----- | ------ | ------------- |
|
|
37
|
+
| Package | Architecture | `docs/architecture.md` | @webex/web-client, @webex/web-sdk | Draft | 2026-10-07 |
|
|
38
|
+
| LLM channel plugin | Module | `src/docs/README.md` | @webex/web-client, @webex/web-sdk | Draft | 2026-10-07 |
|
|
39
|
+
| `llm-sdk` | Contract | `package.json` | @webex/web-client, @webex/web-sdk | Active | 2026-10-07 |
|
|
40
|
+
| `llm-plugin-events` | Contract | `src/llm.ts` | @webex/web-client, @webex/web-sdk | Active | 2026-10-07 |
|
|
41
|
+
| `llm-datachannel-protocol` | Contract | `src/llm.ts` | @webex/web-client, @webex/web-sdk | Active | 2026-10-07 |
|
|
42
|
+
|
|
43
|
+
### Module registry
|
|
44
|
+
|
|
45
|
+
| Module | Responsibility | Manifest coverage state | Start here |
|
|
46
|
+
| --- | --- | --- | --- |
|
|
47
|
+
| `src/` | LLM data-channel registration, session metadata, ownership, token cache, and URL lookup | Partial | `src/docs/README.md` |
|
|
48
|
+
|
|
49
|
+
Generator-side field measurement is complete. Field coverage measured 2026-10-07 is 93.3% (14 of 15 mandatory fields PRESENT for `src`). Critical fields are 8 of 8 PRESENT. The WEAK field is test strategy: untested paths are listed in the module spec's Verification section, and no characterization baseline exists. Independent validation round 3 passed with warnings on 2026-10-08. Coverage state stays `Partial` until a characterization baseline and a spec-drift record exist.
|
|
50
|
+
|
|
51
|
+
## Change and verification routing
|
|
52
|
+
|
|
53
|
+
| Change affects | Load and update | Verification route |
|
|
54
|
+
| -------------- | --------------- | ------------------ |
|
|
55
|
+
| Package boundaries or cross-cutting architecture | `docs/architecture.md` and applicable ADRs | `yarn workspace @webex/internal-plugin-llm test:unit` and `yarn workspace @webex/internal-plugin-llm test:style` |
|
|
56
|
+
| A deployable service surface or operating posture | Not applicable — no deployable service exists in this package | Not applicable |
|
|
57
|
+
| Registration, connect, timing, or the auth header | `src/docs/README.md` | `yarn workspace @webex/internal-plugin-llm test:unit` |
|
|
58
|
+
| Ownership, token cache, or refresh handlers | `src/docs/README.md`; check callers in plugin-meetings | `yarn workspace @webex/internal-plugin-llm test:unit` |
|
|
59
|
+
| A public export, session id, or event name | The module spec and `docs/architecture.md`; check plugin-meetings and internal-plugin-voicea | `yarn workspace @webex/internal-plugin-llm test:unit`, then `yarn workspace @webex/internal-plugin-llm build` |
|
|
60
|
+
| Socket lifecycle or reconnect behavior | Not owned here; change sibling package internal-plugin-mercury | That package's own checks, then `yarn workspace @webex/internal-plugin-llm test:unit` |
|
|
61
|
+
|
|
62
|
+
## Module and contract registration
|
|
63
|
+
|
|
64
|
+
Modules, in manifest tree order: `src` with canonical spec `src/docs/README.md`. It has no child
|
|
65
|
+
module.
|
|
66
|
+
|
|
67
|
+
`llm-sdk` is published; its ecosystem-native artifact is `package.json`, owned by `src`.
|
|
68
|
+
`llm-plugin-events` is published with source `src/llm.ts`, owned by `src`.
|
|
69
|
+
`llm-datachannel-protocol` is internal with source `src/llm.ts`, owned by `src`. No OpenAPI document
|
|
70
|
+
applies, which is why `api-specs/openapi.yaml` is omitted.
|
|
71
|
+
|
|
72
|
+
`mercury-plugin-base`, `webex-core-plugin-host`, `webex-device-registration`, and
|
|
73
|
+
`webex-feature-toggles` are external required contracts. They are not implemented in this package.
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"node": ">=18"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@webex/internal-plugin-mercury": "3.12.0-next.
|
|
16
|
+
"@webex/internal-plugin-mercury": "3.12.0-next.63"
|
|
17
17
|
},
|
|
18
18
|
"browserify": {
|
|
19
19
|
"transform": [
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"test:style": "eslint ./src/**/*.*",
|
|
45
45
|
"test:unit": "webex-legacy-tools test --unit --runner jest"
|
|
46
46
|
},
|
|
47
|
-
"version": "3.12.0-next.
|
|
47
|
+
"version": "3.12.0-next.67"
|
|
48
48
|
}
|