voice-router-dev 0.6.5 → 0.6.6

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
@@ -5,6 +5,73 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.6.6] - 2026-01-14
9
+
10
+ ### Added
11
+
12
+ #### Lightweight Field Metadata Export (solves 2.8MB type bundle OOM issue)
13
+
14
+ ### Fixed
15
+
16
+ #### Encoding Format Documentation Clarification
17
+
18
+ Fixed misleading documentation that showed provider-specific encoding formats instead of unified SDK format:
19
+
20
+ | Provider | SDK Unified Format | Provider API Format |
21
+ |----------|-------------------|---------------------|
22
+ | Gladia | `linear16` | `wav/pcm` |
23
+ | Gladia | `mulaw` | `wav/ulaw` |
24
+ | Gladia | `alaw` | `wav/alaw` |
25
+ | AssemblyAI | `linear16` | `pcm_s16le` |
26
+ | Deepgram | `linear16` | `linear16` |
27
+
28
+ **When using VoiceRouter or adapters**, always use the unified format (`linear16`, `mulaw`, `alaw`). The SDK handles translation to provider-specific formats automatically.
29
+
30
+ **Field-configs** show provider-native values (what the API expects). These are correct for direct API usage but different from VoiceRouter unified format.
31
+
32
+ ---
33
+
34
+ #### Lightweight Field Metadata Export (solves 2.8MB type bundle OOM issue)
35
+
36
+ New `voice-router-dev/field-metadata` export provides pre-computed field metadata **without** the heavy Zod schema types:
37
+
38
+ - **156 KB** types vs **2.8 MB** for `field-configs`
39
+ - **18x reduction** in type declaration size
40
+ - **No Zod dependency** - plain TypeScript const arrays
41
+ - Same field information: name, type, required, description, options, min/max, etc.
42
+
43
+ ```typescript
44
+ // Lightweight import - 156KB types (was 2.8MB OOM-inducing)
45
+ import {
46
+ GLADIA_STREAMING_FIELDS,
47
+ GladiaStreamingFieldName,
48
+ PROVIDER_FIELDS,
49
+ FieldMetadata
50
+ } from 'voice-router-dev/field-metadata'
51
+
52
+ // Use for UI rendering without loading heavy Zod schemas
53
+ GLADIA_STREAMING_FIELDS.forEach(field => {
54
+ if (field.type === 'select' && field.options) {
55
+ renderDropdown(field.name, field.options)
56
+ }
57
+ })
58
+
59
+ // Type-safe field names still work
60
+ const fieldName: GladiaStreamingFieldName = 'encoding' // ✓
61
+ // const bad: GladiaStreamingFieldName = 'typo' // ✗ TypeScript error
62
+ ```
63
+
64
+ **When to use which:**
65
+
66
+ | Use Case | Import |
67
+ |----------|--------|
68
+ | UI form generation (no validation) | `voice-router-dev/field-metadata` (156KB) |
69
+ | Runtime Zod validation needed | `voice-router-dev/field-configs` (2.8MB) |
70
+
71
+ Generated by new build script: `pnpm openapi:generate-field-metadata`
72
+
73
+ ---
74
+
8
75
  ## [0.6.5] - 2026-01-13
9
76
 
10
77
  ### Added
package/README.md CHANGED
@@ -484,11 +484,11 @@ const session = await router.transcribeStream({
484
484
  sampleRate: 16000
485
485
  });
486
486
 
487
- // Type-safe Gladia encoding
487
+ // Type-safe Gladia encoding - use unified format
488
488
  const gladiaSession = await router.transcribeStream({
489
489
  provider: 'gladia',
490
- encoding: StreamingSupportedEncodingEnum['wav/pcm'],
491
- sampleRate: StreamingSupportedSampleRateEnum['16000']
490
+ encoding: 'linear16', // Unified format - mapped to Gladia's 'wav/pcm'
491
+ sampleRate: 16000
492
492
  });
493
493
  ```
494
494
 
@@ -509,7 +509,7 @@ const deepgramSession = await router.transcribeStream({
509
509
  // Gladia streaming - with typed gladiaStreaming options
510
510
  const gladiaSession = await router.transcribeStream({
511
511
  provider: 'gladia',
512
- encoding: 'wav/pcm',
512
+ encoding: 'linear16', // Unified format - mapped to Gladia's 'wav/pcm'
513
513
  sampleRate: 16000,
514
514
  gladiaStreaming: {
515
515
  realtime_processing: { words_accurate_timestamps: true },
@@ -567,6 +567,34 @@ type EncodingOptions = GladiaStreamingConfig['encoding']
567
567
  - `GladiaStreamingConfig`, `DeepgramTranscriptionConfig`, `AzureTranscriptionConfig`, etc.
568
568
  - `GladiaStreamingSchema`, `DeepgramTranscriptionSchema`, etc. (Zod schemas for advanced extraction)
569
569
 
570
+ ### Lightweight Field Metadata (Performance-Optimized)
571
+
572
+ For UI form generation without heavy Zod schema types (156KB vs 2.8MB):
573
+
574
+ ```typescript
575
+ // Lightweight import - 156KB types instead of 2.8MB
576
+ import {
577
+ GLADIA_STREAMING_FIELDS,
578
+ GladiaStreamingFieldName,
579
+ PROVIDER_FIELDS,
580
+ FieldMetadata
581
+ } from 'voice-router-dev/field-metadata'
582
+
583
+ // Pre-computed field metadata - no Zod at runtime
584
+ GLADIA_STREAMING_FIELDS.forEach(field => {
585
+ if (field.type === 'select' && field.options) {
586
+ renderDropdown(field.name, field.options)
587
+ }
588
+ })
589
+ ```
590
+
591
+ **When to use which:**
592
+
593
+ | Use Case | Import | Types Size |
594
+ |----------|--------|------------|
595
+ | UI form generation (no validation) | `field-metadata` | 156 KB |
596
+ | Runtime Zod validation needed | `field-configs` | 2.8 MB |
597
+
570
598
  ## Requirements
571
599
 
572
600
  - **Node.js**: 20.0.0 or higher