@wildix/wilma-voice-client 0.0.51 → 0.0.53

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,37 @@ 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: {
156
- readonly HANGUP: "hangup";
157
- readonly PLAY: "play";
158
- readonly SAY: "say";
159
- readonly STOP: "stop";
160
- readonly TRANSFER: "transfer";
161
- };
162
- /**
163
- * @public
164
- */
165
- export type VoiceCommandType = (typeof VoiceCommandType)[keyof typeof VoiceCommandType];
166
- /**
167
- * @public
168
- * @enum
169
- */
170
- export declare const MediaAudioBeginFrameType: {
171
- 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
- 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
- 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: {
89
+ export declare const VoiceCallEndReason: {
90
+ readonly COMPLETE: "complete";
204
91
  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
92
  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
- 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
- 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
- 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
- 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: {
93
+ readonly TIMEOUT: "timeout";
304
94
  readonly TRANSFER: "transfer";
305
95
  };
306
96
  /**
307
97
  * @public
308
98
  */
309
- export type MediaTransferFrameType = (typeof MediaTransferFrameType)[keyof typeof MediaTransferFrameType];
99
+ export type VoiceCallEndReason = (typeof VoiceCallEndReason)[keyof typeof VoiceCallEndReason];
310
100
  /**
311
101
  * @public
312
102
  * @enum
313
103
  */
314
- export declare const MediaDtmfFrameType: {
104
+ export declare const VoiceCallClientFrameType: {
315
105
  readonly DTMF: "dtmf";
106
+ readonly END: "end";
107
+ readonly PLAYBACK: "playback";
108
+ readonly START: "start";
109
+ readonly VAD: "vad";
316
110
  };
317
111
  /**
318
112
  * @public
319
113
  */
320
- export type MediaDtmfFrameType = (typeof MediaDtmfFrameType)[keyof typeof MediaDtmfFrameType];
114
+ export type VoiceCallClientFrameType = (typeof VoiceCallClientFrameType)[keyof typeof VoiceCallClientFrameType];
321
115
  /**
322
116
  * @public
323
117
  * @enum
324
118
  */
325
- export declare const MediaFinishReason: {
119
+ export declare const VoiceCallClientEndReason: {
326
120
  /**
327
121
  * The PBX ran the agent's `hangup`.
328
122
  */
@@ -331,10 +125,6 @@ export declare const MediaFinishReason: {
331
125
  * The PBX ran the agent's `transfer`, or tried to and the target does not exist.
332
126
  */
333
127
  readonly AGENT_TRANSFER: "agent-transfer";
334
- /**
335
- * The callee hung up.
336
- */
337
- readonly CALLEE_HANGUP: "callee-hangup";
338
128
  /**
339
129
  * The caller hung up.
340
130
  */
@@ -347,45 +137,12 @@ export declare const MediaFinishReason: {
347
137
  /**
348
138
  * @public
349
139
  */
350
- export type MediaFinishReason = (typeof MediaFinishReason)[keyof typeof MediaFinishReason];
351
- /**
352
- * @public
353
- * @enum
354
- */
355
- export declare const MediaFinishFrameType: {
356
- readonly FINISH: "finish";
357
- };
358
- /**
359
- * @public
360
- */
361
- export type MediaFinishFrameType = (typeof MediaFinishFrameType)[keyof typeof MediaFinishFrameType];
140
+ export type VoiceCallClientEndReason = (typeof VoiceCallClientEndReason)[keyof typeof VoiceCallClientEndReason];
362
141
  /**
363
142
  * @public
364
143
  * @enum
365
144
  */
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: {
145
+ export declare const VoiceCallPlaybackPhase: {
389
146
  /**
390
147
  * The stream played to its end.
391
148
  */
@@ -402,66 +159,51 @@ export declare const MediaPlaybackEvent: {
402
159
  /**
403
160
  * @public
404
161
  */
405
- export type MediaPlaybackEvent = (typeof MediaPlaybackEvent)[keyof typeof MediaPlaybackEvent];
162
+ export type VoiceCallPlaybackPhase = (typeof VoiceCallPlaybackPhase)[keyof typeof VoiceCallPlaybackPhase];
406
163
  /**
407
164
  * @public
408
165
  * @enum
409
166
  */
410
- export declare const MediaPlaybackFrameType: {
411
- readonly PLAYBACK: "playback";
167
+ export declare const VoiceCallServerFrameType: {
168
+ readonly AUDIO_BEGIN: "audio.begin";
169
+ readonly AUDIO_END: "audio.end";
170
+ readonly DUCK: "duck";
171
+ readonly ENDED: "ended";
172
+ readonly ERROR: "error";
173
+ readonly HANGUP: "hangup";
174
+ readonly LANGUAGE: "language";
175
+ readonly STARTED: "started";
176
+ readonly STOP: "stop";
177
+ readonly TRANSCRIPTION: "transcription";
178
+ readonly TRANSFER: "transfer";
412
179
  };
413
180
  /**
414
181
  * @public
415
182
  */
416
- export type MediaPlaybackFrameType = (typeof MediaPlaybackFrameType)[keyof typeof MediaPlaybackFrameType];
183
+ export type VoiceCallServerFrameType = (typeof VoiceCallServerFrameType)[keyof typeof VoiceCallServerFrameType];
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];