@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
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The injectable **Cisco Webex Meetings SDK seam** — the minimal set of operations
|
|
3
|
+
* {@link import('./webex-bridge.js').WebexBridge} needs from Webex, declared as an interface so the driver
|
|
4
|
+
* builds and unit-tests against an in-memory fake with **no network and no real Cisco Webex Meetings SDK
|
|
5
|
+
* / xAPI / Webex bot framework**.
|
|
6
|
+
*
|
|
7
|
+
* ## Production binding (TODO at deployment)
|
|
8
|
+
* In production this interface is bound to the **Cisco Webex Meetings SDK** (the embedded-app / Web /
|
|
9
|
+
* mobile Meetings SDK that joins a meeting and exposes media + roster) together with the **Webex bot
|
|
10
|
+
* framework** (Webex Messaging API, for posting to the meeting/space) and, where a Webex room device is
|
|
11
|
+
* involved, the **xAPI** (the device control surface for participant actions). The named operations map
|
|
12
|
+
* to the SDK as follows:
|
|
13
|
+
* - {@link join} / {@link leave} → the Webex Meetings SDK `Meeting.join()` / `Meeting.leave()` lifecycle
|
|
14
|
+
* (the bot/app joins via the meeting link, SIP address, or meeting number).
|
|
15
|
+
* - {@link sendAudioFrame} → the Meetings SDK outbound audio media track (the bot's voice into the meeting).
|
|
16
|
+
* - {@link onAudioFrame} → the Meetings SDK per-participant inbound audio media callback (the source of
|
|
17
|
+
* speaker labels for diarization — Webex attributes media to a `Member`).
|
|
18
|
+
* - {@link onParticipantJoin} / {@link onParticipantLeave} / {@link getParticipants} → the meeting's
|
|
19
|
+
* `members` collection + the `members:update` change events.
|
|
20
|
+
* - {@link onHandRaise} → the Webex raised-hand reaction. ⚠️ Partial: Webex surfaces raised hands in the
|
|
21
|
+
* meeting UI, but a clean per-participant *event* over the Meetings SDK is not guaranteed on every
|
|
22
|
+
* client/build; the adapter wires it where the platform exposes it and otherwise no-ops.
|
|
23
|
+
* - {@link postChatMessage} → the Webex Messaging API `POST /messages` against the meeting's associated
|
|
24
|
+
* space (the in-meeting chat thread).
|
|
25
|
+
* - {@link muteParticipant} → the meeting's `Member.mute` action / device xAPI mute (requires the bot be
|
|
26
|
+
* a host / cohost with the relevant privilege).
|
|
27
|
+
* - {@link onMeetingEnded} → the meeting's `meeting:ended` / `state` → `ENDED` notification.
|
|
28
|
+
*
|
|
29
|
+
* Binding the real SDK is a thin adapter that implements this interface; the driver and its tests do
|
|
30
|
+
* not change. **None of the Webex SDK types leak into this package.**
|
|
31
|
+
*
|
|
32
|
+
* See `/plans/realtime/realtime-bridges-architecture.md` §3, §8 (Cisco Webex row) and
|
|
33
|
+
* `/guides/REALTIME_BRIDGES_GUIDE.md`.
|
|
34
|
+
*/
|
|
35
|
+
/** The role a Webex member holds in the meeting, normalized to the bridge's participant roles. */
|
|
36
|
+
export type WebexParticipantRole = 'Host' | 'Cohost' | 'Attendee';
|
|
37
|
+
/**
|
|
38
|
+
* One Webex meeting member as the seam reports it. Platform-native and minimal — the driver maps
|
|
39
|
+
* this onto `BridgeParticipantInfo` / `BridgeMeetingParticipant`.
|
|
40
|
+
*/
|
|
41
|
+
export interface WebexParticipant {
|
|
42
|
+
/** The Webex member id (the meeting `Member.id`, stable for their presence). */
|
|
43
|
+
ParticipantId: string;
|
|
44
|
+
/** The member's display name as Webex reports it. */
|
|
45
|
+
DisplayName?: string;
|
|
46
|
+
/** The member's meeting role. */
|
|
47
|
+
Role: WebexParticipantRole;
|
|
48
|
+
/** Whether this member is the bridge's own bot (so the driver can exclude it from diarization addressing). */
|
|
49
|
+
IsSelf?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/** One frame of raw per-participant audio the seam surfaces for diarization + the agent's "hearing". */
|
|
52
|
+
export interface WebexAudioFrame {
|
|
53
|
+
/** Raw PCM audio bytes for this frame. */
|
|
54
|
+
Pcm: ArrayBuffer;
|
|
55
|
+
/** The Webex member id this audio came from (the diarization speaker label). */
|
|
56
|
+
ParticipantId: string;
|
|
57
|
+
/** The member's display name at capture time, when known. */
|
|
58
|
+
DisplayName?: string;
|
|
59
|
+
/** Optional epoch-ms capture timestamp. */
|
|
60
|
+
TimestampMs?: number;
|
|
61
|
+
}
|
|
62
|
+
/** Arguments to {@link IWebexMeetingSdk.join} — what the bot needs to get into a Webex meeting. */
|
|
63
|
+
export interface WebexJoinArgs {
|
|
64
|
+
/** The Webex meeting link (the `https://*.webex.com/meet/...` / `.../join/...` URL). */
|
|
65
|
+
MeetingLink: string;
|
|
66
|
+
/**
|
|
67
|
+
* The parsed Webex meeting number / SIP address (the durable meeting coordinate behind the link),
|
|
68
|
+
* when resolved upstream. Used as a stable meeting identifier when the link is opaque.
|
|
69
|
+
*/
|
|
70
|
+
MeetingNumber?: string;
|
|
71
|
+
/** The display name the bot appears as in the participant list. */
|
|
72
|
+
BotDisplayName: string;
|
|
73
|
+
/**
|
|
74
|
+
* The OAuth bearer / bot access token authorizing the bot's Webex Meetings + Messaging calls.
|
|
75
|
+
* Resolved upstream via MJ's credential system; never inline secrets.
|
|
76
|
+
*/
|
|
77
|
+
AccessToken?: string;
|
|
78
|
+
/** The Webex site (org) the meeting belongs to, when joining cross-site. */
|
|
79
|
+
SiteUrl?: string;
|
|
80
|
+
}
|
|
81
|
+
/** The handles the seam returns after a successful {@link IWebexMeetingSdk.join}. */
|
|
82
|
+
export interface WebexJoinResult {
|
|
83
|
+
/** The bot's own member id in the joined meeting. */
|
|
84
|
+
BotParticipantId: string;
|
|
85
|
+
/** The Webex meeting id the bot joined (the durable external connection id). */
|
|
86
|
+
MeetingId: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The minimal Cisco Webex Meetings SDK surface the {@link import('./webex-bridge.js').WebexBridge}
|
|
90
|
+
* depends on. Production binds this to the real Webex Meetings SDK / Webex bot framework; tests
|
|
91
|
+
* inject a `FakeWebexSdk`.
|
|
92
|
+
*/
|
|
93
|
+
export interface IWebexMeetingSdk {
|
|
94
|
+
/**
|
|
95
|
+
* Joins the Webex meeting and brings the bot online. Returns the bot's member id + the meeting id.
|
|
96
|
+
*
|
|
97
|
+
* @param args Join parameters (meeting link, meeting number, bot name, auth).
|
|
98
|
+
* @returns The bot member + meeting handles.
|
|
99
|
+
*/
|
|
100
|
+
join(args: WebexJoinArgs): Promise<WebexJoinResult>;
|
|
101
|
+
/** Leaves the meeting (the bot's `Meeting.leave()`) and releases SDK resources. */
|
|
102
|
+
leave(): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* Sends one raw PCM audio frame as the bot's outbound audio (the agent's voice into the meeting),
|
|
105
|
+
* over the Webex Meetings SDK outbound audio media track.
|
|
106
|
+
*
|
|
107
|
+
* @param pcm The PCM audio bytes to send.
|
|
108
|
+
*/
|
|
109
|
+
sendAudioFrame(pcm: ArrayBuffer): void;
|
|
110
|
+
/**
|
|
111
|
+
* Registers a callback for inbound raw per-participant audio frames (what the agent hears, carrying
|
|
112
|
+
* the speaker label for diarization). "Latest handler wins."
|
|
113
|
+
*
|
|
114
|
+
* @param cb Invoked with each inbound audio frame.
|
|
115
|
+
*/
|
|
116
|
+
onAudioFrame(cb: (frame: WebexAudioFrame) => void): void;
|
|
117
|
+
/**
|
|
118
|
+
* Registers a callback fired when a member joins. "Latest handler wins."
|
|
119
|
+
*
|
|
120
|
+
* @param cb Invoked with the member who joined.
|
|
121
|
+
*/
|
|
122
|
+
onParticipantJoin(cb: (participant: WebexParticipant) => void): void;
|
|
123
|
+
/**
|
|
124
|
+
* Registers a callback fired when a member leaves. "Latest handler wins."
|
|
125
|
+
*
|
|
126
|
+
* @param cb Invoked with the member id that left.
|
|
127
|
+
*/
|
|
128
|
+
onParticipantLeave(cb: (participantId: string) => void): void;
|
|
129
|
+
/**
|
|
130
|
+
* Registers a callback for native raised-hand signals. "Latest handler wins."
|
|
131
|
+
*
|
|
132
|
+
* ⚠️ Webex raised-hand is partial over the Meetings SDK: a clean per-participant event is not
|
|
133
|
+
* guaranteed on every client/build. The adapter wires this where the platform exposes it and the
|
|
134
|
+
* driver tolerates the signal never firing.
|
|
135
|
+
*
|
|
136
|
+
* @param cb Invoked with the member id and whether the hand is now raised.
|
|
137
|
+
*/
|
|
138
|
+
onHandRaise(cb: (participantId: string, raised: boolean) => void): void;
|
|
139
|
+
/**
|
|
140
|
+
* Returns the current member roster (including the bot).
|
|
141
|
+
*
|
|
142
|
+
* @returns The current members.
|
|
143
|
+
*/
|
|
144
|
+
getParticipants(): Promise<WebexParticipant[]>;
|
|
145
|
+
/**
|
|
146
|
+
* Posts a message to the Webex meeting space chat (everyone).
|
|
147
|
+
*
|
|
148
|
+
* @param text The chat message text.
|
|
149
|
+
*/
|
|
150
|
+
postChatMessage(text: string): Promise<void>;
|
|
151
|
+
/**
|
|
152
|
+
* Mutes a member (requires the bot be a host/cohost with the relevant privilege).
|
|
153
|
+
*
|
|
154
|
+
* @param participantId The member to mute.
|
|
155
|
+
*/
|
|
156
|
+
muteParticipant(participantId: string): Promise<void>;
|
|
157
|
+
/**
|
|
158
|
+
* Registers a callback fired when the meeting ends (host ended / meeting state → ENDED).
|
|
159
|
+
* "Latest handler wins."
|
|
160
|
+
*
|
|
161
|
+
* @param cb Invoked when the meeting has ended.
|
|
162
|
+
*/
|
|
163
|
+
onMeetingEnded(cb: () => void): void;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* A factory that constructs an {@link IWebexMeetingSdk} for a session — the creation seam (mirroring
|
|
167
|
+
* Gemini's `connectLiveSession`). Production supplies a factory that builds the real Webex Meetings SDK /
|
|
168
|
+
* Webex bot adapter from resolved config; tests supply one that returns a `FakeWebexSdk`.
|
|
169
|
+
*
|
|
170
|
+
* @param config The resolved provider/session configuration (site, credential refs already resolved upstream).
|
|
171
|
+
* @returns The Webex SDK instance to drive the meeting with.
|
|
172
|
+
*/
|
|
173
|
+
export type WebexMeetingSdkFactory = (config?: Record<string, unknown>) => IWebexMeetingSdk;
|
|
174
|
+
//# sourceMappingURL=webex-sdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webex-sdk.d.ts","sourceRoot":"","sources":["../src/webex-sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,kGAAkG;AAClG,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AAElE;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC7B,gFAAgF;IAChF,aAAa,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,8GAA8G;IAC9G,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wGAAwG;AACxG,MAAM,WAAW,eAAe;IAC5B,0CAA0C;IAC1C,GAAG,EAAE,WAAW,CA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M,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAAC;IAExE;;;;OAIG;IACH,eAAe,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAE/C;;;;OAIG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7C;;;;OAIG;IACH,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtD;;;;;OAKG;IACH,cAAc,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CACxC;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The injectable **Cisco Webex Meetings SDK seam** — the minimal set of operations
|
|
3
|
+
* {@link import('./webex-bridge.js').WebexBridge} needs from Webex, declared as an interface so the driver
|
|
4
|
+
* builds and unit-tests against an in-memory fake with **no network and no real Cisco Webex Meetings SDK
|
|
5
|
+
* / xAPI / Webex bot framework**.
|
|
6
|
+
*
|
|
7
|
+
* ## Production binding (TODO at deployment)
|
|
8
|
+
* In production this interface is bound to the **Cisco Webex Meetings SDK** (the embedded-app / Web /
|
|
9
|
+
* mobile Meetings SDK that joins a meeting and exposes media + roster) together with the **Webex bot
|
|
10
|
+
* framework** (Webex Messaging API, for posting to the meeting/space) and, where a Webex room device is
|
|
11
|
+
* involved, the **xAPI** (the device control surface for participant actions). The named operations map
|
|
12
|
+
* to the SDK as follows:
|
|
13
|
+
* - {@link join} / {@link leave} → the Webex Meetings SDK `Meeting.join()` / `Meeting.leave()` lifecycle
|
|
14
|
+
* (the bot/app joins via the meeting link, SIP address, or meeting number).
|
|
15
|
+
* - {@link sendAudioFrame} → the Meetings SDK outbound audio media track (the bot's voice into the meeting).
|
|
16
|
+
* - {@link onAudioFrame} → the Meetings SDK per-participant inbound audio media callback (the source of
|
|
17
|
+
* speaker labels for diarization — Webex attributes media to a `Member`).
|
|
18
|
+
* - {@link onParticipantJoin} / {@link onParticipantLeave} / {@link getParticipants} → the meeting's
|
|
19
|
+
* `members` collection + the `members:update` change events.
|
|
20
|
+
* - {@link onHandRaise} → the Webex raised-hand reaction. ⚠️ Partial: Webex surfaces raised hands in the
|
|
21
|
+
* meeting UI, but a clean per-participant *event* over the Meetings SDK is not guaranteed on every
|
|
22
|
+
* client/build; the adapter wires it where the platform exposes it and otherwise no-ops.
|
|
23
|
+
* - {@link postChatMessage} → the Webex Messaging API `POST /messages` against the meeting's associated
|
|
24
|
+
* space (the in-meeting chat thread).
|
|
25
|
+
* - {@link muteParticipant} → the meeting's `Member.mute` action / device xAPI mute (requires the bot be
|
|
26
|
+
* a host / cohost with the relevant privilege).
|
|
27
|
+
* - {@link onMeetingEnded} → the meeting's `meeting:ended` / `state` → `ENDED` notification.
|
|
28
|
+
*
|
|
29
|
+
* Binding the real SDK is a thin adapter that implements this interface; the driver and its tests do
|
|
30
|
+
* not change. **None of the Webex SDK types leak into this package.**
|
|
31
|
+
*
|
|
32
|
+
* See `/plans/realtime/realtime-bridges-architecture.md` §3, §8 (Cisco Webex row) and
|
|
33
|
+
* `/guides/REALTIME_BRIDGES_GUIDE.md`.
|
|
34
|
+
*/
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=webex-sdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webex-sdk.js","sourceRoot":"","sources":["../src/webex-sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ai-bridge-webex",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "5.42.0",
|
|
5
|
+
"description": "MemberJunction: Cisco Webex Realtime Bridge driver. Connects the realtime agent engine to a Webex meeting (audio in/out, diarized roster, participant mute, Webex meeting chat) via an injectable Cisco Webex Meetings SDK seam (Webex Meetings SDK / xAPI / Webex bot framework), and contributes a Meeting Controls facilitator channel.",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"/dist"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"start": "ts-node-dev src/index.ts",
|
|
13
|
+
"build": "tsc && tsc-alias -f",
|
|
14
|
+
"test": "vitest run",
|
|
15
|
+
"test:watch": "vitest"
|
|
16
|
+
},
|
|
17
|
+
"author": "MemberJunction.com",
|
|
18
|
+
"license": "ISC",
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@memberjunction/core": "5.42.0",
|
|
21
|
+
"@memberjunction/global": "5.42.0",
|
|
22
|
+
"@memberjunction/core-entities": "5.42.0",
|
|
23
|
+
"@memberjunction/ai-bridge-base": "5.42.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/node": "24.10.11",
|
|
27
|
+
"ts-node-dev": "^2.0.0",
|
|
28
|
+
"typescript": "^5.9.3",
|
|
29
|
+
"vitest": "^4.0.18"
|
|
30
|
+
},
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://github.com/MemberJunction/MJ"
|
|
34
|
+
}
|
|
10
35
|
}
|