@memberjunction/ai-bridge-webex 0.0.1 → 5.42.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/README.md +110 -43
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/register-native.d.ts +18 -0
- package/dist/register-native.d.ts.map +1 -0
- package/dist/register-native.js +31 -0
- package/dist/register-native.js.map +1 -0
- package/dist/webex-bridge.d.ts +156 -0
- package/dist/webex-bridge.d.ts.map +1 -0
- package/dist/webex-bridge.js +361 -0
- package/dist/webex-bridge.js.map +1 -0
- package/dist/webex-meeting-controls.d.ts +80 -0
- package/dist/webex-meeting-controls.d.ts.map +1 -0
- package/dist/webex-meeting-controls.js +130 -0
- package/dist/webex-meeting-controls.js.map +1 -0
- package/dist/webex-native-sdk.d.ts +283 -0
- package/dist/webex-native-sdk.d.ts.map +1 -0
- package/dist/webex-native-sdk.js +305 -0
- package/dist/webex-native-sdk.js.map +1 -0
- package/dist/webex-sdk.d.ts +174 -0
- package/dist/webex-sdk.d.ts.map +1 -0
- package/dist/webex-sdk.js +36 -0
- package/dist/webex-sdk.js.map +1 -0
- package/package.json +32 -7
package/README.md
CHANGED
|
@@ -1,45 +1,112 @@
|
|
|
1
1
|
# @memberjunction/ai-bridge-webex
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
3
|
+
The **Cisco Webex** Realtime Bridge driver in MemberJunction's Realtime Bridges program. It connects
|
|
4
|
+
the one realtime agent engine to a **Webex meeting**: bidirectional audio, a diarized participant roster,
|
|
5
|
+
participant mute, Webex meeting chat, and a **Meeting Controls** facilitator channel — all behind an
|
|
6
|
+
injectable Cisco Webex Meetings SDK seam so the driver builds and unit-tests with **no network and no real
|
|
7
|
+
Cisco Webex Meetings SDK**. It is a structural mirror of the reference
|
|
8
|
+
[`@memberjunction/ai-bridge-zoom`](../BridgeZoom/README.md) driver (and its sibling
|
|
9
|
+
[`@memberjunction/ai-bridge-teams`](../BridgeTeams/README.md)).
|
|
10
|
+
|
|
11
|
+
See the [Realtime Bridges Guide](../../../../guides/REALTIME_BRIDGES_GUIDE.md) and
|
|
12
|
+
[`/plans/realtime/realtime-bridges-architecture.md`](../../../../plans/realtime/realtime-bridges-architecture.md)
|
|
13
|
+
(§3 provider abstraction, §4b channels, §8 Cisco Webex capability row) for the full architecture.
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @memberjunction/ai-bridge-webex
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## What it provides
|
|
22
|
+
|
|
23
|
+
- **`WebexBridge`** — `@RegisterClass(BaseRealtimeBridge, 'WebexBridge')`. The `MJ: AI Bridge Providers`
|
|
24
|
+
row with `DriverClass = 'WebexBridge'` resolves to this driver via the `ClassFactory`. Implements the
|
|
25
|
+
four `BaseRealtimeBridge` abstracts (`Connect` / `Disconnect` / `SendMedia` / `OnMedia`) and the
|
|
26
|
+
capability-gated virtuals Webex supports (`GetParticipants`, `OnParticipantChange`), plus
|
|
27
|
+
`GetMeetingControlsEventSource` for the facilitator channel and a `PostChatMessage` helper.
|
|
28
|
+
- **`IWebexMeetingSdk`** — the **injectable seam** the driver depends on instead of the real SDK.
|
|
29
|
+
- **`WebexMeetingControlsEventSource`** — adapts the seam's roster / hand-raise / speaking / mute into
|
|
30
|
+
the bridge's `IBridgeMeetingControlsEventSource`, so the engine wires the Meeting Controls channel.
|
|
31
|
+
|
|
32
|
+
## Capability coverage (the Cisco Webex seed row)
|
|
33
|
+
|
|
34
|
+
| Capability | Status |
|
|
35
|
+
|---|---|
|
|
36
|
+
| On-demand + scheduled + invite join | ✅ |
|
|
37
|
+
| Inbound routing | ✅ |
|
|
38
|
+
| Audio in / out | ✅ |
|
|
39
|
+
| Video in/out, Screen in/out (directional flags) | ✅ (transport carries them; models light audio first) |
|
|
40
|
+
| Speaker diarization (roster + per-speaker labels) | ✅ |
|
|
41
|
+
| Participant mute (Meeting Controls) | ✅ |
|
|
42
|
+
| Webex meeting chat | ✅ |
|
|
43
|
+
| Native raised-hand | ⚠️ Partial — wired where the Meetings SDK surfaces it; tolerant of it never firing |
|
|
44
|
+
| DTMF / call transfer / recording | ➖ not Webex-meeting features here — the gated base methods throw `BridgeCapabilityNotSupportedError` |
|
|
45
|
+
|
|
46
|
+
Capability gating is two-layer (defense-in-depth): the engine checks the provider's `SupportedFeatures`
|
|
47
|
+
first, and the driver re-asserts each flag with `RequireFeature` at the top of its overrides.
|
|
48
|
+
|
|
49
|
+
### Webex vs. Zoom capability differences
|
|
50
|
+
|
|
51
|
+
Webex advertises everything Zoom does, **plus** `InviteJoin` and `InboundRouting` (the calendar-invite /
|
|
52
|
+
inbound-routing UX), and its native raised-hand is **partial** rather than fully reliable. Unlike Teams,
|
|
53
|
+
Webex does **not** advertise `NativeInvite`. Everything else (audio in/out, directional video/screen,
|
|
54
|
+
diarized roster, mute, meeting chat) maps one-to-one onto the Zoom reference driver.
|
|
55
|
+
|
|
56
|
+
## The Cisco Webex Meetings SDK seam (`IWebexMeetingSdk`)
|
|
57
|
+
|
|
58
|
+
The driver never imports the real Webex SDK. It depends only on this minimal interface, named after
|
|
59
|
+
Cisco Webex Meetings SDK / xAPI / Webex bot concepts:
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
export interface IWebexMeetingSdk {
|
|
63
|
+
join(args: WebexJoinArgs): Promise<WebexJoinResult>;
|
|
64
|
+
leave(): Promise<void>;
|
|
65
|
+
sendAudioFrame(pcm: ArrayBuffer): void; // agent's voice out (outbound audio track)
|
|
66
|
+
onAudioFrame(cb: (frame: WebexAudioFrame) => void): void; // raw per-participant audio in (diarization)
|
|
67
|
+
onParticipantJoin(cb: (p: WebexParticipant) => void): void;
|
|
68
|
+
onParticipantLeave(cb: (id: string) => void): void;
|
|
69
|
+
onHandRaise(cb: (id: string, raised: boolean) => void): void; // ⚠️ partial on Webex
|
|
70
|
+
getParticipants(): Promise<WebexParticipant[]>;
|
|
71
|
+
postChatMessage(text: string): Promise<void>; // Webex meeting space chat
|
|
72
|
+
muteParticipant(participantId: string): Promise<void>;
|
|
73
|
+
onMeetingEnded(cb: () => void): void;
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Production binding (deployment TODO)
|
|
78
|
+
|
|
79
|
+
In production this is bound to the **Cisco Webex Meetings SDK** (the embedded-app / Web / mobile Meetings
|
|
80
|
+
SDK that joins the meeting and exposes media + the `members` roster) together with the **Webex bot
|
|
81
|
+
framework** (Webex Messaging API for the in-meeting space chat) and, where a Webex room device is involved,
|
|
82
|
+
the **xAPI** for participant actions. Supply a factory via the creation seam:
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import { WebexBridge } from '@memberjunction/ai-bridge-webex';
|
|
86
|
+
|
|
87
|
+
// Once, where bridge drivers are configured:
|
|
88
|
+
// bridge.SetSdkFactory((config) => new RealWebexSdkAdapter(config));
|
|
89
|
+
// The adapter implements IWebexMeetingSdk over the real Webex SDK. The driver + its tests do not change.
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Out of the box, `WebexBridge` ships **without** the real SDK adapter — `Connect` throws an explicit
|
|
93
|
+
"bind the real Cisco Webex SDK" error until `SetSdkFactory` is called. Tests inject a `FakeWebexSdk`.
|
|
94
|
+
|
|
95
|
+
## Usage (engine-driven)
|
|
96
|
+
|
|
97
|
+
The bridge is not used directly — `AIBridgeEngine.StartBridgeSession` (`@memberjunction/ai-bridge-server`)
|
|
98
|
+
resolves it from the provider's `DriverClass`, wires the transport seam to the injected
|
|
99
|
+
`IRealtimeSession`, and (when a channel host is supplied) wires the Meeting Controls channel from
|
|
100
|
+
`GetMeetingControlsEventSource`. See the bridge-server package and the guide's "Channel plane" section.
|
|
101
|
+
|
|
102
|
+
## Testing
|
|
103
|
+
|
|
104
|
+
`FakeWebexSdk` (in `src/__tests__/`) is an in-memory `IWebexMeetingSdk` with drive helpers and capture
|
|
105
|
+
sinks. The suite covers connect/disconnect (incl. parsing the meeting number out of the join link),
|
|
106
|
+
audio in→`OnMedia` (speaker labels) and out→seam, participant join/leave → roster + event source, native
|
|
107
|
+
hand-raise → Meeting Controls perception, capability gating (a feature Webex lacks throws), and chat — all
|
|
108
|
+
with no network.
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
cd packages/AI/Providers/BridgeWebex && npm run test
|
|
112
|
+
```
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './webex-sdk.js';
|
|
2
|
+
export * from './webex-meeting-controls.js';
|
|
3
|
+
export * from './webex-bridge.js';
|
|
4
|
+
export * from './webex-native-sdk.js';
|
|
5
|
+
export * from './register-native.js';
|
|
6
|
+
import { LoadWebexBridge } from './webex-bridge.js';
|
|
7
|
+
import { RegisterWebexNativeSdk } from './register-native.js';
|
|
8
|
+
// Static reference so bundlers cannot tree-shake the @RegisterClass(BaseRealtimeBridge, 'WebexBridge')
|
|
9
|
+
// registration. Calling the no-op here keeps the driver resolvable by the engine's ClassFactory.
|
|
10
|
+
LoadWebexBridge();
|
|
11
|
+
// Register Webex's native two-way SDK binding so the engine auto-binds it at StartBridgeSession.
|
|
12
|
+
RegisterWebexNativeSdk();
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,uGAAuG;AACvG,iGAAiG;AACjG,eAAe,EAAE,CAAC;AAClB,iGAAiG;AACjG,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Registers the Webex **native two-way** SDK binding into the {@link BridgeNativeSdkRegistry}
|
|
3
|
+
* so `AIBridgeEngine.StartBridgeSession` auto-binds it onto a resolved `WebexBridge` before connect — no
|
|
4
|
+
* per-deployment wiring needed. The typed downcast + `SetSdkFactory` stay confined here (where the concrete
|
|
5
|
+
* `WebexBridge` type is known), keeping the engine seam free of provider types.
|
|
6
|
+
*
|
|
7
|
+
* A host can still override per-session via `StartBridgeSessionParams.BindSdk`.
|
|
8
|
+
*
|
|
9
|
+
* @module @memberjunction/ai-bridge-webex
|
|
10
|
+
* @author MemberJunction.com
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Registers Webex's native two-way binding. Idempotent (latest-wins in the registry), and invoked from the
|
|
14
|
+
* package `index.ts` so merely importing `@memberjunction/ai-bridge-webex` wires the default binding. Also
|
|
15
|
+
* exported as a tree-shake-safe no-op-returning function callers can reference to force-retain the module.
|
|
16
|
+
*/
|
|
17
|
+
export declare function RegisterWebexNativeSdk(): void;
|
|
18
|
+
//# sourceMappingURL=register-native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-native.d.ts","sourceRoot":"","sources":["../src/register-native.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AASH;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAO7C"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Registers the Webex **native two-way** SDK binding into the {@link BridgeNativeSdkRegistry}
|
|
3
|
+
* so `AIBridgeEngine.StartBridgeSession` auto-binds it onto a resolved `WebexBridge` before connect — no
|
|
4
|
+
* per-deployment wiring needed. The typed downcast + `SetSdkFactory` stay confined here (where the concrete
|
|
5
|
+
* `WebexBridge` type is known), keeping the engine seam free of provider types.
|
|
6
|
+
*
|
|
7
|
+
* A host can still override per-session via `StartBridgeSessionParams.BindSdk`.
|
|
8
|
+
*
|
|
9
|
+
* @module @memberjunction/ai-bridge-webex
|
|
10
|
+
* @author MemberJunction.com
|
|
11
|
+
*/
|
|
12
|
+
import { BridgeNativeSdkRegistry } from '@memberjunction/ai-bridge-base';
|
|
13
|
+
import { BindWebexNative } from './webex-native-sdk.js';
|
|
14
|
+
/** The `MJ: AI Bridge Providers.DriverClass` value the Webex provider row carries. */
|
|
15
|
+
const WEBEX_DRIVER_CLASS = 'WebexBridge';
|
|
16
|
+
/**
|
|
17
|
+
* Registers Webex's native two-way binding. Idempotent (latest-wins in the registry), and invoked from the
|
|
18
|
+
* package `index.ts` so merely importing `@memberjunction/ai-bridge-webex` wires the default binding. Also
|
|
19
|
+
* exported as a tree-shake-safe no-op-returning function callers can reference to force-retain the module.
|
|
20
|
+
*/
|
|
21
|
+
export function RegisterWebexNativeSdk() {
|
|
22
|
+
BridgeNativeSdkRegistry.Instance.Register(WEBEX_DRIVER_CLASS, (driver) => {
|
|
23
|
+
// Safe downcast: the registry is keyed by DriverClass, so the engine only ever applies this to the
|
|
24
|
+
// WebexBridge it resolved for 'WebexBridge'. BindWebexNative() defaults to the lazy native loader,
|
|
25
|
+
// which reads NativeModuleSpecifier from the per-session Configuration.
|
|
26
|
+
driver.SetSdkFactory(BindWebexNative());
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
// Register on import (mirrors the LoadWebexBridge() tree-shake pattern in index.ts).
|
|
30
|
+
RegisterWebexNativeSdk();
|
|
31
|
+
//# sourceMappingURL=register-native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-native.js","sourceRoot":"","sources":["../src/register-native.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,uBAAuB,EAAsB,MAAM,gCAAgC,CAAC;AAE7F,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,sFAAsF;AACtF,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAEzC;;;;GAIG;AACH,MAAM,UAAU,sBAAsB;IAClC,uBAAuB,CAAC,QAAQ,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC,MAA0B,EAAE,EAAE;QACzF,mGAAmG;QACnG,mGAAmG;QACnG,wEAAwE;QACvE,MAAsB,CAAC,aAAa,CAAC,eAAe,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACP,CAAC;AAED,qFAAqF;AACrF,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview `WebexBridge` — the **Cisco Webex** platform Realtime Bridge driver, connecting the
|
|
3
|
+
* one realtime agent engine to a **Webex meeting**. Implements the {@link BaseRealtimeBridge} contract
|
|
4
|
+
* against an injectable {@link IWebexMeetingSdk} seam so it builds + unit-tests with NO network and NO
|
|
5
|
+
* real Cisco Webex Meetings SDK (the Gemini `connectLiveSession` testability pattern). Structurally
|
|
6
|
+
* mirrors `ZoomBridge` / `TeamsBridge` (the reference drivers) — only the platform names + join-coordinate
|
|
7
|
+
* parsing differ.
|
|
8
|
+
*
|
|
9
|
+
* Webex capability coverage (per the §8 seed row): on-demand + scheduled + invite join, inbound routing,
|
|
10
|
+
* audio in/out (video/screen directional flags carried by transport), a diarized roster
|
|
11
|
+
* (`SpeakerDiarization`), participant mute + Webex meeting chat (via the Meeting Controls channel). Native
|
|
12
|
+
* raised-hand is ⚠️ partial over the Meetings SDK — wired where the platform surfaces it, tolerant of it
|
|
13
|
+
* never firing. Telephony features (DTMF / transfer / recording) are NOT Webex-meeting features here, so
|
|
14
|
+
* those virtual base methods keep throwing `BridgeCapabilityNotSupportedError`.
|
|
15
|
+
*
|
|
16
|
+
* @module @memberjunction/ai-bridge-webex
|
|
17
|
+
* @author MemberJunction.com
|
|
18
|
+
*/
|
|
19
|
+
import { BaseRealtimeBridge, BridgeConnectResult, BridgeDisconnectReason, BridgeMediaFrame, BridgeMediaTrackKind, BridgeParticipantInfo, RealtimeBridgeContext, IBridgeMeetingControlsEventSource } from '@memberjunction/ai-bridge-base';
|
|
20
|
+
import { WebexMeetingSdkFactory } from './webex-sdk.js';
|
|
21
|
+
/**
|
|
22
|
+
* The `DriverClass` key {@link WebexBridge} registers under. A `MJ: AI Bridge Providers` row with
|
|
23
|
+
* `DriverClass = 'WebexBridge'` resolves to this driver via the `ClassFactory`.
|
|
24
|
+
*/
|
|
25
|
+
export declare const WEBEX_BRIDGE_DRIVER_CLASS = "WebexBridge";
|
|
26
|
+
/**
|
|
27
|
+
* Realtime Bridge driver for **Cisco Webex meetings**.
|
|
28
|
+
*
|
|
29
|
+
* Construct the driver with the default constructor (the engine's `ClassFactory` path) — it lazily
|
|
30
|
+
* builds the Webex SDK from the {@link sdkFactory} at {@link Connect} time. Tests inject a `FakeWebexSdk`
|
|
31
|
+
* by overriding the factory via {@link SetSdkFactory} (the creation seam) before connecting.
|
|
32
|
+
*
|
|
33
|
+
* Registered via `@RegisterClass(BaseRealtimeBridge, 'WebexBridge')`.
|
|
34
|
+
*/
|
|
35
|
+
export declare class WebexBridge extends BaseRealtimeBridge {
|
|
36
|
+
/** The live Webex SDK seam for this session, created at {@link Connect}. */
|
|
37
|
+
private sdk;
|
|
38
|
+
/** The bot's own member id in the joined meeting (set at {@link Connect}). */
|
|
39
|
+
private botParticipantId;
|
|
40
|
+
/** The inbound-media handler registered via {@link OnMedia}; raw audio frames are forwarded to it. */
|
|
41
|
+
private mediaHandler?;
|
|
42
|
+
/** The roster-change handler registered via {@link OnParticipantChange}. */
|
|
43
|
+
private participantHandler?;
|
|
44
|
+
/** The Meeting Controls event source for this session (only when diarization is supported). */
|
|
45
|
+
private meetingControls;
|
|
46
|
+
/**
|
|
47
|
+
* The SDK creation seam. Defaults to a factory that throws an explicit "bind the real Webex SDK"
|
|
48
|
+
* error, since this package ships WITHOUT the real SDK adapter (a deployment concern). Production
|
|
49
|
+
* sets a real factory via {@link SetSdkFactory}; tests inject a `FakeWebexSdk`.
|
|
50
|
+
*/
|
|
51
|
+
private sdkFactory;
|
|
52
|
+
/**
|
|
53
|
+
* Sets the {@link WebexMeetingSdkFactory} this driver uses to construct its SDK seam at connect —
|
|
54
|
+
* the creation seam (mirroring Gemini's overridable `connectLiveSession`). Production binds the
|
|
55
|
+
* real Cisco Webex Meetings SDK adapter here; tests inject a `FakeWebexSdk`.
|
|
56
|
+
*
|
|
57
|
+
* @param factory The factory that builds the {@link IWebexMeetingSdk} for a session.
|
|
58
|
+
*/
|
|
59
|
+
SetSdkFactory(factory: WebexMeetingSdkFactory): void;
|
|
60
|
+
/**
|
|
61
|
+
* Joins the Webex meeting and brings the bot online. Captures the capability context, builds the SDK
|
|
62
|
+
* from the {@link sdkFactory}, wires the inbound raw-audio path and meeting-ended callback, joins,
|
|
63
|
+
* and (when the provider diarizes) constructs + seeds the Meeting Controls event source.
|
|
64
|
+
*
|
|
65
|
+
* @param ctx The bridge context (features, provider name, the meeting link as `Address`, config).
|
|
66
|
+
* @returns The bot member + meeting (external connection) identifiers, persisted by the engine.
|
|
67
|
+
*/
|
|
68
|
+
Connect(ctx: RealtimeBridgeContext): Promise<BridgeConnectResult>;
|
|
69
|
+
/**
|
|
70
|
+
* Leaves the Webex meeting and releases all SDK resources. Tolerant of teardown errors.
|
|
71
|
+
*
|
|
72
|
+
* @param _reason Why the disconnect happened (Webex teardown is uniform; the bot simply leaves).
|
|
73
|
+
*/
|
|
74
|
+
Disconnect(_reason: BridgeDisconnectReason): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Sends an outbound media frame into the meeting. Audio is fed to the SDK's outbound audio-track
|
|
77
|
+
* path; video/screen frames are gated by the directional capability flags (the transport carries
|
|
78
|
+
* them, and the SDK send is a deployment-time binding TODO — today the models emit audio).
|
|
79
|
+
*
|
|
80
|
+
* @param track The outbound track the frame targets.
|
|
81
|
+
* @param frame The media frame to send.
|
|
82
|
+
*/
|
|
83
|
+
SendMedia(track: BridgeMediaTrackKind, frame: BridgeMediaFrame): void;
|
|
84
|
+
/**
|
|
85
|
+
* Registers the inbound-media handler. The driver forwards each raw per-participant audio frame
|
|
86
|
+
* (with its speaker label) to this handler; the engine routes it to `IRealtimeSession.SendInput`.
|
|
87
|
+
*
|
|
88
|
+
* @param handler Invoked with each inbound media frame.
|
|
89
|
+
*/
|
|
90
|
+
OnMedia(handler: (frame: BridgeMediaFrame) => void): void;
|
|
91
|
+
/**
|
|
92
|
+
* Returns the current Webex member roster (gated by `SpeakerDiarization`). Re-asserts the flag
|
|
93
|
+
* (defense-in-depth) so even an engine-bypassing caller cannot pull a roster a disabled provider
|
|
94
|
+
* forbids.
|
|
95
|
+
*
|
|
96
|
+
* @returns The current members.
|
|
97
|
+
* @throws {BridgeCapabilityNotSupportedError} when diarization is not enabled for the provider.
|
|
98
|
+
*/
|
|
99
|
+
GetParticipants(): Promise<BridgeParticipantInfo[]>;
|
|
100
|
+
/**
|
|
101
|
+
* Registers a roster-change handler (gated by `SpeakerDiarization`). The driver fires it from the
|
|
102
|
+
* SDK's member join/leave stream with the full current roster.
|
|
103
|
+
*
|
|
104
|
+
* @param handler Invoked with the updated participant list on each change.
|
|
105
|
+
* @throws {BridgeCapabilityNotSupportedError} when diarization is not enabled.
|
|
106
|
+
*/
|
|
107
|
+
OnParticipantChange(handler: (participants: BridgeParticipantInfo[]) => void): void;
|
|
108
|
+
/**
|
|
109
|
+
* Returns the Webex Meeting Controls event source for this session (roster · hand-raise · speaking ·
|
|
110
|
+
* mute), or `null` when diarization is off (no roster to facilitate). The engine wires the Meeting
|
|
111
|
+
* Controls channel from this.
|
|
112
|
+
*/
|
|
113
|
+
GetMeetingControlsEventSource(): IBridgeMeetingControlsEventSource | null;
|
|
114
|
+
/**
|
|
115
|
+
* Posts a message to the Webex meeting space chat. Exposed for the channel plane / turn-taking hybrid
|
|
116
|
+
* mode (the social-cost-free "raise hand"). Best-effort — a chat failure is logged, never fatal.
|
|
117
|
+
*
|
|
118
|
+
* @param text The chat message to post.
|
|
119
|
+
*/
|
|
120
|
+
PostChatMessage(text: string): Promise<void>;
|
|
121
|
+
/** The bot's member id in the joined meeting (or `null` before {@link Connect}). */
|
|
122
|
+
get BotParticipantId(): string | null;
|
|
123
|
+
/** Wires the SDK's inbound raw-audio callback to a diarized inbound {@link BridgeMediaFrame}. */
|
|
124
|
+
private wireInboundAudio;
|
|
125
|
+
/**
|
|
126
|
+
* Wires the SDK's member join/leave + hand-raise streams ONCE (the driver is the single owner;
|
|
127
|
+
* the SDK seam is latest-handler-wins). Each roster change fans out to both the driver's own
|
|
128
|
+
* roster-change handler and the Meeting Controls source; hand-raise signals (⚠️ partial on Webex)
|
|
129
|
+
* feed the source.
|
|
130
|
+
*/
|
|
131
|
+
private wireRoster;
|
|
132
|
+
/** Pulls the current roster from the SDK and fans it out to both the participant handler + Meeting Controls. */
|
|
133
|
+
private refreshRoster;
|
|
134
|
+
/** Handles the SDK's meeting-ended signal: surface an empty roster so the engine sees everyone gone. */
|
|
135
|
+
private handleMeetingEnded;
|
|
136
|
+
/** Builds the SDK join args from the bridge context (Address is the meeting link). */
|
|
137
|
+
private buildJoinArgs;
|
|
138
|
+
/**
|
|
139
|
+
* Extracts the Webex meeting number from a meeting link when present, else `undefined`. Webex meeting
|
|
140
|
+
* numbers are 9–11 digit strings carried in the join URL (e.g. as a `MTID`/`/j.php?MTID=...` query
|
|
141
|
+
* param or a trailing numeric segment of a personal-room / scheduled link). Tolerant — a non-matching
|
|
142
|
+
* address yields `undefined` so the SDK can resolve coordinates itself.
|
|
143
|
+
*/
|
|
144
|
+
private parseMeetingNumber;
|
|
145
|
+
/** Returns the PCM bytes of an outbound audio frame, preferring the binary payload. */
|
|
146
|
+
private framePcm;
|
|
147
|
+
/** Decodes a base64 payload to an `ArrayBuffer` (Node `Buffer` fast path, `atob` fallback). */
|
|
148
|
+
private decodeBase64;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Tree-shaking-prevention loader. Modern bundlers cannot see the `@RegisterClass` dynamic registration
|
|
152
|
+
* of {@link WebexBridge} and may eliminate it. Import and call this no-op from a static code path
|
|
153
|
+
* (the package entry point does) so the `ClassFactory` can resolve `'WebexBridge'`.
|
|
154
|
+
*/
|
|
155
|
+
export declare function LoadWebexBridge(): void;
|
|
156
|
+
//# sourceMappingURL=webex-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webex-bridge.d.ts","sourceRoot":"","sources":["../src/webex-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,EACH,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EAErB,qBAAqB,EACrB,iCAAiC,EACpC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEH,sBAAsB,EAKzB,MAAM,aAAa,CAAC;AAGrB;;;GAGG;AACH,eAAO,MAAM,yBAAyB,gBAAgB,CAAC;AA8BvD;;;;;;;;GAQG;AACH,qBACa,WAAY,SAAQ,kBAAkB;IAC/C,4EAA4E;IAC5E,OAAO,CAAC,GAAG,CAAiC;IAE5C,8EAA8E;IAC9E,OAAO,CAAC,gBAAgB,CAAuB;IAE/C,sGAAsG;IACtG,OAAO,CAAC,YAAY,CAAC,CAAoC;IAEzD,4EAA4E;IAC5E,OAAO,CAAC,kBAAkB,CAAC,CAAkD;IAE7E,+FAA+F;IAC/F,OAAO,CAAC,eAAe,CAAgD;IAEvE;;;;OAIG;IACH,OAAO,CAAC,UAAU,CAMhB;IAEF;;;;;;OAMG;IACI,aAAa,CAAC,OAAO,EAAE,sBAAsB,GAAG,IAAI;IAM3D;;;;;;;OAOG;IACU,OAAO,CAAC,GAAG,EAAE,qBAAqB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IA2B9E;;;;OAIG;IACU,UAAU,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBvE;;;;;;;OAOG;IACI,SAAS,CAAC,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAuB5E;;;;;OAKG;IACI,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,GAAG,IAAI;IAMhE;;;;;;;OAOG;IACmB,eAAe,IAAI,OAAO,CAAC,qBAAqB,EAAE,CAAC;IASzE;;;;;;OAMG;IACa,mBAAmB,CAAC,OAAO,EAAE,CAAC,YAAY,EAAE,qBAAqB,EAAE,KAAK,IAAI,GAAG,IAAI;IAKnG;;;;OAIG;IACa,6BAA6B,IAAI,iCAAiC,GAAG,IAAI;IAMzF;;;;;OAKG;IACU,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWzD,oFAAoF;IACpF,IAAW,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAE3C;IAID,iGAAiG;IACjG,OAAO,CAAC,gBAAgB;IAWxB;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAMlB,gHAAgH;YAClG,aAAa;IAU3B,wGAAwG;IACxG,OAAO,CAAC,kBAAkB;IAK1B,sFAAsF;IACtF,OAAO,CAAC,aAAa;IAYrB;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IAmB1B,uFAAuF;IACvF,OAAO,CAAC,QAAQ;IAUhB,+FAA+F;IAC/F,OAAO,CAAC,YAAY;CAevB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAEtC"}
|