@webex/internal-plugin-voicea 3.12.0-auth-prejoin-fetch.1 → 3.12.0-llmrefactor.10
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 +4 -10
- 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 +2 -1
- package/dist/types/index.d.ts +6 -3
- package/dist/types/voicea-plugin.d.ts +23 -0
- package/dist/types/voicea.d.ts +82 -31
- package/dist/types/voicea.types.d.ts +19 -1
- package/dist/voicea-plugin.js +59 -0
- package/dist/voicea-plugin.js.map +1 -0
- package/dist/voicea.js +257 -156
- package/dist/voicea.js.map +1 -1
- package/dist/voicea.types.js.map +1 -1
- package/package.json +9 -9
- package/src/constants.ts +2 -2
- package/src/index.ts +7 -5
- package/src/voicea-plugin.ts +33 -0
- package/src/voicea.ts +250 -159
- package/src/voicea.types.ts +22 -0
- package/test/unit/spec/voicea-plugin.js +83 -0
- package/test/unit/spec/voicea.js +837 -1126
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',
|
|
@@ -21,6 +13,7 @@ var EVENT_TRIGGERS = exports.EVENT_TRIGGERS = {
|
|
|
21
13
|
TRANSCRIBING_ON: 'voicea:transcribingOn',
|
|
22
14
|
TRANSCRIBING_OFF: 'voicea:transcribingOff',
|
|
23
15
|
NEW_CAPTION: 'voicea:newCaption',
|
|
16
|
+
SPEAKER_NAME_UPDATED: 'voicea:speakerNameUpdated',
|
|
24
17
|
EVA_COMMAND: 'voicea:wxa',
|
|
25
18
|
HIGHLIGHT_CREATED: 'voicea:highlightCreated',
|
|
26
19
|
NEW_MANUAL_CAPTION: 'aibridge:newManualCaption',
|
|
@@ -32,7 +25,8 @@ var AIBRIDGE_RELAY_TYPES = exports.AIBRIDGE_RELAY_TYPES = {
|
|
|
32
25
|
CLIENT_ANNOUNCEMENT: 'client.annc',
|
|
33
26
|
TRANSLATION_REQUEST: 'voicea.transl.req',
|
|
34
27
|
TRANSLATION_RESPONSE: 'voicea.transl.rsp',
|
|
35
|
-
TRANSCRIPTION: 'voicea.transcription'
|
|
28
|
+
TRANSCRIPTION: 'voicea.transcription',
|
|
29
|
+
SPEAKER_NAME_UPDATE: 'voicea.update_speakername'
|
|
36
30
|
},
|
|
37
31
|
MANUAL: {
|
|
38
32
|
TRANSCRIPTION: 'aibridge.manual_transcription',
|
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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C,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,IAAA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ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { LLM_PRACTICE_SESSION } from '@webex/internal-plugin-llm';
|
|
2
1
|
export declare const EVENT_TRIGGERS: {
|
|
3
2
|
VOICEA_ANNOUNCEMENT: string;
|
|
4
3
|
CAPTION_LANGUAGE_UPDATE: string;
|
|
@@ -7,6 +6,7 @@ export declare const EVENT_TRIGGERS: {
|
|
|
7
6
|
TRANSCRIBING_ON: string;
|
|
8
7
|
TRANSCRIBING_OFF: string;
|
|
9
8
|
NEW_CAPTION: string;
|
|
9
|
+
SPEAKER_NAME_UPDATED: string;
|
|
10
10
|
EVA_COMMAND: string;
|
|
11
11
|
HIGHLIGHT_CREATED: string;
|
|
12
12
|
NEW_MANUAL_CAPTION: string;
|
|
@@ -19,6 +19,7 @@ export declare const AIBRIDGE_RELAY_TYPES: {
|
|
|
19
19
|
TRANSLATION_REQUEST: string;
|
|
20
20
|
TRANSLATION_RESPONSE: string;
|
|
21
21
|
TRANSCRIPTION: string;
|
|
22
|
+
SPEAKER_NAME_UPDATE: string;
|
|
22
23
|
};
|
|
23
24
|
MANUAL: {
|
|
24
25
|
TRANSCRIPTION: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import Voicea from './voicea-plugin';
|
|
2
|
+
import { VoiceaChannel } from './voicea';
|
|
3
|
+
import type { MeetingTranscriptPayload, SpeakerNameUpdatePayload } from './voicea.types';
|
|
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,32 +23,87 @@ 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;
|
|
36
67
|
/**
|
|
37
|
-
*
|
|
38
|
-
* @
|
|
68
|
+
* Detach any pending 'online' listener.
|
|
69
|
+
* @private
|
|
70
|
+
* @returns {void}
|
|
39
71
|
*/
|
|
40
|
-
|
|
72
|
+
private detachPendingOnline;
|
|
73
|
+
/**
|
|
74
|
+
* Reset announcement state for a new connection.
|
|
75
|
+
* @private
|
|
76
|
+
* @returns {void}
|
|
77
|
+
*/
|
|
78
|
+
private resetAnnounceState;
|
|
79
|
+
/**
|
|
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>}
|
|
85
|
+
*/
|
|
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
|
|
44
98
|
* @returns {void}
|
|
45
99
|
*/
|
|
46
100
|
private processManualTranscription;
|
|
101
|
+
/**
|
|
102
|
+
* Process speaker name update and send alert
|
|
103
|
+
* @param {SpeakerNameUpdatePayload} voiceaPayload
|
|
104
|
+
* @returns {void}
|
|
105
|
+
*/
|
|
106
|
+
private processSpeakerNameUpdate;
|
|
47
107
|
/**
|
|
48
108
|
* Process Transcript and send alert
|
|
49
109
|
* @param {TranscriptionResponse} voiceaPayload
|
|
@@ -63,22 +123,16 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
63
123
|
*/
|
|
64
124
|
private processAnnouncementMessage;
|
|
65
125
|
/**
|
|
66
|
-
* Indicates whether the
|
|
126
|
+
* Indicates whether the LLM channel is connected.
|
|
67
127
|
* @returns {boolean}
|
|
68
128
|
*/
|
|
69
|
-
|
|
129
|
+
isLLMConnected: () => boolean;
|
|
70
130
|
getKeepTranscriptionSubscribed: () => 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;
|
|
77
131
|
/**
|
|
78
132
|
* Sends Announcement to add voicea to the meeting
|
|
79
133
|
* @returns {void}
|
|
80
134
|
*/
|
|
81
|
-
|
|
135
|
+
sendAnnouncement: () => void;
|
|
82
136
|
/**
|
|
83
137
|
* Set Spoken Language for the meeting
|
|
84
138
|
* @param {string} languageCode
|
|
@@ -103,7 +157,7 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
103
157
|
sendManualClosedCaption: (text: string, timeStamp: number, csis: number[], isFinal: boolean) => void;
|
|
104
158
|
/**
|
|
105
159
|
* request turn on Captions
|
|
106
|
-
* @param {string} [languageCode] - Optional Parameter for spoken language code
|
|
160
|
+
* @param {string} [languageCode] - Optional Parameter for spoken language code
|
|
107
161
|
* @returns {Promise}
|
|
108
162
|
*/
|
|
109
163
|
private requestTurnOnCaptions;
|
|
@@ -118,7 +172,7 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
118
172
|
*/
|
|
119
173
|
private isAnnounceProcessed;
|
|
120
174
|
/**
|
|
121
|
-
* announce to voicea data
|
|
175
|
+
* announce to voicea data channel
|
|
122
176
|
* @returns {void}
|
|
123
177
|
*/
|
|
124
178
|
announce: () => void;
|
|
@@ -132,7 +186,7 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
132
186
|
* @param {string} [spokenLanguage] - Optional Spoken language code
|
|
133
187
|
* @returns {Promise}
|
|
134
188
|
*/
|
|
135
|
-
turnOnCaptions: (spokenLanguage?:
|
|
189
|
+
turnOnCaptions: (spokenLanguage?: string) => Promise<void | undefined>;
|
|
136
190
|
/**
|
|
137
191
|
* Toggle transcribing for highlights
|
|
138
192
|
* @param {boolean} activate true means to turn on transcribing and false means to turn off
|
|
@@ -152,7 +206,7 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
152
206
|
* @param {string} meetingId
|
|
153
207
|
* @returns {void}
|
|
154
208
|
*/
|
|
155
|
-
onSpokenLanguageUpdate: (languageCode: string, meetingId:
|
|
209
|
+
onSpokenLanguageUpdate: (languageCode: string, meetingId: string) => void;
|
|
156
210
|
/**
|
|
157
211
|
* In meeting Spoken Language changed event
|
|
158
212
|
* @param {string} serviceId
|
|
@@ -172,9 +226,6 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
172
226
|
/**
|
|
173
227
|
* update LLM sub‑channel subscriptions.
|
|
174
228
|
*
|
|
175
|
-
* sends a single `subchannelSubscriptionRequest` to LLM,
|
|
176
|
-
* allowing subscribe and unsubscribe subchannel.
|
|
177
|
-
*
|
|
178
229
|
* @param {string[]} options.subscribe Sub‑channels to subscribe to.
|
|
179
230
|
* @param {string[]} options.unsubscribe Sub‑channels to unsubscribe from.
|
|
180
231
|
* @returns {Promise}
|
|
@@ -25,6 +25,19 @@ interface Transcription {
|
|
|
25
25
|
csis: number[];
|
|
26
26
|
last_packet_timestamp_ms: number;
|
|
27
27
|
timestamp: string;
|
|
28
|
+
taggedSpeaker?: {
|
|
29
|
+
speakerId?: string[];
|
|
30
|
+
newName?: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
interface TaggedSpeaker {
|
|
34
|
+
csiId: number;
|
|
35
|
+
speakerId: string;
|
|
36
|
+
newName: string;
|
|
37
|
+
}
|
|
38
|
+
interface SpeakerNameUpdatePayload {
|
|
39
|
+
id?: string;
|
|
40
|
+
taggedSpeakers: TaggedSpeaker[];
|
|
28
41
|
}
|
|
29
42
|
/**
|
|
30
43
|
* Highlights
|
|
@@ -76,6 +89,7 @@ interface IVoiceaChannel {
|
|
|
76
89
|
deregisterEvents: () => void;
|
|
77
90
|
toggleManualCaption: (enable: boolean) => undefined | Promise<void>;
|
|
78
91
|
sendManualClosedCaption: (text: string, timeStamp: number, csis: number[], isFinal: boolean) => void;
|
|
92
|
+
getKeepTranscriptionSubscribed: () => boolean;
|
|
79
93
|
}
|
|
80
94
|
type MeetingTranscripts = {
|
|
81
95
|
start_mills?: number;
|
|
@@ -88,10 +102,14 @@ type MeetingTranscripts = {
|
|
|
88
102
|
[key: string]: string;
|
|
89
103
|
};
|
|
90
104
|
timestamp?: string;
|
|
105
|
+
taggedSpeaker?: {
|
|
106
|
+
speakerId?: string[];
|
|
107
|
+
newName?: string;
|
|
108
|
+
};
|
|
91
109
|
};
|
|
92
110
|
type MeetingTranscriptPayload = {
|
|
93
111
|
isFinal: boolean;
|
|
94
112
|
transcriptId: string;
|
|
95
113
|
transcripts: Array<MeetingTranscripts>;
|
|
96
114
|
};
|
|
97
|
-
export type { AnnouncementPayload, CaptionLanguageResponse, TranscriptionResponse, Transcription, Highlight, IVoiceaChannel, MeetingTranscriptPayload, };
|
|
115
|
+
export type { AnnouncementPayload, CaptionLanguageResponse, TranscriptionResponse, Transcription, Highlight, TaggedSpeaker, SpeakerNameUpdatePayload, IVoiceaChannel, MeetingTranscriptPayload, };
|
|
@@ -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,CAA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