@volley/recognition-client-sdk 0.1.621 → 0.1.670
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/dist/browser.bundled.d.ts +36 -3
- package/dist/index.bundled.d.ts +88 -49
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +53 -11
- package/dist/index.js.map +3 -3
- package/dist/recog-client-sdk.browser.js +29 -10
- package/dist/recog-client-sdk.browser.js.map +3 -3
- package/dist/vgf-recognition-mapper.d.ts.map +1 -1
- package/dist/vgf-recognition-state.d.ts +6 -0
- package/dist/vgf-recognition-state.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/index.spec.ts +11 -0
- package/src/index.ts +4 -0
- package/src/recognition-client.ts +8 -8
- package/src/utils/message-handler.ts +1 -1
- package/src/vgf-recognition-mapper.ts +19 -1
- package/src/vgf-recognition-state.ts +4 -0
|
@@ -3737,11 +3737,14 @@ var RecognitionProvider;
|
|
|
3737
3737
|
RecognitionProvider2["DEEPGRAM"] = "deepgram";
|
|
3738
3738
|
RecognitionProvider2["ELEVENLABS"] = "elevenlabs";
|
|
3739
3739
|
RecognitionProvider2["FIREWORKS"] = "fireworks";
|
|
3740
|
+
RecognitionProvider2["GLADIA"] = "gladia";
|
|
3740
3741
|
RecognitionProvider2["GOOGLE"] = "google";
|
|
3741
3742
|
RecognitionProvider2["GEMINI_BATCH"] = "gemini-batch";
|
|
3742
3743
|
RecognitionProvider2["OPENAI_BATCH"] = "openai-batch";
|
|
3744
|
+
RecognitionProvider2["SELF_SERVE_VLLM"] = "self-serve-vllm";
|
|
3743
3745
|
RecognitionProvider2["OPENAI_REALTIME"] = "openai-realtime";
|
|
3744
3746
|
RecognitionProvider2["MISTRAL_VOXTRAL"] = "mistral-voxtral";
|
|
3747
|
+
RecognitionProvider2["CARTESIA"] = "cartesia";
|
|
3745
3748
|
RecognitionProvider2["DASHSCOPE"] = "dashscope";
|
|
3746
3749
|
RecognitionProvider2["TEST_ASR_PROVIDER_QUOTA"] = "test-asr-provider-quota";
|
|
3747
3750
|
RecognitionProvider2["TEST_ASR_STREAMING"] = "test-asr-streaming";
|
|
@@ -3783,10 +3786,13 @@ var FireworksModel;
|
|
|
3783
3786
|
FireworksModel2["WHISPER_V3"] = "whisper-v3";
|
|
3784
3787
|
FireworksModel2["WHISPER_V3_TURBO"] = "whisper-v3-turbo";
|
|
3785
3788
|
})(FireworksModel || (FireworksModel = {}));
|
|
3789
|
+
var GladiaModel;
|
|
3790
|
+
(function(GladiaModel2) {
|
|
3791
|
+
GladiaModel2["SOLARIA_1"] = "solaria-1";
|
|
3792
|
+
})(GladiaModel || (GladiaModel = {}));
|
|
3786
3793
|
var ElevenLabsModel;
|
|
3787
3794
|
(function(ElevenLabsModel2) {
|
|
3788
3795
|
ElevenLabsModel2["SCRIBE_V2_REALTIME"] = "scribe_v2_realtime";
|
|
3789
|
-
ElevenLabsModel2["SCRIBE_V1"] = "scribe_v1";
|
|
3790
3796
|
})(ElevenLabsModel || (ElevenLabsModel = {}));
|
|
3791
3797
|
var OpenAIRealtimeModel;
|
|
3792
3798
|
(function(OpenAIRealtimeModel2) {
|
|
@@ -3797,11 +3803,20 @@ var MistralVoxtralModel;
|
|
|
3797
3803
|
(function(MistralVoxtralModel2) {
|
|
3798
3804
|
MistralVoxtralModel2["VOXTRAL_MINI_REALTIME_2602"] = "voxtral-mini-transcribe-realtime-2602";
|
|
3799
3805
|
})(MistralVoxtralModel || (MistralVoxtralModel = {}));
|
|
3806
|
+
var CartesiaModel;
|
|
3807
|
+
(function(CartesiaModel2) {
|
|
3808
|
+
CartesiaModel2["INK_WHISPER"] = "ink-whisper";
|
|
3809
|
+
CartesiaModel2["INK_WHISPER_20250604"] = "ink-whisper-2025-06-04";
|
|
3810
|
+
})(CartesiaModel || (CartesiaModel = {}));
|
|
3800
3811
|
var DashScopeModel;
|
|
3801
3812
|
(function(DashScopeModel2) {
|
|
3802
3813
|
DashScopeModel2["QWEN3_ASR_FLASH_REALTIME_2602"] = "qwen3-asr-flash-realtime-2026-02-10";
|
|
3803
3814
|
DashScopeModel2["QWEN3_ASR_FLASH_REALTIME"] = "qwen3-asr-flash-realtime";
|
|
3804
3815
|
})(DashScopeModel || (DashScopeModel = {}));
|
|
3816
|
+
var SelfServeVllmModel;
|
|
3817
|
+
(function(SelfServeVllmModel2) {
|
|
3818
|
+
SelfServeVllmModel2["QWEN3_ASR_1_7B"] = "qwen3-asr-1.7b";
|
|
3819
|
+
})(SelfServeVllmModel || (SelfServeVllmModel = {}));
|
|
3805
3820
|
|
|
3806
3821
|
// ../../libs/types/dist/recognition-result-v1.types.js
|
|
3807
3822
|
var RecognitionResultTypeV1;
|
|
@@ -3826,6 +3841,7 @@ var TranscriptionResultSchemaV1 = z.object({
|
|
|
3826
3841
|
voiceStart: z.number().optional(),
|
|
3827
3842
|
voiceDuration: z.number().optional(),
|
|
3828
3843
|
voiceEnd: z.number().optional(),
|
|
3844
|
+
lastNonSilence: z.number().optional(),
|
|
3829
3845
|
startTimestamp: z.number().optional(),
|
|
3830
3846
|
endTimestamp: z.number().optional(),
|
|
3831
3847
|
receivedAtMs: z.number().optional(),
|
|
@@ -3873,6 +3889,9 @@ var MetadataResultSchemaV1 = z.object({
|
|
|
3873
3889
|
costInUSD: z.number().default(0).optional(),
|
|
3874
3890
|
// ASR API Type
|
|
3875
3891
|
apiType: z.nativeEnum(ASRApiType).optional(),
|
|
3892
|
+
// Provider identification
|
|
3893
|
+
provider: z.string().optional(),
|
|
3894
|
+
model: z.string().optional(),
|
|
3876
3895
|
// ASR configuration as JSON string (no type validation)
|
|
3877
3896
|
asrConfig: z.string().optional(),
|
|
3878
3897
|
// Raw ASR metadata payload as provided by the provider (stringified if needed)
|
|
@@ -5180,7 +5199,7 @@ var MessageHandler = class {
|
|
|
5180
5199
|
}
|
|
5181
5200
|
if (msg.data && typeof msg.data !== "object") {
|
|
5182
5201
|
if (this.callbacks.logger) {
|
|
5183
|
-
this.callbacks.logger("
|
|
5202
|
+
this.callbacks.logger("warn", "[RecogSDK] Received primitive msg.data from server", {
|
|
5184
5203
|
dataType: typeof msg.data,
|
|
5185
5204
|
data: msg.data,
|
|
5186
5205
|
fullMessage: msg
|
|
@@ -5435,7 +5454,7 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
|
|
|
5435
5454
|
const timeout = setTimeout(() => {
|
|
5436
5455
|
if (settled) return;
|
|
5437
5456
|
settled = true;
|
|
5438
|
-
this.log("warn",
|
|
5457
|
+
this.log("warn", `Connection timeout url=${this.config.url}`, { timeout: connectionTimeout, attempt });
|
|
5439
5458
|
this.state = "failed" /* FAILED */;
|
|
5440
5459
|
reject(new Error(`Connection timeout after ${connectionTimeout}ms`));
|
|
5441
5460
|
}, connectionTimeout);
|
|
@@ -5457,7 +5476,7 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
|
|
|
5457
5476
|
if (settled) return;
|
|
5458
5477
|
settled = true;
|
|
5459
5478
|
clearTimeout(timeout);
|
|
5460
|
-
this.log("warn",
|
|
5479
|
+
this.log("warn", `Connection error url=${this.config.url}`, { error, attempt });
|
|
5461
5480
|
this.state = "failed" /* FAILED */;
|
|
5462
5481
|
reject(error);
|
|
5463
5482
|
};
|
|
@@ -5472,14 +5491,14 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
|
|
|
5472
5491
|
lastError = error;
|
|
5473
5492
|
if (attempt < maxAttempts) {
|
|
5474
5493
|
const logLevel = attempt < 3 ? "info" : "warn";
|
|
5475
|
-
this.log(logLevel, `Connection attempt ${attempt} failed, retrying after ${delayMs}ms`, {
|
|
5494
|
+
this.log(logLevel, `Connection attempt ${attempt} failed, retrying after ${delayMs}ms url=${this.config.url}`, {
|
|
5476
5495
|
error: lastError.message,
|
|
5477
5496
|
nextAttempt: attempt + 1
|
|
5478
5497
|
});
|
|
5479
5498
|
this.state = "initial" /* INITIAL */;
|
|
5480
5499
|
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
5481
5500
|
} else {
|
|
5482
|
-
this.log("warn", `All ${maxAttempts} connection attempts failed`, {
|
|
5501
|
+
this.log("warn", `All ${maxAttempts} connection attempts failed url=${this.config.url}`, {
|
|
5483
5502
|
error: lastError.message
|
|
5484
5503
|
});
|
|
5485
5504
|
}
|
|
@@ -5502,7 +5521,7 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
|
|
|
5502
5521
|
blobToArrayBuffer(audioData).then((arrayBuffer) => {
|
|
5503
5522
|
this.sendAudioInternal(arrayBuffer);
|
|
5504
5523
|
}).catch((error) => {
|
|
5505
|
-
this.log("
|
|
5524
|
+
this.log("warn", "Failed to convert Blob to ArrayBuffer", error);
|
|
5506
5525
|
});
|
|
5507
5526
|
return;
|
|
5508
5527
|
}
|
|
@@ -5542,7 +5561,7 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
|
|
|
5542
5561
|
*/
|
|
5543
5562
|
async stopRecording() {
|
|
5544
5563
|
if (this.state !== "ready" /* READY */) {
|
|
5545
|
-
this.log("
|
|
5564
|
+
this.log("info", "stopRecording called but not in READY state", { state: this.state });
|
|
5546
5565
|
return;
|
|
5547
5566
|
}
|
|
5548
5567
|
this.log("debug", "Stopping recording");
|
|
@@ -5712,7 +5731,7 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
|
|
|
5712
5731
|
if (this.state === "stopping" /* STOPPING */) {
|
|
5713
5732
|
this.state = "stopped" /* STOPPED */;
|
|
5714
5733
|
} else if (this.state === "connected" /* CONNECTED */ || this.state === "ready" /* READY */ || this.state === "connecting" /* CONNECTING */) {
|
|
5715
|
-
this.log("
|
|
5734
|
+
this.log("warn", "[DIAGNOSTIC] Unexpected disconnection", {
|
|
5716
5735
|
code,
|
|
5717
5736
|
codeDescription: closeCodeDescription,
|
|
5718
5737
|
reason: reason || "(empty)",
|
|
@@ -5834,7 +5853,7 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
|
|
|
5834
5853
|
blobToArrayBuffer(audioData).then((arrayBuffer) => {
|
|
5835
5854
|
this.sendPrefixAudioInternal(arrayBuffer);
|
|
5836
5855
|
}).catch((error) => {
|
|
5837
|
-
this.log("
|
|
5856
|
+
this.log("warn", "Failed to convert Blob to ArrayBuffer for prefix audio", error);
|
|
5838
5857
|
});
|
|
5839
5858
|
return;
|
|
5840
5859
|
}
|