@wildix/wilma-voice-client 0.0.50 → 0.0.52

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.
@@ -40,8 +40,7 @@ declare const SendSayCommand_base: {
40
40
  * text: "STRING_VALUE", // required
41
41
  * replyId: "STRING_VALUE", // required
42
42
  * interruptible: true || false,
43
- * voice: "STRING_VALUE",
44
- * audio: { // SayCommandAudioOptions
43
+ * audio: { // VoiceSayCommandAudioOptions
45
44
  * streamId: "STRING_VALUE", // required
46
45
  * sampleRate: Number("int"), // required
47
46
  * },
@@ -5,12 +5,11 @@
5
5
  * (engine, instructions, capabilities and channels.voice settings). This is a runtime only: there
6
6
  * is no agent/bot CRUD here — agents are authored and versioned in wilma-agents.
7
7
  *
8
- * On the WebSocket (transport host `wilma-voice-ws.wildix.com`), PBX clients transcribe caller
9
- * speech themselves and send `transcription` / `reply` text, while web/app clients connect with
10
- * inputMode=AUDIO and push raw caller `audio` chunks that the service transcribes server-side;
11
- * the service returns `say` / `play` / `stop` / `hangup` / `transfer`. On the PBX media socket
12
- * (`/v2/voice/media/ws`, subprotocol `wilma-media-v2`), the PBX sends raw caller audio and the
13
- * service answers with audio and the text frames listed under DescribeVoiceProtocol `media`.
8
+ * On the WebSocket (transport host `wilma-voice-ws.wildix.com`), the PBX transcribes caller
9
+ * speech itself and sends `transcription` / `reply` text; the service returns `say` / `play` /
10
+ * `stop` / `hangup` / `transfer`. On the call socket
11
+ * (`/v2/voice/calls/ws`), the PBX sends raw caller audio and the
12
+ * service answers with audio and the text frames listed under DescribeVoiceProtocol `callSocket`.
14
13
  * Every WebSocket message shape (connect params, events and commands) is declared as a structure
15
14
  * and enumerated by DescribeVoiceProtocol so the generated SDKs carry the types and
16
15
  * (de)serializers; the WebSocket transport itself is hand-coded. The HTTP Send* operations push
@@ -22,15 +22,15 @@ export type VoicePronunciationEncoding = (typeof VoicePronunciationEncoding)[key
22
22
  */
23
23
  export declare const VoiceEventType: {
24
24
  readonly AGENT_TRANSCRIPTION: "agentTranscription";
25
- readonly AUDIO: "audio";
26
25
  readonly COMPLETE: "complete";
27
- readonly CONTROL: "control";
28
26
  readonly ENDED: "ended";
29
27
  readonly ERROR: "error";
30
28
  readonly INTERRUPTION: "interruption";
31
29
  readonly PLAYBACK: "playback";
32
30
  readonly REPLY: "reply";
33
31
  readonly STARTED: "started";
32
+ readonly THINKING: "thinking";
33
+ readonly TOOL: "tool";
34
34
  readonly TRANSCRIPTION: "transcription";
35
35
  };
36
36
  /**
@@ -41,62 +41,40 @@ export type VoiceEventType = (typeof VoiceEventType)[keyof typeof VoiceEventType
41
41
  * @public
42
42
  * @enum
43
43
  */
44
- export declare const VoiceControlAction: {
45
- /**
46
- * Discard buffered caller audio and cancel the in-progress input turn.
47
- */
48
- readonly CLEAR: "clear";
49
- /**
50
- * Push-to-talk: the caller finished the current utterance; transcribe and run the agent now.
51
- */
52
- readonly END_OF_TURN: "end_of_turn";
53
- /**
54
- * Application-level keepalive.
55
- */
56
- readonly KEEPALIVE: "keepalive";
57
- };
58
- /**
59
- * @public
60
- */
61
- export type VoiceControlAction = (typeof VoiceControlAction)[keyof typeof VoiceControlAction];
62
- /**
63
- * @public
64
- * @enum
65
- */
66
- export declare const VoiceCallEndReason: {
67
- readonly COMPLETE: "complete";
68
- readonly ERROR: "error";
44
+ export declare const VoiceCommandType: {
69
45
  readonly HANGUP: "hangup";
70
- readonly TIMEOUT: "timeout";
46
+ readonly PLAY: "play";
47
+ readonly SAY: "say";
48
+ readonly STOP: "stop";
71
49
  readonly TRANSFER: "transfer";
72
50
  };
73
51
  /**
74
52
  * @public
75
53
  */
76
- export type VoiceCallEndReason = (typeof VoiceCallEndReason)[keyof typeof VoiceCallEndReason];
54
+ export type VoiceCommandType = (typeof VoiceCommandType)[keyof typeof VoiceCommandType];
77
55
  /**
78
56
  * @public
79
57
  * @enum
80
58
  */
81
- export declare const VoiceCallToolPhase: {
59
+ export declare const VoiceToolPhase: {
82
60
  readonly FINISHED: "finished";
83
61
  readonly STARTED: "started";
84
62
  };
85
63
  /**
86
64
  * @public
87
65
  */
88
- export type VoiceCallToolPhase = (typeof VoiceCallToolPhase)[keyof typeof VoiceCallToolPhase];
66
+ export type VoiceToolPhase = (typeof VoiceToolPhase)[keyof typeof VoiceToolPhase];
89
67
  /**
90
68
  * @public
91
69
  * @enum
92
70
  */
93
71
  export declare const VoiceTranscriptionDropReason: {
94
72
  /**
95
- * The recognition confidence was below the minimum confidence of the call.
73
+ * The confidence of the recogniser was less than the minimum confidence of the call.
96
74
  */
97
75
  readonly LOW_CONFIDENCE: "low_confidence";
98
76
  /**
99
- * The recogniser labelled the words with a speaker other than the caller.
77
+ * The recogniser identified a speaker that is not the caller.
100
78
  */
101
79
  readonly OTHER_SPEAKER: "other_speaker";
102
80
  };
@@ -108,221 +86,58 @@ export type VoiceTranscriptionDropReason = (typeof VoiceTranscriptionDropReason)
108
86
  * @public
109
87
  * @enum
110
88
  */
111
- export declare const VoiceAudioEncoding: {
112
- /**
113
- * G.711 A-law.
114
- */
115
- readonly ALAW: "alaw";
116
- /**
117
- * G.711 μ-law.
118
- */
119
- readonly MULAW: "mulaw";
120
- /**
121
- * Opus.
122
- */
123
- readonly OPUS: "opus";
124
- /**
125
- * 16-bit signed little-endian linear PCM.
126
- */
127
- readonly PCM_S16LE: "pcm_s16le";
128
- };
129
- /**
130
- * @public
131
- */
132
- export type VoiceAudioEncoding = (typeof VoiceAudioEncoding)[keyof typeof VoiceAudioEncoding];
133
- /**
134
- * @public
135
- * @enum
136
- */
137
- export declare const VoiceInputMode: {
138
- /**
139
- * The client pushes raw caller `audio` chunks and the service transcribes them server-side (web/app clients).
140
- */
141
- readonly AUDIO: "audio";
142
- /**
143
- * The client sends `transcription` / `reply` text events; it performs speech-to-text itself (PBX behaviour).
144
- */
145
- readonly TRANSCRIPTION: "transcription";
146
- };
147
- /**
148
- * @public
149
- */
150
- export type VoiceInputMode = (typeof VoiceInputMode)[keyof typeof VoiceInputMode];
151
- /**
152
- * @public
153
- * @enum
154
- */
155
- export declare const VoiceCommandType: {
89
+ export declare const VoiceCallEndReason: {
90
+ readonly COMPLETE: "complete";
91
+ readonly ERROR: "error";
156
92
  readonly HANGUP: "hangup";
157
- readonly PLAY: "play";
158
- readonly SAY: "say";
159
- readonly STOP: "stop";
93
+ readonly TIMEOUT: "timeout";
160
94
  readonly TRANSFER: "transfer";
161
95
  };
162
96
  /**
163
97
  * @public
164
98
  */
165
- export type VoiceCommandType = (typeof VoiceCommandType)[keyof typeof VoiceCommandType];
99
+ export type VoiceCallEndReason = (typeof VoiceCallEndReason)[keyof typeof VoiceCallEndReason];
166
100
  /**
167
101
  * @public
168
102
  * @enum
169
103
  */
170
- export declare const MediaAudioBeginFrameType: {
104
+ export declare const VoiceCallServerFrameType: {
171
105
  readonly AUDIO_BEGIN: "audio.begin";
172
- };
173
- /**
174
- * @public
175
- */
176
- export type MediaAudioBeginFrameType = (typeof MediaAudioBeginFrameType)[keyof typeof MediaAudioBeginFrameType];
177
- /**
178
- * @public
179
- * @enum
180
- */
181
- export declare const MediaAudioEndFrameType: {
182
106
  readonly AUDIO_END: "audio.end";
183
- };
184
- /**
185
- * @public
186
- */
187
- export type MediaAudioEndFrameType = (typeof MediaAudioEndFrameType)[keyof typeof MediaAudioEndFrameType];
188
- /**
189
- * @public
190
- * @enum
191
- */
192
- export declare const MediaDuckFrameType: {
193
107
  readonly DUCK: "duck";
194
- };
195
- /**
196
- * @public
197
- */
198
- export type MediaDuckFrameType = (typeof MediaDuckFrameType)[keyof typeof MediaDuckFrameType];
199
- /**
200
- * @public
201
- * @enum
202
- */
203
- export declare const MediaErrorFrameType: {
108
+ readonly ENDED: "ended";
204
109
  readonly ERROR: "error";
205
- };
206
- /**
207
- * @public
208
- */
209
- export type MediaErrorFrameType = (typeof MediaErrorFrameType)[keyof typeof MediaErrorFrameType];
210
- /**
211
- * @public
212
- * @enum
213
- */
214
- export declare const MediaFinishedFrameType: {
215
- readonly FINISHED: "finished";
216
- };
217
- /**
218
- * @public
219
- */
220
- export type MediaFinishedFrameType = (typeof MediaFinishedFrameType)[keyof typeof MediaFinishedFrameType];
221
- /**
222
- * @public
223
- * @enum
224
- */
225
- export declare const MediaHangupFrameType: {
226
110
  readonly HANGUP: "hangup";
227
- };
228
- /**
229
- * @public
230
- */
231
- export type MediaHangupFrameType = (typeof MediaHangupFrameType)[keyof typeof MediaHangupFrameType];
232
- /**
233
- * @public
234
- * @enum
235
- */
236
- export declare const MediaLanguageFrameType: {
237
111
  readonly LANGUAGE: "language";
238
- };
239
- /**
240
- * @public
241
- */
242
- export type MediaLanguageFrameType = (typeof MediaLanguageFrameType)[keyof typeof MediaLanguageFrameType];
243
- /**
244
- * @public
245
- * @enum
246
- */
247
- export declare const MediaRestoreFrameType: {
248
- readonly RESTORE: "restore";
249
- };
250
- /**
251
- * @public
252
- */
253
- export type MediaRestoreFrameType = (typeof MediaRestoreFrameType)[keyof typeof MediaRestoreFrameType];
254
- /**
255
- * @public
256
- * @enum
257
- */
258
- export declare const MediaStartedFrameType: {
259
112
  readonly STARTED: "started";
260
- };
261
- /**
262
- * @public
263
- */
264
- export type MediaStartedFrameType = (typeof MediaStartedFrameType)[keyof typeof MediaStartedFrameType];
265
- /**
266
- * @public
267
- * @enum
268
- */
269
- export declare const MediaStopFrameType: {
270
113
  readonly STOP: "stop";
271
- };
272
- /**
273
- * @public
274
- */
275
- export type MediaStopFrameType = (typeof MediaStopFrameType)[keyof typeof MediaStopFrameType];
276
- /**
277
- * @public
278
- * @enum
279
- */
280
- export declare const MediaParty: {
281
- readonly CALLEE: "callee";
282
- readonly CALLER: "caller";
283
- };
284
- /**
285
- * @public
286
- */
287
- export type MediaParty = (typeof MediaParty)[keyof typeof MediaParty];
288
- /**
289
- * @public
290
- * @enum
291
- */
292
- export declare const MediaTranscriptionFrameType: {
293
114
  readonly TRANSCRIPTION: "transcription";
294
- };
295
- /**
296
- * @public
297
- */
298
- export type MediaTranscriptionFrameType = (typeof MediaTranscriptionFrameType)[keyof typeof MediaTranscriptionFrameType];
299
- /**
300
- * @public
301
- * @enum
302
- */
303
- export declare const MediaTransferFrameType: {
304
115
  readonly TRANSFER: "transfer";
305
116
  };
306
117
  /**
307
118
  * @public
308
119
  */
309
- export type MediaTransferFrameType = (typeof MediaTransferFrameType)[keyof typeof MediaTransferFrameType];
120
+ export type VoiceCallServerFrameType = (typeof VoiceCallServerFrameType)[keyof typeof VoiceCallServerFrameType];
310
121
  /**
311
122
  * @public
312
123
  * @enum
313
124
  */
314
- export declare const MediaDtmfFrameType: {
125
+ export declare const VoiceCallClientFrameType: {
315
126
  readonly DTMF: "dtmf";
127
+ readonly END: "end";
128
+ readonly PLAYBACK: "playback";
129
+ readonly START: "start";
130
+ readonly VAD: "vad";
316
131
  };
317
132
  /**
318
133
  * @public
319
134
  */
320
- export type MediaDtmfFrameType = (typeof MediaDtmfFrameType)[keyof typeof MediaDtmfFrameType];
135
+ export type VoiceCallClientFrameType = (typeof VoiceCallClientFrameType)[keyof typeof VoiceCallClientFrameType];
321
136
  /**
322
137
  * @public
323
138
  * @enum
324
139
  */
325
- export declare const MediaFinishReason: {
140
+ export declare const VoiceCallClientEndReason: {
326
141
  /**
327
142
  * The PBX ran the agent's `hangup`.
328
143
  */
@@ -331,10 +146,6 @@ export declare const MediaFinishReason: {
331
146
  * The PBX ran the agent's `transfer`, or tried to and the target does not exist.
332
147
  */
333
148
  readonly AGENT_TRANSFER: "agent-transfer";
334
- /**
335
- * The callee hung up.
336
- */
337
- readonly CALLEE_HANGUP: "callee-hangup";
338
149
  /**
339
150
  * The caller hung up.
340
151
  */
@@ -347,45 +158,12 @@ export declare const MediaFinishReason: {
347
158
  /**
348
159
  * @public
349
160
  */
350
- export type MediaFinishReason = (typeof MediaFinishReason)[keyof typeof MediaFinishReason];
161
+ export type VoiceCallClientEndReason = (typeof VoiceCallClientEndReason)[keyof typeof VoiceCallClientEndReason];
351
162
  /**
352
163
  * @public
353
164
  * @enum
354
165
  */
355
- export declare const MediaFinishFrameType: {
356
- readonly FINISH: "finish";
357
- };
358
- /**
359
- * @public
360
- */
361
- export type MediaFinishFrameType = (typeof MediaFinishFrameType)[keyof typeof MediaFinishFrameType];
362
- /**
363
- * @public
364
- * @enum
365
- */
366
- export declare const MediaPlaybackStopCause: {
367
- /**
368
- * The caller hung up or the run ended.
369
- */
370
- readonly CALLER: "caller";
371
- /**
372
- * A `stop` frame from the cloud.
373
- */
374
- readonly CLOUD: "cloud";
375
- /**
376
- * The PBX dropped the stream, for example at its queue limit.
377
- */
378
- readonly DROP: "drop";
379
- };
380
- /**
381
- * @public
382
- */
383
- export type MediaPlaybackStopCause = (typeof MediaPlaybackStopCause)[keyof typeof MediaPlaybackStopCause];
384
- /**
385
- * @public
386
- * @enum
387
- */
388
- export declare const MediaPlaybackEvent: {
166
+ export declare const VoiceCallPlaybackPhase: {
389
167
  /**
390
168
  * The stream played to its end.
391
169
  */
@@ -402,66 +180,30 @@ export declare const MediaPlaybackEvent: {
402
180
  /**
403
181
  * @public
404
182
  */
405
- export type MediaPlaybackEvent = (typeof MediaPlaybackEvent)[keyof typeof MediaPlaybackEvent];
406
- /**
407
- * @public
408
- * @enum
409
- */
410
- export declare const MediaPlaybackFrameType: {
411
- readonly PLAYBACK: "playback";
412
- };
413
- /**
414
- * @public
415
- */
416
- export type MediaPlaybackFrameType = (typeof MediaPlaybackFrameType)[keyof typeof MediaPlaybackFrameType];
183
+ export type VoiceCallPlaybackPhase = (typeof VoiceCallPlaybackPhase)[keyof typeof VoiceCallPlaybackPhase];
417
184
  /**
418
185
  * @public
419
186
  * @enum
420
187
  */
421
- export declare const MediaAudioEncoding: {
422
- readonly PCM_S16LE: "pcm_s16le";
188
+ export declare const VoiceCallParty: {
189
+ readonly CALLEE: "callee";
190
+ readonly CALLER: "caller";
423
191
  };
424
192
  /**
425
193
  * @public
426
194
  */
427
- export type MediaAudioEncoding = (typeof MediaAudioEncoding)[keyof typeof MediaAudioEncoding];
195
+ export type VoiceCallParty = (typeof VoiceCallParty)[keyof typeof VoiceCallParty];
428
196
  /**
429
197
  * @public
430
198
  * @enum
431
199
  */
432
- export declare const MediaRunPurpose: {
433
- /**
434
- * A voice agent answers the call.
435
- */
436
- readonly AGENT: "agent";
200
+ export declare const VoiceInputMode: {
437
201
  /**
438
- * 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.
202
+ * The client does speech-to-text itself and sends `transcription` / `reply` text events.
439
203
  */
440
204
  readonly TRANSCRIPTION: "transcription";
441
205
  };
442
206
  /**
443
207
  * @public
444
208
  */
445
- export type MediaRunPurpose = (typeof MediaRunPurpose)[keyof typeof MediaRunPurpose];
446
- /**
447
- * @public
448
- * @enum
449
- */
450
- export declare const MediaStartFrameType: {
451
- readonly START: "start";
452
- };
453
- /**
454
- * @public
455
- */
456
- export type MediaStartFrameType = (typeof MediaStartFrameType)[keyof typeof MediaStartFrameType];
457
- /**
458
- * @public
459
- * @enum
460
- */
461
- export declare const MediaVadFrameType: {
462
- readonly VAD: "vad";
463
- };
464
- /**
465
- * @public
466
- */
467
- export type MediaVadFrameType = (typeof MediaVadFrameType)[keyof typeof MediaVadFrameType];
209
+ export type VoiceInputMode = (typeof VoiceInputMode)[keyof typeof VoiceInputMode];