@volley/recognition-client-sdk 0.1.800 → 0.1.806

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,9 +1,40 @@
1
1
  import { z } from 'zod';
2
2
 
3
+ /**
4
+ * Gemini Model Types
5
+ * Based on available models as of January 2025
6
+ *
7
+ * API Version Notes:
8
+ * - Gemini 2.5+ models: Use v1beta API (early access features)
9
+ * - Gemini 2.0 models: Use v1beta API (early access features)
10
+ * - Gemini 1.5 models: Use v1 API (stable, production-ready)
11
+ *
12
+ * @see https://ai.google.dev/gemini-api/docs/models
13
+ * @see https://ai.google.dev/gemini-api/docs/api-versions
14
+ */
15
+ declare enum GeminiModel {
16
+ GEMINI_2_5_PRO = "gemini-2.5-pro",
17
+ GEMINI_2_5_FLASH = "gemini-2.5-flash",
18
+ GEMINI_2_5_FLASH_LITE = "gemini-2.5-flash-lite",
19
+ GEMINI_2_0_FLASH_LATEST = "gemini-2.0-flash-latest",
20
+ GEMINI_2_0_FLASH_EXP = "gemini-2.0-flash-exp"
21
+ }
22
+
23
+ /**
24
+ * OpenAI Batch API Model Types (HTTP API)
25
+ * @see https://platform.openai.com/docs/guides/speech-to-text
26
+ *
27
+ * Note: For openai-realtime provider models, see OpenAIRealtimeModel in provider.types.ts
28
+ */
29
+ declare enum OpenAIModel {
30
+ WHISPER_1 = "whisper-1"
31
+ }
32
+
3
33
  /**
4
34
  * Provider types and enums for recognition services
5
35
  * NOTE_TO_AI: DO NOT CHANGE THIS UNLESS EXPLICITLY ASKED. Always ask before making any changes.
6
36
  */
37
+
7
38
  /**
8
39
  * Supported speech recognition providers
9
40
  */
@@ -45,6 +76,17 @@ declare enum DeepgramModel {
45
76
  NOVA_3 = "nova-3",
46
77
  FLUX_GENERAL_EN = "flux-general-en"
47
78
  }
79
+ /**
80
+ * AssemblyAI streaming speech models
81
+ * @see https://www.assemblyai.com/docs/streaming/universal-streaming
82
+ * @see https://www.assemblyai.com/docs/streaming/universal-3-pro
83
+ */
84
+ declare enum AssemblyAIModel {
85
+ DEFAULT = "default",
86
+ UNIVERSAL_STREAMING_ENGLISH = "universal-streaming-english",
87
+ UNIVERSAL_STREAMING_MULTILINGUAL = "universal-streaming-multilingual",
88
+ U3_RT_PRO = "u3-rt-pro"
89
+ }
48
90
  /**
49
91
  * Google Cloud Speech models
50
92
  * @see https://cloud.google.com/speech-to-text/docs/transcription-model
@@ -169,7 +211,7 @@ declare enum SelfServeVllmModel {
169
211
  /**
170
212
  * Type alias for any model from any provider
171
213
  */
172
- type RecognitionModel = DeepgramModel | GoogleModel | FireworksModel | GladiaModel | ElevenLabsModel | OpenAIRealtimeModel | MistralVoxtralModel | CartesiaModel | DashScopeModel | InworldSttModel | SelfServeVllmModel | BedrockModel | AwsTranscribeModel | AmazonNovaSonicModel | string;
214
+ type RecognitionModel = AssemblyAIModel | DeepgramModel | GoogleModel | FireworksModel | GladiaModel | ElevenLabsModel | OpenAIModel | GeminiModel | OpenAIRealtimeModel | MistralVoxtralModel | CartesiaModel | DashScopeModel | InworldSttModel | SelfServeVllmModel | BedrockModel | AwsTranscribeModel | AmazonNovaSonicModel | string;
173
215
 
174
216
  /**
175
217
  * Recognition Result Types V1
@@ -797,6 +839,26 @@ declare const GameContextSchemaV1: z.ZodObject<{
797
839
  }>;
798
840
  type GameContextV1 = z.infer<typeof GameContextSchemaV1>;
799
841
 
842
+ /**
843
+ * Microphone Source Types
844
+ *
845
+ * Identifies which client-side audio capture path produced the audio.
846
+ * Paired with the upstream client capture enum — the recognition service
847
+ * always stores/uses this enum internally (never the raw wire string).
848
+ *
849
+ * Clients send the value as a string query param; normalize it to the enum
850
+ * at the SDK / server boundary via {@link coerceMicrophoneSourceType}.
851
+ */
852
+ /**
853
+ * Audio capture source path reported by the client.
854
+ */
855
+ declare enum MicrophoneSourceType {
856
+ /** Browser / legacy web capture path (default). */
857
+ WEB = "web",
858
+ /** Mobile native bridge path (MobileNativeSource) when supported. */
859
+ NATIVE = "native"
860
+ }
861
+
800
862
  /**
801
863
  * Unified ASR Request Configuration
802
864
  *
@@ -1327,6 +1389,14 @@ interface IRecognitionClientConfig {
1327
1389
  accountId?: string;
1328
1390
  /** Question answer identifier for tracking Q&A sessions (optional and tracking purpose only) */
1329
1391
  questionAnswerId?: string;
1392
+ /** Client identifier for downstream tracking/audio-labeling (optional and tracking purpose only) */
1393
+ clientId?: string;
1394
+ /**
1395
+ * Client audio capture path (optional). Accepts the {@link MicrophoneSourceType}
1396
+ * enum or its string value ('web' | 'native'). Defaults to 'web' on the server
1397
+ * when omitted. The service normalizes this to the enum at the boundary.
1398
+ */
1399
+ microphoneSourceType?: MicrophoneSourceType | string;
1330
1400
  /** Platform for audio recording device (optional, e.g., 'ios', 'android', 'web', 'unity') */
1331
1401
  platform?: string;
1332
1402
  /** Experiment cohort (optional). Defaults to 'control' if not provided. */
@@ -4,7 +4,7 @@
4
4
  * Simple builder pattern for RealTimeTwoWayWebSocketRecognitionClientConfig
5
5
  */
6
6
  import type { RealTimeTwoWayWebSocketRecognitionClientConfig, RecognitionCallbackUrl } from './recognition-client.types.js';
7
- import type { ASRRequestConfig, GameContextV1, TranscriptionResultV1, MetadataResultV1, SessionConfiguredV1, AudioMetricsResultV1, ErrorResultV1, Stage } from '@recog/shared-types';
7
+ import type { ASRRequestConfig, GameContextV1, TranscriptionResultV1, MetadataResultV1, SessionConfiguredV1, AudioMetricsResultV1, ErrorResultV1, Stage, MicrophoneSourceType } from '@recog/shared-types';
8
8
  /**
9
9
  * Builder for RealTimeTwoWayWebSocketRecognitionClientConfig
10
10
  *
@@ -82,6 +82,15 @@ export declare class ConfigBuilder {
82
82
  * Set question answer ID
83
83
  */
84
84
  questionAnswerId(id: string): this;
85
+ /**
86
+ * Set client ID (for downstream tracking/audio-labeling)
87
+ */
88
+ clientId(id: string): this;
89
+ /**
90
+ * Set the client audio capture path (MicrophoneSourceType enum or 'web' | 'native' string).
91
+ * Defaults to 'web' on the server when omitted.
92
+ */
93
+ microphoneSourceType(source: MicrophoneSourceType | string): this;
85
94
  /**
86
95
  * Set platform
87
96
  */
@@ -1 +1 @@
1
- {"version":3,"file":"config-builder.d.ts","sourceRoot":"","sources":["../src/config-builder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,8CAA8C,EAC9C,sBAAsB,EACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACV,gBAAgB,EAChB,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,KAAK,EACN,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAA+D;IAE7E;;;OAGG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAKtB;;;;;;;;OAQG;IACH,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI;IAKlC;;OAEG;IACH,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAKhD;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAKzC;;;OAGG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAKxB;;OAEG;IACH,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAKlC;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,sBAAsB,EAAE,GAAG,IAAI;IAKlD;;OAEG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAKxB;;OAEG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAK/B;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAK1B;;OAEG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAK3B;;OAEG;IACH,gBAAgB,CAAC,EAAE,EAAE,MA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ACH,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK3C;;OAEG;IACH,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAKrC;;OAEG;IAEH,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IAKvG;;OAEG;IACH,KAAK,IAAI,8CAA8C;CAGxD"}
@@ -1,9 +1,40 @@
1
1
  import { z } from 'zod';
2
2
 
3
+ /**
4
+ * Gemini Model Types
5
+ * Based on available models as of January 2025
6
+ *
7
+ * API Version Notes:
8
+ * - Gemini 2.5+ models: Use v1beta API (early access features)
9
+ * - Gemini 2.0 models: Use v1beta API (early access features)
10
+ * - Gemini 1.5 models: Use v1 API (stable, production-ready)
11
+ *
12
+ * @see https://ai.google.dev/gemini-api/docs/models
13
+ * @see https://ai.google.dev/gemini-api/docs/api-versions
14
+ */
15
+ declare enum GeminiModel {
16
+ GEMINI_2_5_PRO = "gemini-2.5-pro",
17
+ GEMINI_2_5_FLASH = "gemini-2.5-flash",
18
+ GEMINI_2_5_FLASH_LITE = "gemini-2.5-flash-lite",
19
+ GEMINI_2_0_FLASH_LATEST = "gemini-2.0-flash-latest",
20
+ GEMINI_2_0_FLASH_EXP = "gemini-2.0-flash-exp"
21
+ }
22
+
23
+ /**
24
+ * OpenAI Batch API Model Types (HTTP API)
25
+ * @see https://platform.openai.com/docs/guides/speech-to-text
26
+ *
27
+ * Note: For openai-realtime provider models, see OpenAIRealtimeModel in provider.types.ts
28
+ */
29
+ declare enum OpenAIModel {
30
+ WHISPER_1 = "whisper-1"
31
+ }
32
+
3
33
  /**
4
34
  * Provider types and enums for recognition services
5
35
  * NOTE_TO_AI: DO NOT CHANGE THIS UNLESS EXPLICITLY ASKED. Always ask before making any changes.
6
36
  */
37
+
7
38
  /**
8
39
  * Supported speech recognition providers
9
40
  */
@@ -45,6 +76,17 @@ declare enum DeepgramModel {
45
76
  NOVA_3 = "nova-3",
46
77
  FLUX_GENERAL_EN = "flux-general-en"
47
78
  }
79
+ /**
80
+ * AssemblyAI streaming speech models
81
+ * @see https://www.assemblyai.com/docs/streaming/universal-streaming
82
+ * @see https://www.assemblyai.com/docs/streaming/universal-3-pro
83
+ */
84
+ declare enum AssemblyAIModel {
85
+ DEFAULT = "default",
86
+ UNIVERSAL_STREAMING_ENGLISH = "universal-streaming-english",
87
+ UNIVERSAL_STREAMING_MULTILINGUAL = "universal-streaming-multilingual",
88
+ U3_RT_PRO = "u3-rt-pro"
89
+ }
48
90
  /**
49
91
  * Google Cloud Speech models
50
92
  * @see https://cloud.google.com/speech-to-text/docs/transcription-model
@@ -169,7 +211,7 @@ declare enum SelfServeVllmModel {
169
211
  /**
170
212
  * Type alias for any model from any provider
171
213
  */
172
- type RecognitionModel = DeepgramModel | GoogleModel | FireworksModel | GladiaModel | ElevenLabsModel | OpenAIRealtimeModel | MistralVoxtralModel | CartesiaModel | DashScopeModel | InworldSttModel | SelfServeVllmModel | BedrockModel | AwsTranscribeModel | AmazonNovaSonicModel | string;
214
+ type RecognitionModel = AssemblyAIModel | DeepgramModel | GoogleModel | FireworksModel | GladiaModel | ElevenLabsModel | OpenAIModel | GeminiModel | OpenAIRealtimeModel | MistralVoxtralModel | CartesiaModel | DashScopeModel | InworldSttModel | SelfServeVllmModel | BedrockModel | AwsTranscribeModel | AmazonNovaSonicModel | string;
173
215
 
174
216
  /**
175
217
  * Recognition Result Types V1
@@ -1527,6 +1569,26 @@ declare const ASRRequestSchemaV1: z.ZodObject<{
1527
1569
  }>;
1528
1570
  type ASRRequestV1 = z.infer<typeof ASRRequestSchemaV1>;
1529
1571
 
1572
+ /**
1573
+ * Microphone Source Types
1574
+ *
1575
+ * Identifies which client-side audio capture path produced the audio.
1576
+ * Paired with the upstream client capture enum — the recognition service
1577
+ * always stores/uses this enum internally (never the raw wire string).
1578
+ *
1579
+ * Clients send the value as a string query param; normalize it to the enum
1580
+ * at the SDK / server boundary via {@link coerceMicrophoneSourceType}.
1581
+ */
1582
+ /**
1583
+ * Audio capture source path reported by the client.
1584
+ */
1585
+ declare enum MicrophoneSourceType {
1586
+ /** Browser / legacy web capture path (default). */
1587
+ WEB = "web",
1588
+ /** Mobile native bridge path (MobileNativeSource) when supported. */
1589
+ NATIVE = "native"
1590
+ }
1591
+
1530
1592
  /**
1531
1593
  * Unified ASR Request Configuration
1532
1594
  *
@@ -1811,36 +1873,6 @@ type PartialASRRequestConfig = Partial<ASRRequestConfig>;
1811
1873
  */
1812
1874
  declare function createDefaultASRConfig(overrides?: PartialASRRequestConfig): ASRRequestConfig;
1813
1875
 
1814
- /**
1815
- * Gemini Model Types
1816
- * Based on available models as of January 2025
1817
- *
1818
- * API Version Notes:
1819
- * - Gemini 2.5+ models: Use v1beta API (early access features)
1820
- * - Gemini 2.0 models: Use v1beta API (early access features)
1821
- * - Gemini 1.5 models: Use v1 API (stable, production-ready)
1822
- *
1823
- * @see https://ai.google.dev/gemini-api/docs/models
1824
- * @see https://ai.google.dev/gemini-api/docs/api-versions
1825
- */
1826
- declare enum GeminiModel {
1827
- GEMINI_2_5_PRO = "gemini-2.5-pro",
1828
- GEMINI_2_5_FLASH = "gemini-2.5-flash",
1829
- GEMINI_2_5_FLASH_LITE = "gemini-2.5-flash-lite",
1830
- GEMINI_2_0_FLASH_LATEST = "gemini-2.0-flash-latest",
1831
- GEMINI_2_0_FLASH_EXP = "gemini-2.0-flash-exp"
1832
- }
1833
-
1834
- /**
1835
- * OpenAI Batch API Model Types (HTTP API)
1836
- * @see https://platform.openai.com/docs/guides/speech-to-text
1837
- *
1838
- * Note: For openai-realtime provider models, see OpenAIRealtimeModel in provider.types.ts
1839
- */
1840
- declare enum OpenAIModel {
1841
- WHISPER_1 = "whisper-1"
1842
- }
1843
-
1844
1876
  /**
1845
1877
  * Standard stage/environment constants used across all services
1846
1878
  */
@@ -2096,6 +2128,14 @@ interface IRecognitionClientConfig {
2096
2128
  accountId?: string;
2097
2129
  /** Question answer identifier for tracking Q&A sessions (optional and tracking purpose only) */
2098
2130
  questionAnswerId?: string;
2131
+ /** Client identifier for downstream tracking/audio-labeling (optional and tracking purpose only) */
2132
+ clientId?: string;
2133
+ /**
2134
+ * Client audio capture path (optional). Accepts the {@link MicrophoneSourceType}
2135
+ * enum or its string value ('web' | 'native'). Defaults to 'web' on the server
2136
+ * when omitted. The service normalizes this to the enum at the boundary.
2137
+ */
2138
+ microphoneSourceType?: MicrophoneSourceType | string;
2099
2139
  /** Platform for audio recording device (optional, e.g., 'ios', 'android', 'web', 'unity') */
2100
2140
  platform?: string;
2101
2141
  /** Experiment cohort (optional). Defaults to 'control' if not provided. */
@@ -2596,6 +2636,15 @@ declare class ConfigBuilder {
2596
2636
  * Set question answer ID
2597
2637
  */
2598
2638
  questionAnswerId(id: string): this;
2639
+ /**
2640
+ * Set client ID (for downstream tracking/audio-labeling)
2641
+ */
2642
+ clientId(id: string): this;
2643
+ /**
2644
+ * Set the client audio capture path (MicrophoneSourceType enum or 'web' | 'native' string).
2645
+ * Defaults to 'web' on the server when omitted.
2646
+ */
2647
+ microphoneSourceType(source: MicrophoneSourceType | string): this;
2599
2648
  /**
2600
2649
  * Set platform
2601
2650
  */
@@ -2805,6 +2854,8 @@ declare const RecognitionVGFStateSchema: z.ZodObject<{
2805
2854
  functionCallMetadata: z.ZodOptional<z.ZodString>;
2806
2855
  functionCallConfidence: z.ZodOptional<z.ZodNumber>;
2807
2856
  finalFunctionCallTimestamp: z.ZodOptional<z.ZodString>;
2857
+ gameId: z.ZodOptional<z.ZodString>;
2858
+ gamePhase: z.ZodOptional<z.ZodString>;
2808
2859
  promptSlotMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
2809
2860
  promptSTT: z.ZodOptional<z.ZodString>;
2810
2861
  promptSTF: z.ZodOptional<z.ZodString>;
@@ -2859,6 +2910,8 @@ declare const RecognitionVGFStateSchema: z.ZodObject<{
2859
2910
  functionCallMetadata?: string | undefined;
2860
2911
  functionCallConfidence?: number | undefined;
2861
2912
  finalFunctionCallTimestamp?: string | undefined;
2913
+ gameId?: string | undefined;
2914
+ gamePhase?: string | undefined;
2862
2915
  promptSlotMap?: Record<string, string[]> | undefined;
2863
2916
  promptSTT?: string | undefined;
2864
2917
  promptSTF?: string | undefined;
@@ -2901,6 +2954,8 @@ declare const RecognitionVGFStateSchema: z.ZodObject<{
2901
2954
  functionCallMetadata?: string | undefined;
2902
2955
  functionCallConfidence?: number | undefined;
2903
2956
  finalFunctionCallTimestamp?: string | undefined;
2957
+ gameId?: string | undefined;
2958
+ gamePhase?: string | undefined;
2904
2959
  promptSlotMap?: Record<string, string[]> | undefined;
2905
2960
  promptSTT?: string | undefined;
2906
2961
  promptSTF?: string | undefined;
@@ -2931,6 +2986,7 @@ declare const TranscriptionStatus: {
2931
2986
  };
2932
2987
  type TranscriptionStatusType = typeof TranscriptionStatus[keyof typeof TranscriptionStatus];
2933
2988
  declare function createInitialRecognitionState(audioUtteranceId: string): RecognitionState;
2989
+ declare function isTerminal(state: Pick<RecognitionState, "transcriptionStatus">): boolean;
2934
2990
  declare function isValidRecordingStatusTransition(from: string | undefined, to: string): boolean;
2935
2991
 
2936
2992
  /**
@@ -3015,9 +3071,42 @@ declare class SimplifiedVGFRecognitionClient implements ISimplifiedVGFRecognitio
3015
3071
  sendGameContext(context: GameContextV1): void;
3016
3072
  isServerReady(): boolean;
3017
3073
  getVGFState(): RecognitionState;
3018
- private isTerminalStatus;
3019
3074
  private notifyStateChange;
3020
3075
  }
3076
+ /**
3077
+ * Fluent builder for {@link SimplifiedVGFClientConfig}.
3078
+ *
3079
+ * Extends {@link ConfigBuilder} with the two VGF-specific fields
3080
+ * (`onStateChange`, `initialState`) so the simplified client has the same
3081
+ * builder ergonomics as the base RealTimeTwoWayWebSocketRecognitionClient.
3082
+ *
3083
+ * Example:
3084
+ * ```typescript
3085
+ * import { STAGES, RecognitionProvider } from '@recog/shared-types';
3086
+ *
3087
+ * const config = new SimplifiedVGFConfigBuilder()
3088
+ * .stage(STAGES.STAGING)
3089
+ * .asrRequestConfig({ provider: RecognitionProvider.DEEPGRAM, language: 'en' })
3090
+ * .onStateChange((state) => setVGFState(state))
3091
+ * .build();
3092
+ * ```
3093
+ */
3094
+ declare class SimplifiedVGFConfigBuilder extends ConfigBuilder {
3095
+ private vgfConfig;
3096
+ /**
3097
+ * Set the VGF state-change callback, fired whenever the VGF state updates.
3098
+ */
3099
+ onStateChange(callback: (state: RecognitionState) => void): this;
3100
+ /**
3101
+ * Set the initial VGF state to restore from a previous session.
3102
+ * The audioUtteranceId is extracted from it when valid.
3103
+ */
3104
+ initialState(state: RecognitionState): this;
3105
+ /**
3106
+ * Build the SimplifiedVGFClientConfig (base fields + VGF fields).
3107
+ */
3108
+ build(): SimplifiedVGFClientConfig;
3109
+ }
3021
3110
  /**
3022
3111
  * Factory function for creating simplified client
3023
3112
  * Usage examples:
@@ -3062,6 +3151,24 @@ declare class SimplifiedVGFRecognitionClient implements ISimplifiedVGFRecognitio
3062
3151
  * // VGF state automatically updates based on transcription results
3063
3152
  */
3064
3153
  declare function createSimplifiedVGFClient(config: SimplifiedVGFClientConfig): ISimplifiedVGFRecognitionClient;
3154
+ /**
3155
+ * Create a simplified VGF client using the builder pattern.
3156
+ *
3157
+ * Mirror of `createClientWithBuilder` for the base client.
3158
+ *
3159
+ * Example:
3160
+ * ```typescript
3161
+ * import { STAGES, RecognitionProvider } from '@recog/shared-types';
3162
+ *
3163
+ * const client = createSimplifiedVGFClientWithBuilder((builder) =>
3164
+ * builder
3165
+ * .stage(STAGES.STAGING)
3166
+ * .asrRequestConfig({ provider: RecognitionProvider.DEEPGRAM, language: 'en' })
3167
+ * .onStateChange((state) => setVGFState(state))
3168
+ * );
3169
+ * ```
3170
+ */
3171
+ declare function createSimplifiedVGFClientWithBuilder(configure: (builder: SimplifiedVGFConfigBuilder) => SimplifiedVGFConfigBuilder): ISimplifiedVGFRecognitionClient;
3065
3172
 
3066
3173
  /**
3067
3174
  * VGF Recognition Mapper
@@ -3128,5 +3235,5 @@ declare function getRecognitionConductorHttpBase(stage?: Stage | string | null |
3128
3235
  declare function getRecognitionConductorWsBase(stage?: Stage | string | null | undefined): string;
3129
3236
  declare function getRecognitionConductorHost(stage?: Stage | string | null | undefined): string;
3130
3237
 
3131
- export { AmazonNovaSonicModel, AudioEncoding, AwsTranscribeModel, BedrockModel, CartesiaModel, ClientControlActionV1, ClientState, ConfigBuilder, ConnectionError, ControlSignalTypeV1 as ControlSignal, ControlSignalTypeV1, DashScopeModel, DeepgramModel, ElevenLabsModel, ErrorTypeV1, FinalTranscriptStability, FireworksModel, GeminiModel, GladiaModel, GoogleModel, Language, MistralVoxtralModel, OpenAIModel, OpenAIRealtimeModel, RECOGNITION_CONDUCTOR_BASES, RECOGNITION_SERVICE_BASES, RealTimeTwoWayWebSocketRecognitionClient, RecognitionContextTypeV1, RecognitionError, RecognitionProvider, RecognitionResultTypeV1, RecognitionVGFStateSchema, RecordingStatus, STAGES, SampleRate, SelfServeVllmModel, SimplifiedVGFRecognitionClient, TimeoutError, TranscriptionStatus, ValidationError, createClient, createClientWithBuilder, createDefaultASRConfig, createInitialRecognitionState, createSimplifiedVGFClient, getRecognitionConductorBase, getRecognitionConductorHost, getRecognitionConductorHttpBase, getRecognitionConductorWsBase, getRecognitionServiceBase, getRecognitionServiceHost, getRecognitionServiceHttpBase, getRecognitionServiceWsBase, getUserFriendlyMessage, isExceptionImmediatelyAvailable, isNormalDisconnection, isValidRecordingStatusTransition, normalizeStage, resetRecognitionVGFState };
3238
+ export { AmazonNovaSonicModel, AssemblyAIModel, AudioEncoding, AwsTranscribeModel, BedrockModel, CartesiaModel, ClientControlActionV1, ClientState, ConfigBuilder, ConnectionError, ControlSignalTypeV1 as ControlSignal, ControlSignalTypeV1, DashScopeModel, DeepgramModel, ElevenLabsModel, ErrorTypeV1, FinalTranscriptStability, FireworksModel, GeminiModel, GladiaModel, GoogleModel, Language, MicrophoneSourceType, MistralVoxtralModel, OpenAIModel, OpenAIRealtimeModel, RECOGNITION_CONDUCTOR_BASES, RECOGNITION_SERVICE_BASES, RealTimeTwoWayWebSocketRecognitionClient, RecognitionContextTypeV1, RecognitionError, RecognitionProvider, RecognitionResultTypeV1, RecognitionVGFStateSchema, RecordingStatus, STAGES, SampleRate, SelfServeVllmModel, SimplifiedVGFConfigBuilder, SimplifiedVGFRecognitionClient, TimeoutError, TranscriptionStatus, ValidationError, createClient, createClientWithBuilder, createDefaultASRConfig, createInitialRecognitionState, createSimplifiedVGFClient, createSimplifiedVGFClientWithBuilder, getRecognitionConductorBase, getRecognitionConductorHost, getRecognitionConductorHttpBase, getRecognitionConductorWsBase, getRecognitionServiceBase, getRecognitionServiceHost, getRecognitionServiceHttpBase, getRecognitionServiceWsBase, getUserFriendlyMessage, isExceptionImmediatelyAvailable, isNormalDisconnection, isTerminal, isValidRecordingStatusTransition, normalizeStage, resetRecognitionVGFState };
3132
3239
  export type { ASRRequestConfig, ASRRequestV1, AudioMetricsResultV1, AuthenticationException, ConnectionException, ErrorResultV1, FunctionCallResultV1, GameContextV1, IRecognitionClient, IRecognitionClientConfig, IRecognitionClientStats, ISimplifiedVGFRecognitionClient, MetadataResultV1, ProviderException, QuotaExceededException, RealTimeTwoWayWebSocketRecognitionClientConfig, RecognitionCallbackUrl, RecognitionException, RecognitionState, RecordingStatusType, SimplifiedVGFClientConfig, SlotMap, Stage, TimeoutException, TranscriptionResult, TranscriptionResultV1, TranscriptionStatusType, UnknownException, ValidationException };
package/dist/index.d.ts CHANGED
@@ -6,11 +6,11 @@ export { RecognitionError, ConnectionError, TimeoutError, ValidationError } from
6
6
  export { ErrorTypeV1 } from '@recog/shared-types';
7
7
  export type { RecognitionException, ConnectionException, TimeoutException, ValidationException, AuthenticationException, ProviderException, QuotaExceededException, UnknownException } from '@recog/shared-types';
8
8
  export { isExceptionImmediatelyAvailable, getUserFriendlyMessage } from '@recog/shared-types';
9
- export { SimplifiedVGFRecognitionClient, createSimplifiedVGFClient, type ISimplifiedVGFRecognitionClient, type SimplifiedVGFClientConfig } from './simplified-vgf-recognition-client.js';
10
- export { type RecognitionState, RecognitionVGFStateSchema, RecordingStatus, TranscriptionStatus, type RecordingStatusType, type TranscriptionStatusType, createInitialRecognitionState, isValidRecordingStatusTransition } from './vgf-recognition-state.js';
9
+ export { SimplifiedVGFRecognitionClient, SimplifiedVGFConfigBuilder, createSimplifiedVGFClient, createSimplifiedVGFClientWithBuilder, type ISimplifiedVGFRecognitionClient, type SimplifiedVGFClientConfig } from './simplified-vgf-recognition-client.js';
10
+ export { type RecognitionState, RecognitionVGFStateSchema, RecordingStatus, TranscriptionStatus, type RecordingStatusType, type TranscriptionStatusType, createInitialRecognitionState, isTerminal, isValidRecordingStatusTransition } from './vgf-recognition-state.js';
11
11
  export { resetRecognitionVGFState } from './vgf-recognition-mapper.js';
12
12
  export { AudioEncoding } from '@recog/websocket';
13
13
  export { type GameContextV1, type SlotMap, RecognitionContextTypeV1, ControlSignalTypeV1, ControlSignalTypeV1 as ControlSignal, // Alias for backward compatibility
14
- type TranscriptionResultV1, type FunctionCallResultV1, type MetadataResultV1, type AudioMetricsResultV1, type ErrorResultV1, RecognitionResultTypeV1, ClientControlActionV1, type ASRRequestConfig, type ASRRequestV1, FinalTranscriptStability, createDefaultASRConfig, RecognitionProvider, DeepgramModel, ElevenLabsModel, FireworksModel, GladiaModel, GoogleModel, GeminiModel, OpenAIModel, SelfServeVllmModel, OpenAIRealtimeModel, MistralVoxtralModel, CartesiaModel, DashScopeModel, BedrockModel, AwsTranscribeModel, AmazonNovaSonicModel, Language, SampleRate, STAGES, type Stage } from '@recog/shared-types';
14
+ type TranscriptionResultV1, type FunctionCallResultV1, type MetadataResultV1, type AudioMetricsResultV1, type ErrorResultV1, RecognitionResultTypeV1, ClientControlActionV1, type ASRRequestConfig, type ASRRequestV1, FinalTranscriptStability, createDefaultASRConfig, RecognitionProvider, AssemblyAIModel, DeepgramModel, ElevenLabsModel, FireworksModel, GladiaModel, GoogleModel, GeminiModel, OpenAIModel, SelfServeVllmModel, OpenAIRealtimeModel, MistralVoxtralModel, CartesiaModel, DashScopeModel, BedrockModel, AwsTranscribeModel, AmazonNovaSonicModel, Language, SampleRate, MicrophoneSourceType, STAGES, type Stage } from '@recog/shared-types';
15
15
  export { getRecognitionServiceBase, getRecognitionServiceHttpBase, getRecognitionServiceWsBase, getRecognitionServiceHost, getRecognitionConductorBase, getRecognitionConductorHttpBase, getRecognitionConductorWsBase, getRecognitionConductorHost, normalizeStage, RECOGNITION_SERVICE_BASES, RECOGNITION_CONDUCTOR_BASES } from '@recog/shared-config';
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,wCAAwC,EACxC,KAAK,8CAA8C,EACnD,KAAK,mBAAmB,EACxB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,WAAW,EACZ,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAGrE,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,eAAe,EAChB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,E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