voice-router-dev 0.8.7 → 0.8.9

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/CHANGELOG.md CHANGED
@@ -7,8 +7,42 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [0.8.7] - 2026-04-18
9
9
 
10
+ ### Added
11
+
12
+ #### Speechmatics: Real-Time Streaming (`transcribeStream()`)
13
+
14
+ Speechmatics now supports WebSocket-based real-time transcription via `wss://{region}.rt.speechmatics.com/v2`. The adapter follows the same pattern as Deepgram/Gladia/AssemblyAI streaming.
15
+
16
+ **Protocol flow:**
17
+ 1. Connect with `Authorization: Bearer` header
18
+ 2. Send `StartRecognition` JSON with `audio_format` + `transcription_config`
19
+ 3. Wait for `RecognitionStarted` acknowledgment
20
+ 4. Stream binary audio frames via `sendAudio()`
21
+ 5. Receive `AddPartialTranscript` (partials) and `AddTranscript` (finals)
22
+ 6. `EndOfUtterance` boundaries trigger `onUtterance()` callback
23
+ 7. `EndOfStream` → `EndOfTranscript` for clean shutdown
24
+
25
+ **Streaming options** (`speechmaticsStreaming`): `encoding`, `sampleRate`, `language`, `domain`, `operatingPoint`, `maxDelay`, `maxDelayMode`, `enablePartials`, `enableEntities`, `diarization`, `maxSpeakers`, `additionalVocab`, `conversationConfig`, `region`.
26
+
27
+ **Type changes:**
28
+ - `SpeechmaticsCapabilities.streaming` is now `true` — Speechmatics is included in `StreamingProviderType`
29
+ - `SpeechmaticsStreamingOptions` added to `ProviderStreamingOptions` union and `StreamingOptionsForProvider<P>` conditional type
30
+ - `StreamingOptions.speechmaticsStreaming` field added
31
+
10
32
  ### Fixed
11
33
 
34
+ #### Soniox: Fix Streaming WebSocket Initialization
35
+
36
+ Three bugs in the Soniox streaming adapter:
37
+
38
+ | Bug | Before (broken) | After (fixed) |
39
+ |-----|-----------------|----------------|
40
+ | **Init message** | Config sent as URL query params | JSON text frame sent after `ws.onopen` (Soniox requires first frame to be JSON) |
41
+ | **Default model** | `stt-rt-preview` (deprecated/removed) | `stt-rt-v4` |
42
+ | **Close detection** | 1s threshold for early-close detection | 5s threshold (Soniox takes ~3s to close) |
43
+
44
+ The JSON init frame now includes `api_key`, `model`, `audio_format`, `sample_rate`, `num_channels`, and all optional config (diarization, language hints, context, etc.).
45
+
12
46
  #### Speechmatics: Fix Content-Type for URL-Based Batch Transcription
13
47
 
14
48
  Speechmatics `POST /v2/jobs` always requires `multipart/form-data`, but the URL path was sending a JSON body with `Content-Type: application/json`, causing HTTP 400 errors.
@@ -3413,7 +3413,7 @@ declare const OpenAIModel: {
3413
3413
  readonly "whisper-1": "whisper-1";
3414
3414
  };
3415
3415
  declare const OpenAIModelCodes: readonly ["gpt-4o-mini-realtime-preview", "gpt-4o-mini-realtime-preview-2024-12-17", "gpt-4o-mini-transcribe", "gpt-4o-mini-transcribe-2025-12-15", "gpt-4o-realtime-preview", "gpt-4o-realtime-preview-2024-10-01", "gpt-4o-realtime-preview-2024-12-17", "gpt-4o-realtime-preview-2025-06-03", "gpt-4o-transcribe", "gpt-4o-transcribe-diarize", "gpt-audio-1.5", "gpt-audio-mini", "gpt-audio-mini-2025-10-06", "gpt-audio-mini-2025-12-15", "gpt-realtime", "gpt-realtime-1.5", "gpt-realtime-2025-08-28", "gpt-realtime-mini", "gpt-realtime-mini-2025-10-06", "gpt-realtime-mini-2025-12-15", "whisper-1"];
3416
- declare const OpenAIModelLabels: Record<"gpt-4o-mini-transcribe" | "gpt-4o-mini-transcribe-2025-12-15" | "gpt-4o-transcribe" | "gpt-4o-transcribe-diarize" | "whisper-1" | "gpt-4o-mini-realtime-preview" | "gpt-4o-mini-realtime-preview-2024-12-17" | "gpt-4o-realtime-preview" | "gpt-4o-realtime-preview-2024-10-01" | "gpt-4o-realtime-preview-2024-12-17" | "gpt-4o-realtime-preview-2025-06-03" | "gpt-audio-1.5" | "gpt-audio-mini" | "gpt-audio-mini-2025-10-06" | "gpt-audio-mini-2025-12-15" | "gpt-realtime" | "gpt-realtime-1.5" | "gpt-realtime-2025-08-28" | "gpt-realtime-mini" | "gpt-realtime-mini-2025-10-06" | "gpt-realtime-mini-2025-12-15", string>;
3416
+ declare const OpenAIModelLabels: Record<"whisper-1" | "gpt-4o-transcribe" | "gpt-4o-mini-transcribe" | "gpt-4o-mini-transcribe-2025-12-15" | "gpt-4o-transcribe-diarize" | "gpt-4o-mini-realtime-preview" | "gpt-4o-mini-realtime-preview-2024-12-17" | "gpt-4o-realtime-preview" | "gpt-4o-realtime-preview-2024-10-01" | "gpt-4o-realtime-preview-2024-12-17" | "gpt-4o-realtime-preview-2025-06-03" | "gpt-audio-1.5" | "gpt-audio-mini" | "gpt-audio-mini-2025-10-06" | "gpt-audio-mini-2025-12-15" | "gpt-realtime" | "gpt-realtime-1.5" | "gpt-realtime-2025-08-28" | "gpt-realtime-mini" | "gpt-realtime-mini-2025-10-06" | "gpt-realtime-mini-2025-12-15", string>;
3417
3417
  /**
3418
3418
  * OpenAI Realtime API models (streaming)
3419
3419
  * @see scripts/generate-openai-models.js
@@ -3413,7 +3413,7 @@ declare const OpenAIModel: {
3413
3413
  readonly "whisper-1": "whisper-1";
3414
3414
  };
3415
3415
  declare const OpenAIModelCodes: readonly ["gpt-4o-mini-realtime-preview", "gpt-4o-mini-realtime-preview-2024-12-17", "gpt-4o-mini-transcribe", "gpt-4o-mini-transcribe-2025-12-15", "gpt-4o-realtime-preview", "gpt-4o-realtime-preview-2024-10-01", "gpt-4o-realtime-preview-2024-12-17", "gpt-4o-realtime-preview-2025-06-03", "gpt-4o-transcribe", "gpt-4o-transcribe-diarize", "gpt-audio-1.5", "gpt-audio-mini", "gpt-audio-mini-2025-10-06", "gpt-audio-mini-2025-12-15", "gpt-realtime", "gpt-realtime-1.5", "gpt-realtime-2025-08-28", "gpt-realtime-mini", "gpt-realtime-mini-2025-10-06", "gpt-realtime-mini-2025-12-15", "whisper-1"];
3416
- declare const OpenAIModelLabels: Record<"gpt-4o-mini-transcribe" | "gpt-4o-mini-transcribe-2025-12-15" | "gpt-4o-transcribe" | "gpt-4o-transcribe-diarize" | "whisper-1" | "gpt-4o-mini-realtime-preview" | "gpt-4o-mini-realtime-preview-2024-12-17" | "gpt-4o-realtime-preview" | "gpt-4o-realtime-preview-2024-10-01" | "gpt-4o-realtime-preview-2024-12-17" | "gpt-4o-realtime-preview-2025-06-03" | "gpt-audio-1.5" | "gpt-audio-mini" | "gpt-audio-mini-2025-10-06" | "gpt-audio-mini-2025-12-15" | "gpt-realtime" | "gpt-realtime-1.5" | "gpt-realtime-2025-08-28" | "gpt-realtime-mini" | "gpt-realtime-mini-2025-10-06" | "gpt-realtime-mini-2025-12-15", string>;
3416
+ declare const OpenAIModelLabels: Record<"whisper-1" | "gpt-4o-transcribe" | "gpt-4o-mini-transcribe" | "gpt-4o-mini-transcribe-2025-12-15" | "gpt-4o-transcribe-diarize" | "gpt-4o-mini-realtime-preview" | "gpt-4o-mini-realtime-preview-2024-12-17" | "gpt-4o-realtime-preview" | "gpt-4o-realtime-preview-2024-10-01" | "gpt-4o-realtime-preview-2024-12-17" | "gpt-4o-realtime-preview-2025-06-03" | "gpt-audio-1.5" | "gpt-audio-mini" | "gpt-audio-mini-2025-10-06" | "gpt-audio-mini-2025-12-15" | "gpt-realtime" | "gpt-realtime-1.5" | "gpt-realtime-2025-08-28" | "gpt-realtime-mini" | "gpt-realtime-mini-2025-10-06" | "gpt-realtime-mini-2025-12-15", string>;
3417
3417
  /**
3418
3418
  * OpenAI Realtime API models (streaming)
3419
3419
  * @see scripts/generate-openai-models.js