@webex/internal-plugin-llm 3.12.0-webex-services-ready.4 → 3.13.0
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/README.md +45 -65
- package/dist/index.js +17 -6
- package/dist/index.js.map +1 -1
- package/dist/llm-plugin.js +199 -0
- package/dist/llm-plugin.js.map +1 -0
- package/dist/llm.js +193 -411
- package/dist/llm.js.map +1 -1
- package/dist/llm.types.js +8 -0
- package/dist/llm.types.js.map +1 -1
- 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 +6 -6
- package/schemas/repo-context.schema.json +796 -0
- package/src/docs/README.md +522 -0
- package/src/index.ts +7 -2
- package/src/llm-plugin.ts +115 -0
- package/src/llm.ts +156 -443
- package/src/llm.types.ts +68 -50
- package/test/unit/spec/llm-plugin.js +391 -0
- package/test/unit/spec/llm.js +440 -567
|
@@ -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.
|
|
16
|
+
"@webex/internal-plugin-mercury": "3.13.0"
|
|
17
17
|
},
|
|
18
18
|
"browserify": {
|
|
19
19
|
"transform": [
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"@webex/eslint-config-legacy": "0.0.0",
|
|
28
28
|
"@webex/jest-config-legacy": "0.0.0",
|
|
29
29
|
"@webex/legacy-tools": "0.0.0",
|
|
30
|
-
"@webex/test-helper-chai": "3.
|
|
31
|
-
"@webex/test-helper-mocha": "3.
|
|
32
|
-
"@webex/test-helper-mock-webex": "3.
|
|
33
|
-
"@webex/test-helper-test-users": "3.
|
|
30
|
+
"@webex/test-helper-chai": "3.13.0",
|
|
31
|
+
"@webex/test-helper-mocha": "3.13.0",
|
|
32
|
+
"@webex/test-helper-mock-webex": "3.13.0",
|
|
33
|
+
"@webex/test-helper-test-users": "3.13.0",
|
|
34
34
|
"eslint": "^8.24.0",
|
|
35
35
|
"prettier": "^2.7.1",
|
|
36
36
|
"sinon": "^9.2.4"
|
|
@@ -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.
|
|
47
|
+
"version": "3.13.0"
|
|
48
48
|
}
|