@wildix/wilma-voice-client 0.0.43 → 0.0.45

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.
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MediaVadFrameType = exports.MediaStartFrameType = exports.MediaRunPurpose = exports.MediaAudioEncoding = exports.MediaPlaybackFrameType = exports.MediaPlaybackEvent = exports.MediaPlaybackStopCause = exports.MediaFinishFrameType = exports.MediaFinishReason = exports.MediaDtmfFrameType = exports.MediaTransferFrameType = exports.MediaTranscriptionFrameType = exports.MediaParty = exports.MediaStopFrameType = exports.MediaStartedFrameType = exports.MediaRestoreFrameType = exports.MediaLanguageFrameType = exports.MediaHangupFrameType = exports.MediaFinishedFrameType = exports.MediaErrorFrameType = exports.MediaDuckFrameType = exports.MediaAudioEndFrameType = exports.MediaAudioBeginFrameType = exports.VoiceCommandType = exports.VoiceInputMode = exports.VoiceAudioEncoding = exports.VoiceTranscriptionDropReason = exports.VoiceCallToolPhase = exports.VoiceCallEndReason = exports.VoiceControlAction = exports.VoiceEventType = exports.VoicePronunciationEncoding = void 0;
3
+ exports.MediaVadFrameType = exports.MediaStartFrameType = exports.MediaRunPurpose = exports.MediaAudioEncoding = exports.MediaPlaybackFrameType = exports.MediaPlaybackEvent = exports.MediaPlaybackStopCause = exports.MediaFinishFrameType = exports.MediaFinishReason = exports.MediaDtmfFrameType = exports.MediaTransferFrameType = exports.MediaTranscriptionFrameType = exports.MediaParty = exports.MediaStopFrameType = exports.MediaStartedFrameType = exports.MediaRestoreFrameType = exports.MediaLanguageFrameType = exports.MediaHangupFrameType = exports.MediaFinishedFrameType = exports.MediaErrorFrameType = exports.MediaDuckFrameType = exports.MediaAudioEndFrameType = exports.MediaAudioBeginFrameType = exports.VoiceCommandType = exports.VoiceInputMode = exports.VoiceAudioEncoding = exports.VoiceTranscriptionDropReason = exports.VoiceCallToolPhase = exports.VoiceCallEndReason = exports.VoiceControlAction = exports.VoiceEventType = exports.VoiceLowConfidenceAction = exports.VoicePronunciationEncoding = void 0;
4
4
  exports.VoicePronunciationEncoding = {
5
5
  ALIAS: "alias",
6
6
  IPA: "ipa",
7
7
  };
8
+ exports.VoiceLowConfidenceAction = {
9
+ ANSWER: "answer",
10
+ ASK_TO_REPEAT: "ask_to_repeat",
11
+ };
8
12
  exports.VoiceEventType = {
9
13
  AGENT_TRANSCRIPTION: "agentTranscription",
10
14
  AUDIO: "audio",
@@ -201,6 +201,7 @@ const _in = "interruptions";
201
201
  const _int = "interruptible";
202
202
  const _inte = "interruption";
203
203
  const _l = "language";
204
+ const _lC = "lowConfidence";
204
205
  const _la = "languages";
205
206
  const _m = "message";
206
207
  const _mC = "minConfidence";
@@ -233,10 +234,9 @@ const _rAMe = "restoreAfterMs";
233
234
  const _rI = "replyId";
234
235
  const _rM = "rampMs";
235
236
  const _rWE = "replyWebsocketEvent";
236
- const _re = "recogniser";
237
+ const _re = "restore";
237
238
  const _rep = "reply";
238
- const _res = "restore";
239
- const _resu = "resume";
239
+ const _res = "resume";
240
240
  const _ret = "retryable";
241
241
  const _s = "smithy.ts.sdk.synthetic.wildix.wilma.voice";
242
242
  const _sEWE = "sessionEndedWebsocketEvent";
@@ -382,8 +382,8 @@ exports.GetVoiceDefaultsInput$ = [3, n1, _GVDI,
382
382
  ];
383
383
  exports.GetVoiceDefaultsOutput$ = [3, n1, _GVDO,
384
384
  0,
385
- [_re, _vD, _in, _tE],
386
- [0, () => exports.VoiceDetectionDefaults$, () => exports.VoiceInterruptionDefaults$, () => exports.VoiceTurnEndDefaults$], 4
385
+ [_vD, _in, _tE],
386
+ [() => exports.VoiceDetectionDefaults$, () => exports.VoiceInterruptionDefaults$, () => exports.VoiceTurnEndDefaults$], 3
387
387
  ];
388
388
  exports.HangupCommandData$ = [3, n1, _HCD,
389
389
  0,
@@ -432,7 +432,7 @@ exports.MediaAudioFormat$ = [3, n1, _MAF,
432
432
  ];
433
433
  exports.MediaCloudFrames$ = [3, n1, _MCF,
434
434
  0,
435
- [_sta, _tr, _aB, _au, _aE, _sto, _du, _res, _l, _tra, _h, _e, _fi],
435
+ [_sta, _tr, _aB, _au, _aE, _sto, _du, _re, _l, _tra, _h, _e, _fi],
436
436
  [() => exports.MediaStartedFrame$, () => exports.MediaTranscriptionFrame$, () => exports.MediaAudioBeginFrame$, 21, () => exports.MediaAudioEndFrame$, () => exports.MediaStopFrame$, () => exports.MediaDuckFrame$, () => exports.MediaRestoreFrame$, () => exports.MediaLanguageFrame$, () => exports.MediaTransferFrame$, () => exports.MediaHangupFrame$, () => exports.MediaErrorFrame$, () => exports.MediaFinishedFrame$]
437
437
  ];
438
438
  exports.MediaDtmfFrame$ = [3, n1, _MDF,
@@ -512,7 +512,7 @@ exports.MediaStartedFrame$ = [3, n1, _MSF,
512
512
  ];
513
513
  exports.MediaStartFrame$ = [3, n1, _MSFe,
514
514
  0,
515
- [_t, _pu, _cI, _fI, _sIe, _resu, _rAM, _au, _cal, _ag, _la, _pL, _aD, _dN, _var],
515
+ [_t, _pu, _cI, _fI, _sIe, _res, _rAM, _au, _cal, _ag, _la, _pL, _aD, _dN, _var],
516
516
  [0, 0, 0, 1, 0, 2, 1, () => exports.MediaAudioFormat$, () => exports.MediaStartCaller$, () => exports.MediaStartAgent$, 64 | 0, 0, 2, 0, 0], 9
517
517
  ];
518
518
  exports.MediaStopFrame$ = [3, n1, _MSFed,
@@ -782,8 +782,8 @@ exports.VoiceErrorEvent$ = [3, n1, _VEE,
782
782
  ];
783
783
  exports.VoiceInterruptionDefaults$ = [3, n1, _VID,
784
784
  0,
785
- [_mW, _mC, _dAM, _dVD, _rAMe],
786
- [1, 1, 1, 1, 1], 5
785
+ [_mW, _dAM, _dVD, _rAMe],
786
+ [1, 1, 1, 1], 4
787
787
  ];
788
788
  exports.VoiceSpeechPayload$ = [3, n1, _VSP,
789
789
  0,
@@ -792,8 +792,8 @@ exports.VoiceSpeechPayload$ = [3, n1, _VSP,
792
792
  ];
793
793
  exports.VoiceTurnEndDefaults$ = [3, n1, _VTED,
794
794
  0,
795
- [_hM, _mWM],
796
- [128 | 1, 1], 2
795
+ [_hM, _mWM, _mC, _lC],
796
+ [1, 1, 1, 0], 4
797
797
  ];
798
798
  var LanguageCodeList = 64 | 0;
799
799
  var VoicePronunciationList = [1, n2, _VPL,
@@ -803,7 +803,6 @@ var MediaStartLanguageList = 64 | 0;
803
803
  var VoiceList = [1, n1, _VL,
804
804
  0, () => exports.Voice$
805
805
  ];
806
- var VoiceHoldByRecogniser = 128 | 1;
807
806
  exports.VoiceCallEvent$ = [4, n1, _VCE,
808
807
  0,
809
808
  [_sta, _tr, _aT, _rep, _sa, _pl, _inte, _l, _too, _end],
@@ -2,6 +2,10 @@ export const VoicePronunciationEncoding = {
2
2
  ALIAS: "alias",
3
3
  IPA: "ipa",
4
4
  };
5
+ export const VoiceLowConfidenceAction = {
6
+ ANSWER: "answer",
7
+ ASK_TO_REPEAT: "ask_to_repeat",
8
+ };
5
9
  export const VoiceEventType = {
6
10
  AGENT_TRANSCRIPTION: "agentTranscription",
7
11
  AUDIO: "audio",
@@ -196,6 +196,7 @@ const _in = "interruptions";
196
196
  const _int = "interruptible";
197
197
  const _inte = "interruption";
198
198
  const _l = "language";
199
+ const _lC = "lowConfidence";
199
200
  const _la = "languages";
200
201
  const _m = "message";
201
202
  const _mC = "minConfidence";
@@ -228,10 +229,9 @@ const _rAMe = "restoreAfterMs";
228
229
  const _rI = "replyId";
229
230
  const _rM = "rampMs";
230
231
  const _rWE = "replyWebsocketEvent";
231
- const _re = "recogniser";
232
+ const _re = "restore";
232
233
  const _rep = "reply";
233
- const _res = "restore";
234
- const _resu = "resume";
234
+ const _res = "resume";
235
235
  const _ret = "retryable";
236
236
  const _s = "smithy.ts.sdk.synthetic.wildix.wilma.voice";
237
237
  const _sEWE = "sessionEndedWebsocketEvent";
@@ -377,8 +377,8 @@ export var GetVoiceDefaultsInput$ = [3, n1, _GVDI,
377
377
  ];
378
378
  export var GetVoiceDefaultsOutput$ = [3, n1, _GVDO,
379
379
  0,
380
- [_re, _vD, _in, _tE],
381
- [0, () => VoiceDetectionDefaults$, () => VoiceInterruptionDefaults$, () => VoiceTurnEndDefaults$], 4
380
+ [_vD, _in, _tE],
381
+ [() => VoiceDetectionDefaults$, () => VoiceInterruptionDefaults$, () => VoiceTurnEndDefaults$], 3
382
382
  ];
383
383
  export var HangupCommandData$ = [3, n1, _HCD,
384
384
  0,
@@ -427,7 +427,7 @@ export var MediaAudioFormat$ = [3, n1, _MAF,
427
427
  ];
428
428
  export var MediaCloudFrames$ = [3, n1, _MCF,
429
429
  0,
430
- [_sta, _tr, _aB, _au, _aE, _sto, _du, _res, _l, _tra, _h, _e, _fi],
430
+ [_sta, _tr, _aB, _au, _aE, _sto, _du, _re, _l, _tra, _h, _e, _fi],
431
431
  [() => MediaStartedFrame$, () => MediaTranscriptionFrame$, () => MediaAudioBeginFrame$, 21, () => MediaAudioEndFrame$, () => MediaStopFrame$, () => MediaDuckFrame$, () => MediaRestoreFrame$, () => MediaLanguageFrame$, () => MediaTransferFrame$, () => MediaHangupFrame$, () => MediaErrorFrame$, () => MediaFinishedFrame$]
432
432
  ];
433
433
  export var MediaDtmfFrame$ = [3, n1, _MDF,
@@ -507,7 +507,7 @@ export var MediaStartedFrame$ = [3, n1, _MSF,
507
507
  ];
508
508
  export var MediaStartFrame$ = [3, n1, _MSFe,
509
509
  0,
510
- [_t, _pu, _cI, _fI, _sIe, _resu, _rAM, _au, _cal, _ag, _la, _pL, _aD, _dN, _var],
510
+ [_t, _pu, _cI, _fI, _sIe, _res, _rAM, _au, _cal, _ag, _la, _pL, _aD, _dN, _var],
511
511
  [0, 0, 0, 1, 0, 2, 1, () => MediaAudioFormat$, () => MediaStartCaller$, () => MediaStartAgent$, 64 | 0, 0, 2, 0, 0], 9
512
512
  ];
513
513
  export var MediaStopFrame$ = [3, n1, _MSFed,
@@ -777,8 +777,8 @@ export var VoiceErrorEvent$ = [3, n1, _VEE,
777
777
  ];
778
778
  export var VoiceInterruptionDefaults$ = [3, n1, _VID,
779
779
  0,
780
- [_mW, _mC, _dAM, _dVD, _rAMe],
781
- [1, 1, 1, 1, 1], 5
780
+ [_mW, _dAM, _dVD, _rAMe],
781
+ [1, 1, 1, 1], 4
782
782
  ];
783
783
  export var VoiceSpeechPayload$ = [3, n1, _VSP,
784
784
  0,
@@ -787,8 +787,8 @@ export var VoiceSpeechPayload$ = [3, n1, _VSP,
787
787
  ];
788
788
  export var VoiceTurnEndDefaults$ = [3, n1, _VTED,
789
789
  0,
790
- [_hM, _mWM],
791
- [128 | 1, 1], 2
790
+ [_hM, _mWM, _mC, _lC],
791
+ [1, 1, 1, 0], 4
792
792
  ];
793
793
  var LanguageCodeList = 64 | 0;
794
794
  var VoicePronunciationList = [1, n2, _VPL,
@@ -798,7 +798,6 @@ var MediaStartLanguageList = 64 | 0;
798
798
  var VoiceList = [1, n1, _VL,
799
799
  0, () => Voice$
800
800
  ];
801
- var VoiceHoldByRecogniser = 128 | 1;
802
801
  export var VoiceCallEvent$ = [4, n1, _VCE,
803
802
  0,
804
803
  [_sta, _tr, _aT, _rep, _sa, _pl, _inte, _l, _too, _end],
@@ -40,7 +40,6 @@ declare const GetVoiceDefaultsCommand_base: {
40
40
  * const command = new GetVoiceDefaultsCommand(input);
41
41
  * const response = await client.send(command);
42
42
  * // { // GetVoiceDefaultsOutput
43
- * // recogniser: "STRING_VALUE", // required
44
43
  * // voiceDetection: { // VoiceDetectionDefaults
45
44
  * // silenceMs: Number("int"), // required
46
45
  * // silenceLevelDb: Number("int"), // required
@@ -48,16 +47,15 @@ declare const GetVoiceDefaultsCommand_base: {
48
47
  * // },
49
48
  * // interruptions: { // VoiceInterruptionDefaults
50
49
  * // minWords: Number("int"), // required
51
- * // minConfidence: Number("double"), // required
52
50
  * // duckAfterMs: Number("int"), // required
53
51
  * // duckVolumeDb: Number("int"), // required
54
52
  * // restoreAfterMs: Number("int"), // required
55
53
  * // },
56
54
  * // turnEnd: { // VoiceTurnEndDefaults
57
- * // holdMs: { // VoiceHoldByRecogniser // required
58
- * // "<keys>": Number("int"),
59
- * // },
55
+ * // holdMs: Number("int"), // required
60
56
  * // maxWaitMs: Number("int"), // required
57
+ * // minConfidence: Number("double"), // required
58
+ * // lowConfidence: "answer" || "ask_to_repeat", // required
61
59
  * // },
62
60
  * // };
63
61
  *
@@ -16,6 +16,24 @@ export declare const VoicePronunciationEncoding: {
16
16
  * @public
17
17
  */
18
18
  export type VoicePronunciationEncoding = (typeof VoicePronunciationEncoding)[keyof typeof VoicePronunciationEncoding];
19
+ /**
20
+ * @public
21
+ * @enum
22
+ */
23
+ export declare const VoiceLowConfidenceAction: {
24
+ /**
25
+ * The agent answers the words as they were recognised.
26
+ */
27
+ readonly ANSWER: "answer";
28
+ /**
29
+ * The agent asks the caller to repeat.
30
+ */
31
+ readonly ASK_TO_REPEAT: "ask_to_repeat";
32
+ };
33
+ /**
34
+ * @public
35
+ */
36
+ export type VoiceLowConfidenceAction = (typeof VoiceLowConfidenceAction)[keyof typeof VoiceLowConfidenceAction];
19
37
  /**
20
38
  * @public
21
39
  * @enum
@@ -435,7 +453,7 @@ export declare const MediaRunPurpose: {
435
453
  */
436
454
  readonly AGENT: "agent";
437
455
  /**
438
- * The cloud transcribes the call and sends no audio.
456
+ * Reserved: the cloud transcribes the call and sends no audio. The cloud does not serve it at this time and closes the socket with 4400.
439
457
  */
440
458
  readonly TRANSCRIPTION: "transcription";
441
459
  };
@@ -1,5 +1,5 @@
1
1
  import type { DocumentType as __DocumentType, StreamingBlobTypes } from "@smithy/types";
2
- import type { MediaAudioBeginFrameType, MediaAudioEncoding, MediaAudioEndFrameType, MediaDtmfFrameType, MediaDuckFrameType, MediaErrorFrameType, MediaFinishedFrameType, MediaFinishFrameType, MediaFinishReason, MediaHangupFrameType, MediaLanguageFrameType, MediaParty, MediaPlaybackEvent, MediaPlaybackFrameType, MediaPlaybackStopCause, MediaRestoreFrameType, MediaRunPurpose, MediaStartedFrameType, MediaStartFrameType, MediaStopFrameType, MediaTranscriptionFrameType, MediaTransferFrameType, MediaVadFrameType, VoiceAudioEncoding, VoiceCallEndReason, VoiceCallToolPhase, VoiceCommandType, VoiceControlAction, VoiceEventType, VoiceInputMode, VoicePronunciationEncoding, VoiceTranscriptionDropReason } from "./enums";
2
+ import type { MediaAudioBeginFrameType, MediaAudioEncoding, MediaAudioEndFrameType, MediaDtmfFrameType, MediaDuckFrameType, MediaErrorFrameType, MediaFinishedFrameType, MediaFinishFrameType, MediaFinishReason, MediaHangupFrameType, MediaLanguageFrameType, MediaParty, MediaPlaybackEvent, MediaPlaybackFrameType, MediaPlaybackStopCause, MediaRestoreFrameType, MediaRunPurpose, MediaStartedFrameType, MediaStartFrameType, MediaStopFrameType, MediaTranscriptionFrameType, MediaTransferFrameType, MediaVadFrameType, VoiceAudioEncoding, VoiceCallEndReason, VoiceCallToolPhase, VoiceCommandType, VoiceControlAction, VoiceEventType, VoiceInputMode, VoiceLowConfidenceAction, VoicePronunciationEncoding, VoiceTranscriptionDropReason } from "./enums";
3
3
  /**
4
4
  * A pronunciation rule for one phrase. Belongs to a LANGUAGE, not to the agent: 'Wildix' is
5
5
  * respelled differently for an Italian and a German voice, so one list shared ACROSS languages
@@ -352,7 +352,7 @@ export interface VoiceCallTranscriptionEvent {
352
352
  */
353
353
  time?: number | undefined;
354
354
  /**
355
- * Present on a final that did not go to the agent as a caller turn. It came while the agent spoke and the cloud took it for noise or echo, or for another speaker.
355
+ * Present on a final that did not go to the agent as a caller turn. It came while the agent spoke, and its recognition confidence was below the minimum of the call or the recogniser labelled it with another speaker.
356
356
  * @public
357
357
  */
358
358
  dropped?: VoiceTranscriptionDropReason | undefined;
@@ -900,7 +900,7 @@ export interface MediaVoiceDetection {
900
900
  */
901
901
  silenceMs: number;
902
902
  /**
903
- * Level in dBFS below which caller audio is silence.
903
+ * Mean frame level in dBFS below which caller audio is silence.
904
904
  * @public
905
905
  */
906
906
  silenceLevelDb: number;
@@ -1163,7 +1163,7 @@ export interface MediaStartAgent {
1163
1163
  version?: number | undefined;
1164
1164
  }
1165
1165
  /**
1166
- * Format of the binary PBX audio (`MediaPbxAudio`). Channel 0 is the caller; channel 1, when present, is the callee. Samples interleave.
1166
+ * Format of the binary PBX audio (`MediaPbxAudio`). Channel 0 is the caller; channel 1, when present, is the callee. Samples interleave. The cloud accepts only 8000 Hz and one channel at this time; another format closes the socket with 4400.
1167
1167
  * @public
1168
1168
  */
1169
1169
  export interface MediaAudioFormat {
@@ -1220,7 +1220,7 @@ export interface MediaStartFrame {
1220
1220
  */
1221
1221
  sessionId: string;
1222
1222
  /**
1223
- * True when an earlier connection of this run got `started`: the cloud continues that session without a new greeting.
1223
+ * True when an earlier connection of this run got agent audio (`audio.begin`): the cloud continues that session without a new greeting.
1224
1224
  * @public
1225
1225
  */
1226
1226
  resume: boolean;
@@ -1230,7 +1230,7 @@ export interface MediaStartFrame {
1230
1230
  */
1231
1231
  resumeAtMs: number;
1232
1232
  /**
1233
- * Format of the binary PBX audio (`MediaPbxAudio`). Channel 0 is the caller; channel 1, when present, is the callee. Samples interleave.
1233
+ * Format of the binary PBX audio (`MediaPbxAudio`). Channel 0 is the caller; channel 1, when present, is the callee. Samples interleave. The cloud accepts only 8000 Hz and one channel at this time; another format closes the socket with 4400.
1234
1234
  * @public
1235
1235
  */
1236
1236
  audio: MediaAudioFormat;
@@ -1879,11 +1879,6 @@ export interface VoiceInterruptionDefaults {
1879
1879
  * @public
1880
1880
  */
1881
1881
  minWords: number;
1882
- /**
1883
- * Minimum recognition confidence, from 0 to 1, of the caller words that count as an interruption.
1884
- * @public
1885
- */
1886
- minConfidence: number;
1887
1882
  /**
1888
1883
  * Caller speech in ms before the agent's reply is lowered.
1889
1884
  * @public
@@ -1906,15 +1901,25 @@ export interface VoiceInterruptionDefaults {
1906
1901
  */
1907
1902
  export interface VoiceTurnEndDefaults {
1908
1903
  /**
1909
- * Default of `holdMs` for each recogniser, by the URI scheme of the recogniser, for example `soniox` and `aws`.
1904
+ * Default of `holdMs`.
1910
1905
  * @public
1911
1906
  */
1912
- holdMs: Record<string, number>;
1907
+ holdMs: number;
1913
1908
  /**
1914
1909
  * Default of `maxWaitMs`.
1915
1910
  * @public
1916
1911
  */
1917
1912
  maxWaitMs: number;
1913
+ /**
1914
+ * Default of `minConfidence`. 0: off.
1915
+ * @public
1916
+ */
1917
+ minConfidence: number;
1918
+ /**
1919
+ * Default of `lowConfidence`.
1920
+ * @public
1921
+ */
1922
+ lowConfidence: VoiceLowConfidenceAction;
1918
1923
  }
1919
1924
  /**
1920
1925
  * Defaults of `VoiceChannelSettings.voiceDetection`.
@@ -1927,7 +1932,7 @@ export interface VoiceDetectionDefaults {
1927
1932
  */
1928
1933
  silenceMs: number;
1929
1934
  /**
1930
- * Level in dBFS below which caller audio is silence.
1935
+ * Mean frame level in dBFS below which caller audio is silence.
1931
1936
  * @public
1932
1937
  */
1933
1938
  silenceLevelDb: number;
@@ -1941,11 +1946,6 @@ export interface VoiceDetectionDefaults {
1941
1946
  * @public
1942
1947
  */
1943
1948
  export interface GetVoiceDefaultsOutput {
1944
- /**
1945
- * URI scheme of the recogniser that a call uses when its agent sets none, for example `soniox`.
1946
- * @public
1947
- */
1948
- recogniser: string;
1949
1949
  /**
1950
1950
  * Defaults of `VoiceChannelSettings.voiceDetection`.
1951
1951
  * @public
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wildix/wilma-voice-client",
3
3
  "description": "@wildix/wilma-voice-client client",
4
- "version": "0.0.43",
4
+ "version": "0.0.45",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",