@webex/internal-plugin-voicea 3.12.0-next.73 → 3.12.0-next.74
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 +1 -9
- package/dist/constants.js.map +1 -1
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/types/constants.d.ts +0 -1
- package/dist/types/index.d.ts +5 -2
- package/dist/types/voicea-plugin.d.ts +23 -0
- package/dist/types/voicea.d.ts +76 -31
- package/dist/types/voicea.types.d.ts +1 -0
- package/dist/voicea-plugin.js +59 -0
- package/dist/voicea-plugin.js.map +1 -0
- package/dist/voicea.js +246 -157
- package/dist/voicea.js.map +1 -1
- package/dist/voicea.types.js.map +1 -1
- package/package.json +3 -3
- package/src/constants.ts +0 -2
- package/src/index.ts +6 -4
- package/src/voicea-plugin.ts +33 -0
- package/src/voicea.ts +237 -160
- package/src/voicea.types.ts +1 -0
- package/test/unit/spec/voicea-plugin.js +83 -0
- package/test/unit/spec/voicea.js +827 -1145
package/dist/constants.js
CHANGED
|
@@ -4,15 +4,7 @@ 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.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");
|
|
7
|
+
exports.VOICEA = exports.TURN_ON_CAPTION_STATUS = exports.TRANSCRIPTION_TYPE = exports.TOGGLE_MANUAL_CAPTION_STATUS = exports.LANGUAGE_ASSIGNMENT = exports.EVENT_TRIGGERS = exports.DEFAULT_SPOKEN_LANGUAGE = exports.ANNOUNCE_STATUS = exports.AIBRIDGE_RELAY_TYPES = void 0;
|
|
16
8
|
var EVENT_TRIGGERS = exports.EVENT_TRIGGERS = {
|
|
17
9
|
VOICEA_ANNOUNCEMENT: 'voicea:announcement',
|
|
18
10
|
CAPTION_LANGUAGE_UPDATE: 'voicea:captionLanguageUpdate',
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["EVENT_TRIGGERS","exports","VOICEA_ANNOUNCEMENT","CAPTION_LANGUAGE_UPDATE","SPOKEN_LANGUAGE_UPDATE","CAPTIONS_TURNED_ON","TRANSCRIBING_ON","TRANSCRIBING_OFF","NEW_CAPTION","SPEAKER_NAME_UPDATED","EVA_COMMAND","HIGHLIGHT_CREATED","NEW_MANUAL_CAPTION","LANGUAGE_DETECTED","AIBRIDGE_RELAY_TYPES","VOICEA","ANNOUNCEMENT","CLIENT_ANNOUNCEMENT","TRANSLATION_REQUEST","TRANSLATION_RESPONSE","TRANSCRIPTION","SPEAKER_NAME_UPDATE","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 SPEAKER_NAME_UPDATED: 'voicea:speakerNameUpdated',\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 SPEAKER_NAME_UPDATE: 'voicea.update_speakername',\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":";;;;;;;AAAO,IAAMA,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,oBAAoB,EAAE,2BAA2B;EACjDC,WAAW,EAAE,YAAY;EACzBC,iBAAiB,EAAE,yBAAyB;EAC5CC,kBAAkB,EAAE,2BAA2B;EAE/CC,iBAAiB,EAAE;AACrB,CAAC;AAEM,IAAMC,oBAAoB,GAAAb,OAAA,CAAAa,oBAAA,GAAG;EAClCC,MAAM,EAAE;IACNC,YAAY,EAAE,aAAa;IAC3BC,mBAAmB,EAAE,aAAa;IAClCC,mBAAmB,EAAE,mBAAmB;IACxCC,oBAAoB,EAAE,mBAAmB;IACzCC,aAAa,EAAE,sBAAsB;IACrCC,mBAAmB,EAAE;EACvB,CAAC;EACDC,MAAM,EAAE;IACNF,aAAa,EAAE,+BAA+B;IAC9CG,SAAS,EAAE;EACb;AACF,CAAC;AAEM,IAAMC,kBAAkB,GAAAvB,OAAA,CAAAuB,kBAAA,GAAG;EAChCC,OAAO,EAAE,SAAS;EAClBC,QAAQ,EAAE,UAAU;EACpBC,UAAU,EAAE,YAAY;EACxBC,UAAU,EAAE,YAAY;EACxBjB,iBAAiB,EAAE,mBAAmB;EACtCkB,0BAA0B,EAAE,4BAA4B;EACxDC,uBAAuB,EAAE,yBAAyB;EAClDC,8BAA8B,EAAE,gCAAgC;EAChEC,6BAA6B,EAAE,+BAA+B;EAC9DC,2BAA2B,EAAE,6BAA6B;EAC1DpB,iBAAiB,EAAE;AACrB,CAAC;AAEM,IAAME,MAAM,GAAAd,OAAA,CAAAc,MAAA,GAAG,QAAQ;AACvB,IAAMmB,uBAAuB,GAAAjC,OAAA,CAAAiC,uBAAA,GAAG,IAAI;AAEpC,IAAMC,eAAe,GAAAlC,OAAA,CAAAkC,eAAA,GAAG;EAC7BC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,QAAQ;EAChBC,OAAO,EAAE;AACX,CAAC;AAEM,IAAMC,sBAAsB,GAAAtC,OAAA,CAAAsC,sBAAA,GAAG;EACpCH,IAAI,EAAE,MAAM;EACZI,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE;AACX,CAAC;AAEM,IAAMC,4BAA4B,GAAAzC,OAAA,CAAAyC,4BAAA,GAAG;EAC1CN,IAAI,EAAE,MAAM;EACZK,OAAO,EAAE;AACX,CAAC;AAEM,IAAME,mBAAmB,GAAA1C,OAAA,CAAA0C,mBAAA,GAAG;EACjCC,IAAI,EAAE,MAAM;EACZtB,MAAM,EAAE,QAAQ;EAChBuB,OAAO,EAAE;AACX,CAAC","ignoreList":[]}
|
package/dist/index.js
CHANGED
|
@@ -20,15 +20,24 @@ _Object$defineProperty(exports, "TURN_ON_CAPTION_STATUS", {
|
|
|
20
20
|
return _constants.TURN_ON_CAPTION_STATUS;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
-
_Object$defineProperty(exports, "
|
|
23
|
+
_Object$defineProperty(exports, "VoiceaChannel", {
|
|
24
24
|
enumerable: true,
|
|
25
25
|
get: function get() {
|
|
26
|
-
return _voicea.
|
|
26
|
+
return _voicea.VoiceaChannel;
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
|
+
_Object$defineProperty(exports, "VoiceaPlugin", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function get() {
|
|
32
|
+
return _voiceaPlugin.default;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
exports.default = void 0;
|
|
29
36
|
var WebexCore = _interopRequireWildcard(require("@webex/webex-core"));
|
|
30
|
-
var
|
|
37
|
+
var _voiceaPlugin = _interopRequireDefault(require("./voicea-plugin"));
|
|
38
|
+
var _voicea = require("./voicea");
|
|
31
39
|
var _constants = require("./constants");
|
|
32
40
|
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
33
|
-
WebexCore.registerInternalPlugin('voicea',
|
|
41
|
+
WebexCore.registerInternalPlugin('voicea', _voiceaPlugin.default, {});
|
|
42
|
+
var _default = exports.default = _voiceaPlugin.default;
|
|
34
43
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WebexCore","_interopRequireWildcard","require","
|
|
1
|
+
{"version":3,"names":["WebexCore","_interopRequireWildcard","require","_voiceaPlugin","_interopRequireDefault","_voicea","_constants","e","t","_WeakMap","r","n","__esModule","o","i","f","__proto__","default","_typeof","has","get","set","_t","hasOwnProperty","call","_Object$defineProperty","_Object$getOwnPropertyDescriptor","registerInternalPlugin","Voicea","_default","exports"],"sources":["index.ts"],"sourcesContent":["import * as WebexCore from '@webex/webex-core';\n\nimport Voicea from './voicea-plugin';\nimport {VoiceaChannel} from './voicea';\nimport type {MeetingTranscriptPayload, SpeakerNameUpdatePayload} from './voicea.types';\n\nWebexCore.registerInternalPlugin('voicea', Voicea, {});\n\nexport {Voicea as VoiceaPlugin, VoiceaChannel};\nexport default Voicea;\nexport {type MeetingTranscriptPayload, type SpeakerNameUpdatePayload};\nexport {EVENT_TRIGGERS, TURN_ON_CAPTION_STATUS} from './constants';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAQA,IAAAI,UAAA,GAAAJ,OAAA;AAAmE,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,QAAA,MAAAC,CAAA,OAAAD,QAAA,IAAAE,CAAA,OAAAF,QAAA,YAAAR,uBAAA,YAAAA,wBAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,gBAAAW,OAAA,CAAAX,CAAA,0BAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAM,GAAA,CAAAZ,CAAA,UAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,GAAAM,CAAA,CAAAQ,GAAA,CAAAd,CAAA,EAAAQ,CAAA,cAAAO,EAAA,IAAAf,CAAA,gBAAAe,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAe,EAAA,OAAAR,CAAA,IAAAD,CAAA,GAAAY,sBAAA,KAAAC,gCAAA,CAAAnB,CAAA,EAAAe,EAAA,OAAAR,CAAA,CAAAM,GAAA,IAAAN,CAAA,CAAAO,GAAA,IAAAR,CAAA,CAAAE,CAAA,EAAAO,EAAA,EAAAR,CAAA,IAAAC,CAAA,CAAAO,EAAA,IAAAf,CAAA,CAAAe,EAAA,WAAAP,CAAA,KAAAR,CAAA,EAAAC,CAAA;AALnER,SAAS,CAAC2B,sBAAsB,CAAC,QAAQ,EAAEC,qBAAM,EAAE,CAAC,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAb,OAAA,GAGxCW,qBAAM","ignoreList":[]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import Voicea from './voicea-plugin';
|
|
2
|
+
import { VoiceaChannel } from './voicea';
|
|
1
3
|
import type { MeetingTranscriptPayload, SpeakerNameUpdatePayload } from './voicea.types';
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
4
|
+
export { Voicea as VoiceaPlugin, VoiceaChannel };
|
|
5
|
+
export default Voicea;
|
|
6
|
+
export { type MeetingTranscriptPayload, type SpeakerNameUpdatePayload };
|
|
4
7
|
export { EVENT_TRIGGERS, TURN_ON_CAPTION_STATUS } from './constants';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { WebexPlugin } from '@webex/webex-core';
|
|
2
|
+
import type LLMChannel from '@webex/internal-plugin-llm';
|
|
3
|
+
import { VoiceaChannel } from './voicea';
|
|
4
|
+
/**
|
|
5
|
+
* VoiceaPlugin - factory for creating VoiceaChannel instances
|
|
6
|
+
* @export
|
|
7
|
+
* @class VoiceaPlugin
|
|
8
|
+
*/
|
|
9
|
+
export declare class VoiceaPlugin extends WebexPlugin {
|
|
10
|
+
namespace: string;
|
|
11
|
+
/**
|
|
12
|
+
* Creates a VoiceaChannel, optionally bound to an LLMChannel.
|
|
13
|
+
*
|
|
14
|
+
* Note: VoiceaChannel does not take ownership of the LLMChannel.
|
|
15
|
+
* The caller retains ownership and is responsible for the LLMChannel's
|
|
16
|
+
* lifecycle (connection, disconnection, cleanup).
|
|
17
|
+
*
|
|
18
|
+
* @param {LLMChannel} [llmChannel] - The LLM channel to use for voicea (optional)
|
|
19
|
+
* @returns {VoiceaChannel} A new VoiceaChannel instance
|
|
20
|
+
*/
|
|
21
|
+
createChannel(llmChannel?: LLMChannel): VoiceaChannel;
|
|
22
|
+
}
|
|
23
|
+
export default VoiceaPlugin;
|
package/dist/types/voicea.d.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import EventEmitter from 'events';
|
|
3
|
+
import type LLMChannel from '@webex/internal-plugin-llm';
|
|
2
4
|
import { IVoiceaChannel } from './voicea.types';
|
|
3
5
|
/**
|
|
4
|
-
* @description VoiceaChannel
|
|
6
|
+
* @description VoiceaChannel — handles voicea/transcription functionality for a single LLM connection.
|
|
7
|
+
* Created via `webex.internal.voicea.createChannel(llmChannel)`. The caller owns the
|
|
8
|
+
* channel and is responsible for its lifecycle.
|
|
5
9
|
* @export
|
|
6
10
|
* @class VoiceaChannel
|
|
7
11
|
*/
|
|
8
|
-
export declare class VoiceaChannel extends
|
|
9
|
-
|
|
12
|
+
export declare class VoiceaChannel extends EventEmitter implements IVoiceaChannel {
|
|
13
|
+
private request;
|
|
14
|
+
private llmChannel?;
|
|
10
15
|
private seqNum;
|
|
11
16
|
private areCaptionsEnabled;
|
|
12
17
|
private hasSubscribedToEvents;
|
|
@@ -18,26 +23,75 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
18
23
|
private currentSpokenLanguage?;
|
|
19
24
|
private spokenLanguages;
|
|
20
25
|
private currentCaptionLanguage?;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
private targetLLMChannel?;
|
|
27
|
+
private _pendingOnlineListener?;
|
|
28
|
+
private _pendingCaptionRestore;
|
|
29
|
+
/**
|
|
30
|
+
* Creates a VoiceaChannel, optionally bound to an LLMChannel.
|
|
31
|
+
* If no llmChannel is provided, call switchLLMChannel() later to attach one.
|
|
32
|
+
* @param {LLMChannel} [llmChannel] - The LLM channel to use (optional)
|
|
33
|
+
* @param {Function} request - The request function for making API calls (typically webex.request bound to webex)
|
|
34
|
+
*/
|
|
35
|
+
constructor(llmChannel: LLMChannel | undefined, request: (options: {
|
|
36
|
+
method: string;
|
|
37
|
+
url: string;
|
|
38
|
+
body?: object;
|
|
39
|
+
}) => Promise<any>);
|
|
40
|
+
/**
|
|
41
|
+
* Returns the LLM channel, throwing if not available.
|
|
42
|
+
* @private
|
|
43
|
+
* @returns {LLMChannel}
|
|
44
|
+
* @throws {Error} If LLM channel is not available
|
|
45
|
+
*/
|
|
46
|
+
private requireLLMChannel;
|
|
47
|
+
/**
|
|
48
|
+
* Process events from LLM channel
|
|
49
|
+
* @param {Object} e - Event data
|
|
50
|
+
* @returns {void}
|
|
24
51
|
*/
|
|
25
52
|
private eventProcessor;
|
|
26
53
|
/**
|
|
27
|
-
*
|
|
28
|
-
* @returns {
|
|
54
|
+
* Deregister events and clean up
|
|
55
|
+
* @returns {void}
|
|
29
56
|
*/
|
|
30
|
-
|
|
57
|
+
deregisterEvents(): void;
|
|
31
58
|
/**
|
|
32
|
-
*
|
|
59
|
+
* Attach a pending 'online' listener to a channel for deferred reconciliation.
|
|
60
|
+
* Detaches any existing listener first.
|
|
61
|
+
* @param {LLMChannel} channel - The channel to attach to
|
|
62
|
+
* @param {Function} callback - The callback to run when 'online' fires
|
|
63
|
+
* @private
|
|
33
64
|
* @returns {void}
|
|
34
65
|
*/
|
|
35
|
-
|
|
66
|
+
private attachPendingOnline;
|
|
67
|
+
/**
|
|
68
|
+
* Detach any pending 'online' listener.
|
|
69
|
+
* @private
|
|
70
|
+
* @returns {void}
|
|
71
|
+
*/
|
|
72
|
+
private detachPendingOnline;
|
|
73
|
+
/**
|
|
74
|
+
* Reset announcement state for a new connection.
|
|
75
|
+
* @private
|
|
76
|
+
* @returns {void}
|
|
77
|
+
*/
|
|
78
|
+
private resetAnnounceState;
|
|
36
79
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
80
|
+
* Reconcile voicea binding and caption state to match the desired target.
|
|
81
|
+
* This is idempotent - always re-reads targetLLMChannel and current state.
|
|
82
|
+
* A deferred 'online' callback that fires late self-corrects automatically.
|
|
83
|
+
* @private
|
|
84
|
+
* @returns {Promise<void>}
|
|
39
85
|
*/
|
|
40
|
-
|
|
86
|
+
private reconcile;
|
|
87
|
+
/**
|
|
88
|
+
* Switch to a different LLM channel while preserving caption state.
|
|
89
|
+
* Used when transitioning between main meeting and practice session.
|
|
90
|
+
* This is a thin intent-setter - actual binding happens in reconcile().
|
|
91
|
+
* @param {LLMChannel} newLLMChannel - The new LLM channel to switch to
|
|
92
|
+
* @returns {Promise<void>}
|
|
93
|
+
*/
|
|
94
|
+
switchLLMChannel(newLLMChannel: LLMChannel): Promise<void>;
|
|
41
95
|
/**
|
|
42
96
|
* Process manual Transcript and send alert
|
|
43
97
|
* @param {TranscriptionResponse} transcriptPayload
|
|
@@ -69,22 +123,16 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
69
123
|
*/
|
|
70
124
|
private processAnnouncementMessage;
|
|
71
125
|
/**
|
|
72
|
-
* Indicates whether the
|
|
126
|
+
* Indicates whether the LLM channel is connected.
|
|
73
127
|
* @returns {boolean}
|
|
74
128
|
*/
|
|
75
|
-
|
|
129
|
+
isLLMConnected: () => boolean;
|
|
76
130
|
getKeepTranscriptionSubscribed: () => boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Resolves the active LLM publish transport, preferring the practice-session
|
|
79
|
-
* connection only when that session is fully connected.
|
|
80
|
-
* @returns {Object}
|
|
81
|
-
*/
|
|
82
|
-
private getPublishTransport;
|
|
83
131
|
/**
|
|
84
132
|
* Sends Announcement to add voicea to the meeting
|
|
85
133
|
* @returns {void}
|
|
86
134
|
*/
|
|
87
|
-
|
|
135
|
+
sendAnnouncement: () => void;
|
|
88
136
|
/**
|
|
89
137
|
* Set Spoken Language for the meeting
|
|
90
138
|
* @param {string} languageCode
|
|
@@ -109,7 +157,7 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
109
157
|
sendManualClosedCaption: (text: string, timeStamp: number, csis: number[], isFinal: boolean) => void;
|
|
110
158
|
/**
|
|
111
159
|
* request turn on Captions
|
|
112
|
-
* @param {string} [languageCode] - Optional Parameter for spoken language code
|
|
160
|
+
* @param {string} [languageCode] - Optional Parameter for spoken language code
|
|
113
161
|
* @returns {Promise}
|
|
114
162
|
*/
|
|
115
163
|
private requestTurnOnCaptions;
|
|
@@ -124,7 +172,7 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
124
172
|
*/
|
|
125
173
|
private isAnnounceProcessed;
|
|
126
174
|
/**
|
|
127
|
-
* announce to voicea data
|
|
175
|
+
* announce to voicea data channel
|
|
128
176
|
* @returns {void}
|
|
129
177
|
*/
|
|
130
178
|
announce: () => void;
|
|
@@ -138,7 +186,7 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
138
186
|
* @param {string} [spokenLanguage] - Optional Spoken language code
|
|
139
187
|
* @returns {Promise}
|
|
140
188
|
*/
|
|
141
|
-
turnOnCaptions: (spokenLanguage?:
|
|
189
|
+
turnOnCaptions: (spokenLanguage?: string) => Promise<void | undefined>;
|
|
142
190
|
/**
|
|
143
191
|
* Toggle transcribing for highlights
|
|
144
192
|
* @param {boolean} activate true means to turn on transcribing and false means to turn off
|
|
@@ -158,7 +206,7 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
158
206
|
* @param {string} meetingId
|
|
159
207
|
* @returns {void}
|
|
160
208
|
*/
|
|
161
|
-
onSpokenLanguageUpdate: (languageCode: string, meetingId:
|
|
209
|
+
onSpokenLanguageUpdate: (languageCode: string, meetingId: string) => void;
|
|
162
210
|
/**
|
|
163
211
|
* In meeting Spoken Language changed event
|
|
164
212
|
* @param {string} serviceId
|
|
@@ -178,9 +226,6 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
178
226
|
/**
|
|
179
227
|
* update LLM sub‑channel subscriptions.
|
|
180
228
|
*
|
|
181
|
-
* sends a single `subchannelSubscriptionRequest` to LLM,
|
|
182
|
-
* allowing subscribe and unsubscribe subchannel.
|
|
183
|
-
*
|
|
184
229
|
* @param {string[]} options.subscribe Sub‑channels to subscribe to.
|
|
185
230
|
* @param {string[]} options.unsubscribe Sub‑channels to unsubscribe from.
|
|
186
231
|
* @returns {Promise}
|
|
@@ -89,6 +89,7 @@ interface IVoiceaChannel {
|
|
|
89
89
|
deregisterEvents: () => void;
|
|
90
90
|
toggleManualCaption: (enable: boolean) => undefined | Promise<void>;
|
|
91
91
|
sendManualClosedCaption: (text: string, timeStamp: number, csis: number[], isFinal: boolean) => void;
|
|
92
|
+
getKeepTranscriptionSubscribed: () => boolean;
|
|
92
93
|
}
|
|
93
94
|
type MeetingTranscripts = {
|
|
94
95
|
start_mills?: number;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
|
|
4
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
6
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.default = exports.VoiceaPlugin = void 0;
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
11
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
12
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
|
|
13
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
|
|
14
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
|
|
15
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
16
|
+
var _webexCore = require("@webex/webex-core");
|
|
17
|
+
var _voicea = require("./voicea");
|
|
18
|
+
var _constants = require("./constants");
|
|
19
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
20
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
|
+
/**
|
|
22
|
+
* VoiceaPlugin - factory for creating VoiceaChannel instances
|
|
23
|
+
* @export
|
|
24
|
+
* @class VoiceaPlugin
|
|
25
|
+
*/
|
|
26
|
+
var VoiceaPlugin = exports.VoiceaPlugin = /*#__PURE__*/function (_WebexPlugin) {
|
|
27
|
+
function VoiceaPlugin() {
|
|
28
|
+
var _this;
|
|
29
|
+
(0, _classCallCheck2.default)(this, VoiceaPlugin);
|
|
30
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
31
|
+
args[_key] = arguments[_key];
|
|
32
|
+
}
|
|
33
|
+
_this = _callSuper(this, VoiceaPlugin, [].concat(args));
|
|
34
|
+
(0, _defineProperty2.default)(_this, "namespace", _constants.VOICEA);
|
|
35
|
+
return _this;
|
|
36
|
+
}
|
|
37
|
+
(0, _inherits2.default)(VoiceaPlugin, _WebexPlugin);
|
|
38
|
+
return (0, _createClass2.default)(VoiceaPlugin, [{
|
|
39
|
+
key: "createChannel",
|
|
40
|
+
value:
|
|
41
|
+
/**
|
|
42
|
+
* Creates a VoiceaChannel, optionally bound to an LLMChannel.
|
|
43
|
+
*
|
|
44
|
+
* Note: VoiceaChannel does not take ownership of the LLMChannel.
|
|
45
|
+
* The caller retains ownership and is responsible for the LLMChannel's
|
|
46
|
+
* lifecycle (connection, disconnection, cleanup).
|
|
47
|
+
*
|
|
48
|
+
* @param {LLMChannel} [llmChannel] - The LLM channel to use for voicea (optional)
|
|
49
|
+
* @returns {VoiceaChannel} A new VoiceaChannel instance
|
|
50
|
+
*/
|
|
51
|
+
function createChannel(llmChannel) {
|
|
52
|
+
// @ts-ignore - webex is available on WebexPlugin
|
|
53
|
+
var channel = new _voicea.VoiceaChannel(llmChannel, this.webex.request.bind(this.webex));
|
|
54
|
+
return channel;
|
|
55
|
+
}
|
|
56
|
+
}]);
|
|
57
|
+
}(_webexCore.WebexPlugin);
|
|
58
|
+
var _default = exports.default = VoiceaPlugin;
|
|
59
|
+
//# sourceMappingURL=voicea-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_webexCore","require","_voicea","_constants","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","VoiceaPlugin","exports","_WebexPlugin","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","concat","_defineProperty2","VOICEA","_inherits2","_createClass2","key","value","createChannel","llmChannel","channel","VoiceaChannel","webex","request","bind","WebexPlugin","_default"],"sources":["voicea-plugin.ts"],"sourcesContent":["import {WebexPlugin} from '@webex/webex-core';\nimport type LLMChannel from '@webex/internal-plugin-llm';\n\nimport {VoiceaChannel} from './voicea';\nimport {VOICEA} from './constants';\n\n/**\n * VoiceaPlugin - factory for creating VoiceaChannel instances\n * @export\n * @class VoiceaPlugin\n */\nexport class VoiceaPlugin extends WebexPlugin {\n namespace = VOICEA;\n\n /**\n * Creates a VoiceaChannel, optionally bound to an LLMChannel.\n *\n * Note: VoiceaChannel does not take ownership of the LLMChannel.\n * The caller retains ownership and is responsible for the LLMChannel's\n * lifecycle (connection, disconnection, cleanup).\n *\n * @param {LLMChannel} [llmChannel] - The LLM channel to use for voicea (optional)\n * @returns {VoiceaChannel} A new VoiceaChannel instance\n */\n public createChannel(llmChannel?: LLMChannel): VoiceaChannel {\n // @ts-ignore - webex is available on WebexPlugin\n const channel = new VoiceaChannel(llmChannel, this.webex.request.bind(this.webex));\n\n return channel;\n }\n}\n\nexport default VoiceaPlugin;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAAmC,SAAAG,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,CAAAC,OAAA,EAAAH,CAAA,OAAAI,2BAAA,CAAAD,OAAA,EAAAJ,CAAA,EAAAM,yBAAA,KAAAC,kBAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,CAAAC,OAAA,EAAAJ,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAI,0BAAA,cAAAN,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAN,kBAAA,CAAAG,OAAA,iCAAAV,CAAA,aAAAM,yBAAA,YAAAA,0BAAA,aAAAN,CAAA;AAEnC;AACA;AACA;AACA;AACA;AAJA,IAKac,YAAY,GAAAC,OAAA,CAAAD,YAAA,0BAAAE,YAAA;EAAA,SAAAF,aAAA;IAAA,IAAAG,KAAA;IAAA,IAAAC,gBAAA,CAAAd,OAAA,QAAAU,YAAA;IAAA,SAAAK,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAAP,KAAA,GAAAlB,UAAA,OAAAe,YAAA,KAAAW,MAAA,CAAAH,IAAA;IAAA,IAAAI,gBAAA,CAAAtB,OAAA,EAAAa,KAAA,eACXU,iBAAM;IAAA,OAAAV,KAAA;EAAA;EAAA,IAAAW,UAAA,CAAAxB,OAAA,EAAAU,YAAA,EAAAE,YAAA;EAAA,WAAAa,aAAA,CAAAzB,OAAA,EAAAU,YAAA;IAAAgB,GAAA;IAAAC,KAAA;IAElB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACE,SAAOC,aAAaA,CAACC,UAAuB,EAAiB;MAC3D;MACA,IAAMC,OAAO,GAAG,IAAIC,qBAAa,CAACF,UAAU,EAAE,IAAI,CAACG,KAAK,CAACC,OAAO,CAACC,IAAI,CAAC,IAAI,CAACF,KAAK,CAAC,CAAC;MAElF,OAAOF,OAAO;IAChB;EAAC;AAAA,EAlB+BK,sBAAW;AAAA,IAAAC,QAAA,GAAAzB,OAAA,CAAAX,OAAA,GAqB9BU,YAAY","ignoreList":[]}
|