@webex/internal-plugin-voicea 3.12.0-task-refactor.1 → 3.12.0-webex-services-ready.1
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/dist/constants.js +9 -1
- package/dist/constants.js.map +1 -1
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/voicea.d.ts +56 -2
- package/dist/voicea.js +173 -24
- package/dist/voicea.js.map +1 -1
- package/package.json +9 -9
- package/src/constants.ts +2 -0
- package/src/voicea.ts +163 -24
- package/test/unit/spec/voicea.js +498 -20
package/dist/constants.js
CHANGED
|
@@ -4,7 +4,15 @@ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/defi
|
|
|
4
4
|
_Object$defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.LANGUAGE_ASSIGNMENT = exports.EVENT_TRIGGERS = exports.DEFAULT_SPOKEN_LANGUAGE = exports.ANNOUNCE_STATUS = exports.AIBRIDGE_RELAY_TYPES = void 0;
|
|
8
|
+
_Object$defineProperty(exports, "LLM_PRACTICE_SESSION", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _internalPluginLlm.LLM_PRACTICE_SESSION;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
exports.VOICEA = exports.TURN_ON_CAPTION_STATUS = exports.TRANSCRIPTION_TYPE = exports.TOGGLE_MANUAL_CAPTION_STATUS = void 0;
|
|
15
|
+
var _internalPluginLlm = require("@webex/internal-plugin-llm");
|
|
8
16
|
var EVENT_TRIGGERS = exports.EVENT_TRIGGERS = {
|
|
9
17
|
VOICEA_ANNOUNCEMENT: 'voicea:announcement',
|
|
10
18
|
CAPTION_LANGUAGE_UPDATE: 'voicea:captionLanguageUpdate',
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EVENT_TRIGGERS","exports","VOICEA_ANNOUNCEMENT","CAPTION_LANGUAGE_UPDATE","SPOKEN_LANGUAGE_UPDATE","CAPTIONS_TURNED_ON","TRANSCRIBING_ON","TRANSCRIBING_OFF","NEW_CAPTION","EVA_COMMAND","HIGHLIGHT_CREATED","NEW_MANUAL_CAPTION","LANGUAGE_DETECTED","AIBRIDGE_RELAY_TYPES","VOICEA","ANNOUNCEMENT","CLIENT_ANNOUNCEMENT","TRANSLATION_REQUEST","TRANSLATION_RESPONSE","TRANSCRIPTION","MANUAL","CAPTIONER","TRANSCRIPTION_TYPE","UNKNOWN","EVA_WAKE","EVA_THANKS","EVA_CANCEL","TRANSCRIPT_INTERIM_RESULTS","TRANSCRIPT_FINAL_RESULT","MANUAL_CAPTION_INTERIM_RESULTS","MANUAL_CAPTION_INTERIM_RESULT","MANUAL_CAPTION_FINAL_RESULT","DEFAULT_SPOKEN_LANGUAGE","ANNOUNCE_STATUS","IDLE","JOINED","JOINING","TURN_ON_CAPTION_STATUS","ENABLED","SENDING","TOGGLE_MANUAL_CAPTION_STATUS","LANGUAGE_ASSIGNMENT","AUTO","DEFAULT"],"sources":["constants.ts"],"sourcesContent":["export const EVENT_TRIGGERS = {\n VOICEA_ANNOUNCEMENT: 'voicea:announcement',\n CAPTION_LANGUAGE_UPDATE: 'voicea:captionLanguageUpdate',\n SPOKEN_LANGUAGE_UPDATE: 'voicea:spokenLanguageUpdate',\n CAPTIONS_TURNED_ON: 'voicea:captionOn',\n TRANSCRIBING_ON: 'voicea:transcribingOn',\n TRANSCRIBING_OFF: 'voicea:transcribingOff',\n\n NEW_CAPTION: 'voicea:newCaption',\n EVA_COMMAND: 'voicea:wxa',\n HIGHLIGHT_CREATED: 'voicea:highlightCreated',\n NEW_MANUAL_CAPTION: 'aibridge:newManualCaption',\n\n LANGUAGE_DETECTED: 'voicea:languageDetected',\n};\n\nexport const AIBRIDGE_RELAY_TYPES = {\n VOICEA: {\n ANNOUNCEMENT: 'voicea.annc',\n CLIENT_ANNOUNCEMENT: 'client.annc',\n TRANSLATION_REQUEST: 'voicea.transl.req',\n TRANSLATION_RESPONSE: 'voicea.transl.rsp',\n TRANSCRIPTION: 'voicea.transcription',\n },\n MANUAL: {\n TRANSCRIPTION: 'aibridge.manual_transcription',\n CAPTIONER: 'client.manual_transcription',\n },\n};\n\nexport const TRANSCRIPTION_TYPE = {\n UNKNOWN: 'unknown',\n EVA_WAKE: 'eva_wake',\n EVA_THANKS: 'eva_thanks',\n EVA_CANCEL: 'eva_cancel',\n HIGHLIGHT_CREATED: 'highlight_created',\n TRANSCRIPT_INTERIM_RESULTS: 'transcript_interim_results',\n TRANSCRIPT_FINAL_RESULT: 'transcript_final_result',\n MANUAL_CAPTION_INTERIM_RESULTS: 'manual_caption_interim_results',\n MANUAL_CAPTION_INTERIM_RESULT: 'manual_caption_interim_result',\n MANUAL_CAPTION_FINAL_RESULT: 'manual_caption_final_result',\n LANGUAGE_DETECTED: 'language_detected',\n};\n\nexport const VOICEA = 'voicea';\nexport const DEFAULT_SPOKEN_LANGUAGE = 'en';\n\nexport const ANNOUNCE_STATUS = {\n IDLE: 'idle',\n JOINED: 'joined',\n JOINING: 'joining',\n};\n\nexport const TURN_ON_CAPTION_STATUS = {\n IDLE: 'idle',\n ENABLED: 'enabled',\n SENDING: 'sending',\n};\n\nexport const TOGGLE_MANUAL_CAPTION_STATUS = {\n IDLE: 'idle',\n SENDING: 'sending',\n};\n\nexport const LANGUAGE_ASSIGNMENT = {\n AUTO: 'AUTO',\n MANUAL: 'MANUAL',\n DEFAULT: 'DEFAULT',\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_internalPluginLlm","require","EVENT_TRIGGERS","exports","VOICEA_ANNOUNCEMENT","CAPTION_LANGUAGE_UPDATE","SPOKEN_LANGUAGE_UPDATE","CAPTIONS_TURNED_ON","TRANSCRIBING_ON","TRANSCRIBING_OFF","NEW_CAPTION","EVA_COMMAND","HIGHLIGHT_CREATED","NEW_MANUAL_CAPTION","LANGUAGE_DETECTED","AIBRIDGE_RELAY_TYPES","VOICEA","ANNOUNCEMENT","CLIENT_ANNOUNCEMENT","TRANSLATION_REQUEST","TRANSLATION_RESPONSE","TRANSCRIPTION","MANUAL","CAPTIONER","TRANSCRIPTION_TYPE","UNKNOWN","EVA_WAKE","EVA_THANKS","EVA_CANCEL","TRANSCRIPT_INTERIM_RESULTS","TRANSCRIPT_FINAL_RESULT","MANUAL_CAPTION_INTERIM_RESULTS","MANUAL_CAPTION_INTERIM_RESULT","MANUAL_CAPTION_FINAL_RESULT","DEFAULT_SPOKEN_LANGUAGE","ANNOUNCE_STATUS","IDLE","JOINED","JOINING","TURN_ON_CAPTION_STATUS","ENABLED","SENDING","TOGGLE_MANUAL_CAPTION_STATUS","LANGUAGE_ASSIGNMENT","AUTO","DEFAULT"],"sources":["constants.ts"],"sourcesContent":["export {LLM_PRACTICE_SESSION} from '@webex/internal-plugin-llm';\n\nexport const EVENT_TRIGGERS = {\n VOICEA_ANNOUNCEMENT: 'voicea:announcement',\n CAPTION_LANGUAGE_UPDATE: 'voicea:captionLanguageUpdate',\n SPOKEN_LANGUAGE_UPDATE: 'voicea:spokenLanguageUpdate',\n CAPTIONS_TURNED_ON: 'voicea:captionOn',\n TRANSCRIBING_ON: 'voicea:transcribingOn',\n TRANSCRIBING_OFF: 'voicea:transcribingOff',\n\n NEW_CAPTION: 'voicea:newCaption',\n EVA_COMMAND: 'voicea:wxa',\n HIGHLIGHT_CREATED: 'voicea:highlightCreated',\n NEW_MANUAL_CAPTION: 'aibridge:newManualCaption',\n\n LANGUAGE_DETECTED: 'voicea:languageDetected',\n};\n\nexport const AIBRIDGE_RELAY_TYPES = {\n VOICEA: {\n ANNOUNCEMENT: 'voicea.annc',\n CLIENT_ANNOUNCEMENT: 'client.annc',\n TRANSLATION_REQUEST: 'voicea.transl.req',\n TRANSLATION_RESPONSE: 'voicea.transl.rsp',\n TRANSCRIPTION: 'voicea.transcription',\n },\n MANUAL: {\n TRANSCRIPTION: 'aibridge.manual_transcription',\n CAPTIONER: 'client.manual_transcription',\n },\n};\n\nexport const TRANSCRIPTION_TYPE = {\n UNKNOWN: 'unknown',\n EVA_WAKE: 'eva_wake',\n EVA_THANKS: 'eva_thanks',\n EVA_CANCEL: 'eva_cancel',\n HIGHLIGHT_CREATED: 'highlight_created',\n TRANSCRIPT_INTERIM_RESULTS: 'transcript_interim_results',\n TRANSCRIPT_FINAL_RESULT: 'transcript_final_result',\n MANUAL_CAPTION_INTERIM_RESULTS: 'manual_caption_interim_results',\n MANUAL_CAPTION_INTERIM_RESULT: 'manual_caption_interim_result',\n MANUAL_CAPTION_FINAL_RESULT: 'manual_caption_final_result',\n LANGUAGE_DETECTED: 'language_detected',\n};\n\nexport const VOICEA = 'voicea';\nexport const DEFAULT_SPOKEN_LANGUAGE = 'en';\n\nexport const ANNOUNCE_STATUS = {\n IDLE: 'idle',\n JOINED: 'joined',\n JOINING: 'joining',\n};\n\nexport const TURN_ON_CAPTION_STATUS = {\n IDLE: 'idle',\n ENABLED: 'enabled',\n SENDING: 'sending',\n};\n\nexport const TOGGLE_MANUAL_CAPTION_STATUS = {\n IDLE: 'idle',\n SENDING: 'sending',\n};\n\nexport const LANGUAGE_ASSIGNMENT = {\n AUTO: 'AUTO',\n MANUAL: 'MANUAL',\n DEFAULT: 'DEFAULT',\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAEO,IAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC5BE,mBAAmB,EAAE,qBAAqB;EAC1CC,uBAAuB,EAAE,8BAA8B;EACvDC,sBAAsB,EAAE,6BAA6B;EACrDC,kBAAkB,EAAE,kBAAkB;EACtCC,eAAe,EAAE,uBAAuB;EACxCC,gBAAgB,EAAE,wBAAwB;EAE1CC,WAAW,EAAE,mBAAmB;EAChCC,WAAW,EAAE,YAAY;EACzBC,iBAAiB,EAAE,yBAAyB;EAC5CC,kBAAkB,EAAE,2BAA2B;EAE/CC,iBAAiB,EAAE;AACrB,CAAC;AAEM,IAAMC,oBAAoB,GAAAZ,OAAA,CAAAY,oBAAA,GAAG;EAClCC,MAAM,EAAE;IACNC,YAAY,EAAE,aAAa;IAC3BC,mBAAmB,EAAE,aAAa;IAClCC,mBAAmB,EAAE,mBAAmB;IACxCC,oBAAoB,EAAE,mBAAmB;IACzCC,aAAa,EAAE;EACjB,CAAC;EACDC,MAAM,EAAE;IACND,aAAa,EAAE,+BAA+B;IAC9CE,SAAS,EAAE;EACb;AACF,CAAC;AAEM,IAAMC,kBAAkB,GAAArB,OAAA,CAAAqB,kBAAA,GAAG;EAChCC,OAAO,EAAE,SAAS;EAClBC,QAAQ,EAAE,UAAU;EACpBC,UAAU,EAAE,YAAY;EACxBC,UAAU,EAAE,YAAY;EACxBhB,iBAAiB,EAAE,mBAAmB;EACtCiB,0BAA0B,EAAE,4BAA4B;EACxDC,uBAAuB,EAAE,yBAAyB;EAClDC,8BAA8B,EAAE,gCAAgC;EAChEC,6BAA6B,EAAE,+BAA+B;EAC9DC,2BAA2B,EAAE,6BAA6B;EAC1DnB,iBAAiB,EAAE;AACrB,CAAC;AAEM,IAAME,MAAM,GAAAb,OAAA,CAAAa,MAAA,GAAG,QAAQ;AACvB,IAAMkB,uBAAuB,GAAA/B,OAAA,CAAA+B,uBAAA,GAAG,IAAI;AAEpC,IAAMC,eAAe,GAAAhC,OAAA,CAAAgC,eAAA,GAAG;EAC7BC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,QAAQ;EAChBC,OAAO,EAAE;AACX,CAAC;AAEM,IAAMC,sBAAsB,GAAApC,OAAA,CAAAoC,sBAAA,GAAG;EACpCH,IAAI,EAAE,MAAM;EACZI,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE;AACX,CAAC;AAEM,IAAMC,4BAA4B,GAAAvC,OAAA,CAAAuC,4BAAA,GAAG;EAC1CN,IAAI,EAAE,MAAM;EACZK,OAAO,EAAE;AACX,CAAC;AAEM,IAAME,mBAAmB,GAAAxC,OAAA,CAAAwC,mBAAA,GAAG;EACjCC,IAAI,EAAE,MAAM;EACZtB,MAAM,EAAE,QAAQ;EAChBuB,OAAO,EAAE;AACX,CAAC","ignoreList":[]}
|
package/dist/types/voicea.d.ts
CHANGED
|
@@ -10,12 +10,14 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
10
10
|
private seqNum;
|
|
11
11
|
private areCaptionsEnabled;
|
|
12
12
|
private hasSubscribedToEvents;
|
|
13
|
-
private
|
|
13
|
+
private captionServiceId?;
|
|
14
14
|
private announceStatus;
|
|
15
15
|
private captionStatus;
|
|
16
|
+
private isCaptionBoxOn;
|
|
16
17
|
private toggleManualCaptionStatus;
|
|
17
18
|
private currentSpokenLanguage?;
|
|
18
19
|
private spokenLanguages;
|
|
20
|
+
private currentCaptionLanguage?;
|
|
19
21
|
/**
|
|
20
22
|
* @param {Object} e
|
|
21
23
|
* @returns {undefined}
|
|
@@ -60,6 +62,18 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
60
62
|
* @returns {void}
|
|
61
63
|
*/
|
|
62
64
|
private processAnnouncementMessage;
|
|
65
|
+
/**
|
|
66
|
+
* Indicates whether the default or practice-session LLM connection is active.
|
|
67
|
+
* @returns {boolean}
|
|
68
|
+
*/
|
|
69
|
+
private isLLMConnected;
|
|
70
|
+
getIsCaptionBoxOn: () => boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Resolves the active LLM publish transport, preferring the practice-session
|
|
73
|
+
* connection only when that session is fully connected.
|
|
74
|
+
* @returns {Object}
|
|
75
|
+
*/
|
|
76
|
+
private getPublishTransport;
|
|
63
77
|
/**
|
|
64
78
|
* Sends Announcement to add voicea to the meeting
|
|
65
79
|
* @returns {void}
|
|
@@ -71,7 +85,7 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
71
85
|
* @param {"DEFAULT" | "AUTO" | "MANUAL"} languageAssignment
|
|
72
86
|
* @returns {Promise}
|
|
73
87
|
*/
|
|
74
|
-
setSpokenLanguage: (languageCode: string, languageAssignment?:
|
|
88
|
+
setSpokenLanguage: (languageCode: string, languageAssignment?: 'DEFAULT' | 'AUTO' | 'MANUAL') => Promise<void>;
|
|
75
89
|
/**
|
|
76
90
|
* Request Language translation
|
|
77
91
|
* @param {string} languageCode
|
|
@@ -98,6 +112,11 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
98
112
|
* @returns {boolean}
|
|
99
113
|
*/
|
|
100
114
|
private isAnnounceProcessing;
|
|
115
|
+
/**
|
|
116
|
+
* is announce processed
|
|
117
|
+
* @returns {boolean}
|
|
118
|
+
*/
|
|
119
|
+
private isAnnounceProcessed;
|
|
101
120
|
/**
|
|
102
121
|
* announce to voicea data chanel
|
|
103
122
|
* @returns {void}
|
|
@@ -134,6 +153,12 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
134
153
|
* @returns {void}
|
|
135
154
|
*/
|
|
136
155
|
onSpokenLanguageUpdate: (languageCode: string, meetingId: any) => void;
|
|
156
|
+
/**
|
|
157
|
+
* In meeting Spoken Language changed event
|
|
158
|
+
* @param {string} serviceId
|
|
159
|
+
* @returns {void}
|
|
160
|
+
*/
|
|
161
|
+
onCaptionServiceIdUpdate: (serviceId: string) => void;
|
|
137
162
|
/**
|
|
138
163
|
* get caption status
|
|
139
164
|
* @returns {string}
|
|
@@ -144,5 +169,34 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
144
169
|
* @returns {string}
|
|
145
170
|
*/
|
|
146
171
|
getAnnounceStatus: () => string;
|
|
172
|
+
/**
|
|
173
|
+
* update LLM sub‑channel subscriptions.
|
|
174
|
+
*
|
|
175
|
+
* sends a single `subchannelSubscriptionRequest` to LLM,
|
|
176
|
+
* allowing subscribe and unsubscribe subchannel.
|
|
177
|
+
*
|
|
178
|
+
* @param {string[]} options.subscribe Sub‑channels to subscribe to.
|
|
179
|
+
* @param {string[]} options.unsubscribe Sub‑channels to unsubscribe from.
|
|
180
|
+
* @returns {Promise}
|
|
181
|
+
*/
|
|
182
|
+
updateSubchannelSubscriptions: ({ subscribe, unsubscribe, }?: {
|
|
183
|
+
subscribe?: string[];
|
|
184
|
+
unsubscribe?: string[];
|
|
185
|
+
}) => Promise<void>;
|
|
186
|
+
/**
|
|
187
|
+
* Syncs the UI caption intent and updates transcription subchannel
|
|
188
|
+
* subscriptions accordingly.
|
|
189
|
+
*
|
|
190
|
+
* @param {Object} [options] - Subscription options.
|
|
191
|
+
* @param {string[]} [options.subscribe] - Subchannels to subscribe to.
|
|
192
|
+
* @param {string[]} [options.unsubscribe] - Subchannels to unsubscribe from.
|
|
193
|
+
* @param {boolean} [isCaptionBoxOn=false] - Whether captions are intended to be enabled.
|
|
194
|
+
*
|
|
195
|
+
* @returns {Promise<void>}
|
|
196
|
+
*/
|
|
197
|
+
updateSubchannelSubscriptionsAndSyncCaptionState: (options?: {
|
|
198
|
+
subscribe?: string[];
|
|
199
|
+
unsubscribe?: string[];
|
|
200
|
+
}, isCaptionBoxOn?: boolean) => Promise<void>;
|
|
147
201
|
}
|
|
148
202
|
export default VoiceaChannel;
|
package/dist/voicea.js
CHANGED
|
@@ -49,12 +49,14 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
49
49
|
(0, _defineProperty2.default)(_this, "seqNum", void 0);
|
|
50
50
|
(0, _defineProperty2.default)(_this, "areCaptionsEnabled", void 0);
|
|
51
51
|
(0, _defineProperty2.default)(_this, "hasSubscribedToEvents", false);
|
|
52
|
-
(0, _defineProperty2.default)(_this, "
|
|
52
|
+
(0, _defineProperty2.default)(_this, "captionServiceId", void 0);
|
|
53
53
|
(0, _defineProperty2.default)(_this, "announceStatus", void 0);
|
|
54
54
|
(0, _defineProperty2.default)(_this, "captionStatus", void 0);
|
|
55
|
+
(0, _defineProperty2.default)(_this, "isCaptionBoxOn", void 0);
|
|
55
56
|
(0, _defineProperty2.default)(_this, "toggleManualCaptionStatus", void 0);
|
|
56
57
|
(0, _defineProperty2.default)(_this, "currentSpokenLanguage", void 0);
|
|
57
58
|
(0, _defineProperty2.default)(_this, "spokenLanguages", []);
|
|
59
|
+
(0, _defineProperty2.default)(_this, "currentCaptionLanguage", void 0);
|
|
58
60
|
/**
|
|
59
61
|
* @param {Object} e
|
|
60
62
|
* @returns {undefined}
|
|
@@ -64,7 +66,7 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
64
66
|
_this.seqNum = e.sequenceNumber + 1;
|
|
65
67
|
switch (e.data.relayType) {
|
|
66
68
|
case _constants.AIBRIDGE_RELAY_TYPES.VOICEA.ANNOUNCEMENT:
|
|
67
|
-
_this.
|
|
69
|
+
_this.onCaptionServiceIdUpdate(e.headers.from);
|
|
68
70
|
_this.announceStatus = _constants.ANNOUNCE_STATUS.JOINED;
|
|
69
71
|
_this.processAnnouncementMessage(e.data.voiceaPayload);
|
|
70
72
|
break;
|
|
@@ -204,6 +206,36 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
204
206
|
// @ts-ignore
|
|
205
207
|
_this.trigger(_constants.EVENT_TRIGGERS.VOICEA_ANNOUNCEMENT, voiceaLanguageOptions);
|
|
206
208
|
});
|
|
209
|
+
/**
|
|
210
|
+
* Indicates whether the default or practice-session LLM connection is active.
|
|
211
|
+
* @returns {boolean}
|
|
212
|
+
*/
|
|
213
|
+
(0, _defineProperty2.default)(_this, "isLLMConnected", function () {
|
|
214
|
+
return (
|
|
215
|
+
// @ts-ignore
|
|
216
|
+
_this.webex.internal.llm.isConnected() ||
|
|
217
|
+
// @ts-ignore
|
|
218
|
+
_this.webex.internal.llm.isConnected(_constants.LLM_PRACTICE_SESSION)
|
|
219
|
+
);
|
|
220
|
+
});
|
|
221
|
+
(0, _defineProperty2.default)(_this, "getIsCaptionBoxOn", function () {
|
|
222
|
+
return _this.isCaptionBoxOn;
|
|
223
|
+
});
|
|
224
|
+
/**
|
|
225
|
+
* Resolves the active LLM publish transport, preferring the practice-session
|
|
226
|
+
* connection only when that session is fully connected.
|
|
227
|
+
* @returns {Object}
|
|
228
|
+
*/
|
|
229
|
+
(0, _defineProperty2.default)(_this, "getPublishTransport", function () {
|
|
230
|
+
// @ts-ignore
|
|
231
|
+
var llm = _this.webex.internal.llm;
|
|
232
|
+
var isPracticeSessionConnected = llm.isConnected(_constants.LLM_PRACTICE_SESSION);
|
|
233
|
+
return {
|
|
234
|
+
socket: isPracticeSessionConnected && llm.getSocket(_constants.LLM_PRACTICE_SESSION) || llm.socket,
|
|
235
|
+
binding: isPracticeSessionConnected && llm.getBinding(_constants.LLM_PRACTICE_SESSION) || llm.getBinding(),
|
|
236
|
+
datachannelUrl: isPracticeSessionConnected && llm.getDatachannelUrl(_constants.LLM_PRACTICE_SESSION) || llm.getDatachannelUrl()
|
|
237
|
+
};
|
|
238
|
+
});
|
|
207
239
|
/**
|
|
208
240
|
* Sends Announcement to add voicea to the meeting
|
|
209
241
|
* @returns {void}
|
|
@@ -211,15 +243,20 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
211
243
|
(0, _defineProperty2.default)(_this, "sendAnnouncement", function () {
|
|
212
244
|
_this.announceStatus = _constants.ANNOUNCE_STATUS.JOINING;
|
|
213
245
|
_this.listenToEvents();
|
|
214
|
-
|
|
215
|
-
|
|
246
|
+
var _this$getPublishTrans = _this.getPublishTransport(),
|
|
247
|
+
socket = _this$getPublishTrans.socket,
|
|
248
|
+
binding = _this$getPublishTrans.binding;
|
|
249
|
+
socket.send({
|
|
216
250
|
id: "".concat(_this.seqNum),
|
|
217
251
|
type: 'publishRequest',
|
|
218
252
|
recipients: {
|
|
219
253
|
// @ts-ignore
|
|
220
|
-
route:
|
|
254
|
+
route: binding
|
|
221
255
|
},
|
|
222
|
-
headers
|
|
256
|
+
// If captionServiceId exists, send it as the 'to' header; otherwise keep headers empty.
|
|
257
|
+
headers: _this.captionServiceId ? {
|
|
258
|
+
to: _this.captionServiceId
|
|
259
|
+
} : {},
|
|
223
260
|
data: {
|
|
224
261
|
clientPayload: {
|
|
225
262
|
version: 'v2'
|
|
@@ -265,18 +302,21 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
265
302
|
* @returns {void}
|
|
266
303
|
*/
|
|
267
304
|
(0, _defineProperty2.default)(_this, "requestLanguage", function (languageCode) {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
_this.
|
|
305
|
+
if (!_this.isLLMConnected()) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
var _this$getPublishTrans2 = _this.getPublishTransport(),
|
|
309
|
+
socket = _this$getPublishTrans2.socket,
|
|
310
|
+
binding = _this$getPublishTrans2.binding;
|
|
311
|
+
socket.send({
|
|
272
312
|
id: "".concat(_this.seqNum),
|
|
273
313
|
type: 'publishRequest',
|
|
274
314
|
recipients: {
|
|
275
315
|
// @ts-ignore
|
|
276
|
-
route:
|
|
316
|
+
route: binding
|
|
277
317
|
},
|
|
278
318
|
headers: {
|
|
279
|
-
to: _this.
|
|
319
|
+
to: _this.captionServiceId
|
|
280
320
|
},
|
|
281
321
|
data: {
|
|
282
322
|
clientPayload: {
|
|
@@ -288,6 +328,7 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
288
328
|
},
|
|
289
329
|
trackingId: "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString())
|
|
290
330
|
});
|
|
331
|
+
_this.currentCaptionLanguage = languageCode;
|
|
291
332
|
_this.seqNum += 1;
|
|
292
333
|
});
|
|
293
334
|
/**
|
|
@@ -299,16 +340,18 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
299
340
|
* @returns {void}
|
|
300
341
|
*/
|
|
301
342
|
(0, _defineProperty2.default)(_this, "sendManualClosedCaption", function (text, timeStamp, csis, isFinal) {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
343
|
+
if (!_this.isLLMConnected()) {
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
var _this$getPublishTrans3 = _this.getPublishTransport(),
|
|
347
|
+
socket = _this$getPublishTrans3.socket,
|
|
348
|
+
binding = _this$getPublishTrans3.binding;
|
|
349
|
+
socket === null || socket === void 0 ? void 0 : socket.send({
|
|
307
350
|
id: "".concat(_this.seqNum),
|
|
308
351
|
type: 'publishRequest',
|
|
309
352
|
recipients: {
|
|
310
353
|
// @ts-ignore
|
|
311
|
-
route:
|
|
354
|
+
route: binding
|
|
312
355
|
},
|
|
313
356
|
headers: {},
|
|
314
357
|
data: {
|
|
@@ -359,6 +402,9 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
359
402
|
_this.areCaptionsEnabled = true;
|
|
360
403
|
_this.captionStatus = _constants.TURN_ON_CAPTION_STATUS.ENABLED;
|
|
361
404
|
_this.announce();
|
|
405
|
+
_this.updateSubchannelSubscriptionsAndSyncCaptionState({
|
|
406
|
+
subscribe: ['transcription']
|
|
407
|
+
}, true);
|
|
362
408
|
}).catch(function () {
|
|
363
409
|
_this.captionStatus = _constants.TURN_ON_CAPTION_STATUS.IDLE;
|
|
364
410
|
throw new Error('turn on captions fail');
|
|
@@ -371,14 +417,22 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
371
417
|
(0, _defineProperty2.default)(_this, "isAnnounceProcessing", function () {
|
|
372
418
|
return [_constants.ANNOUNCE_STATUS.JOINING, _constants.ANNOUNCE_STATUS.JOINED].includes(_this.announceStatus);
|
|
373
419
|
});
|
|
420
|
+
/**
|
|
421
|
+
* is announce processed
|
|
422
|
+
* @returns {boolean}
|
|
423
|
+
*/
|
|
424
|
+
(0, _defineProperty2.default)(_this, "isAnnounceProcessed", function () {
|
|
425
|
+
return _this.announceStatus === _constants.ANNOUNCE_STATUS.JOINED;
|
|
426
|
+
});
|
|
374
427
|
/**
|
|
375
428
|
* announce to voicea data chanel
|
|
376
429
|
* @returns {void}
|
|
377
430
|
*/
|
|
378
431
|
(0, _defineProperty2.default)(_this, "announce", function () {
|
|
379
|
-
if (_this.
|
|
380
|
-
|
|
381
|
-
|
|
432
|
+
if (_this.isAnnounceProcessed()) {
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
if (!_this.isLLMConnected()) {
|
|
382
436
|
throw new Error('voicea can not announce before llm connected');
|
|
383
437
|
}
|
|
384
438
|
_this.sendAnnouncement();
|
|
@@ -406,7 +460,7 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
406
460
|
}
|
|
407
461
|
return _context.abrupt("return", undefined);
|
|
408
462
|
case 1:
|
|
409
|
-
if (_this.
|
|
463
|
+
if (_this.isLLMConnected()) {
|
|
410
464
|
_context.next = 2;
|
|
411
465
|
break;
|
|
412
466
|
}
|
|
@@ -489,6 +543,23 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
489
543
|
});
|
|
490
544
|
_this.currentSpokenLanguage = languageCode;
|
|
491
545
|
});
|
|
546
|
+
/**
|
|
547
|
+
* In meeting Spoken Language changed event
|
|
548
|
+
* @param {string} serviceId
|
|
549
|
+
* @returns {void}
|
|
550
|
+
*/
|
|
551
|
+
(0, _defineProperty2.default)(_this, "onCaptionServiceIdUpdate", function (serviceId) {
|
|
552
|
+
if (!serviceId) {
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
if (_this.captionServiceId !== serviceId) {
|
|
556
|
+
_this.captionServiceId = serviceId;
|
|
557
|
+
// if service id value has changed and the translation language has been set, client needs to resend the translator language message to the LLM.
|
|
558
|
+
if (_this.currentCaptionLanguage) {
|
|
559
|
+
_this.requestLanguage(_this.currentCaptionLanguage);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
});
|
|
492
563
|
/**
|
|
493
564
|
* get caption status
|
|
494
565
|
* @returns {string}
|
|
@@ -503,13 +574,85 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
503
574
|
(0, _defineProperty2.default)(_this, "getAnnounceStatus", function () {
|
|
504
575
|
return _this.announceStatus;
|
|
505
576
|
});
|
|
577
|
+
/**
|
|
578
|
+
* update LLM sub‑channel subscriptions.
|
|
579
|
+
*
|
|
580
|
+
* sends a single `subchannelSubscriptionRequest` to LLM,
|
|
581
|
+
* allowing subscribe and unsubscribe subchannel.
|
|
582
|
+
*
|
|
583
|
+
* @param {string[]} options.subscribe Sub‑channels to subscribe to.
|
|
584
|
+
* @param {string[]} options.unsubscribe Sub‑channels to unsubscribe from.
|
|
585
|
+
* @returns {Promise}
|
|
586
|
+
*/
|
|
587
|
+
(0, _defineProperty2.default)(_this, "updateSubchannelSubscriptions", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
588
|
+
var _ref3,
|
|
589
|
+
_ref3$subscribe,
|
|
590
|
+
subscribe,
|
|
591
|
+
_ref3$unsubscribe,
|
|
592
|
+
unsubscribe,
|
|
593
|
+
isDataChannelTokenEnabled,
|
|
594
|
+
_this$getPublishTrans4,
|
|
595
|
+
socket,
|
|
596
|
+
datachannelUrl,
|
|
597
|
+
_args2 = arguments;
|
|
598
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
599
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
600
|
+
case 0:
|
|
601
|
+
_ref3 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, _ref3$subscribe = _ref3.subscribe, subscribe = _ref3$subscribe === void 0 ? [] : _ref3$subscribe, _ref3$unsubscribe = _ref3.unsubscribe, unsubscribe = _ref3$unsubscribe === void 0 ? [] : _ref3$unsubscribe;
|
|
602
|
+
_context2.next = 1;
|
|
603
|
+
return _this.webex.internal.llm.isDataChannelTokenEnabled();
|
|
604
|
+
case 1:
|
|
605
|
+
isDataChannelTokenEnabled = _context2.sent;
|
|
606
|
+
if (!(!_this.isLLMConnected() || !isDataChannelTokenEnabled)) {
|
|
607
|
+
_context2.next = 2;
|
|
608
|
+
break;
|
|
609
|
+
}
|
|
610
|
+
return _context2.abrupt("return");
|
|
611
|
+
case 2:
|
|
612
|
+
_this$getPublishTrans4 = _this.getPublishTransport(), socket = _this$getPublishTrans4.socket, datachannelUrl = _this$getPublishTrans4.datachannelUrl; // @ts-ignore
|
|
613
|
+
socket.send({
|
|
614
|
+
id: "".concat(_this.seqNum),
|
|
615
|
+
type: 'subchannelSubscriptionRequest',
|
|
616
|
+
data: {
|
|
617
|
+
// @ts-ignore
|
|
618
|
+
datachannelUri: datachannelUrl,
|
|
619
|
+
subscribe: subscribe,
|
|
620
|
+
unsubscribe: unsubscribe
|
|
621
|
+
},
|
|
622
|
+
trackingId: "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString())
|
|
623
|
+
});
|
|
624
|
+
_this.seqNum += 1;
|
|
625
|
+
case 3:
|
|
626
|
+
case "end":
|
|
627
|
+
return _context2.stop();
|
|
628
|
+
}
|
|
629
|
+
}, _callee2);
|
|
630
|
+
})));
|
|
631
|
+
/**
|
|
632
|
+
* Syncs the UI caption intent and updates transcription subchannel
|
|
633
|
+
* subscriptions accordingly.
|
|
634
|
+
*
|
|
635
|
+
* @param {Object} [options] - Subscription options.
|
|
636
|
+
* @param {string[]} [options.subscribe] - Subchannels to subscribe to.
|
|
637
|
+
* @param {string[]} [options.unsubscribe] - Subchannels to unsubscribe from.
|
|
638
|
+
* @param {boolean} [isCaptionBoxOn=false] - Whether captions are intended to be enabled.
|
|
639
|
+
*
|
|
640
|
+
* @returns {Promise<void>}
|
|
641
|
+
*/
|
|
642
|
+
(0, _defineProperty2.default)(_this, "updateSubchannelSubscriptionsAndSyncCaptionState", function () {
|
|
643
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
644
|
+
var isCaptionBoxOn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
645
|
+
_this.isCaptionBoxOn = isCaptionBoxOn;
|
|
646
|
+
return _this.updateSubchannelSubscriptions(options);
|
|
647
|
+
});
|
|
506
648
|
_this.seqNum = 1;
|
|
507
649
|
_this.areCaptionsEnabled = false;
|
|
508
|
-
_this.
|
|
650
|
+
_this.captionServiceId = undefined;
|
|
509
651
|
_this.announceStatus = _constants.ANNOUNCE_STATUS.IDLE;
|
|
510
652
|
_this.captionStatus = _constants.TURN_ON_CAPTION_STATUS.IDLE;
|
|
511
653
|
_this.toggleManualCaptionStatus = _constants.TOGGLE_MANUAL_CAPTION_STATUS.IDLE;
|
|
512
654
|
_this.currentSpokenLanguage = _constants.DEFAULT_SPOKEN_LANGUAGE;
|
|
655
|
+
_this.currentCaptionLanguage = undefined;
|
|
513
656
|
return _this;
|
|
514
657
|
}
|
|
515
658
|
(0, _inherits2.default)(VoiceaChannel, _WebexPlugin);
|
|
@@ -524,6 +667,8 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
524
667
|
if (!this.hasSubscribedToEvents) {
|
|
525
668
|
// @ts-ignore
|
|
526
669
|
this.webex.internal.llm.on('event:relay.event', this.eventProcessor);
|
|
670
|
+
// @ts-ignore
|
|
671
|
+
this.webex.internal.llm.on("event:relay.event:".concat(_constants.LLM_PRACTICE_SESSION), this.eventProcessor);
|
|
527
672
|
this.hasSubscribedToEvents = true;
|
|
528
673
|
}
|
|
529
674
|
}
|
|
@@ -536,14 +681,18 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
536
681
|
key: "deregisterEvents",
|
|
537
682
|
value: function deregisterEvents() {
|
|
538
683
|
this.areCaptionsEnabled = false;
|
|
539
|
-
this.
|
|
684
|
+
this.isCaptionBoxOn = false;
|
|
685
|
+
this.captionServiceId = undefined;
|
|
540
686
|
// @ts-ignore
|
|
541
687
|
this.webex.internal.llm.off('event:relay.event', this.eventProcessor);
|
|
688
|
+
// @ts-ignore
|
|
689
|
+
this.webex.internal.llm.off("event:relay.event:".concat(_constants.LLM_PRACTICE_SESSION), this.eventProcessor);
|
|
542
690
|
this.hasSubscribedToEvents = false;
|
|
543
691
|
this.announceStatus = _constants.ANNOUNCE_STATUS.IDLE;
|
|
544
692
|
this.captionStatus = _constants.TURN_ON_CAPTION_STATUS.IDLE;
|
|
545
693
|
this.toggleManualCaptionStatus = _constants.TOGGLE_MANUAL_CAPTION_STATUS.IDLE;
|
|
546
694
|
this.currentSpokenLanguage = undefined;
|
|
695
|
+
this.currentCaptionLanguage = undefined;
|
|
547
696
|
}
|
|
548
697
|
}]);
|
|
549
698
|
}(_webexCore.WebexPlugin);
|