voice-runtime 1.0.1 → 1.2.0
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/README.md +50 -25
- package/dist/index.cjs +22192 -10270
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +1324 -399
- package/dist/index.js +22198 -10302
- package/dist/index.js.map +4 -4
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import WebSocket from 'ws';
|
|
1
|
+
import * as WebSocket from 'ws';
|
|
2
|
+
import WebSocket__default from 'ws';
|
|
2
3
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
3
4
|
import { AddressInfo } from 'node:net';
|
|
4
5
|
|
|
@@ -226,6 +227,48 @@ declare class MemorySessionQuotaExceededError extends DurableError {
|
|
|
226
227
|
constructor(sessionId: string, usedBytes: number, requestedBytes: number, maxBytes: number);
|
|
227
228
|
}
|
|
228
229
|
|
|
230
|
+
/** Canonical cross-provider error codes shared by runtime and adapters. */
|
|
231
|
+
declare const TVIC_ERROR_CODES: Readonly<{
|
|
232
|
+
readonly providerAuthFailed: "provider.auth_failed";
|
|
233
|
+
readonly providerRateLimited: "provider.rate_limited";
|
|
234
|
+
readonly providerQuotaExceeded: "provider.quota_exceeded";
|
|
235
|
+
readonly providerTransportWriteFailed: "provider.transport_write_failed";
|
|
236
|
+
readonly providerTransportTimeout: "provider.transport_timeout";
|
|
237
|
+
readonly providerModelUnsupported: "provider.model_unsupported";
|
|
238
|
+
readonly providerVoiceUnsupported: "provider.voice_unsupported";
|
|
239
|
+
readonly providerInputRejected: "provider.input_rejected";
|
|
240
|
+
readonly providerInvalidRequest: "provider.invalid_request";
|
|
241
|
+
readonly providerSessionExpired: "provider.session_expired";
|
|
242
|
+
readonly providerProtocolInvalid: "provider.protocol_invalid";
|
|
243
|
+
readonly providerSequenceInvalid: "provider.sequence_invalid";
|
|
244
|
+
readonly providerUpstreamFailed: "provider.upstream_failed";
|
|
245
|
+
readonly providerIdentityMismatch: "provider.identity_mismatch";
|
|
246
|
+
readonly providerStreamBufferOverflow: "provider.stream_buffer_overflow";
|
|
247
|
+
readonly sttSessionBufferOverflow: "stt.session_buffer_overflow";
|
|
248
|
+
readonly sttCommitInFlight: "stt.commit_in_flight";
|
|
249
|
+
readonly llmProviderFailed: "llm.provider.failed";
|
|
250
|
+
readonly sttTransportUnexpectedEof: "stt.transport.unexpected_eof";
|
|
251
|
+
readonly ttsTransportUnexpectedEof: "tts.transport.unexpected_eof";
|
|
252
|
+
readonly llmProviderUnexpectedEof: "llm.provider.unexpected_eof";
|
|
253
|
+
}>;
|
|
254
|
+
/** One-release aliases accepted at provider and persisted-data boundaries. */
|
|
255
|
+
declare const TVIC_ERROR_CODE_ALIASES: Readonly<{
|
|
256
|
+
readonly "stt.provider.auth_failed": "provider.auth_failed";
|
|
257
|
+
readonly "stt.provider.rate_limited": "provider.rate_limited";
|
|
258
|
+
readonly "stt.provider.quota_exceeded": "provider.quota_exceeded";
|
|
259
|
+
readonly "stt.transport.write_failed": "provider.transport_write_failed";
|
|
260
|
+
readonly "stt.send_timeout": "provider.transport_timeout";
|
|
261
|
+
readonly "stt.audio_write_timeout": "provider.transport_timeout";
|
|
262
|
+
readonly "stt.provider.invalid_request": "provider.invalid_request";
|
|
263
|
+
readonly "stt.provider.input_rejected": "provider.input_rejected";
|
|
264
|
+
readonly "stt.provider.session_expired": "provider.session_expired";
|
|
265
|
+
readonly "stt.provider.protocol_error": "provider.protocol_invalid";
|
|
266
|
+
readonly "stt.provider.service_unavailable": "provider.upstream_failed";
|
|
267
|
+
readonly "stt.provider.internal": "provider.upstream_failed";
|
|
268
|
+
readonly "model.unsupported": "provider.model_unsupported";
|
|
269
|
+
readonly "voice.unsupported": "provider.voice_unsupported";
|
|
270
|
+
readonly "stt.model_unsupported": "provider.model_unsupported";
|
|
271
|
+
}>;
|
|
229
272
|
declare const TELEPHONY_SAMPLE_RATE_HZ = 8000;
|
|
230
273
|
declare const RUNTIME_SAMPLE_RATE_HZ = 16000;
|
|
231
274
|
declare const PCM16_16K_MONO: {
|
|
@@ -242,11 +285,14 @@ declare const PROVIDER_NAMES: {
|
|
|
242
285
|
readonly twilio: "twilio-media-streams";
|
|
243
286
|
readonly deepgram: "deepgram";
|
|
244
287
|
readonly cartesia: "cartesia";
|
|
288
|
+
readonly cartesiaStt: "cartesia-stt";
|
|
245
289
|
readonly elevenlabs: "elevenlabs";
|
|
246
290
|
readonly elevenlabsStt: "elevenlabs-stt-realtime";
|
|
247
291
|
readonly sarvam: "sarvam";
|
|
292
|
+
readonly sarvamTts: "sarvam-tts";
|
|
248
293
|
readonly assemblyaiStt: "assemblyai-stt";
|
|
249
294
|
readonly sonioxStt: "soniox-stt";
|
|
295
|
+
readonly groq: "groq-chat-completions";
|
|
250
296
|
readonly openaiResponses: "openai-responses";
|
|
251
297
|
readonly webClientAudio: "web-client-audio";
|
|
252
298
|
};
|
|
@@ -257,30 +303,40 @@ declare const PROVIDER_ERROR_CODES: {
|
|
|
257
303
|
readonly elevenlabsTts: "elevenlabs.tts.error";
|
|
258
304
|
readonly elevenlabsStt: "elevenlabs.stt.error";
|
|
259
305
|
readonly sarvamStt: "sarvam.stt.error";
|
|
306
|
+
readonly sarvamTts: "sarvam.tts.error";
|
|
260
307
|
readonly assemblyaiStt: "assemblyai.stt.error";
|
|
261
308
|
readonly sonioxStt: "soniox.stt.error";
|
|
309
|
+
readonly groqChat: "groq.chat.error";
|
|
310
|
+
readonly groqHttp: "groq.http_error";
|
|
311
|
+
readonly groqResponseFailed: "groq.response.failed";
|
|
312
|
+
readonly groqProtocol: "groq.protocol.error";
|
|
262
313
|
readonly openaiResponses: "openai.responses.error";
|
|
263
314
|
readonly openaiHttp: "openai.http_error";
|
|
264
315
|
readonly openaiResponseFailed: "openai.response.failed";
|
|
265
316
|
readonly webClientAudio: "web_client_audio.error";
|
|
317
|
+
readonly cartesiaStt: "cartesia.stt.error";
|
|
266
318
|
};
|
|
267
319
|
/** Stable runtime taxonomy consumed by reconnect and call-failure policy. */
|
|
268
320
|
declare const STT_ERROR_CODES: {
|
|
269
|
-
readonly transportWriteFailed: "
|
|
321
|
+
readonly transportWriteFailed: "provider.transport_write_failed";
|
|
322
|
+
readonly transportTimeout: "provider.transport_timeout";
|
|
270
323
|
readonly unexpectedEof: "stt.transport.unexpected_eof";
|
|
271
324
|
readonly connectFailed: "stt.transport.connect_failed";
|
|
272
325
|
readonly connectTimeout: "stt.transport.connect_timeout";
|
|
273
|
-
readonly authFailed: "
|
|
274
|
-
readonly invalidRequest: "
|
|
275
|
-
readonly inputRejected: "
|
|
276
|
-
readonly rateLimited: "
|
|
277
|
-
readonly quotaExceeded: "
|
|
278
|
-
readonly serviceUnavailable: "
|
|
279
|
-
readonly providerInternal: "
|
|
280
|
-
readonly protocolError: "
|
|
281
|
-
readonly sessionExpired: "
|
|
326
|
+
readonly authFailed: "provider.auth_failed";
|
|
327
|
+
readonly invalidRequest: "provider.invalid_request";
|
|
328
|
+
readonly inputRejected: "provider.input_rejected";
|
|
329
|
+
readonly rateLimited: "provider.rate_limited";
|
|
330
|
+
readonly quotaExceeded: "provider.quota_exceeded";
|
|
331
|
+
readonly serviceUnavailable: "provider.upstream_failed";
|
|
332
|
+
readonly providerInternal: "provider.upstream_failed";
|
|
333
|
+
readonly protocolError: "provider.protocol_invalid";
|
|
334
|
+
readonly sessionExpired: "provider.session_expired";
|
|
282
335
|
readonly streamEnded: "stt.stream_ended";
|
|
336
|
+
readonly audioWriteTimeout: "provider.transport_timeout";
|
|
337
|
+
readonly closeTimeout: "stt.close_timeout";
|
|
283
338
|
readonly bufferOverflow: "stt.reconnect.buffer_overflow";
|
|
339
|
+
readonly sessionBufferOverflow: "stt.session_buffer_overflow";
|
|
284
340
|
readonly recoveryExhausted: "stt.reconnect.recovery_exhausted";
|
|
285
341
|
readonly closed: "stt.reconnect.closed";
|
|
286
342
|
};
|
|
@@ -774,58 +830,13 @@ interface FailedCall extends CallBase {
|
|
|
774
830
|
readonly startedAt?: Timestamp;
|
|
775
831
|
}
|
|
776
832
|
type Call = CreatedCall | RingingCall | ConnectedCall | EndedCall | FailedCall;
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
readonly turnSequence: number;
|
|
785
|
-
}
|
|
786
|
-
interface SessionBase {
|
|
787
|
-
readonly id: SessionId;
|
|
788
|
-
readonly agentId: AgentId;
|
|
789
|
-
readonly channel: ChannelKind;
|
|
790
|
-
readonly callId?: CallId;
|
|
791
|
-
/**
|
|
792
|
-
* Reserved for a future durable reference index. The runtime currently
|
|
793
|
-
* leaves this empty; memory adapters and session-end snapshots are the
|
|
794
|
-
* authoritative memory surfaces.
|
|
795
|
-
*/
|
|
796
|
-
readonly memoryRefs: readonly MemoryEntryId[];
|
|
797
|
-
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
798
|
-
readonly createdAt: Timestamp;
|
|
799
|
-
readonly state: SessionState;
|
|
800
|
-
}
|
|
801
|
-
interface CreatedSession extends SessionBase {
|
|
802
|
-
readonly status: "created";
|
|
803
|
-
}
|
|
804
|
-
interface StartingSession extends SessionBase {
|
|
805
|
-
readonly status: "starting";
|
|
806
|
-
}
|
|
807
|
-
interface ActiveSession extends SessionBase {
|
|
808
|
-
readonly status: "active" | "interrupted" | "waiting_for_tool" | "ending";
|
|
809
|
-
readonly startedAt: Timestamp;
|
|
810
|
-
}
|
|
811
|
-
type TerminalSessionStatus = "completed" | "failed" | "cancelled";
|
|
812
|
-
interface TerminalSessionBase extends SessionBase {
|
|
813
|
-
readonly startedAt: Timestamp;
|
|
814
|
-
readonly endedAt: Timestamp;
|
|
815
|
-
}
|
|
816
|
-
interface CompletedSession extends TerminalSessionBase {
|
|
817
|
-
readonly status: "completed";
|
|
818
|
-
}
|
|
819
|
-
interface FailedSession extends TerminalSessionBase {
|
|
820
|
-
readonly status: "failed";
|
|
821
|
-
readonly error: NormalizedError;
|
|
822
|
-
}
|
|
823
|
-
interface CancelledSession extends TerminalSessionBase {
|
|
824
|
-
readonly status: "cancelled";
|
|
825
|
-
readonly cancelReason: SessionCancellationReason;
|
|
826
|
-
}
|
|
827
|
-
type TerminalSession = CompletedSession | FailedSession | CancelledSession;
|
|
828
|
-
type Session = CreatedSession | StartingSession | ActiveSession | TerminalSession;
|
|
833
|
+
/**
|
|
834
|
+
* The immutable value a managed runtime passes across its call boundary.
|
|
835
|
+
* Runtime validation supplies the deep-freeze guarantee; this alias keeps
|
|
836
|
+
* that boundary visible to TypeScript consumers without creating a second
|
|
837
|
+
* call union.
|
|
838
|
+
*/
|
|
839
|
+
type CallSnapshot = Readonly<Call>;
|
|
829
840
|
|
|
830
841
|
type TurnCancellationReason = "barge_in" | "dtmf" | "explicit" | "timeout" | "not_heard" | "transport_lost" | "lease_lost" | "runtime_restarted";
|
|
831
842
|
type TurnStatus = "started" | "listening" | "thinking" | "calling_tool" | "speaking" | "interrupted" | "completed" | "cancelled" | "failed";
|
|
@@ -913,6 +924,12 @@ interface ProviderStreamingCapabilities {
|
|
|
913
924
|
/** Streaming is supported by the provider protocol, not emulated by chunked requests. */
|
|
914
925
|
readonly native: boolean;
|
|
915
926
|
}
|
|
927
|
+
interface ProviderBatchCapabilities {
|
|
928
|
+
/** Accepts one complete input payload instead of requiring a live stream. */
|
|
929
|
+
readonly input: boolean;
|
|
930
|
+
/** Returns one complete output payload instead of incremental events. */
|
|
931
|
+
readonly output: boolean;
|
|
932
|
+
}
|
|
916
933
|
interface ProviderCancellationCapabilities {
|
|
917
934
|
/** Active provider work can be stopped rather than merely ignored by TVIC. */
|
|
918
935
|
readonly request: boolean;
|
|
@@ -947,11 +964,13 @@ interface ProviderPlayoutCapabilities {
|
|
|
947
964
|
*/
|
|
948
965
|
interface ProviderCapabilities {
|
|
949
966
|
readonly streaming: ProviderStreamingCapabilities;
|
|
967
|
+
readonly batch?: ProviderBatchCapabilities;
|
|
950
968
|
readonly cancellation: ProviderCancellationCapabilities;
|
|
951
969
|
readonly transports: readonly ProviderTransport[];
|
|
952
970
|
readonly audio?: ProviderAudioCapabilities;
|
|
953
971
|
readonly languages?: readonly string[];
|
|
954
972
|
readonly models?: readonly string[];
|
|
973
|
+
readonly batchModels?: readonly string[];
|
|
955
974
|
readonly voices?: readonly string[];
|
|
956
975
|
readonly turnDetection?: readonly TurnDetectionMode[];
|
|
957
976
|
readonly tools?: ProviderToolCapabilities;
|
|
@@ -980,12 +999,14 @@ type RequiredProviderCapabilities<T extends object> = {
|
|
|
980
999
|
interface ProviderRequirements {
|
|
981
1000
|
readonly kind: ProviderKind;
|
|
982
1001
|
readonly streaming?: RequiredProviderCapabilities<ProviderStreamingCapabilities>;
|
|
1002
|
+
readonly batch?: RequiredProviderCapabilities<ProviderBatchCapabilities>;
|
|
983
1003
|
readonly cancellation?: RequiredProviderCapabilities<ProviderCancellationCapabilities>;
|
|
984
1004
|
readonly transport?: ProviderTransport;
|
|
985
1005
|
readonly inputFormat?: AudioFormat;
|
|
986
1006
|
readonly outputFormat?: AudioFormat;
|
|
987
1007
|
readonly language?: string;
|
|
988
1008
|
readonly model?: string;
|
|
1009
|
+
readonly batchModel?: string;
|
|
989
1010
|
readonly voice?: string;
|
|
990
1011
|
readonly turnDetection?: TurnDetectionMode;
|
|
991
1012
|
readonly functionCalling?: boolean;
|
|
@@ -995,7 +1016,7 @@ interface ProviderRequirements {
|
|
|
995
1016
|
readonly region?: string;
|
|
996
1017
|
readonly dataPolicy?: ProviderDataPolicy;
|
|
997
1018
|
}
|
|
998
|
-
type ProviderCompatibilityIssueCode = "kind.unsupported" | "streaming.unsupported" | "cancellation.unsupported" | "transport.unsupported" | "audio.input_unsupported" | "audio.output_unsupported" | "language.unsupported" | "
|
|
1019
|
+
type ProviderCompatibilityIssueCode = "kind.unsupported" | "streaming.unsupported" | "batch.unsupported" | "cancellation.unsupported" | "transport.unsupported" | "audio.input_unsupported" | "audio.output_unsupported" | "language.unsupported" | "provider.model_unsupported" | "provider.voice_unsupported" | "turn_detection.unsupported" | "tools.unsupported" | "playout.unsupported" | "call_control.unsupported" | "region.unsupported" | "data_policy.unsupported";
|
|
999
1020
|
interface ProviderCompatibilityIssue {
|
|
1000
1021
|
readonly code: ProviderCompatibilityIssueCode;
|
|
1001
1022
|
readonly requirement: string;
|
|
@@ -1103,6 +1124,37 @@ interface SttOpenRequest {
|
|
|
1103
1124
|
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
1104
1125
|
readonly signal?: AbortSignal;
|
|
1105
1126
|
}
|
|
1127
|
+
type SttBatchTimestampGranularity = "word";
|
|
1128
|
+
/** A complete audio payload for a non-streaming transcription request. */
|
|
1129
|
+
interface SttBatchTranscriptionRequest {
|
|
1130
|
+
/** Container bytes, or raw bytes when `format` is supplied. */
|
|
1131
|
+
readonly audio: Uint8Array;
|
|
1132
|
+
/** Optional filename used as the multipart upload filename and format hint. */
|
|
1133
|
+
readonly fileName?: string;
|
|
1134
|
+
/** Optional MIME type for the multipart file part. */
|
|
1135
|
+
readonly mimeType?: string;
|
|
1136
|
+
/** Raw PCM format. Omit this when `audio` contains a self-describing container. */
|
|
1137
|
+
readonly format?: AudioFormat;
|
|
1138
|
+
readonly language?: string;
|
|
1139
|
+
readonly model?: string;
|
|
1140
|
+
readonly timestampGranularities?: readonly SttBatchTimestampGranularity[];
|
|
1141
|
+
readonly allowUnknownModel?: boolean;
|
|
1142
|
+
readonly signal?: AbortSignal;
|
|
1143
|
+
}
|
|
1144
|
+
interface SttBatchWord {
|
|
1145
|
+
readonly word: string;
|
|
1146
|
+
readonly startMs: number;
|
|
1147
|
+
readonly endMs: number;
|
|
1148
|
+
}
|
|
1149
|
+
/** A complete transcript returned by a batch STT provider. */
|
|
1150
|
+
interface SttBatchTranscription {
|
|
1151
|
+
readonly text: string;
|
|
1152
|
+
readonly requestId?: string;
|
|
1153
|
+
readonly language?: string;
|
|
1154
|
+
readonly durationMs?: number;
|
|
1155
|
+
readonly words?: readonly SttBatchWord[];
|
|
1156
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
1157
|
+
}
|
|
1106
1158
|
type SttCommitMode = "provider" | "none";
|
|
1107
1159
|
/**
|
|
1108
1160
|
* Origin of audio offsets emitted by an STT stream. Reconnectable streams must
|
|
@@ -1122,6 +1174,8 @@ interface SttStream {
|
|
|
1122
1174
|
interface SpeechToTextProvider extends Provider {
|
|
1123
1175
|
readonly kind: "stt";
|
|
1124
1176
|
open(request: SttOpenRequest): Promise<SttStream>;
|
|
1177
|
+
/** Optional complete-file transcription capability. */
|
|
1178
|
+
transcribe?(request: SttBatchTranscriptionRequest): Promise<SttBatchTranscription>;
|
|
1125
1179
|
}
|
|
1126
1180
|
|
|
1127
1181
|
interface TtsSessionOpenRequest {
|
|
@@ -1193,18 +1247,24 @@ interface IncrementalTextToSpeechProvider extends TextToSpeechProvider {
|
|
|
1193
1247
|
declare function isIncrementalTextToSpeechProvider(provider: TextToSpeechProvider): provider is IncrementalTextToSpeechProvider;
|
|
1194
1248
|
|
|
1195
1249
|
type LlmMessageRole = "system" | "user" | "assistant" | "tool";
|
|
1250
|
+
interface LlmInlineToolCall {
|
|
1251
|
+
readonly callRef: string;
|
|
1252
|
+
readonly toolName: ToolName;
|
|
1253
|
+
readonly input: unknown;
|
|
1254
|
+
}
|
|
1196
1255
|
interface LlmMessage {
|
|
1197
1256
|
readonly role: LlmMessageRole;
|
|
1198
1257
|
readonly content: string;
|
|
1199
1258
|
readonly toolCallRef?: string;
|
|
1200
1259
|
readonly toolName?: ToolName;
|
|
1260
|
+
/**
|
|
1261
|
+
* Tool calls emitted by an assistant message. Providers that use native
|
|
1262
|
+
* function-calling protocols need this envelope before the corresponding
|
|
1263
|
+
* `tool` result messages.
|
|
1264
|
+
*/
|
|
1265
|
+
readonly toolCalls?: readonly LlmInlineToolCall[];
|
|
1201
1266
|
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
1202
1267
|
}
|
|
1203
|
-
interface LlmInlineToolCall {
|
|
1204
|
-
readonly callRef: string;
|
|
1205
|
-
readonly toolName: ToolName;
|
|
1206
|
-
readonly input: unknown;
|
|
1207
|
-
}
|
|
1208
1268
|
interface LlmCompletionRequest {
|
|
1209
1269
|
readonly sessionId: SessionId;
|
|
1210
1270
|
readonly turnId: TurnId;
|
|
@@ -1498,6 +1558,8 @@ interface RuntimeOptions {
|
|
|
1498
1558
|
readonly clock?: Clock;
|
|
1499
1559
|
readonly idGenerator?: IdGenerator;
|
|
1500
1560
|
readonly durableStore?: DurableRuntimeStore;
|
|
1561
|
+
/** Whether the runtime may close an injected durable store during stop. */
|
|
1562
|
+
readonly durableStoreOwnership?: "runtime" | "caller";
|
|
1501
1563
|
/** Overrides for the explicit defaults; omitted values use the safe defaults. */
|
|
1502
1564
|
readonly durablePolicy?: Partial<DurableRuntimePolicy>;
|
|
1503
1565
|
readonly toolIdempotencyStore?: ToolIdempotencyStore;
|
|
@@ -1711,6 +1773,8 @@ interface HealthCheckResult {
|
|
|
1711
1773
|
readonly ok: boolean;
|
|
1712
1774
|
readonly latencyMs?: number;
|
|
1713
1775
|
readonly message?: string;
|
|
1776
|
+
/** Sanitized diagnostic details supplied by the owning subsystem. */
|
|
1777
|
+
readonly details?: Readonly<Record<string, unknown>>;
|
|
1714
1778
|
}
|
|
1715
1779
|
interface DurableRuntimeMetric {
|
|
1716
1780
|
readonly name: string;
|
|
@@ -1754,17 +1818,22 @@ interface StartSessionOptions {
|
|
|
1754
1818
|
readonly workflowId?: WorkflowId;
|
|
1755
1819
|
}
|
|
1756
1820
|
type EndSessionReason = "completed" | "cancelled" | "failed" | "timeout";
|
|
1821
|
+
type TerminalSource = "operator_stop" | "caller_abort" | "run_timeout" | "remote_transport" | "provider_runtime" | "normal_completion" | "runtime_recovery" | "runtime_shutdown" | "legacy_unknown";
|
|
1757
1822
|
type EndSessionRequest = {
|
|
1758
1823
|
readonly reason: "completed";
|
|
1824
|
+
readonly terminalSource?: "normal_completion" | "legacy_unknown";
|
|
1759
1825
|
} | {
|
|
1760
1826
|
readonly reason: "cancelled";
|
|
1761
1827
|
readonly cancelReason: SessionCancellationReason;
|
|
1828
|
+
readonly terminalSource?: "operator_stop" | "caller_abort" | "remote_transport" | "runtime_recovery" | "runtime_shutdown" | "legacy_unknown";
|
|
1762
1829
|
} | {
|
|
1763
1830
|
readonly reason: "failed";
|
|
1764
1831
|
readonly error: NormalizedError;
|
|
1832
|
+
readonly terminalSource?: "provider_runtime" | "legacy_unknown";
|
|
1765
1833
|
} | {
|
|
1766
1834
|
readonly reason: "timeout";
|
|
1767
1835
|
readonly error: NormalizedError;
|
|
1836
|
+
readonly terminalSource?: "run_timeout" | "legacy_unknown";
|
|
1768
1837
|
};
|
|
1769
1838
|
interface StartTurnRequest {
|
|
1770
1839
|
readonly sessionId: SessionId;
|
|
@@ -1823,7 +1892,7 @@ interface SessionAttachment {
|
|
|
1823
1892
|
}
|
|
1824
1893
|
interface RuntimeServiceLifecycle {
|
|
1825
1894
|
/** Starts the runtime. A runtime can be started once; create a new runtime after stop. */
|
|
1826
|
-
start(): Promise<void>;
|
|
1895
|
+
start(signal?: AbortSignal): Promise<void>;
|
|
1827
1896
|
/**
|
|
1828
1897
|
* Stops the runtime and closes its owned resources. The operation is
|
|
1829
1898
|
* idempotent and concurrent callers await the same teardown. A stopped
|
|
@@ -1833,6 +1902,13 @@ interface RuntimeServiceLifecycle {
|
|
|
1833
1902
|
readonly isRunning: boolean;
|
|
1834
1903
|
}
|
|
1835
1904
|
interface Runtime extends RuntimeServiceLifecycle {
|
|
1905
|
+
/**
|
|
1906
|
+
* Optional execution seam for low-level pipeline users. Registered runs are
|
|
1907
|
+
* cancelled and drained by `stop()` before the runtime closes its durable
|
|
1908
|
+
* stores. Managed voice agents already provide their own higher-level
|
|
1909
|
+
* lifecycle, but direct `PipelineVoiceLoop` callers need this ownership too.
|
|
1910
|
+
*/
|
|
1911
|
+
registerPipelineRun?(run: Promise<unknown>, cancel: () => void): () => void;
|
|
1836
1912
|
startSession(agent: Agent, options: StartSessionOptions): Promise<ActiveSession>;
|
|
1837
1913
|
startAttachedSession(agent: Agent, options: StartAttachedSessionOptions): Promise<SessionAttachment>;
|
|
1838
1914
|
attachSession(agent: Agent, sessionId: SessionId, options?: {
|
|
@@ -1875,6 +1951,60 @@ interface Runtime extends RuntimeServiceLifecycle {
|
|
|
1875
1951
|
readonly memory?: Memory;
|
|
1876
1952
|
}
|
|
1877
1953
|
|
|
1954
|
+
type SessionCancellationReason = "caller_hangup" | "transport_lost" | "recovery_expired" | "operator_requested" | "shutdown";
|
|
1955
|
+
type SessionStatus = "created" | "starting" | "active" | "interrupted" | "waiting_for_tool" | "ending" | "completed" | "failed" | "cancelled";
|
|
1956
|
+
interface SessionState {
|
|
1957
|
+
readonly variables: Readonly<Record<string, unknown>>;
|
|
1958
|
+
readonly currentTurnId?: TurnId;
|
|
1959
|
+
readonly pendingToolCallIds: readonly ToolCallId[];
|
|
1960
|
+
readonly turnSequence: number;
|
|
1961
|
+
}
|
|
1962
|
+
interface SessionBase {
|
|
1963
|
+
readonly id: SessionId;
|
|
1964
|
+
readonly agentId: AgentId;
|
|
1965
|
+
readonly channel: ChannelKind;
|
|
1966
|
+
readonly callId?: CallId;
|
|
1967
|
+
/**
|
|
1968
|
+
* Reserved for a future durable reference index. The runtime currently
|
|
1969
|
+
* leaves this empty; memory adapters and session-end snapshots are the
|
|
1970
|
+
* authoritative memory surfaces.
|
|
1971
|
+
*/
|
|
1972
|
+
readonly memoryRefs: readonly MemoryEntryId[];
|
|
1973
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
1974
|
+
readonly createdAt: Timestamp;
|
|
1975
|
+
readonly state: SessionState;
|
|
1976
|
+
}
|
|
1977
|
+
interface CreatedSession extends SessionBase {
|
|
1978
|
+
readonly status: "created";
|
|
1979
|
+
}
|
|
1980
|
+
interface StartingSession extends SessionBase {
|
|
1981
|
+
readonly status: "starting";
|
|
1982
|
+
}
|
|
1983
|
+
interface ActiveSession extends SessionBase {
|
|
1984
|
+
readonly status: "active" | "interrupted" | "waiting_for_tool" | "ending";
|
|
1985
|
+
readonly startedAt: Timestamp;
|
|
1986
|
+
}
|
|
1987
|
+
type TerminalSessionStatus = "completed" | "failed" | "cancelled";
|
|
1988
|
+
interface TerminalSessionBase extends SessionBase {
|
|
1989
|
+
readonly startedAt: Timestamp;
|
|
1990
|
+
readonly endedAt: Timestamp;
|
|
1991
|
+
/** Terminal provenance is optional only for legacy in-memory values. */
|
|
1992
|
+
readonly terminalSource?: TerminalSource;
|
|
1993
|
+
}
|
|
1994
|
+
interface CompletedSession extends TerminalSessionBase {
|
|
1995
|
+
readonly status: "completed";
|
|
1996
|
+
}
|
|
1997
|
+
interface FailedSession extends TerminalSessionBase {
|
|
1998
|
+
readonly status: "failed";
|
|
1999
|
+
readonly error: NormalizedError;
|
|
2000
|
+
}
|
|
2001
|
+
interface CancelledSession extends TerminalSessionBase {
|
|
2002
|
+
readonly status: "cancelled";
|
|
2003
|
+
readonly cancelReason: SessionCancellationReason;
|
|
2004
|
+
}
|
|
2005
|
+
type TerminalSession = CompletedSession | FailedSession | CancelledSession;
|
|
2006
|
+
type Session = CreatedSession | StartingSession | ActiveSession | TerminalSession;
|
|
2007
|
+
|
|
1878
2008
|
interface TerminalSessionDraft {
|
|
1879
2009
|
readonly id: SessionId;
|
|
1880
2010
|
readonly agentId: AgentId;
|
|
@@ -1889,19 +2019,25 @@ interface TerminalSessionDraft {
|
|
|
1889
2019
|
readonly endedAt: Timestamp;
|
|
1890
2020
|
}
|
|
1891
2021
|
declare function terminalSessionFromRequest(draft: TerminalSessionDraft, request: EndSessionRequest): TerminalSession;
|
|
2022
|
+
declare function terminalSourceForRequest(request: EndSessionRequest): TerminalSource;
|
|
1892
2023
|
declare function terminalTurnFromRequest(turn: ActiveTurn, request: EndTurnRequest, endedAt: Timestamp, durationMs: number): TerminalTurn;
|
|
1893
2024
|
declare function isTerminalSession(session: Session): session is TerminalSession;
|
|
1894
2025
|
declare function isTerminalTurn(turn: Turn): turn is TerminalTurn;
|
|
1895
2026
|
|
|
1896
2027
|
interface ProviderClock {
|
|
1897
2028
|
now(): Timestamp;
|
|
2029
|
+
/** Optional for backward-compatible injected clocks; adapters fall back to performance.now(). */
|
|
2030
|
+
monotonicNowMs?(): number;
|
|
1898
2031
|
}
|
|
1899
2032
|
|
|
2033
|
+
declare const TWILIO_MAX_AUDIO_EVENT_BYTES = 65536;
|
|
2034
|
+
|
|
1900
2035
|
interface TwilioMediaStreamSocket {
|
|
1901
2036
|
readonly readyState: number;
|
|
2037
|
+
readonly bufferedAmount?: number;
|
|
1902
2038
|
send(data: string): void;
|
|
1903
2039
|
close(code?: number, reason?: string): void;
|
|
1904
|
-
on(event: "message", handler: (data:
|
|
2040
|
+
on(event: "message", handler: (data: WebSocket__default.RawData) => void): this;
|
|
1905
2041
|
on(event: "close", handler: () => void): this;
|
|
1906
2042
|
on(event: "error", handler: (error: Error) => void): this;
|
|
1907
2043
|
}
|
|
@@ -1911,7 +2047,11 @@ interface TwilioMediaStreamCallHandleOptions {
|
|
|
1911
2047
|
readonly sessionId: SessionId;
|
|
1912
2048
|
readonly inputFormat?: AudioFormat;
|
|
1913
2049
|
readonly outputFormat?: AudioFormat;
|
|
2050
|
+
/** Values authenticated by the host and expected in Twilio's start frame. */
|
|
2051
|
+
readonly expectedTwilioCallSid?: string;
|
|
2052
|
+
readonly expectedAccountSid?: string;
|
|
1914
2053
|
readonly clock?: ProviderClock;
|
|
2054
|
+
readonly onClosed?: () => void;
|
|
1915
2055
|
}
|
|
1916
2056
|
declare class TwilioMediaStreamCallHandle implements CallHandle {
|
|
1917
2057
|
#private;
|
|
@@ -1924,6 +2064,8 @@ declare class TwilioMediaStreamCallHandle implements CallHandle {
|
|
|
1924
2064
|
close(reason: StreamEndReason): Promise<void>;
|
|
1925
2065
|
confirmPlayout(markId: string, timeoutMs: number): Promise<boolean>;
|
|
1926
2066
|
}
|
|
2067
|
+
|
|
2068
|
+
/** Accept-only bridge for a host-authenticated Twilio Media Streams socket. */
|
|
1927
2069
|
declare class TwilioMediaStreamsProvider implements TelephonyProvider {
|
|
1928
2070
|
#private;
|
|
1929
2071
|
readonly name: "twilio-media-streams";
|
|
@@ -1963,29 +2105,32 @@ declare class TwilioMediaStreamsProvider implements TelephonyProvider {
|
|
|
1963
2105
|
dial(): Promise<CallHandle>;
|
|
1964
2106
|
accept(ctx: Parameters<TelephonyProvider["accept"]>[0]): Promise<CallHandle>;
|
|
1965
2107
|
attachWebSocket(socket: TwilioMediaStreamSocket, callId: CallId, sessionId: SessionId): void;
|
|
1966
|
-
acceptWebSocket(socket: TwilioMediaStreamSocket, callId: CallId, sessionId: SessionId): Promise<TwilioMediaStreamCallHandle>;
|
|
1967
|
-
hangup(
|
|
2108
|
+
acceptWebSocket(socket: TwilioMediaStreamSocket, callId: CallId, sessionId: SessionId, options?: Pick<TwilioMediaStreamCallHandleOptions, "expectedTwilioCallSid" | "expectedAccountSid">): Promise<TwilioMediaStreamCallHandle>;
|
|
2109
|
+
hangup(callId: CallId): Promise<void>;
|
|
1968
2110
|
}
|
|
1969
2111
|
declare function createTwilioMediaStreamsProvider(): TwilioMediaStreamsProvider;
|
|
1970
2112
|
|
|
1971
2113
|
declare const WEB_CLIENT_AUDIO_CLOSE_CODES: {
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
2114
|
+
protocol: number;
|
|
2115
|
+
heartbeatTimeout: number;
|
|
2116
|
+
superseded: number;
|
|
2117
|
+
maxDuration: number;
|
|
2118
|
+
resourceLimit: number;
|
|
2119
|
+
operatorTerminated: number;
|
|
1978
2120
|
};
|
|
1979
2121
|
declare const WEB_CLIENT_AUDIO_DEFAULTS: {
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
2122
|
+
heartbeatIntervalMs: number;
|
|
2123
|
+
heartbeatTimeoutMs: number;
|
|
2124
|
+
maxSessionDurationMs: number;
|
|
2125
|
+
maxPendingEvents: number;
|
|
2126
|
+
maxInputFramesPerSecond: number;
|
|
2127
|
+
maxPendingAcks: number;
|
|
1986
2128
|
};
|
|
2129
|
+
declare const WEB_CLIENT_AUDIO_ACK_RETENTION_MS = 60000;
|
|
2130
|
+
|
|
1987
2131
|
interface WebClientAudioSocket {
|
|
1988
2132
|
readonly readyState: number;
|
|
2133
|
+
readonly bufferedAmount?: number;
|
|
1989
2134
|
send(data: string | Buffer): void;
|
|
1990
2135
|
close(code?: number, reason?: string): void;
|
|
1991
2136
|
on(event: "message", handler: (data: WebSocket.RawData, isBinary: boolean) => void): this;
|
|
@@ -2029,11 +2174,9 @@ interface WebClientAudioCallHandleOptions {
|
|
|
2029
2174
|
readonly onConnectionEvent?: (event: ConnectionObservabilityEvent) => void;
|
|
2030
2175
|
readonly onClosed?: () => void;
|
|
2031
2176
|
}
|
|
2032
|
-
|
|
2033
|
-
#private;
|
|
2177
|
+
interface WebClientAudioCallHandle extends CallHandle {
|
|
2034
2178
|
readonly callId: CallId;
|
|
2035
2179
|
readonly events: AsyncIterable<InboundMediaEvent>;
|
|
2036
|
-
constructor(options: WebClientAudioCallHandleOptions);
|
|
2037
2180
|
send(event: OutputMediaEvent): Promise<boolean>;
|
|
2038
2181
|
deliverText(turnId: TurnId, sequence: number, text: string): Promise<boolean>;
|
|
2039
2182
|
clear(): Promise<void>;
|
|
@@ -2041,45 +2184,16 @@ declare class WebClientAudioCallHandle implements CallHandle {
|
|
|
2041
2184
|
terminate(code: number, reason: string): void;
|
|
2042
2185
|
confirmPlayout(markId: string, timeoutMs: number): Promise<boolean>;
|
|
2043
2186
|
}
|
|
2187
|
+
declare const WebClientAudioCallHandle: {
|
|
2188
|
+
new (options: WebClientAudioCallHandleOptions): WebClientAudioCallHandle;
|
|
2189
|
+
};
|
|
2044
2190
|
interface WebClientAudioProviderOptions extends Omit<WebClientAudioCallHandleOptions, "socket" | "callId" | "sessionId" | "onClosed" | "expectedMode"> {
|
|
2045
2191
|
}
|
|
2046
|
-
|
|
2047
|
-
#private;
|
|
2192
|
+
interface WebClientAudioProvider extends TelephonyProvider {
|
|
2048
2193
|
readonly name: "web-client-audio";
|
|
2049
|
-
readonly kind
|
|
2050
|
-
readonly version
|
|
2051
|
-
readonly capabilities:
|
|
2052
|
-
streaming: {
|
|
2053
|
-
input: true;
|
|
2054
|
-
output: true;
|
|
2055
|
-
native: true;
|
|
2056
|
-
};
|
|
2057
|
-
cancellation: {
|
|
2058
|
-
request: true;
|
|
2059
|
-
output: true;
|
|
2060
|
-
buffer: true;
|
|
2061
|
-
truncation: false;
|
|
2062
|
-
};
|
|
2063
|
-
transports: "websocket"[];
|
|
2064
|
-
audio: {
|
|
2065
|
-
input: {
|
|
2066
|
-
readonly encoding: "pcm_s16le";
|
|
2067
|
-
readonly sampleRateHz: 16000;
|
|
2068
|
-
readonly channels: 1;
|
|
2069
|
-
}[];
|
|
2070
|
-
output: {
|
|
2071
|
-
readonly encoding: "pcm_s16le";
|
|
2072
|
-
readonly sampleRateHz: 16000;
|
|
2073
|
-
readonly channels: 1;
|
|
2074
|
-
}[];
|
|
2075
|
-
};
|
|
2076
|
-
playout: {
|
|
2077
|
-
clearBuffer: true;
|
|
2078
|
-
acknowledgement: true;
|
|
2079
|
-
position: false;
|
|
2080
|
-
};
|
|
2081
|
-
};
|
|
2082
|
-
constructor(options?: WebClientAudioProviderOptions);
|
|
2194
|
+
readonly kind: "telephony";
|
|
2195
|
+
readonly version: "0.1.0";
|
|
2196
|
+
readonly capabilities: ProviderCapabilities;
|
|
2083
2197
|
dial(): Promise<CallHandle>;
|
|
2084
2198
|
accept(ctx: Parameters<TelephonyProvider["accept"]>[0]): Promise<CallHandle>;
|
|
2085
2199
|
attachWebSocket(socket: WebClientAudioSocket, callId: CallId, sessionId: SessionId): void;
|
|
@@ -2089,6 +2203,9 @@ declare class WebClientAudioProvider implements TelephonyProvider {
|
|
|
2089
2203
|
hangup(callId: CallId): Promise<void>;
|
|
2090
2204
|
supersede(callId: CallId): Promise<void>;
|
|
2091
2205
|
}
|
|
2206
|
+
declare const WebClientAudioProvider: {
|
|
2207
|
+
new (options?: WebClientAudioProviderOptions): WebClientAudioProvider;
|
|
2208
|
+
};
|
|
2092
2209
|
declare function createWebClientAudioProvider(options?: WebClientAudioProviderOptions): WebClientAudioProvider;
|
|
2093
2210
|
|
|
2094
2211
|
interface DeepgramSttProviderOptions {
|
|
@@ -2099,8 +2216,9 @@ interface DeepgramSttProviderOptions {
|
|
|
2099
2216
|
readonly endpointingMs?: number;
|
|
2100
2217
|
readonly vadEvents?: boolean;
|
|
2101
2218
|
readonly punctuate?: boolean;
|
|
2102
|
-
readonly webSocketFactory?: (url: string, headers: Readonly<Record<string, string>>) =>
|
|
2219
|
+
readonly webSocketFactory?: (url: string, headers: Readonly<Record<string, string>>) => WebSocket__default;
|
|
2103
2220
|
}
|
|
2221
|
+
declare const MAX_PROVIDER_AUDIO_OFFSET_MS = 86400000;
|
|
2104
2222
|
declare class DeepgramSttProvider implements SpeechToTextProvider {
|
|
2105
2223
|
#private;
|
|
2106
2224
|
readonly name: "deepgram";
|
|
@@ -2135,6 +2253,72 @@ declare class DeepgramSttProvider implements SpeechToTextProvider {
|
|
|
2135
2253
|
}
|
|
2136
2254
|
declare function createDeepgramSttProvider(options: DeepgramSttProviderOptions): DeepgramSttProvider;
|
|
2137
2255
|
|
|
2256
|
+
type CartesiaSttMode = "manual" | "auto";
|
|
2257
|
+
interface CartesiaSttProviderOptions {
|
|
2258
|
+
readonly apiKey: string;
|
|
2259
|
+
readonly url?: string;
|
|
2260
|
+
readonly batchUrl?: string;
|
|
2261
|
+
readonly modelId?: string;
|
|
2262
|
+
readonly batchModelId?: string;
|
|
2263
|
+
readonly allowUnknownModel?: boolean;
|
|
2264
|
+
/** `manual` uses `/stt/websocket`; `auto` uses Ink's native turn detector. */
|
|
2265
|
+
readonly mode?: CartesiaSttMode;
|
|
2266
|
+
/** Used when a session request does not provide a language. Ink 2 can auto-detect. */
|
|
2267
|
+
readonly language?: string;
|
|
2268
|
+
readonly turnStartThreshold?: number;
|
|
2269
|
+
readonly turnEagerEndThreshold?: number;
|
|
2270
|
+
readonly turnEndThreshold?: number;
|
|
2271
|
+
readonly turnEndTimeoutMs?: number;
|
|
2272
|
+
readonly clock?: ProviderClock;
|
|
2273
|
+
readonly fetchImpl?: typeof fetch;
|
|
2274
|
+
readonly webSocketFactory?: (url: string, headers: Readonly<Record<string, string>>) => WebSocket__default;
|
|
2275
|
+
}
|
|
2276
|
+
declare class CartesiaSttProvider implements SpeechToTextProvider {
|
|
2277
|
+
#private;
|
|
2278
|
+
readonly name: "cartesia-stt";
|
|
2279
|
+
readonly kind = "stt";
|
|
2280
|
+
readonly version = "0.1.0";
|
|
2281
|
+
readonly capabilities: {
|
|
2282
|
+
streaming: {
|
|
2283
|
+
input: true;
|
|
2284
|
+
output: true;
|
|
2285
|
+
native: true;
|
|
2286
|
+
};
|
|
2287
|
+
batch: {
|
|
2288
|
+
input: true;
|
|
2289
|
+
output: true;
|
|
2290
|
+
};
|
|
2291
|
+
cancellation: {
|
|
2292
|
+
request: true;
|
|
2293
|
+
output: false;
|
|
2294
|
+
buffer: false;
|
|
2295
|
+
truncation: false;
|
|
2296
|
+
};
|
|
2297
|
+
transports: ("http" | "websocket")[];
|
|
2298
|
+
audio: {
|
|
2299
|
+
input: {
|
|
2300
|
+
readonly encoding: "pcm_s16le";
|
|
2301
|
+
readonly sampleRateHz: 16000;
|
|
2302
|
+
readonly channels: 1;
|
|
2303
|
+
}[];
|
|
2304
|
+
};
|
|
2305
|
+
models: readonly ["ink-2", "ink-preview", "ink-whisper-2025-06-04"];
|
|
2306
|
+
batchModels: readonly ["ink-whisper"];
|
|
2307
|
+
turnDetection: ("manual" | "provider")[];
|
|
2308
|
+
metadata: {
|
|
2309
|
+
realtimeModels: string[];
|
|
2310
|
+
autoTurnModels: string[];
|
|
2311
|
+
batchModels: string[];
|
|
2312
|
+
partialTranscripts: boolean;
|
|
2313
|
+
manualFinalize: boolean;
|
|
2314
|
+
};
|
|
2315
|
+
};
|
|
2316
|
+
constructor(options: CartesiaSttProviderOptions);
|
|
2317
|
+
open(request: SttOpenRequest): Promise<SttStream>;
|
|
2318
|
+
transcribe(request: SttBatchTranscriptionRequest): Promise<SttBatchTranscription>;
|
|
2319
|
+
}
|
|
2320
|
+
declare function createCartesiaSttProvider(options: CartesiaSttProviderOptions): CartesiaSttProvider;
|
|
2321
|
+
|
|
2138
2322
|
type SarvamOutputMode = "transcribe" | "translate" | "verbatim" | "translit" | "codemix";
|
|
2139
2323
|
interface SarvamSttProviderOptions {
|
|
2140
2324
|
readonly apiKey: string;
|
|
@@ -2146,7 +2330,7 @@ interface SarvamSttProviderOptions {
|
|
|
2146
2330
|
readonly flushSignal?: boolean;
|
|
2147
2331
|
readonly inputAudioCodec?: "pcm_s16le" | "pcm_l16" | "pcm_raw";
|
|
2148
2332
|
readonly clock?: ProviderClock;
|
|
2149
|
-
readonly webSocketFactory?: (url: string, headers: Readonly<Record<string, string>>) =>
|
|
2333
|
+
readonly webSocketFactory?: (url: string, headers: Readonly<Record<string, string>>) => WebSocket__default;
|
|
2150
2334
|
}
|
|
2151
2335
|
declare class SarvamSttProvider implements SpeechToTextProvider {
|
|
2152
2336
|
#private;
|
|
@@ -2179,7 +2363,7 @@ declare class SarvamSttProvider implements SpeechToTextProvider {
|
|
|
2179
2363
|
})[];
|
|
2180
2364
|
};
|
|
2181
2365
|
models: readonly ["saaras:v3", "saaras:v4"];
|
|
2182
|
-
turnDetection: ("
|
|
2366
|
+
turnDetection: ("manual" | "vad")[];
|
|
2183
2367
|
metadata: {
|
|
2184
2368
|
interimResults: boolean;
|
|
2185
2369
|
outputModes: string[];
|
|
@@ -2190,24 +2374,39 @@ declare class SarvamSttProvider implements SpeechToTextProvider {
|
|
|
2190
2374
|
}
|
|
2191
2375
|
declare function createSarvamSttProvider(options: SarvamSttProviderOptions): SarvamSttProvider;
|
|
2192
2376
|
|
|
2193
|
-
|
|
2194
|
-
interface ElevenLabsSttProviderOptions {
|
|
2377
|
+
interface SarvamTtsProviderOptions {
|
|
2195
2378
|
readonly apiKey: string;
|
|
2196
2379
|
readonly url?: string;
|
|
2197
|
-
readonly
|
|
2380
|
+
readonly voiceId?: string;
|
|
2198
2381
|
readonly modelId?: string;
|
|
2199
|
-
readonly
|
|
2200
|
-
|
|
2201
|
-
readonly
|
|
2202
|
-
|
|
2203
|
-
readonly
|
|
2382
|
+
readonly language?: string;
|
|
2383
|
+
/** Provider pace. Sarvam v3 accepts 0.5 through 2.0. */
|
|
2384
|
+
readonly pace?: number;
|
|
2385
|
+
/** Provider temperature. Sarvam's streaming schema accepts 0.01 through 1.0. */
|
|
2386
|
+
readonly temperature?: number;
|
|
2387
|
+
readonly minBufferSize?: number;
|
|
2388
|
+
readonly maxChunkLength?: number;
|
|
2389
|
+
readonly pronunciationDictionaryId?: string;
|
|
2390
|
+
readonly keepAliveIntervalMs?: number;
|
|
2204
2391
|
readonly clock?: ProviderClock;
|
|
2205
|
-
readonly webSocketFactory?: (url: string, headers: Readonly<Record<string, string>>) =>
|
|
2392
|
+
readonly webSocketFactory?: (url: string, headers: Readonly<Record<string, string>>) => WebSocket__default;
|
|
2206
2393
|
}
|
|
2207
|
-
|
|
2394
|
+
interface SarvamTtsStreamOptions {
|
|
2395
|
+
readonly clock: ProviderClock;
|
|
2396
|
+
readonly model: string;
|
|
2397
|
+
readonly language: string;
|
|
2398
|
+
readonly voice: string;
|
|
2399
|
+
readonly pace: number;
|
|
2400
|
+
readonly temperature: number;
|
|
2401
|
+
readonly minBufferSize: number;
|
|
2402
|
+
readonly maxChunkLength: number;
|
|
2403
|
+
readonly pronunciationDictionaryId?: string;
|
|
2404
|
+
readonly keepAliveIntervalMs: number;
|
|
2405
|
+
}
|
|
2406
|
+
declare class SarvamTtsProvider implements IncrementalTextToSpeechProvider {
|
|
2208
2407
|
#private;
|
|
2209
|
-
readonly name: "
|
|
2210
|
-
readonly kind = "
|
|
2408
|
+
readonly name: "sarvam-tts";
|
|
2409
|
+
readonly kind = "tts";
|
|
2211
2410
|
readonly version = "0.1.0";
|
|
2212
2411
|
readonly capabilities: {
|
|
2213
2412
|
streaming: {
|
|
@@ -2223,67 +2422,62 @@ declare class ElevenLabsSttProvider implements SpeechToTextProvider {
|
|
|
2223
2422
|
};
|
|
2224
2423
|
transports: "websocket"[];
|
|
2225
2424
|
audio: {
|
|
2226
|
-
|
|
2227
|
-
readonly encoding: "pcm_s16le";
|
|
2228
|
-
readonly sampleRateHz: 8000;
|
|
2229
|
-
readonly channels: 1;
|
|
2230
|
-
}, {
|
|
2425
|
+
output: {
|
|
2231
2426
|
readonly encoding: "pcm_s16le";
|
|
2232
2427
|
readonly sampleRateHz: 16000;
|
|
2233
2428
|
readonly channels: 1;
|
|
2234
|
-
}
|
|
2235
|
-
readonly encoding: "pcm_s16le";
|
|
2236
|
-
readonly sampleRateHz: 22050;
|
|
2237
|
-
readonly channels: 1;
|
|
2238
|
-
}, {
|
|
2239
|
-
readonly encoding: "pcm_s16le";
|
|
2240
|
-
readonly sampleRateHz: 24000;
|
|
2241
|
-
readonly channels: 1;
|
|
2242
|
-
}, {
|
|
2243
|
-
readonly encoding: "pcm_s16le";
|
|
2244
|
-
readonly sampleRateHz: 44100;
|
|
2245
|
-
readonly channels: 1;
|
|
2246
|
-
}, {
|
|
2247
|
-
readonly encoding: "pcm_s16le";
|
|
2248
|
-
readonly sampleRateHz: 48000;
|
|
2249
|
-
readonly channels: 1;
|
|
2250
|
-
}];
|
|
2429
|
+
}[];
|
|
2251
2430
|
};
|
|
2252
|
-
|
|
2253
|
-
|
|
2431
|
+
languages: readonly ["hi-IN", "bn-IN", "ta-IN", "te-IN", "gu-IN", "kn-IN", "ml-IN", "mr-IN", "pa-IN", "od-IN", "en-IN"];
|
|
2432
|
+
models: readonly ["bulbul:v3"];
|
|
2433
|
+
voices: readonly ["shubh", "aditya", "ritu", "priya", "neha", "rahul", "pooja", "rohan", "simran", "kavya", "amit", "dev", "ishita", "shreya", "ratan", "varun", "manan", "sumit", "roopa", "kabir", "aayan", "ashutosh", "advait", "anand", "tanya", "tarun", "sunny", "mani", "gokul", "vijay", "shruti", "suhani", "mohit", "kavitha", "rehan", "soham", "rupali"];
|
|
2254
2434
|
metadata: {
|
|
2255
|
-
|
|
2256
|
-
|
|
2435
|
+
outputAudioCodec: string;
|
|
2436
|
+
outputSampleRateHz: number;
|
|
2437
|
+
completionEvent: string;
|
|
2257
2438
|
};
|
|
2258
2439
|
};
|
|
2259
|
-
constructor(options:
|
|
2260
|
-
|
|
2440
|
+
constructor(options: SarvamTtsProviderOptions);
|
|
2441
|
+
synthesize(request: TtsSynthesisRequest): Promise<TtsStream>;
|
|
2442
|
+
openSession(request: TtsSessionOpenRequest): Promise<SarvamTtsStream>;
|
|
2261
2443
|
}
|
|
2262
|
-
declare
|
|
2444
|
+
declare class SarvamTtsStream implements TtsSession {
|
|
2445
|
+
#private;
|
|
2446
|
+
readonly events: AsyncIterable<TtsEvent>;
|
|
2447
|
+
constructor(socket: WebSocket__default, request: TtsSessionOpenRequest, options: SarvamTtsStreamOptions);
|
|
2448
|
+
sendText(text: string): Promise<void>;
|
|
2449
|
+
flush(): Promise<TtsFlushResult>;
|
|
2450
|
+
finish(): Promise<void>;
|
|
2451
|
+
keepAlive(): Promise<void>;
|
|
2452
|
+
cancel(): Promise<void>;
|
|
2453
|
+
}
|
|
2454
|
+
declare function createSarvamTtsProvider(options: SarvamTtsProviderOptions): SarvamTtsProvider;
|
|
2263
2455
|
|
|
2264
|
-
interface
|
|
2456
|
+
interface SarvamTtsHttpProviderOptions {
|
|
2265
2457
|
readonly apiKey: string;
|
|
2266
2458
|
readonly url?: string;
|
|
2459
|
+
readonly voiceId?: string;
|
|
2267
2460
|
readonly modelId?: string;
|
|
2268
|
-
readonly
|
|
2269
|
-
|
|
2270
|
-
readonly
|
|
2271
|
-
|
|
2272
|
-
readonly
|
|
2273
|
-
readonly
|
|
2461
|
+
readonly language?: string;
|
|
2462
|
+
/** Provider pace. Sarvam Bulbul v3 accepts 0.5 through 2.0. */
|
|
2463
|
+
readonly pace?: number;
|
|
2464
|
+
/** Provider temperature. Sarvam Bulbul v3 accepts 0.01 through 1.0. */
|
|
2465
|
+
readonly temperature?: number;
|
|
2466
|
+
readonly pronunciationDictionaryId?: string;
|
|
2274
2467
|
readonly clock?: ProviderClock;
|
|
2275
|
-
|
|
2468
|
+
/** Injectable fetch makes protocol and failure tests hermetic. */
|
|
2469
|
+
readonly fetchImpl?: typeof fetch;
|
|
2276
2470
|
}
|
|
2277
|
-
declare class
|
|
2471
|
+
declare class SarvamTtsRestProvider implements TextToSpeechProvider {
|
|
2278
2472
|
#private;
|
|
2279
|
-
readonly name: "
|
|
2280
|
-
readonly kind = "
|
|
2473
|
+
readonly name: "sarvam-tts";
|
|
2474
|
+
readonly kind = "tts";
|
|
2281
2475
|
readonly version = "0.1.0";
|
|
2282
2476
|
readonly capabilities: {
|
|
2283
2477
|
streaming: {
|
|
2284
|
-
input:
|
|
2285
|
-
output:
|
|
2286
|
-
native:
|
|
2478
|
+
input: false;
|
|
2479
|
+
output: false;
|
|
2480
|
+
native: false;
|
|
2287
2481
|
};
|
|
2288
2482
|
cancellation: {
|
|
2289
2483
|
request: true;
|
|
@@ -2291,138 +2485,129 @@ declare class AssemblyAiSttProvider implements SpeechToTextProvider {
|
|
|
2291
2485
|
buffer: false;
|
|
2292
2486
|
truncation: false;
|
|
2293
2487
|
};
|
|
2294
|
-
transports: "
|
|
2488
|
+
transports: "http"[];
|
|
2295
2489
|
audio: {
|
|
2296
|
-
|
|
2490
|
+
output: {
|
|
2297
2491
|
readonly encoding: "pcm_s16le";
|
|
2298
2492
|
readonly sampleRateHz: 16000;
|
|
2299
2493
|
readonly channels: 1;
|
|
2300
2494
|
}[];
|
|
2301
2495
|
};
|
|
2302
|
-
|
|
2303
|
-
|
|
2496
|
+
languages: readonly ["hi-IN", "bn-IN", "ta-IN", "te-IN", "gu-IN", "kn-IN", "ml-IN", "mr-IN", "pa-IN", "od-IN", "en-IN"];
|
|
2497
|
+
models: readonly ["bulbul:v3"];
|
|
2498
|
+
voices: readonly ["shubh", "aditya", "ritu", "priya", "neha", "rahul", "pooja", "rohan", "simran", "kavya", "amit", "dev", "ishita", "shreya", "ratan", "varun", "manan", "sumit", "roopa", "kabir", "aayan", "ashutosh", "advait", "anand", "tanya", "tarun", "sunny", "mani", "gokul", "vijay", "shruti", "suhani", "mohit", "kavitha", "rehan", "soham", "rupali"];
|
|
2304
2499
|
metadata: {
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2500
|
+
transport: string;
|
|
2501
|
+
endpoint: string;
|
|
2502
|
+
requestTextLimit: number;
|
|
2503
|
+
wireOutputCodec: string;
|
|
2504
|
+
normalizedOutput: string;
|
|
2505
|
+
documentation: string;
|
|
2308
2506
|
};
|
|
2309
2507
|
};
|
|
2310
|
-
constructor(options:
|
|
2311
|
-
|
|
2312
|
-
}
|
|
2313
|
-
declare function createAssemblyAiSttProvider(options: AssemblyAiSttProviderOptions): AssemblyAiSttProvider;
|
|
2314
|
-
|
|
2315
|
-
interface SonioxStructuredContext {
|
|
2316
|
-
readonly general?: readonly Readonly<{
|
|
2317
|
-
key: string;
|
|
2318
|
-
value: string;
|
|
2319
|
-
}>[];
|
|
2320
|
-
readonly text?: string;
|
|
2321
|
-
readonly terms?: readonly string[];
|
|
2322
|
-
}
|
|
2323
|
-
interface SonioxSttProviderOptions {
|
|
2324
|
-
readonly apiKey: string;
|
|
2325
|
-
readonly url?: string;
|
|
2326
|
-
readonly modelId?: string;
|
|
2327
|
-
readonly allowUnknownModel?: boolean;
|
|
2328
|
-
readonly context?: SonioxStructuredContext;
|
|
2329
|
-
readonly enableEndpointDetection?: boolean;
|
|
2330
|
-
readonly maxEndpointDelayMs?: number;
|
|
2331
|
-
readonly endpointSensitivity?: number;
|
|
2332
|
-
readonly endpointLatencyAdjustmentLevel?: number;
|
|
2333
|
-
readonly enableLanguageIdentification?: boolean;
|
|
2334
|
-
readonly clock?: ProviderClock;
|
|
2335
|
-
readonly webSocketFactory?: (url: string, headers: Readonly<Record<string, string>>) => WebSocket;
|
|
2508
|
+
constructor(options: SarvamTtsHttpProviderOptions);
|
|
2509
|
+
synthesize(request: TtsSynthesisRequest): Promise<TtsStream>;
|
|
2336
2510
|
}
|
|
2337
|
-
declare class
|
|
2511
|
+
declare class SarvamTtsHttpStreamProvider implements TextToSpeechProvider {
|
|
2338
2512
|
#private;
|
|
2339
|
-
readonly name: "
|
|
2340
|
-
readonly kind = "
|
|
2513
|
+
readonly name: "sarvam-tts";
|
|
2514
|
+
readonly kind = "tts";
|
|
2341
2515
|
readonly version = "0.1.0";
|
|
2342
2516
|
readonly capabilities: {
|
|
2343
2517
|
streaming: {
|
|
2344
|
-
input:
|
|
2518
|
+
input: false;
|
|
2345
2519
|
output: true;
|
|
2346
2520
|
native: true;
|
|
2347
2521
|
};
|
|
2348
2522
|
cancellation: {
|
|
2349
2523
|
request: true;
|
|
2350
|
-
output:
|
|
2524
|
+
output: true;
|
|
2351
2525
|
buffer: false;
|
|
2352
2526
|
truncation: false;
|
|
2353
2527
|
};
|
|
2354
|
-
transports: "
|
|
2528
|
+
transports: "http"[];
|
|
2355
2529
|
audio: {
|
|
2356
|
-
|
|
2357
|
-
readonly encoding: "pcm_s16le";
|
|
2358
|
-
readonly sampleRateHz: 8000;
|
|
2359
|
-
readonly channels: 1;
|
|
2360
|
-
}, {
|
|
2530
|
+
output: {
|
|
2361
2531
|
readonly encoding: "pcm_s16le";
|
|
2362
2532
|
readonly sampleRateHz: 16000;
|
|
2363
2533
|
readonly channels: 1;
|
|
2364
|
-
}];
|
|
2534
|
+
}[];
|
|
2365
2535
|
};
|
|
2366
|
-
|
|
2367
|
-
|
|
2536
|
+
languages: readonly ["hi-IN", "bn-IN", "ta-IN", "te-IN", "gu-IN", "kn-IN", "ml-IN", "mr-IN", "pa-IN", "od-IN", "en-IN"];
|
|
2537
|
+
models: readonly ["bulbul:v3"];
|
|
2538
|
+
voices: readonly ["shubh", "aditya", "ritu", "priya", "neha", "rahul", "pooja", "rohan", "simran", "kavya", "amit", "dev", "ishita", "shreya", "ratan", "varun", "manan", "sumit", "roopa", "kabir", "aayan", "ashutosh", "advait", "anand", "tanya", "tarun", "sunny", "mani", "gokul", "vijay", "shruti", "suhani", "mohit", "kavitha", "rehan", "soham", "rupali"];
|
|
2368
2539
|
metadata: {
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2540
|
+
transport: string;
|
|
2541
|
+
endpoint: string;
|
|
2542
|
+
requestTextLimit: number;
|
|
2543
|
+
wireOutputCodec: string;
|
|
2544
|
+
normalizedOutput: string;
|
|
2545
|
+
documentation: string;
|
|
2372
2546
|
};
|
|
2373
2547
|
};
|
|
2374
|
-
constructor(options:
|
|
2375
|
-
|
|
2548
|
+
constructor(options: SarvamTtsHttpProviderOptions);
|
|
2549
|
+
synthesize(request: TtsSynthesisRequest): Promise<TtsStream>;
|
|
2376
2550
|
}
|
|
2377
|
-
declare function
|
|
2551
|
+
declare function createSarvamTtsRestProvider(options: SarvamTtsHttpProviderOptions): SarvamTtsRestProvider;
|
|
2552
|
+
declare function createSarvamTtsHttpStreamProvider(options: SarvamTtsHttpProviderOptions): SarvamTtsHttpStreamProvider;
|
|
2378
2553
|
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
readonly
|
|
2554
|
+
type ElevenLabsBatchTimestampGranularity = "none" | "word" | "character";
|
|
2555
|
+
type ElevenLabsEntityDetection = string | readonly string[];
|
|
2556
|
+
interface ElevenLabsBatchSttRequest {
|
|
2557
|
+
readonly audio: Uint8Array;
|
|
2558
|
+
readonly format: AudioFormat;
|
|
2559
|
+
readonly model?: string;
|
|
2560
|
+
readonly language?: string;
|
|
2561
|
+
readonly keyterms?: readonly string[];
|
|
2562
|
+
readonly tagAudioEvents?: boolean;
|
|
2563
|
+
readonly diarize?: boolean;
|
|
2564
|
+
readonly numSpeakers?: number;
|
|
2565
|
+
readonly timestampsGranularity?: ElevenLabsBatchTimestampGranularity;
|
|
2566
|
+
readonly diarizationThreshold?: number;
|
|
2567
|
+
readonly entityDetection?: ElevenLabsEntityDetection;
|
|
2568
|
+
readonly noVerbatim?: boolean;
|
|
2569
|
+
readonly signal?: AbortSignal;
|
|
2383
2570
|
}
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
readonly
|
|
2387
|
-
readonly
|
|
2388
|
-
readonly
|
|
2389
|
-
readonly
|
|
2390
|
-
|
|
2391
|
-
input: false;
|
|
2392
|
-
output: true;
|
|
2393
|
-
native: true;
|
|
2394
|
-
};
|
|
2395
|
-
cancellation: {
|
|
2396
|
-
request: true;
|
|
2397
|
-
output: true;
|
|
2398
|
-
buffer: false;
|
|
2399
|
-
truncation: false;
|
|
2400
|
-
};
|
|
2401
|
-
transports: ("http" | "sse")[];
|
|
2402
|
-
models: readonly ["gpt-5", "gpt-5-mini", "gpt-4.1", "gpt-4.1-mini"];
|
|
2403
|
-
tools: {
|
|
2404
|
-
functionCalling: true;
|
|
2405
|
-
parallelCalls: true;
|
|
2406
|
-
};
|
|
2407
|
-
};
|
|
2408
|
-
constructor(options: OpenAiResponsesLlmProviderOptions);
|
|
2409
|
-
complete(request: LlmCompletionRequest): Promise<LlmCompletion>;
|
|
2571
|
+
interface ElevenLabsBatchSttResult {
|
|
2572
|
+
readonly modelId: string;
|
|
2573
|
+
readonly text: string;
|
|
2574
|
+
readonly languageCode?: string;
|
|
2575
|
+
readonly languageProbability?: number;
|
|
2576
|
+
readonly words: readonly Readonly<Record<string, unknown>>[];
|
|
2577
|
+
readonly entities?: readonly Readonly<Record<string, unknown>>[];
|
|
2410
2578
|
}
|
|
2411
|
-
declare function createOpenAiResponsesLlmProvider(options: OpenAiResponsesLlmProviderOptions): OpenAiResponsesLlmProvider;
|
|
2412
2579
|
|
|
2413
|
-
|
|
2580
|
+
type ElevenLabsSttCommitStrategy = "manual" | "vad";
|
|
2581
|
+
|
|
2582
|
+
interface ElevenLabsSttProviderOptions {
|
|
2414
2583
|
readonly apiKey: string;
|
|
2415
2584
|
readonly url?: string;
|
|
2416
|
-
readonly
|
|
2585
|
+
readonly batchUrl?: string;
|
|
2586
|
+
readonly allowUnknownModel?: boolean;
|
|
2417
2587
|
readonly modelId?: string;
|
|
2418
|
-
readonly
|
|
2588
|
+
readonly commitStrategy?: ElevenLabsSttCommitStrategy;
|
|
2589
|
+
readonly includeTimestamps?: boolean;
|
|
2590
|
+
readonly includeLanguageDetection?: boolean;
|
|
2591
|
+
readonly vadThreshold?: number;
|
|
2592
|
+
readonly vadSilenceThresholdSecs?: number;
|
|
2593
|
+
readonly secondaryLanguages?: readonly string[];
|
|
2594
|
+
readonly minSpeechDurationMs?: number;
|
|
2595
|
+
readonly minSilenceDurationMs?: number;
|
|
2596
|
+
readonly noVerbatim?: boolean;
|
|
2597
|
+
/** Detect bounded entity records on committed realtime transcript segments. */
|
|
2598
|
+
readonly entityDetection?: ElevenLabsEntityDetection;
|
|
2599
|
+
readonly filterBackgroundAudio?: boolean;
|
|
2600
|
+
readonly enableLogging?: boolean;
|
|
2601
|
+
/** Context sent with the first audio frame; useful after reconnects. */
|
|
2602
|
+
readonly previousText?: string;
|
|
2419
2603
|
readonly clock?: ProviderClock;
|
|
2420
|
-
readonly
|
|
2604
|
+
readonly fetchImpl?: typeof fetch;
|
|
2605
|
+
readonly webSocketFactory?: (url: string, headers: Readonly<Record<string, string>>) => WebSocket__default;
|
|
2421
2606
|
}
|
|
2422
|
-
declare class
|
|
2607
|
+
declare class ElevenLabsSttProvider implements SpeechToTextProvider {
|
|
2423
2608
|
#private;
|
|
2424
|
-
readonly name: "
|
|
2425
|
-
readonly kind = "
|
|
2609
|
+
readonly name: "elevenlabs-stt-realtime";
|
|
2610
|
+
readonly kind = "stt";
|
|
2426
2611
|
readonly version = "0.1.0";
|
|
2427
2612
|
readonly capabilities: {
|
|
2428
2613
|
streaming: {
|
|
@@ -2436,21 +2621,50 @@ declare class CartesiaTtsProvider implements IncrementalTextToSpeechProvider {
|
|
|
2436
2621
|
buffer: false;
|
|
2437
2622
|
truncation: false;
|
|
2438
2623
|
};
|
|
2439
|
-
transports: "websocket"[];
|
|
2624
|
+
transports: ("http" | "websocket")[];
|
|
2440
2625
|
audio: {
|
|
2441
|
-
|
|
2626
|
+
input: readonly [{
|
|
2627
|
+
readonly encoding: "pcm_s16le";
|
|
2628
|
+
readonly sampleRateHz: 8000;
|
|
2629
|
+
readonly channels: 1;
|
|
2630
|
+
}, {
|
|
2442
2631
|
readonly encoding: "pcm_s16le";
|
|
2443
2632
|
readonly sampleRateHz: 16000;
|
|
2444
2633
|
readonly channels: 1;
|
|
2445
|
-
}
|
|
2634
|
+
}, {
|
|
2635
|
+
readonly encoding: "pcm_s16le";
|
|
2636
|
+
readonly sampleRateHz: 22050;
|
|
2637
|
+
readonly channels: 1;
|
|
2638
|
+
}, {
|
|
2639
|
+
readonly encoding: "pcm_s16le";
|
|
2640
|
+
readonly sampleRateHz: 24000;
|
|
2641
|
+
readonly channels: 1;
|
|
2642
|
+
}, {
|
|
2643
|
+
readonly encoding: "pcm_s16le";
|
|
2644
|
+
readonly sampleRateHz: 44100;
|
|
2645
|
+
readonly channels: 1;
|
|
2646
|
+
}, {
|
|
2647
|
+
readonly encoding: "pcm_s16le";
|
|
2648
|
+
readonly sampleRateHz: 48000;
|
|
2649
|
+
readonly channels: 1;
|
|
2650
|
+
}];
|
|
2651
|
+
};
|
|
2652
|
+
models: readonly ["scribe_v2_realtime", "scribe_v2", "scribe_v2_medical"];
|
|
2653
|
+
turnDetection: ("manual" | "vad")[];
|
|
2654
|
+
metadata: {
|
|
2655
|
+
realtimeModel: string;
|
|
2656
|
+
realtimeModels: string[];
|
|
2657
|
+
batchModels: string[];
|
|
2658
|
+
batchTranscription: boolean;
|
|
2659
|
+
partialTranscripts: boolean;
|
|
2446
2660
|
};
|
|
2447
|
-
models: readonly ["sonic-3", "sonic-2"];
|
|
2448
2661
|
};
|
|
2449
|
-
constructor(options:
|
|
2450
|
-
|
|
2451
|
-
|
|
2662
|
+
constructor(options: ElevenLabsSttProviderOptions);
|
|
2663
|
+
open(request: SttOpenRequest): Promise<SttStream>;
|
|
2664
|
+
transcribe(request: ElevenLabsBatchSttRequest): Promise<ElevenLabsBatchSttResult>;
|
|
2665
|
+
transcribe(request: SttBatchTranscriptionRequest): Promise<SttBatchTranscription>;
|
|
2452
2666
|
}
|
|
2453
|
-
declare function
|
|
2667
|
+
declare function createElevenLabsSttProvider(options: ElevenLabsSttProviderOptions): ElevenLabsSttProvider;
|
|
2454
2668
|
|
|
2455
2669
|
/**
|
|
2456
2670
|
* Vendor facts that change on the provider's release schedule rather than ours:
|
|
@@ -2474,20 +2688,32 @@ interface ProviderCatalogEntry {
|
|
|
2474
2688
|
readonly defaultModel: string;
|
|
2475
2689
|
/** Models this adapter is known to work with, not the vendor's full catalog. */
|
|
2476
2690
|
readonly models: readonly string[];
|
|
2691
|
+
/** Optional transport-specific model groups when one adapter spans transports. */
|
|
2692
|
+
readonly realtimeModels?: readonly string[];
|
|
2693
|
+
readonly preRecordedModels?: readonly string[];
|
|
2694
|
+
readonly syncModels?: readonly string[];
|
|
2695
|
+
/** Models supported by a separate complete-input/batch contract, when present. */
|
|
2696
|
+
readonly batchModels?: readonly string[];
|
|
2697
|
+
/** Official documentation for the separate batch contract, when present. */
|
|
2698
|
+
readonly batchSource?: string;
|
|
2477
2699
|
}
|
|
2478
2700
|
/**
|
|
2479
|
-
* TVIC maturity labels are our release claim, not a vendor guarantee.
|
|
2480
|
-
*
|
|
2481
|
-
*
|
|
2482
|
-
*
|
|
2701
|
+
* TVIC maturity labels are our release claim, not a vendor guarantee. They are
|
|
2702
|
+
* ordered from least to most supported as deferred, experimental, validated,
|
|
2703
|
+
* and stable. `validated` means the exact adapter/model path has passed the
|
|
2704
|
+
* small-scale live evidence profile; it is not an uptime or compatibility SLA.
|
|
2483
2705
|
*/
|
|
2484
|
-
|
|
2706
|
+
declare const PROVIDER_STABILITY_LEVELS: readonly ["deferred", "experimental", "validated", "stable"];
|
|
2707
|
+
type ProviderStability = (typeof PROVIDER_STABILITY_LEVELS)[number];
|
|
2485
2708
|
declare const PROVIDER_STABILITY: Readonly<{
|
|
2486
2709
|
readonly deepgram: "experimental";
|
|
2710
|
+
readonly cartesiaStt: "experimental";
|
|
2487
2711
|
readonly sarvam: "experimental";
|
|
2488
2712
|
readonly elevenlabsStt: "experimental";
|
|
2489
2713
|
readonly assemblyai: "experimental";
|
|
2490
2714
|
readonly soniox: "experimental";
|
|
2715
|
+
readonly sarvamTts: "experimental";
|
|
2716
|
+
readonly groq: "experimental";
|
|
2491
2717
|
readonly openaiResponses: "experimental";
|
|
2492
2718
|
readonly cartesia: "experimental";
|
|
2493
2719
|
readonly elevenlabs: "experimental";
|
|
@@ -2496,40 +2722,57 @@ declare const PROVIDER_STABILITY: Readonly<{
|
|
|
2496
2722
|
}>;
|
|
2497
2723
|
declare const PROVIDER_CATALOG: {
|
|
2498
2724
|
readonly deepgram: {
|
|
2499
|
-
readonly verifiedAt: "2026-
|
|
2725
|
+
readonly verifiedAt: "2026-09-15";
|
|
2500
2726
|
readonly source: "https://developers.deepgram.com/docs/models-languages-overview";
|
|
2501
2727
|
readonly defaultModel: "nova-3";
|
|
2502
2728
|
readonly models: readonly ["nova-3", "nova-2"];
|
|
2503
2729
|
};
|
|
2730
|
+
readonly cartesiaStt: {
|
|
2731
|
+
readonly verifiedAt: "2026-09-27";
|
|
2732
|
+
readonly source: "https://docs.cartesia.ai/build-with-cartesia/stt/latest";
|
|
2733
|
+
readonly defaultModel: "ink-2";
|
|
2734
|
+
readonly models: readonly ["ink-2", "ink-preview", "ink-whisper-2025-06-04"];
|
|
2735
|
+
readonly batchModels: readonly ["ink-whisper"];
|
|
2736
|
+
readonly batchSource: "https://docs.cartesia.ai/api-reference/stt/transcribe";
|
|
2737
|
+
};
|
|
2504
2738
|
readonly sarvam: {
|
|
2505
|
-
readonly verifiedAt: "2026-
|
|
2506
|
-
readonly source: "https://docs.sarvam.ai/api-reference/
|
|
2739
|
+
readonly verifiedAt: "2026-09-15";
|
|
2740
|
+
readonly source: "https://docs.sarvam.ai/api-reference/speech-to-text/transcribe/ws";
|
|
2507
2741
|
readonly defaultModel: "saaras:v3";
|
|
2508
2742
|
readonly models: readonly ["saaras:v3", "saaras:v4"];
|
|
2509
2743
|
};
|
|
2744
|
+
readonly sarvamTts: {
|
|
2745
|
+
readonly verifiedAt: "2026-09-25";
|
|
2746
|
+
readonly source: "https://docs.sarvam.ai/api-reference/text-to-speech/convert";
|
|
2747
|
+
readonly defaultModel: "bulbul:v3";
|
|
2748
|
+
readonly models: readonly ["bulbul:v3"];
|
|
2749
|
+
};
|
|
2510
2750
|
readonly cartesia: {
|
|
2511
|
-
readonly verifiedAt: "2026-
|
|
2512
|
-
readonly source: "https://docs.cartesia.ai/
|
|
2513
|
-
readonly defaultModel: "sonic-3";
|
|
2514
|
-
readonly models: readonly ["sonic-3", "sonic-
|
|
2751
|
+
readonly verifiedAt: "2026-09-25";
|
|
2752
|
+
readonly source: "https://docs.cartesia.ai/build-with-cartesia/tts-models/latest";
|
|
2753
|
+
readonly defaultModel: "sonic-3.6";
|
|
2754
|
+
readonly models: readonly ["sonic-3.6", "sonic-3.6-2026-08-27", "sonic-preview", "sonic-3.5", "sonic-3.5-2026-05-04", "sonic-3", "sonic-3-2026-01-12"];
|
|
2515
2755
|
};
|
|
2516
2756
|
readonly elevenlabs: {
|
|
2517
|
-
readonly verifiedAt: "2026-
|
|
2518
|
-
readonly source: "https://elevenlabs.io/docs/models";
|
|
2757
|
+
readonly verifiedAt: "2026-09-25";
|
|
2758
|
+
readonly source: "https://elevenlabs.io/docs/overview/models";
|
|
2519
2759
|
readonly defaultModel: "eleven_flash_v2_5";
|
|
2520
|
-
readonly models: readonly ["eleven_flash_v2_5", "
|
|
2760
|
+
readonly models: readonly ["eleven_flash_v2_5", "eleven_flash_v2", "eleven_v3", "eleven_v3_conversational", "eleven_multilingual_v2", "eleven_turbo_v2_5", "eleven_turbo_v2"];
|
|
2521
2761
|
};
|
|
2522
2762
|
readonly elevenlabsStt: {
|
|
2523
|
-
readonly verifiedAt: "2026-
|
|
2524
|
-
readonly source: "https://elevenlabs.io/docs/
|
|
2763
|
+
readonly verifiedAt: "2026-09-24";
|
|
2764
|
+
readonly source: "https://elevenlabs.io/docs/overview/models";
|
|
2525
2765
|
readonly defaultModel: "scribe_v2_realtime";
|
|
2526
|
-
readonly models: readonly ["scribe_v2_realtime"];
|
|
2766
|
+
readonly models: readonly ["scribe_v2_realtime", "scribe_v2", "scribe_v2_medical"];
|
|
2527
2767
|
};
|
|
2528
2768
|
readonly assemblyai: {
|
|
2529
|
-
readonly verifiedAt: "2026-
|
|
2530
|
-
readonly source: "https://www.assemblyai.com/docs/streaming/
|
|
2531
|
-
readonly defaultModel: "
|
|
2532
|
-
readonly models: readonly [
|
|
2769
|
+
readonly verifiedAt: "2026-09-27";
|
|
2770
|
+
readonly source: "https://www.assemblyai.com/docs/streaming/select-the-speech-model";
|
|
2771
|
+
readonly defaultModel: "universal-3-6-pro";
|
|
2772
|
+
readonly models: readonly string[];
|
|
2773
|
+
readonly realtimeModels: readonly ["universal-3-6-pro", "universal-3-5-pro", "universal-streaming-english", "universal-streaming-multilingual"];
|
|
2774
|
+
readonly preRecordedModels: readonly ["universal-3-5-pro", "universal-2"];
|
|
2775
|
+
readonly syncModels: readonly ["universal-3-5-pro"];
|
|
2533
2776
|
};
|
|
2534
2777
|
readonly soniox: {
|
|
2535
2778
|
readonly verifiedAt: "2026-08-20";
|
|
@@ -2537,6 +2780,12 @@ declare const PROVIDER_CATALOG: {
|
|
|
2537
2780
|
readonly defaultModel: "stt-rt-v5";
|
|
2538
2781
|
readonly models: readonly ["stt-rt-v5"];
|
|
2539
2782
|
};
|
|
2783
|
+
readonly groq: {
|
|
2784
|
+
readonly verifiedAt: "2026-09-15";
|
|
2785
|
+
readonly source: "https://console.groq.com/docs/models";
|
|
2786
|
+
readonly defaultModel: "openai/gpt-oss-20b";
|
|
2787
|
+
readonly models: readonly ["openai/gpt-oss-20b", "openai/gpt-oss-120b"];
|
|
2788
|
+
};
|
|
2540
2789
|
readonly openaiResponses: {
|
|
2541
2790
|
readonly verifiedAt: "2026-07-24";
|
|
2542
2791
|
readonly source: "https://platform.openai.com/docs/models";
|
|
@@ -2549,7 +2798,8 @@ declare const PROVIDER_CATALOG: {
|
|
|
2549
2798
|
* protocol version changes adapter parsing, not just which model is selected.
|
|
2550
2799
|
*/
|
|
2551
2800
|
declare const PROVIDER_API_VERSIONS: {
|
|
2552
|
-
readonly cartesia: "2026-
|
|
2801
|
+
readonly cartesia: "2026-08-14";
|
|
2802
|
+
readonly cartesiaStt: "2026-08-14";
|
|
2553
2803
|
};
|
|
2554
2804
|
/**
|
|
2555
2805
|
* TVIC's own adapter tuning. These are our decisions about how to drive a provider,
|
|
@@ -2568,21 +2818,468 @@ declare const ADAPTER_DEFAULTS: {
|
|
|
2568
2818
|
readonly flushSignal: true;
|
|
2569
2819
|
readonly inputAudioCodec: "pcm_s16le";
|
|
2570
2820
|
};
|
|
2571
|
-
readonly
|
|
2572
|
-
readonly language: "en";
|
|
2821
|
+
readonly sarvamTts: {
|
|
2822
|
+
readonly language: "en-IN";
|
|
2823
|
+
readonly voice: "shubh";
|
|
2824
|
+
readonly pace: 1;
|
|
2825
|
+
readonly temperature: 0.6;
|
|
2826
|
+
readonly minBufferSize: 50;
|
|
2827
|
+
readonly maxChunkLength: 150;
|
|
2828
|
+
};
|
|
2829
|
+
readonly cartesia: {
|
|
2830
|
+
readonly language: "en";
|
|
2831
|
+
};
|
|
2832
|
+
readonly cartesiaStt: {
|
|
2833
|
+
readonly mode: "manual";
|
|
2834
|
+
};
|
|
2835
|
+
};
|
|
2836
|
+
|
|
2837
|
+
interface AssemblyAiSpeakerOptions {
|
|
2838
|
+
readonly minSpeakersExpected?: number;
|
|
2839
|
+
readonly maxSpeakersExpected?: number;
|
|
2840
|
+
readonly includeSpeakerConfidence?: boolean;
|
|
2841
|
+
}
|
|
2842
|
+
type AssemblyAiPiiSubstitution = "entity_name" | "hash";
|
|
2843
|
+
type AssemblyAiRedactedAudioQuality = "mp3" | "wav";
|
|
2844
|
+
interface AssemblyAiRedactPiiAudioOptions {
|
|
2845
|
+
readonly overrideAudioRedactionMethod?: "beep" | "silence";
|
|
2846
|
+
readonly returnRedactedNoSpeechAudio?: boolean;
|
|
2847
|
+
}
|
|
2848
|
+
interface AssemblyAiPreRecordedSttRequest {
|
|
2849
|
+
/** A complete local file or encoded media payload. */
|
|
2850
|
+
readonly audio?: Uint8Array;
|
|
2851
|
+
/** A public URL or AssemblyAI upload URL. Exactly one audio source is required. */
|
|
2852
|
+
readonly audioUrl?: string;
|
|
2853
|
+
/** Content type used when `audio` is uploaded. */
|
|
2854
|
+
readonly mimeType?: string;
|
|
2855
|
+
/** Filename used as the multipart upload filename. */
|
|
2856
|
+
readonly fileName?: string;
|
|
2857
|
+
/** Convenience single-model selector. Cannot be combined with speechModels. */
|
|
2858
|
+
readonly model?: string;
|
|
2859
|
+
/** Ordered model candidates. AssemblyAI may fall back to the next model. */
|
|
2860
|
+
readonly speechModels?: readonly string[];
|
|
2861
|
+
readonly language?: string;
|
|
2862
|
+
readonly languageDetection?: boolean;
|
|
2863
|
+
readonly prompt?: string;
|
|
2864
|
+
readonly vocabulary?: readonly string[];
|
|
2865
|
+
readonly punctuate?: boolean;
|
|
2866
|
+
readonly formatText?: boolean;
|
|
2867
|
+
readonly disfluencies?: boolean;
|
|
2868
|
+
readonly speakerLabels?: boolean;
|
|
2869
|
+
readonly speakersExpected?: number;
|
|
2870
|
+
readonly speakerOptions?: AssemblyAiSpeakerOptions;
|
|
2871
|
+
/** Current AssemblyAI name for separate-channel transcription. */
|
|
2872
|
+
readonly multichannel?: boolean;
|
|
2873
|
+
/** @deprecated Use `multichannel`. Kept as a compatibility alias. */
|
|
2874
|
+
readonly dualChannel?: boolean;
|
|
2875
|
+
readonly redactPii?: boolean;
|
|
2876
|
+
readonly redactPiiPolicies?: readonly string[];
|
|
2877
|
+
readonly redactPiiSub?: AssemblyAiPiiSubstitution;
|
|
2878
|
+
readonly redactPiiAudio?: boolean;
|
|
2879
|
+
readonly redactPiiAudioQuality?: AssemblyAiRedactedAudioQuality;
|
|
2880
|
+
readonly redactPiiAudioOptions?: AssemblyAiRedactPiiAudioOptions;
|
|
2881
|
+
readonly redactPiiReturnUnredacted?: boolean;
|
|
2882
|
+
readonly redactStaticEntities?: Readonly<Record<string, readonly string[]>>;
|
|
2883
|
+
readonly speechThreshold?: number;
|
|
2884
|
+
readonly webhookUrl?: string;
|
|
2885
|
+
readonly webhookAuthHeaderName?: string;
|
|
2886
|
+
readonly webhookAuthHeaderValue?: string;
|
|
2887
|
+
readonly signal?: AbortSignal;
|
|
2888
|
+
readonly pollIntervalMs?: number;
|
|
2889
|
+
readonly pollTimeoutMs?: number;
|
|
2890
|
+
}
|
|
2891
|
+
interface AssemblyAiSyncSttRequest {
|
|
2892
|
+
/** Raw PCM16LE bytes. The format is sent in the Sync config part. */
|
|
2893
|
+
readonly audio: Uint8Array;
|
|
2894
|
+
readonly format: AudioFormat;
|
|
2895
|
+
readonly model?: string;
|
|
2896
|
+
readonly languageCodes?: readonly string[];
|
|
2897
|
+
readonly prompt?: string;
|
|
2898
|
+
readonly vocabulary?: readonly string[];
|
|
2899
|
+
readonly timestamps?: boolean;
|
|
2900
|
+
readonly fileName?: string;
|
|
2901
|
+
readonly signal?: AbortSignal;
|
|
2902
|
+
}
|
|
2903
|
+
interface AssemblyAiSyncLiveSttRequest {
|
|
2904
|
+
/** Async PCM16LE chunks produced while the recording is in progress. */
|
|
2905
|
+
readonly audio: AsyncIterable<Uint8Array>;
|
|
2906
|
+
readonly format: AudioFormat;
|
|
2907
|
+
readonly model?: string;
|
|
2908
|
+
readonly languageCodes?: readonly string[];
|
|
2909
|
+
readonly prompt?: string;
|
|
2910
|
+
readonly vocabulary?: readonly string[];
|
|
2911
|
+
readonly timestamps?: boolean;
|
|
2912
|
+
readonly fileName?: string;
|
|
2913
|
+
readonly signal?: AbortSignal;
|
|
2914
|
+
}
|
|
2915
|
+
interface AssemblyAiTranscriptWord {
|
|
2916
|
+
readonly text: string;
|
|
2917
|
+
readonly start?: number;
|
|
2918
|
+
readonly end?: number;
|
|
2919
|
+
readonly confidence?: number;
|
|
2920
|
+
readonly speaker?: string;
|
|
2921
|
+
readonly [key: string]: unknown;
|
|
2922
|
+
}
|
|
2923
|
+
interface AssemblyAiTranscriptUtterance {
|
|
2924
|
+
readonly text: string;
|
|
2925
|
+
readonly start?: number;
|
|
2926
|
+
readonly end?: number;
|
|
2927
|
+
readonly confidence?: number;
|
|
2928
|
+
readonly speaker?: string;
|
|
2929
|
+
readonly words?: readonly AssemblyAiTranscriptWord[];
|
|
2930
|
+
readonly [key: string]: unknown;
|
|
2931
|
+
}
|
|
2932
|
+
interface AssemblyAiPreRecordedSttResult {
|
|
2933
|
+
readonly id: string;
|
|
2934
|
+
readonly status: "completed";
|
|
2935
|
+
readonly modelId: string;
|
|
2936
|
+
readonly text: string;
|
|
2937
|
+
readonly languageCode?: string;
|
|
2938
|
+
readonly audioDurationMs?: number;
|
|
2939
|
+
readonly audioChannels?: number;
|
|
2940
|
+
readonly confidence?: number;
|
|
2941
|
+
readonly words: readonly AssemblyAiTranscriptWord[];
|
|
2942
|
+
readonly utterances: readonly AssemblyAiTranscriptUtterance[];
|
|
2943
|
+
/** Bounded provider response for fields not yet promoted into the TVIC shape. */
|
|
2944
|
+
readonly providerResponse: Readonly<Record<string, unknown>>;
|
|
2945
|
+
}
|
|
2946
|
+
interface AssemblyAiSyncSttResult {
|
|
2947
|
+
readonly sessionId: string;
|
|
2948
|
+
readonly modelId: string;
|
|
2949
|
+
readonly text: string;
|
|
2950
|
+
readonly confidence?: number;
|
|
2951
|
+
readonly audioDurationMs?: number;
|
|
2952
|
+
readonly requestTimeMs?: number;
|
|
2953
|
+
readonly words: readonly AssemblyAiTranscriptWord[];
|
|
2954
|
+
readonly providerResponse: Readonly<Record<string, unknown>>;
|
|
2955
|
+
}
|
|
2956
|
+
|
|
2957
|
+
interface AssemblyAiSttProviderOptions {
|
|
2958
|
+
readonly apiKey: string;
|
|
2959
|
+
readonly url?: string;
|
|
2960
|
+
readonly modelId?: string;
|
|
2961
|
+
readonly allowUnknownModel?: boolean;
|
|
2962
|
+
readonly formatTurns?: boolean;
|
|
2963
|
+
readonly prompt?: string;
|
|
2964
|
+
readonly languageDetection?: boolean;
|
|
2965
|
+
readonly speakerLabels?: boolean;
|
|
2966
|
+
readonly maxSpeakers?: number;
|
|
2967
|
+
readonly speakerLabelsRevisionIntervalMs?: number;
|
|
2968
|
+
readonly minTurnSilenceMs?: number;
|
|
2969
|
+
readonly maxTurnSilenceMs?: number;
|
|
2970
|
+
readonly clock?: ProviderClock;
|
|
2971
|
+
readonly preRecordedUrl?: string;
|
|
2972
|
+
readonly uploadUrl?: string;
|
|
2973
|
+
readonly syncUrl?: string;
|
|
2974
|
+
readonly fetchImpl?: typeof fetch;
|
|
2975
|
+
readonly webSocketFactory?: (url: string, headers: Readonly<Record<string, string>>) => WebSocket__default;
|
|
2976
|
+
}
|
|
2977
|
+
declare class AssemblyAiSttProvider implements SpeechToTextProvider {
|
|
2978
|
+
#private;
|
|
2979
|
+
readonly name: "assemblyai-stt";
|
|
2980
|
+
readonly kind = "stt";
|
|
2981
|
+
readonly version = "0.1.0";
|
|
2982
|
+
readonly capabilities: {
|
|
2983
|
+
streaming: {
|
|
2984
|
+
input: true;
|
|
2985
|
+
output: true;
|
|
2986
|
+
native: true;
|
|
2987
|
+
};
|
|
2988
|
+
cancellation: {
|
|
2989
|
+
request: true;
|
|
2990
|
+
output: false;
|
|
2991
|
+
buffer: false;
|
|
2992
|
+
truncation: false;
|
|
2993
|
+
};
|
|
2994
|
+
transports: ("http" | "websocket")[];
|
|
2995
|
+
audio: {
|
|
2996
|
+
input: {
|
|
2997
|
+
readonly encoding: "pcm_s16le";
|
|
2998
|
+
readonly sampleRateHz: 16000;
|
|
2999
|
+
readonly channels: 1;
|
|
3000
|
+
}[];
|
|
3001
|
+
};
|
|
3002
|
+
models: readonly string[];
|
|
3003
|
+
turnDetection: "stt_endpointing"[];
|
|
3004
|
+
metadata: {
|
|
3005
|
+
realtimeModel: "universal-3-6-pro";
|
|
3006
|
+
realtimeModels: readonly ["universal-3-6-pro", "universal-3-5-pro", "universal-streaming-english", "universal-streaming-multilingual"];
|
|
3007
|
+
preRecordedModels: readonly ["universal-3-5-pro", "universal-2"];
|
|
3008
|
+
syncModels: readonly ["universal-3-5-pro"];
|
|
3009
|
+
preRecordedTranscription: boolean;
|
|
3010
|
+
syncTranscription: boolean;
|
|
3011
|
+
syncLiveTranscription: boolean;
|
|
3012
|
+
partialTranscripts: boolean;
|
|
3013
|
+
formattedTurns: boolean;
|
|
3014
|
+
speakerDiarization: boolean;
|
|
3015
|
+
multichannelTranscription: boolean;
|
|
3016
|
+
piiRedaction: boolean;
|
|
3017
|
+
};
|
|
3018
|
+
};
|
|
3019
|
+
constructor(options: AssemblyAiSttProviderOptions);
|
|
3020
|
+
open(request: SttOpenRequest): Promise<SttStream>;
|
|
3021
|
+
transcribe(request: AssemblyAiPreRecordedSttRequest): Promise<AssemblyAiPreRecordedSttResult>;
|
|
3022
|
+
transcribe(request: SttBatchTranscriptionRequest): Promise<SttBatchTranscription>;
|
|
3023
|
+
transcribeSync(request: AssemblyAiSyncSttRequest): Promise<AssemblyAiSyncSttResult>;
|
|
3024
|
+
transcribeSyncLive(request: AssemblyAiSyncLiveSttRequest): Promise<AssemblyAiSyncSttResult>;
|
|
3025
|
+
warmSync(model?: string, signal?: AbortSignal): Promise<void>;
|
|
3026
|
+
}
|
|
3027
|
+
declare function createAssemblyAiSttProvider(options: AssemblyAiSttProviderOptions): AssemblyAiSttProvider;
|
|
3028
|
+
|
|
3029
|
+
interface SonioxStructuredContext {
|
|
3030
|
+
readonly general?: readonly Readonly<{
|
|
3031
|
+
key: string;
|
|
3032
|
+
value: string;
|
|
3033
|
+
}>[];
|
|
3034
|
+
readonly text?: string;
|
|
3035
|
+
readonly terms?: readonly string[];
|
|
3036
|
+
}
|
|
3037
|
+
interface SonioxSttProviderOptions {
|
|
3038
|
+
readonly apiKey: string;
|
|
3039
|
+
readonly url?: string;
|
|
3040
|
+
readonly modelId?: string;
|
|
3041
|
+
readonly allowUnknownModel?: boolean;
|
|
3042
|
+
readonly context?: SonioxStructuredContext;
|
|
3043
|
+
readonly enableEndpointDetection?: boolean;
|
|
3044
|
+
readonly maxEndpointDelayMs?: number;
|
|
3045
|
+
readonly endpointSensitivity?: number;
|
|
3046
|
+
readonly endpointLatencyAdjustmentLevel?: number;
|
|
3047
|
+
readonly enableLanguageIdentification?: boolean;
|
|
3048
|
+
readonly clock?: ProviderClock;
|
|
3049
|
+
readonly webSocketFactory?: (url: string, headers: Readonly<Record<string, string>>) => WebSocket__default;
|
|
3050
|
+
}
|
|
3051
|
+
declare class SonioxSttProvider implements SpeechToTextProvider {
|
|
3052
|
+
#private;
|
|
3053
|
+
readonly name: "soniox-stt";
|
|
3054
|
+
readonly kind = "stt";
|
|
3055
|
+
readonly version = "0.1.0";
|
|
3056
|
+
readonly capabilities: {
|
|
3057
|
+
streaming: {
|
|
3058
|
+
input: true;
|
|
3059
|
+
output: true;
|
|
3060
|
+
native: true;
|
|
3061
|
+
};
|
|
3062
|
+
cancellation: {
|
|
3063
|
+
request: true;
|
|
3064
|
+
output: false;
|
|
3065
|
+
buffer: false;
|
|
3066
|
+
truncation: false;
|
|
3067
|
+
};
|
|
3068
|
+
transports: "websocket"[];
|
|
3069
|
+
audio: {
|
|
3070
|
+
input: readonly [{
|
|
3071
|
+
readonly encoding: "pcm_s16le";
|
|
3072
|
+
readonly sampleRateHz: 8000;
|
|
3073
|
+
readonly channels: 1;
|
|
3074
|
+
}, {
|
|
3075
|
+
readonly encoding: "pcm_s16le";
|
|
3076
|
+
readonly sampleRateHz: 16000;
|
|
3077
|
+
readonly channels: 1;
|
|
3078
|
+
}];
|
|
3079
|
+
};
|
|
3080
|
+
models: readonly ["stt-rt-v5"];
|
|
3081
|
+
turnDetection: ("manual" | "stt_endpointing")[];
|
|
3082
|
+
metadata: {
|
|
3083
|
+
realtimeModel: "stt-rt-v5";
|
|
3084
|
+
partialTranscripts: boolean;
|
|
3085
|
+
tokenFinality: boolean;
|
|
3086
|
+
};
|
|
3087
|
+
};
|
|
3088
|
+
constructor(options: SonioxSttProviderOptions);
|
|
3089
|
+
open(request: SttOpenRequest): Promise<SttStream>;
|
|
3090
|
+
}
|
|
3091
|
+
declare function createSonioxSttProvider(options: SonioxSttProviderOptions): SonioxSttProvider;
|
|
3092
|
+
|
|
3093
|
+
interface OpenAiResponsesLlmProviderOptions {
|
|
3094
|
+
readonly apiKey: string;
|
|
3095
|
+
readonly url?: string;
|
|
3096
|
+
readonly clock?: ProviderClock;
|
|
3097
|
+
}
|
|
3098
|
+
declare class OpenAiResponsesLlmProvider implements LLMProvider {
|
|
3099
|
+
#private;
|
|
3100
|
+
readonly name: "openai-responses";
|
|
3101
|
+
readonly kind = "llm";
|
|
3102
|
+
readonly version = "0.1.0";
|
|
3103
|
+
readonly capabilities: {
|
|
3104
|
+
streaming: {
|
|
3105
|
+
input: false;
|
|
3106
|
+
output: true;
|
|
3107
|
+
native: true;
|
|
3108
|
+
};
|
|
3109
|
+
cancellation: {
|
|
3110
|
+
request: true;
|
|
3111
|
+
output: true;
|
|
3112
|
+
buffer: false;
|
|
3113
|
+
truncation: false;
|
|
3114
|
+
};
|
|
3115
|
+
transports: ("http" | "sse")[];
|
|
3116
|
+
models: readonly ["gpt-5", "gpt-5-mini", "gpt-4.1", "gpt-4.1-mini"];
|
|
3117
|
+
tools: {
|
|
3118
|
+
functionCalling: true;
|
|
3119
|
+
parallelCalls: true;
|
|
3120
|
+
};
|
|
3121
|
+
};
|
|
3122
|
+
constructor(options: OpenAiResponsesLlmProviderOptions);
|
|
3123
|
+
complete(request: LlmCompletionRequest): Promise<LlmCompletion>;
|
|
3124
|
+
}
|
|
3125
|
+
declare function createOpenAiResponsesLlmProvider(options: OpenAiResponsesLlmProviderOptions): OpenAiResponsesLlmProvider;
|
|
3126
|
+
|
|
3127
|
+
interface GroqChatLlmProviderOptions {
|
|
3128
|
+
readonly apiKey: string;
|
|
3129
|
+
readonly url?: string;
|
|
3130
|
+
/** Allows an explicitly configured compatible endpoint/model outside the dated catalog. */
|
|
3131
|
+
readonly allowUnknownModel?: boolean;
|
|
3132
|
+
readonly clock?: ProviderClock;
|
|
3133
|
+
}
|
|
3134
|
+
declare class GroqChatLlmProvider implements LLMProvider {
|
|
3135
|
+
#private;
|
|
3136
|
+
readonly name: "groq-chat-completions";
|
|
3137
|
+
readonly kind = "llm";
|
|
3138
|
+
readonly version = "0.1.0";
|
|
3139
|
+
readonly capabilities: {
|
|
3140
|
+
streaming: {
|
|
3141
|
+
input: false;
|
|
3142
|
+
output: true;
|
|
3143
|
+
native: true;
|
|
3144
|
+
};
|
|
3145
|
+
cancellation: {
|
|
3146
|
+
request: true;
|
|
3147
|
+
output: true;
|
|
3148
|
+
buffer: false;
|
|
3149
|
+
truncation: false;
|
|
3150
|
+
};
|
|
3151
|
+
transports: ("http" | "sse")[];
|
|
3152
|
+
models: readonly ["openai/gpt-oss-20b", "openai/gpt-oss-120b"];
|
|
3153
|
+
tools: {
|
|
3154
|
+
functionCalling: true;
|
|
3155
|
+
parallelCalls: false;
|
|
3156
|
+
};
|
|
3157
|
+
};
|
|
3158
|
+
constructor(options: GroqChatLlmProviderOptions);
|
|
3159
|
+
complete(request: LlmCompletionRequest): Promise<LlmCompletion>;
|
|
3160
|
+
}
|
|
3161
|
+
declare function createGroqChatLlmProvider(options: GroqChatLlmProviderOptions): GroqChatLlmProvider;
|
|
3162
|
+
|
|
3163
|
+
interface CartesiaGenerationConfig {
|
|
3164
|
+
/** Relative output volume; Cartesia interprets the value for the selected model. */
|
|
3165
|
+
readonly volume?: number;
|
|
3166
|
+
/** Relative speaking speed; a request-level speed overrides this value. */
|
|
3167
|
+
readonly speed?: number;
|
|
3168
|
+
/** Optional Sonic emotion/style control. */
|
|
3169
|
+
readonly emotion?: string;
|
|
3170
|
+
}
|
|
3171
|
+
|
|
3172
|
+
declare const MAX_CARTESIA_INPUT_UTF16_CODE_UNITS = 1048576;
|
|
3173
|
+
declare const MAX_CARTESIA_INPUT_UTF8_BYTES = 4194304;
|
|
3174
|
+
interface CartesiaTtsProviderOptions {
|
|
3175
|
+
readonly apiKey: string;
|
|
3176
|
+
readonly url?: string;
|
|
3177
|
+
readonly voiceId: string;
|
|
3178
|
+
readonly modelId?: string;
|
|
3179
|
+
/** Allows an explicitly configured compatible endpoint/model outside the dated catalog. */
|
|
3180
|
+
readonly allowUnknownModel?: boolean;
|
|
3181
|
+
readonly language?: string;
|
|
3182
|
+
/** Cartesia locale is mutually exclusive with language. */
|
|
3183
|
+
readonly locale?: string;
|
|
3184
|
+
readonly accent?: string;
|
|
3185
|
+
readonly normalization?: string;
|
|
3186
|
+
readonly generationConfig?: CartesiaGenerationConfig;
|
|
3187
|
+
readonly pronunciationDictId?: string;
|
|
3188
|
+
/** Cartesia server-side continuation buffering; 0 keeps latency under TVIC control. */
|
|
3189
|
+
readonly maxBufferDelayMs?: number;
|
|
3190
|
+
readonly clock?: ProviderClock;
|
|
3191
|
+
readonly webSocketFactory?: (url: string, headers: Readonly<Record<string, string>>) => WebSocket__default;
|
|
3192
|
+
}
|
|
3193
|
+
declare class CartesiaTtsProvider implements IncrementalTextToSpeechProvider {
|
|
3194
|
+
#private;
|
|
3195
|
+
readonly name: "cartesia";
|
|
3196
|
+
readonly kind = "tts";
|
|
3197
|
+
readonly version = "0.1.0";
|
|
3198
|
+
readonly capabilities: {
|
|
3199
|
+
streaming: {
|
|
3200
|
+
input: true;
|
|
3201
|
+
output: true;
|
|
3202
|
+
native: true;
|
|
3203
|
+
};
|
|
3204
|
+
cancellation: {
|
|
3205
|
+
request: true;
|
|
3206
|
+
output: false;
|
|
3207
|
+
buffer: false;
|
|
3208
|
+
truncation: false;
|
|
3209
|
+
};
|
|
3210
|
+
transports: "websocket"[];
|
|
3211
|
+
audio: {
|
|
3212
|
+
output: {
|
|
3213
|
+
readonly encoding: "pcm_s16le";
|
|
3214
|
+
readonly sampleRateHz: 16000;
|
|
3215
|
+
readonly channels: 1;
|
|
3216
|
+
}[];
|
|
3217
|
+
};
|
|
3218
|
+
models: readonly ["sonic-3.6", "sonic-3.6-2026-08-27", "sonic-preview", "sonic-3.5", "sonic-3.5-2026-05-04", "sonic-3", "sonic-3-2026-01-12"];
|
|
2573
3219
|
};
|
|
2574
|
-
|
|
3220
|
+
constructor(options: CartesiaTtsProviderOptions);
|
|
3221
|
+
synthesize(request: TtsSynthesisRequest): Promise<TtsStream>;
|
|
3222
|
+
openSession(request: TtsSessionOpenRequest): Promise<TtsSession>;
|
|
3223
|
+
}
|
|
3224
|
+
declare function createCartesiaTtsProvider(options: CartesiaTtsProviderOptions): CartesiaTtsProvider;
|
|
2575
3225
|
|
|
3226
|
+
type ElevenLabsTtsProtocol = "tts" | "dialogue";
|
|
3227
|
+
type ElevenLabsTextNormalization = "auto" | "on" | "off";
|
|
3228
|
+
interface ElevenLabsPronunciationDictionaryLocator {
|
|
3229
|
+
readonly id: string;
|
|
3230
|
+
readonly versionId?: string;
|
|
3231
|
+
}
|
|
3232
|
+
interface ElevenLabsTtsSendTextOptions {
|
|
3233
|
+
/** Regular TTS only. Requests generation before the normal chunk schedule. */
|
|
3234
|
+
readonly tryTriggerGeneration?: boolean;
|
|
3235
|
+
}
|
|
3236
|
+
interface ElevenLabsDialogueTurnOptions {
|
|
3237
|
+
readonly voiceId?: string;
|
|
3238
|
+
/** Starts a new speaker/prosody turn without closing the socket. */
|
|
3239
|
+
readonly newTurn?: boolean;
|
|
3240
|
+
}
|
|
2576
3241
|
interface ElevenLabsTtsProviderOptions {
|
|
2577
3242
|
readonly apiKey: string;
|
|
2578
3243
|
readonly voiceId: string;
|
|
2579
3244
|
readonly modelId?: string;
|
|
2580
3245
|
readonly language?: string;
|
|
2581
3246
|
readonly url?: string;
|
|
3247
|
+
/** Allows an explicitly configured compatible endpoint/model outside the dated catalog. */
|
|
3248
|
+
readonly allowUnknownModel?: boolean;
|
|
2582
3249
|
readonly stability?: number;
|
|
2583
3250
|
readonly similarityBoost?: number;
|
|
3251
|
+
/** Regular TTS WebSocket speaker boost. */
|
|
3252
|
+
readonly useSpeakerBoost?: boolean;
|
|
3253
|
+
/** Regular TTS WebSocket auto mode; use only when sending complete sentences. */
|
|
3254
|
+
readonly autoMode?: boolean;
|
|
3255
|
+
/** Regular TTS WebSocket generation schedule, in provider character thresholds. */
|
|
3256
|
+
readonly chunkLengthSchedule?: readonly number[];
|
|
3257
|
+
readonly applyTextNormalization?: ElevenLabsTextNormalization;
|
|
3258
|
+
readonly enableLogging?: boolean;
|
|
3259
|
+
readonly enableSsmlParsing?: boolean;
|
|
3260
|
+
readonly seed?: number;
|
|
3261
|
+
readonly inactivityTimeoutSeconds?: number;
|
|
3262
|
+
/** Up to three dictionaries, applied in order on the first provider message. */
|
|
3263
|
+
readonly pronunciationDictionaryLocators?: readonly ElevenLabsPronunciationDictionaryLocator[];
|
|
3264
|
+
/** Voices registered for an Eleven v3 dialogue session. */
|
|
3265
|
+
readonly dialogueVoices?: readonly string[];
|
|
2584
3266
|
readonly clock?: ProviderClock;
|
|
2585
|
-
readonly webSocketFactory?: (url: string, headers: Readonly<Record<string, string>>) =>
|
|
3267
|
+
readonly webSocketFactory?: (url: string, headers: Readonly<Record<string, string>>) => WebSocket__default;
|
|
3268
|
+
}
|
|
3269
|
+
|
|
3270
|
+
interface ElevenLabsStreamOptions {
|
|
3271
|
+
readonly clock: ProviderClock;
|
|
3272
|
+
readonly modelId?: string;
|
|
3273
|
+
readonly protocol?: ElevenLabsTtsProtocol;
|
|
3274
|
+
readonly voice?: string;
|
|
3275
|
+
readonly voices?: readonly string[];
|
|
3276
|
+
readonly maxCharacters?: number | undefined;
|
|
3277
|
+
readonly stability: number;
|
|
3278
|
+
readonly similarityBoost: number;
|
|
3279
|
+
readonly useSpeakerBoost?: boolean | undefined;
|
|
3280
|
+
readonly applyTextNormalization?: ElevenLabsTextNormalization | undefined;
|
|
3281
|
+
readonly chunkLengthSchedule?: readonly number[] | undefined;
|
|
3282
|
+
readonly pronunciationDictionaryLocators?: readonly ElevenLabsPronunciationDictionaryLocator[] | undefined;
|
|
2586
3283
|
}
|
|
2587
3284
|
declare class ElevenLabsTtsProvider implements IncrementalTextToSpeechProvider {
|
|
2588
3285
|
#private;
|
|
@@ -2609,14 +3306,207 @@ declare class ElevenLabsTtsProvider implements IncrementalTextToSpeechProvider {
|
|
|
2609
3306
|
readonly channels: 1;
|
|
2610
3307
|
}[];
|
|
2611
3308
|
};
|
|
2612
|
-
models: readonly ["eleven_flash_v2_5", "
|
|
3309
|
+
models: readonly ["eleven_flash_v2_5", "eleven_flash_v2", "eleven_v3", "eleven_v3_conversational", "eleven_multilingual_v2", "eleven_turbo_v2_5", "eleven_turbo_v2"];
|
|
2613
3310
|
};
|
|
2614
3311
|
constructor(options: ElevenLabsTtsProviderOptions);
|
|
2615
3312
|
synthesize(request: TtsSynthesisRequest): Promise<TtsStream>;
|
|
2616
|
-
openSession(request: TtsSessionOpenRequest): Promise<
|
|
3313
|
+
openSession(request: TtsSessionOpenRequest): Promise<ElevenLabsTtsStream>;
|
|
3314
|
+
}
|
|
3315
|
+
declare class ElevenLabsTtsStream implements TtsSession {
|
|
3316
|
+
#private;
|
|
3317
|
+
readonly events: AsyncIterable<TtsEvent>;
|
|
3318
|
+
constructor(socket: WebSocket__default, request: TtsSessionOpenRequest, options: ElevenLabsStreamOptions);
|
|
3319
|
+
sendText(text: string, options?: ElevenLabsTtsSendTextOptions): Promise<void>;
|
|
3320
|
+
/** Sends one incremental line in a Text-to-Dialogue session. */
|
|
3321
|
+
sendDialogueTurn(text: string, options?: ElevenLabsDialogueTurnOptions): Promise<void>;
|
|
3322
|
+
/** Resets the provider receive timeout without causing a generation. */
|
|
3323
|
+
keepAlive(): Promise<void>;
|
|
3324
|
+
flush(): Promise<TtsFlushResult>;
|
|
3325
|
+
finish(): Promise<void>;
|
|
3326
|
+
cancel(): Promise<void>;
|
|
2617
3327
|
}
|
|
2618
3328
|
declare function createElevenLabsTtsProvider(options: ElevenLabsTtsProviderOptions): ElevenLabsTtsProvider;
|
|
2619
3329
|
|
|
3330
|
+
interface ElevenLabsHttpTtsProviderOptions extends Omit<ElevenLabsTtsProviderOptions, "url" | "webSocketFactory"> {
|
|
3331
|
+
/** Overrides the regular text-to-speech endpoint. */
|
|
3332
|
+
readonly url?: string;
|
|
3333
|
+
/** Overrides the text-to-dialogue endpoint. */
|
|
3334
|
+
readonly dialogueUrl?: string;
|
|
3335
|
+
readonly optimizeStreamingLatency?: 0 | 1 | 2 | 3 | 4;
|
|
3336
|
+
readonly applyLanguageTextNormalization?: boolean;
|
|
3337
|
+
readonly fetchImpl?: typeof fetch;
|
|
3338
|
+
}
|
|
3339
|
+
interface ElevenLabsTtsHttpSynthesisRequest extends TtsSynthesisRequest {
|
|
3340
|
+
readonly previousText?: string;
|
|
3341
|
+
readonly nextText?: string;
|
|
3342
|
+
readonly previousRequestIds?: readonly string[];
|
|
3343
|
+
readonly nextRequestIds?: readonly string[];
|
|
3344
|
+
}
|
|
3345
|
+
interface ElevenLabsDialogueInput {
|
|
3346
|
+
readonly text: string;
|
|
3347
|
+
readonly voiceId: string;
|
|
3348
|
+
}
|
|
3349
|
+
interface ElevenLabsDialogueSynthesisRequest extends Omit<TtsSynthesisRequest, "text" | "voice"> {
|
|
3350
|
+
readonly inputs: readonly ElevenLabsDialogueInput[];
|
|
3351
|
+
readonly previousText?: string;
|
|
3352
|
+
readonly futureText?: string;
|
|
3353
|
+
readonly previousRequestIds?: readonly string[];
|
|
3354
|
+
readonly nextRequestIds?: readonly string[];
|
|
3355
|
+
}
|
|
3356
|
+
interface ElevenLabsDialogueProvider extends TextToSpeechProvider {
|
|
3357
|
+
synthesizeDialogue(request: ElevenLabsDialogueSynthesisRequest): Promise<TtsStream>;
|
|
3358
|
+
/** Forces the regular single-voice TTS HTTP endpoint, including for v3 models. */
|
|
3359
|
+
synthesizeSpeech(request: ElevenLabsTtsHttpSynthesisRequest): Promise<TtsStream>;
|
|
3360
|
+
}
|
|
3361
|
+
declare class ElevenLabsTtsRestProvider implements ElevenLabsDialogueProvider {
|
|
3362
|
+
#private;
|
|
3363
|
+
readonly name: "elevenlabs";
|
|
3364
|
+
readonly kind = "tts";
|
|
3365
|
+
readonly version = "0.1.0";
|
|
3366
|
+
readonly capabilities: ProviderCapabilities;
|
|
3367
|
+
constructor(options: ElevenLabsHttpTtsProviderOptions);
|
|
3368
|
+
get _httpOptions(): ElevenLabsHttpTtsProviderOptions;
|
|
3369
|
+
get _httpModelId(): string;
|
|
3370
|
+
get _httpAllowUnknownModel(): boolean;
|
|
3371
|
+
get _httpClock(): ProviderClock;
|
|
3372
|
+
get _httpFetch(): typeof fetch;
|
|
3373
|
+
synthesize(request: TtsSynthesisRequest): Promise<TtsStream>;
|
|
3374
|
+
synthesizeSpeech(request: ElevenLabsTtsHttpSynthesisRequest): Promise<TtsStream>;
|
|
3375
|
+
synthesizeDialogue(request: ElevenLabsDialogueSynthesisRequest): Promise<TtsStream>;
|
|
3376
|
+
}
|
|
3377
|
+
declare class ElevenLabsTtsHttpStreamProvider extends ElevenLabsTtsRestProvider {
|
|
3378
|
+
readonly capabilities: ProviderCapabilities;
|
|
3379
|
+
synthesizeSpeech(request: ElevenLabsTtsHttpSynthesisRequest): Promise<TtsStream>;
|
|
3380
|
+
synthesizeDialogue(request: ElevenLabsDialogueSynthesisRequest): Promise<TtsStream>;
|
|
3381
|
+
private synthesizeSpeechStream;
|
|
3382
|
+
private synthesizeDialogueStream;
|
|
3383
|
+
private executeStreamSpeech;
|
|
3384
|
+
private executeStreamDialogue;
|
|
3385
|
+
private executeViaProtectedPath;
|
|
3386
|
+
}
|
|
3387
|
+
/** The factory is the preferred entry point for complete HTTP responses. */
|
|
3388
|
+
declare function createElevenLabsTtsRestProvider(options: ElevenLabsHttpTtsProviderOptions): ElevenLabsTtsRestProvider;
|
|
3389
|
+
/** The factory is the preferred entry point for chunked HTTP responses. */
|
|
3390
|
+
declare function createElevenLabsTtsHttpStreamProvider(options: ElevenLabsHttpTtsProviderOptions): ElevenLabsTtsHttpStreamProvider;
|
|
3391
|
+
|
|
3392
|
+
/** The point at which the primary TTS provider became unavailable. */
|
|
3393
|
+
type TtsFailoverPhase = "synthesize" | "stream";
|
|
3394
|
+
interface TtsFailoverContext {
|
|
3395
|
+
readonly phase: TtsFailoverPhase;
|
|
3396
|
+
readonly primary: TextToSpeechProvider;
|
|
3397
|
+
readonly fallback: TextToSpeechProvider;
|
|
3398
|
+
readonly request: TtsSynthesisRequest;
|
|
3399
|
+
readonly fallbackRequest: TtsSynthesisRequest;
|
|
3400
|
+
readonly error: NormalizedError;
|
|
3401
|
+
}
|
|
3402
|
+
interface TtsFailoverProviderOptions {
|
|
3403
|
+
/** The provider used for the normal request path. */
|
|
3404
|
+
readonly primary: TextToSpeechProvider;
|
|
3405
|
+
/** The provider used only after the failover policy accepts the error. */
|
|
3406
|
+
readonly fallback: TextToSpeechProvider;
|
|
3407
|
+
/**
|
|
3408
|
+
* Maps the primary request to the fallback provider's model and voice. The
|
|
3409
|
+
* session, turn, signal, and output format must remain unchanged.
|
|
3410
|
+
*/
|
|
3411
|
+
readonly mapFallbackRequest?: (request: TtsSynthesisRequest, error: NormalizedError) => TtsSynthesisRequest;
|
|
3412
|
+
/**
|
|
3413
|
+
* Defaults to operational provider/network/timeout failures. Validation,
|
|
3414
|
+
* authentication, protocol, identity, and cancellation errors do not fail
|
|
3415
|
+
* over because retrying them on another provider usually hides a bug.
|
|
3416
|
+
*/
|
|
3417
|
+
readonly shouldFallback?: (error: NormalizedError, request: TtsSynthesisRequest) => boolean;
|
|
3418
|
+
/** Best-effort observability hook; observer failures never block fallback. */
|
|
3419
|
+
readonly onFallback?: (context: TtsFailoverContext) => void | PromiseLike<void>;
|
|
3420
|
+
readonly name?: string;
|
|
3421
|
+
}
|
|
3422
|
+
/**
|
|
3423
|
+
* Builds an explicit TTS failover provider for host-owned routing.
|
|
3424
|
+
*
|
|
3425
|
+
* Failover is attempted when the primary request fails before a stream is
|
|
3426
|
+
* returned, or when its stream fails before any audio chunk is emitted. Once
|
|
3427
|
+
* audio has been delivered, the original failure is propagated instead of
|
|
3428
|
+
* replaying the whole response and risking duplicated speech.
|
|
3429
|
+
*/
|
|
3430
|
+
declare function createTtsFailoverProvider(options: TtsFailoverProviderOptions): TextToSpeechProvider;
|
|
3431
|
+
|
|
3432
|
+
declare function bytesToBase64(bytes: Uint8Array): string;
|
|
3433
|
+
declare function base64ToBytes(value: string): Uint8Array;
|
|
3434
|
+
declare function mulawToPcm16le(mulaw: Uint8Array): Uint8Array;
|
|
3435
|
+
declare function pcm16leToMulaw(pcm: Uint8Array): Uint8Array;
|
|
3436
|
+
/**
|
|
3437
|
+
* v0.1 normalized audio is frozen to **pcm_s16le, mono**. The frame/duration/
|
|
3438
|
+
* resample helpers below compute on interleaved-sample assumptions that only hold
|
|
3439
|
+
* for a single channel, so a stereo format would silently corrupt timing. We
|
|
3440
|
+
* reject it at the boundary rather than miscompute.
|
|
3441
|
+
*/
|
|
3442
|
+
declare function assertPcm16leFormat(format: AudioFormat): void;
|
|
3443
|
+
declare function resamplePcm16le(pcm: Uint8Array, fromSampleRateHz: number, toSampleRateHz: number): Uint8Array;
|
|
3444
|
+
declare function frameCountForPcm16le(bytes: Uint8Array): number;
|
|
3445
|
+
declare function durationMsForPcm16le(bytes: Uint8Array, sampleRateHz: number): number;
|
|
3446
|
+
declare function splitPcm16leFrames(bytes: Uint8Array, format: AudioFormat, frameDurationMs: number): readonly Uint8Array[];
|
|
3447
|
+
|
|
3448
|
+
/**
|
|
3449
|
+
* Thrown synchronously when a second live iterator claims the queue. The
|
|
3450
|
+
* stable `code` is the cross-realm detection contract.
|
|
3451
|
+
*/
|
|
3452
|
+
declare class AsyncQueueConsumerError extends Error {
|
|
3453
|
+
readonly name = "AsyncQueueConsumerError";
|
|
3454
|
+
readonly code: "async_queue.consumer_already_claimed";
|
|
3455
|
+
constructor();
|
|
3456
|
+
}
|
|
3457
|
+
interface AsyncQueueOptions {
|
|
3458
|
+
readonly maxBuffered?: number;
|
|
3459
|
+
/**
|
|
3460
|
+
* Supplies the terminal error to deliver when a bounded queue is full. When
|
|
3461
|
+
* omitted, `push()` keeps its non-throwing boolean-only contract and the
|
|
3462
|
+
* caller remains responsible for handling `false`.
|
|
3463
|
+
*/
|
|
3464
|
+
readonly onOverflow?: () => unknown;
|
|
3465
|
+
}
|
|
3466
|
+
/**
|
|
3467
|
+
* Bounded, single-live-consumer async queue. Producer close drains buffered
|
|
3468
|
+
* values; consumer return discards them; fail rejects pending and future
|
|
3469
|
+
* reads. A second live consumer is rejected synchronously.
|
|
3470
|
+
*/
|
|
3471
|
+
declare class AsyncQueue<T> implements AsyncIterable<T> {
|
|
3472
|
+
#private;
|
|
3473
|
+
constructor(options?: AsyncQueueOptions);
|
|
3474
|
+
get isClosed(): boolean;
|
|
3475
|
+
push(value: T): boolean;
|
|
3476
|
+
fail(error: unknown): void;
|
|
3477
|
+
close(): void;
|
|
3478
|
+
[Symbol.asyncIterator](): AsyncIterator<T>;
|
|
3479
|
+
}
|
|
3480
|
+
|
|
3481
|
+
interface AudioNormalizerOptions {
|
|
3482
|
+
readonly inputFormat: AudioFormat;
|
|
3483
|
+
readonly outputFormat?: AudioFormat;
|
|
3484
|
+
readonly channelPolicy?: "average" | "left";
|
|
3485
|
+
}
|
|
3486
|
+
interface AudioNormalizer {
|
|
3487
|
+
readonly inputFormat: AudioFormat;
|
|
3488
|
+
readonly outputFormat: AudioFormat;
|
|
3489
|
+
/** Create an independent copy at the current sample-clock position. */
|
|
3490
|
+
fork(): AudioNormalizer;
|
|
3491
|
+
push(bytes: Uint8Array): Uint8Array;
|
|
3492
|
+
finishSegment(): Uint8Array;
|
|
3493
|
+
finish(): Uint8Array;
|
|
3494
|
+
}
|
|
3495
|
+
/**
|
|
3496
|
+
* Converts supported PCM source frames into PCM16LE mono while preserving
|
|
3497
|
+
* sample-clock phase across arbitrary realtime chunk boundaries.
|
|
3498
|
+
*
|
|
3499
|
+
* The FIR is intentionally small and deterministic. It is causal with a
|
|
3500
|
+
* bounded look-ahead: ordinary pushes emit only samples whose filter support is
|
|
3501
|
+
* present, while an explicit segment/stream finish uses the final source sample
|
|
3502
|
+
* as the endpoint. This prevents packet boundaries from becoming resampling
|
|
3503
|
+
* boundaries.
|
|
3504
|
+
*/
|
|
3505
|
+
declare function createAudioNormalizer(options: AudioNormalizerOptions): AudioNormalizer;
|
|
3506
|
+
|
|
3507
|
+
declare function isInputMediaEvent(event: MediaEvent): event is InputMediaEvent;
|
|
3508
|
+
declare function isOutputMediaEvent(event: MediaEvent): event is OutputMediaEvent;
|
|
3509
|
+
|
|
2620
3510
|
/**
|
|
2621
3511
|
* A single param value or an array of repeated param values. Twilio sends
|
|
2622
3512
|
* each value as a separate URL-encoded occurrence in the POST body, so a
|
|
@@ -2650,11 +3540,6 @@ interface VerifyTwilioOptions {
|
|
|
2650
3540
|
* verifyTwilioSignature({...authTokenB});
|
|
2651
3541
|
*/
|
|
2652
3542
|
readonly authToken: string;
|
|
2653
|
-
/**
|
|
2654
|
-
* When true, return true unconditionally. Use this ONLY in tests, never
|
|
2655
|
-
* in production. Defaults to false.
|
|
2656
|
-
*/
|
|
2657
|
-
readonly skipVerification?: boolean;
|
|
2658
3543
|
}
|
|
2659
3544
|
declare function canonicalizeTwilioData(url: string, params: TwilioFlatParams | TwilioParams): Buffer;
|
|
2660
3545
|
/**
|
|
@@ -2712,10 +3597,6 @@ interface VerifyVoiceSessionTokenOptions {
|
|
|
2712
3597
|
* Use this if server and client clocks are skewed.
|
|
2713
3598
|
*/
|
|
2714
3599
|
readonly toleranceMs?: number;
|
|
2715
|
-
/**
|
|
2716
|
-
* When true, return true unconditionally. Use ONLY in tests.
|
|
2717
|
-
*/
|
|
2718
|
-
readonly skipVerification?: boolean;
|
|
2719
3600
|
}
|
|
2720
3601
|
/**
|
|
2721
3602
|
* Compute the expected voice-session token for a given session ref
|
|
@@ -2749,6 +3630,7 @@ type AudioFormatDirection = "input" | "output";
|
|
|
2749
3630
|
declare function supportsAudioFormat(provider: Provider, format: AudioFormat, direction: AudioFormatDirection): boolean;
|
|
2750
3631
|
declare function supportsLanguage(provider: Provider, language: string): boolean;
|
|
2751
3632
|
declare function supportsModel(provider: Provider, model: string): boolean;
|
|
3633
|
+
declare function supportsBatchModel(provider: Provider, model: string): boolean;
|
|
2752
3634
|
declare function requireProviderKind<K extends ProviderKind>(provider: RuntimeProvider, kind: K): ProviderForKind<K>;
|
|
2753
3635
|
|
|
2754
3636
|
interface DefineToolInput<TInput, TOutput> {
|
|
@@ -2866,7 +3748,7 @@ declare class SessionRecoveryCoordinator {
|
|
|
2866
3748
|
#private;
|
|
2867
3749
|
constructor(options: SessionRecoveryCoordinatorOptions);
|
|
2868
3750
|
start(): void;
|
|
2869
|
-
stop(): void
|
|
3751
|
+
stop(): Promise<void>;
|
|
2870
3752
|
pollOnce(): Promise<RecoveryPollResult>;
|
|
2871
3753
|
}
|
|
2872
3754
|
interface SessionReaperOptions {
|
|
@@ -2887,7 +3769,7 @@ declare class SessionReaper {
|
|
|
2887
3769
|
#private;
|
|
2888
3770
|
constructor(options: SessionReaperOptions);
|
|
2889
3771
|
start(): void;
|
|
2890
|
-
stop(): void
|
|
3772
|
+
stop(): Promise<void>;
|
|
2891
3773
|
reapOnce(): Promise<number>;
|
|
2892
3774
|
}
|
|
2893
3775
|
|
|
@@ -2932,7 +3814,7 @@ declare class ConversationPolicy {
|
|
|
2932
3814
|
/** Commits buffered final segments for an endpoint, timeout, or stream shutdown. */
|
|
2933
3815
|
flushBufferedTranscript(): string | null;
|
|
2934
3816
|
messagesForTranscript(transcript: string): readonly LlmMessage[];
|
|
2935
|
-
messagesForToolContinuation(messages: readonly LlmMessage[], assistantText: string, toolMessages: readonly LlmMessage[]): readonly LlmMessage[];
|
|
3817
|
+
messagesForToolContinuation(messages: readonly LlmMessage[], assistantText: string, toolMessages: readonly LlmMessage[], assistantToolCalls?: readonly LlmInlineToolCall[]): readonly LlmMessage[];
|
|
2936
3818
|
recordTurn(transcript: string, assistantText: string): void;
|
|
2937
3819
|
recordInterruptedTurn(transcript: string, assistantText: string): void;
|
|
2938
3820
|
findTool(call: LlmInlineToolCall): ToolDefinition | null;
|
|
@@ -2971,7 +3853,11 @@ interface SttReconnectOptions {
|
|
|
2971
3853
|
readonly uncertainWindowMs?: number;
|
|
2972
3854
|
readonly maxBufferedBytes?: number;
|
|
2973
3855
|
readonly maxBufferedCommands?: number;
|
|
3856
|
+
/** Bounds provider acceptance of one audio command in each generation. */
|
|
3857
|
+
readonly sendTimeoutMs?: number;
|
|
2974
3858
|
readonly commitTimeoutMs?: number;
|
|
3859
|
+
readonly audioWriteTimeoutMs?: number;
|
|
3860
|
+
readonly closeTimeoutMs?: number;
|
|
2975
3861
|
}
|
|
2976
3862
|
/**
|
|
2977
3863
|
* Wraps one STT provider with bounded, best-effort reconnect and replay policy.
|
|
@@ -3006,6 +3892,8 @@ declare function deliverAssistantText(options: {
|
|
|
3006
3892
|
readonly mode?: TextDeliveryMode;
|
|
3007
3893
|
readonly audioDelivered: boolean;
|
|
3008
3894
|
readonly cancelledByBargeIn: boolean;
|
|
3895
|
+
/** Internal seam for deterministic tests and slow text transports. */
|
|
3896
|
+
readonly timeoutMs?: number;
|
|
3009
3897
|
}): Promise<boolean | undefined>;
|
|
3010
3898
|
|
|
3011
3899
|
/**
|
|
@@ -3058,7 +3946,8 @@ type VoiceEvent = {
|
|
|
3058
3946
|
};
|
|
3059
3947
|
/**
|
|
3060
3948
|
* The result of starting a `PipelineVoiceLoop`. Dual-protocol: awaits
|
|
3061
|
-
* to a final `PipelineVoiceLoopResult`
|
|
3949
|
+
* to a final `PipelineVoiceLoopResult` with an explicit terminal reason and
|
|
3950
|
+
* source, AND iterates the per-event
|
|
3062
3951
|
* stream.
|
|
3063
3952
|
*
|
|
3064
3953
|
* Implementation note: the class implements both `PromiseLike<PipelineVoiceLoopResult>`
|
|
@@ -3096,7 +3985,7 @@ type PipelineVoiceLoopResultLike = PipelineVoiceLoopResult;
|
|
|
3096
3985
|
* supervisor controller.
|
|
3097
3986
|
*
|
|
3098
3987
|
* The double-set guard rejects a second `abortSignal` call. To compose
|
|
3099
|
-
* multiple signals, use `AbortSignal.any([a, b])` (Node
|
|
3988
|
+
* multiple signals, use `AbortSignal.any([a, b])` (Node 22+) before
|
|
3100
3989
|
* passing them in.
|
|
3101
3990
|
*/
|
|
3102
3991
|
declare class PipelineVoiceLoopBuilder {
|
|
@@ -3123,9 +4012,15 @@ declare class PipelineVoiceLoopBuilder {
|
|
|
3123
4012
|
interface PipelineVoiceLoopLike {
|
|
3124
4013
|
_startInternal(options: {
|
|
3125
4014
|
readonly overrideSignal?: AbortSignal;
|
|
4015
|
+
readonly consumer?: "internal" | "public";
|
|
4016
|
+
/** Internal lifecycle hook; does not observe or assimilate the thenable. */
|
|
4017
|
+
readonly onRunPromise?: (promise: Promise<PipelineVoiceLoopResult>) => void;
|
|
3126
4018
|
}): DualProtocolResult;
|
|
3127
4019
|
}
|
|
3128
4020
|
|
|
4021
|
+
/** The six sources that may win a live pipeline terminal race. */
|
|
4022
|
+
type LiveTerminalSource = Extract<TerminalSource, "operator_stop" | "caller_abort" | "run_timeout" | "remote_transport" | "provider_runtime" | "normal_completion">;
|
|
4023
|
+
|
|
3129
4024
|
interface TurnLatencyRecord {
|
|
3130
4025
|
readonly sessionId: SessionId;
|
|
3131
4026
|
readonly turnId: TurnId;
|
|
@@ -3163,6 +4058,8 @@ interface PipelineVoiceLoopOptions {
|
|
|
3163
4058
|
readonly turnEndpointTimeoutMs?: number;
|
|
3164
4059
|
/** Absolute cap from the first immutable final segment in one utterance. */
|
|
3165
4060
|
readonly turnMaxDurationMs?: number;
|
|
4061
|
+
/** Optional managed-owner source for an external cancellation signal. */
|
|
4062
|
+
readonly terminalSourceForCancellation?: () => LiveTerminalSource | undefined;
|
|
3166
4063
|
/**
|
|
3167
4064
|
* Receives one record per terminal turn. This is an observation seam, not part of
|
|
3168
4065
|
* execution: it is invoked after the turn is already terminal, its return value is
|
|
@@ -3172,12 +4069,23 @@ interface PipelineVoiceLoopOptions {
|
|
|
3172
4069
|
readonly onAssistantText?: (record: AssistantTextRecord) => void;
|
|
3173
4070
|
readonly sessionMetricsRecorder?: SessionMetricsRecorder;
|
|
3174
4071
|
}
|
|
4072
|
+
type PipelineVoiceLoopTerminalReason = "completed" | "cancelled" | "failed" | "remote_hangup";
|
|
3175
4073
|
interface PipelineVoiceLoopResult {
|
|
3176
4074
|
readonly session: ActiveSession;
|
|
3177
4075
|
readonly turnsHandled: number;
|
|
3178
4076
|
readonly interruptions: number;
|
|
3179
4077
|
readonly turnsFailed: number;
|
|
3180
4078
|
readonly firstTurnError: NormalizedError | null;
|
|
4079
|
+
/**
|
|
4080
|
+
* Terminal reason for RESOLVED runs (additive; existing readers ignore it).
|
|
4081
|
+
* Precedence: cancelled (explicit cancel/abort won) > failed (one or more
|
|
4082
|
+
* failed turns, or a timeout/error stream end) > remote_hangup >
|
|
4083
|
+
* completed. Rejected runs carry their terminal in the rejection instead;
|
|
4084
|
+
* unified cancel/remote arbitration with scheduler batches is joint T1
|
|
4085
|
+
* work — this field reports the resolved outcome only.
|
|
4086
|
+
*/
|
|
4087
|
+
readonly terminalReason: PipelineVoiceLoopTerminalReason;
|
|
4088
|
+
readonly terminalSource: LiveTerminalSource;
|
|
3181
4089
|
}
|
|
3182
4090
|
/**
|
|
3183
4091
|
* Runs a pipeline voice session: media -> STT -> LLM/tools -> TTS -> media.
|
|
@@ -3205,9 +4113,31 @@ declare class PipelineVoiceLoop {
|
|
|
3205
4113
|
*/
|
|
3206
4114
|
_startInternal(options: {
|
|
3207
4115
|
readonly overrideSignal?: AbortSignal;
|
|
4116
|
+
readonly consumer?: "internal" | "public";
|
|
4117
|
+
/** Internal lifecycle hook used by managed wrappers without thenable assimilation. */
|
|
4118
|
+
readonly onRunPromise?: (promise: Promise<PipelineVoiceLoopResult>) => void;
|
|
3208
4119
|
}): DualProtocolResult;
|
|
3209
4120
|
}
|
|
3210
4121
|
|
|
4122
|
+
type CleanupStage = "call.close" | "runtime.endSession" | "runtime.stop" | "late.call.close" | "late.runtime.endSession" | "late.runtime.stop";
|
|
4123
|
+
interface CleanupErrorSummary {
|
|
4124
|
+
readonly stage: CleanupStage;
|
|
4125
|
+
readonly code: string;
|
|
4126
|
+
readonly message: string;
|
|
4127
|
+
}
|
|
4128
|
+
interface VoiceRuntimeFailureMetadata {
|
|
4129
|
+
readonly degraded: boolean;
|
|
4130
|
+
readonly callClosed: boolean;
|
|
4131
|
+
readonly sessionEnded: boolean;
|
|
4132
|
+
readonly timedOut: boolean;
|
|
4133
|
+
readonly lateCleanupPending: boolean;
|
|
4134
|
+
readonly primaryCode: string;
|
|
4135
|
+
readonly cleanupErrors: readonly CleanupErrorSummary[];
|
|
4136
|
+
}
|
|
4137
|
+
declare class VoiceRuntimeFinalizationError extends TvicThrowableError {
|
|
4138
|
+
constructor(raw: NormalizedError | null, cleanupErrors: readonly CleanupErrorSummary[], metadata: VoiceRuntimeFailureMetadata);
|
|
4139
|
+
}
|
|
4140
|
+
|
|
3211
4141
|
type AudioNormalizationMode = "auto" | "never";
|
|
3212
4142
|
interface SttSessionInputOptions {
|
|
3213
4143
|
readonly format: AudioFormat;
|
|
@@ -3228,6 +4158,12 @@ interface SttSessionOptions {
|
|
|
3228
4158
|
readonly vocabulary?: readonly string[];
|
|
3229
4159
|
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
3230
4160
|
readonly openTimeoutMs?: number;
|
|
4161
|
+
/** Bounds provider acceptance of one audio command. */
|
|
4162
|
+
readonly sendTimeoutMs?: number;
|
|
4163
|
+
/** Bounds provider acceptance of one commit barrier. */
|
|
4164
|
+
readonly commitTimeoutMs?: number;
|
|
4165
|
+
/** Bounds an ordered close before the session switches to forced teardown. */
|
|
4166
|
+
readonly closeTimeoutMs?: number;
|
|
3231
4167
|
readonly signal?: AbortSignal;
|
|
3232
4168
|
readonly clock?: Clock;
|
|
3233
4169
|
readonly idGenerator?: IdGenerator;
|
|
@@ -3259,7 +4195,7 @@ type UpgradeAuthorization<TContext> = {
|
|
|
3259
4195
|
readonly reason?: string;
|
|
3260
4196
|
};
|
|
3261
4197
|
interface NodeMediaPlaneConnection<TContext = unknown> {
|
|
3262
|
-
readonly socket:
|
|
4198
|
+
readonly socket: WebSocket__default;
|
|
3263
4199
|
readonly request: IncomingMessage;
|
|
3264
4200
|
readonly url: URL;
|
|
3265
4201
|
readonly params: Readonly<Record<string, string>>;
|
|
@@ -3267,11 +4203,13 @@ interface NodeMediaPlaneConnection<TContext = unknown> {
|
|
|
3267
4203
|
}
|
|
3268
4204
|
type NodeMediaPlaneConnectionHandler<TContext = unknown> = (connection: NodeMediaPlaneConnection<TContext>) => Promise<void> | void;
|
|
3269
4205
|
type NodeMediaPlaneRequestHandler = (request: IncomingMessage, response: ServerResponse) => boolean | Promise<boolean>;
|
|
3270
|
-
type NodeMediaPlaneConnectionErrorHandler = (error: unknown, socket:
|
|
4206
|
+
type NodeMediaPlaneConnectionErrorHandler = (error: unknown, socket: WebSocket__default) => void | Promise<void>;
|
|
3271
4207
|
interface NodeMediaPlaneOptions<TContext = unknown> {
|
|
3272
4208
|
readonly host?: string;
|
|
3273
4209
|
readonly port: number;
|
|
3274
4210
|
readonly path: string;
|
|
4211
|
+
/** Maximum inbound WebSocket frame accepted before the connection is closed. */
|
|
4212
|
+
readonly maxInboundFrameBytes?: number;
|
|
3275
4213
|
readonly healthPath?: string;
|
|
3276
4214
|
/**
|
|
3277
4215
|
* Optional health check. Called when the plane's `healthPath` endpoint
|
|
@@ -3327,12 +4265,17 @@ type AssemblyAiProviderConfig = Omit<AssemblyAiSttProviderOptions, "apiKey" | "m
|
|
|
3327
4265
|
readonly apiKey?: string;
|
|
3328
4266
|
readonly model?: string;
|
|
3329
4267
|
};
|
|
4268
|
+
type CartesiaSttProviderConfig = Omit<CartesiaSttProviderOptions, "apiKey" | "modelId"> & {
|
|
4269
|
+
readonly provider: "cartesia";
|
|
4270
|
+
readonly apiKey?: string;
|
|
4271
|
+
readonly model?: string;
|
|
4272
|
+
};
|
|
3330
4273
|
type SonioxProviderConfig = Omit<SonioxSttProviderOptions, "apiKey" | "modelId"> & {
|
|
3331
4274
|
readonly provider: "soniox";
|
|
3332
4275
|
readonly apiKey?: string;
|
|
3333
4276
|
readonly model?: string;
|
|
3334
4277
|
};
|
|
3335
|
-
type SttProviderConfig = DeepgramProviderConfig | SarvamProviderConfig | ElevenLabsSttProviderConfig | AssemblyAiProviderConfig | SonioxProviderConfig;
|
|
4278
|
+
type SttProviderConfig = DeepgramProviderConfig | SarvamProviderConfig | CartesiaSttProviderConfig | ElevenLabsSttProviderConfig | AssemblyAiProviderConfig | SonioxProviderConfig;
|
|
3336
4279
|
type OpenAiProviderConfig = Omit<OpenAiResponsesLlmProviderOptions, "apiKey"> & {
|
|
3337
4280
|
readonly provider: "openai" | "openai-responses";
|
|
3338
4281
|
readonly apiKey?: string;
|
|
@@ -3340,20 +4283,46 @@ type OpenAiProviderConfig = Omit<OpenAiResponsesLlmProviderOptions, "apiKey"> &
|
|
|
3340
4283
|
/** Allows a custom OpenAI-compatible endpoint to use a model outside TVIC's dated catalog. */
|
|
3341
4284
|
readonly allowUnknownModel?: boolean;
|
|
3342
4285
|
};
|
|
3343
|
-
type
|
|
4286
|
+
type GroqProviderConfig = Omit<GroqChatLlmProviderOptions, "apiKey"> & {
|
|
4287
|
+
readonly provider: "groq";
|
|
4288
|
+
readonly apiKey?: string;
|
|
4289
|
+
readonly model?: string;
|
|
4290
|
+
readonly allowUnknownModel?: boolean;
|
|
4291
|
+
};
|
|
4292
|
+
type LlmProviderConfig = OpenAiProviderConfig | GroqProviderConfig;
|
|
3344
4293
|
type CartesiaProviderConfig = Omit<CartesiaTtsProviderOptions, "apiKey" | "voiceId" | "modelId"> & {
|
|
3345
4294
|
readonly provider: "cartesia";
|
|
3346
4295
|
readonly apiKey?: string;
|
|
3347
4296
|
readonly model?: string;
|
|
3348
4297
|
readonly voiceId?: string;
|
|
3349
4298
|
};
|
|
3350
|
-
type ElevenLabsTtsProviderConfig = Omit<ElevenLabsTtsProviderOptions, "apiKey" | "voiceId" | "modelId"> & {
|
|
4299
|
+
type ElevenLabsTtsProviderConfig = (Omit<ElevenLabsTtsProviderOptions, "apiKey" | "voiceId" | "modelId"> & {
|
|
3351
4300
|
readonly provider: "elevenlabs";
|
|
4301
|
+
readonly transport?: "websocket";
|
|
3352
4302
|
readonly apiKey?: string;
|
|
3353
4303
|
readonly model?: string;
|
|
3354
4304
|
readonly voiceId?: string;
|
|
3355
|
-
}
|
|
3356
|
-
|
|
4305
|
+
}) | (Omit<ElevenLabsHttpTtsProviderOptions, "apiKey" | "voiceId" | "modelId"> & {
|
|
4306
|
+
readonly provider: "elevenlabs";
|
|
4307
|
+
readonly transport: "rest" | "http-stream";
|
|
4308
|
+
readonly apiKey?: string;
|
|
4309
|
+
readonly model?: string;
|
|
4310
|
+
readonly voiceId?: string;
|
|
4311
|
+
});
|
|
4312
|
+
type SarvamTtsProviderConfig = (Omit<SarvamTtsProviderOptions, "apiKey" | "modelId" | "voiceId"> & {
|
|
4313
|
+
readonly provider: "sarvam";
|
|
4314
|
+
readonly transport?: "websocket";
|
|
4315
|
+
readonly apiKey?: string;
|
|
4316
|
+
readonly model?: string;
|
|
4317
|
+
readonly voiceId?: string;
|
|
4318
|
+
}) | (Omit<SarvamTtsHttpProviderOptions, "apiKey" | "modelId" | "voiceId"> & {
|
|
4319
|
+
readonly provider: "sarvam";
|
|
4320
|
+
readonly transport: "rest" | "http-stream";
|
|
4321
|
+
readonly apiKey?: string;
|
|
4322
|
+
readonly model?: string;
|
|
4323
|
+
readonly voiceId?: string;
|
|
4324
|
+
});
|
|
4325
|
+
type TtsProviderConfig = CartesiaProviderConfig | ElevenLabsTtsProviderConfig | SarvamTtsProviderConfig;
|
|
3357
4326
|
type TelephonyProviderConfig = {
|
|
3358
4327
|
readonly provider: "web-client-audio";
|
|
3359
4328
|
readonly options?: WebClientAudioProviderOptions;
|
|
@@ -3403,6 +4372,8 @@ interface VoiceAgentRunOptions {
|
|
|
3403
4372
|
readonly organizationId?: OrganizationId;
|
|
3404
4373
|
readonly workflowId?: WorkflowId;
|
|
3405
4374
|
readonly signal?: AbortSignal;
|
|
4375
|
+
/** Maximum time allowed to start the runtime, attach the call, and create the run. */
|
|
4376
|
+
readonly startupTimeoutMs?: number;
|
|
3406
4377
|
readonly safetyIdentifier?: string;
|
|
3407
4378
|
readonly sttReconnect?: boolean | SttReconnectOptions;
|
|
3408
4379
|
readonly sttLanguage?: string;
|
|
@@ -3413,8 +4384,11 @@ interface VoiceAgentRunOptions {
|
|
|
3413
4384
|
}
|
|
3414
4385
|
interface VoiceAgentCallHandleContext {
|
|
3415
4386
|
readonly sessionId: SessionId;
|
|
3416
|
-
|
|
4387
|
+
/** A deeply frozen copy of the validated call supplied to start(). */
|
|
4388
|
+
readonly call: CallSnapshot;
|
|
3417
4389
|
readonly channel: ChannelKind;
|
|
4390
|
+
/** Aborts when the caller, startup deadline, or global agent shutdown wins. */
|
|
4391
|
+
readonly signal: AbortSignal;
|
|
3418
4392
|
}
|
|
3419
4393
|
type VoiceAgentCallHandleFactory = (context: VoiceAgentCallHandleContext) => CallHandle | PromiseLike<CallHandle>;
|
|
3420
4394
|
interface VoiceAgentRun extends DualProtocolResult {
|
|
@@ -3441,68 +4415,6 @@ interface VoiceAgent {
|
|
|
3441
4415
|
}
|
|
3442
4416
|
declare function createVoiceAgent(options: CreateVoiceAgentOptions): VoiceAgent;
|
|
3443
4417
|
|
|
3444
|
-
declare function bytesToBase64(bytes: Uint8Array): string;
|
|
3445
|
-
declare function base64ToBytes(value: string): Uint8Array;
|
|
3446
|
-
declare function mulawToPcm16le(mulaw: Uint8Array): Uint8Array;
|
|
3447
|
-
declare function pcm16leToMulaw(pcm: Uint8Array): Uint8Array;
|
|
3448
|
-
/**
|
|
3449
|
-
* v0.1 normalized audio is frozen to **pcm_s16le, mono**. The frame/duration/
|
|
3450
|
-
* resample helpers below compute on interleaved-sample assumptions that only hold
|
|
3451
|
-
* for a single channel, so a stereo format would silently corrupt timing. We
|
|
3452
|
-
* reject it at the boundary rather than miscompute.
|
|
3453
|
-
*/
|
|
3454
|
-
declare function assertPcm16leFormat(format: AudioFormat): void;
|
|
3455
|
-
declare function resamplePcm16le(pcm: Uint8Array, fromSampleRateHz: number, toSampleRateHz: number): Uint8Array;
|
|
3456
|
-
declare function frameCountForPcm16le(bytes: Uint8Array): number;
|
|
3457
|
-
declare function durationMsForPcm16le(bytes: Uint8Array, sampleRateHz: number): number;
|
|
3458
|
-
declare function splitPcm16leFrames(bytes: Uint8Array, format: AudioFormat, frameDurationMs: number): readonly Uint8Array[];
|
|
3459
|
-
|
|
3460
|
-
/**
|
|
3461
|
-
* A deliberately unbounded, single-consumer async queue: exactly one iterator
|
|
3462
|
-
* may drain it, and pushed values resolve waiters in FIFO order. Lives in
|
|
3463
|
-
* `@tvic/media` because it is the one package both `@tvic/providers` and
|
|
3464
|
-
* `@tvic/runtime` are allowed to depend on (see `scripts/check-architecture.mjs`),
|
|
3465
|
-
* so provider adapters and the runtime's own session/stream wrappers share this
|
|
3466
|
-
* one implementation instead of each keeping a private copy.
|
|
3467
|
-
*/
|
|
3468
|
-
declare class AsyncQueue<T> implements AsyncIterable<T> {
|
|
3469
|
-
#private;
|
|
3470
|
-
constructor(options?: {
|
|
3471
|
-
readonly maxBuffered?: number;
|
|
3472
|
-
});
|
|
3473
|
-
push(value: T): boolean;
|
|
3474
|
-
fail(error: unknown): void;
|
|
3475
|
-
close(): void;
|
|
3476
|
-
[Symbol.asyncIterator](): AsyncIterator<T>;
|
|
3477
|
-
}
|
|
3478
|
-
|
|
3479
|
-
interface AudioNormalizerOptions {
|
|
3480
|
-
readonly inputFormat: AudioFormat;
|
|
3481
|
-
readonly outputFormat?: AudioFormat;
|
|
3482
|
-
readonly channelPolicy?: "average" | "left";
|
|
3483
|
-
}
|
|
3484
|
-
interface AudioNormalizer {
|
|
3485
|
-
readonly inputFormat: AudioFormat;
|
|
3486
|
-
readonly outputFormat: AudioFormat;
|
|
3487
|
-
push(bytes: Uint8Array): Uint8Array;
|
|
3488
|
-
finishSegment(): Uint8Array;
|
|
3489
|
-
finish(): Uint8Array;
|
|
3490
|
-
}
|
|
3491
|
-
/**
|
|
3492
|
-
* Converts supported PCM source frames into PCM16LE mono while preserving
|
|
3493
|
-
* sample-clock phase across arbitrary realtime chunk boundaries.
|
|
3494
|
-
*
|
|
3495
|
-
* The FIR is intentionally small and deterministic. It is causal with a
|
|
3496
|
-
* bounded look-ahead: ordinary pushes emit only samples whose filter support is
|
|
3497
|
-
* present, while an explicit segment/stream finish uses the final source sample
|
|
3498
|
-
* as the endpoint. This prevents packet boundaries from becoming resampling
|
|
3499
|
-
* boundaries.
|
|
3500
|
-
*/
|
|
3501
|
-
declare function createAudioNormalizer(options: AudioNormalizerOptions): AudioNormalizer;
|
|
3502
|
-
|
|
3503
|
-
declare function isInputMediaEvent(event: MediaEvent): event is InputMediaEvent;
|
|
3504
|
-
declare function isOutputMediaEvent(event: MediaEvent): event is OutputMediaEvent;
|
|
3505
|
-
|
|
3506
4418
|
declare class InMemorySessionStore implements SessionStore {
|
|
3507
4419
|
#private;
|
|
3508
4420
|
get(id: SessionId): Promise<StoredSessionRecord | null>;
|
|
@@ -3668,9 +4580,21 @@ declare function idempotencyKeyFor<TInput, TOutput>(input: ExecuteToolInput<TInp
|
|
|
3668
4580
|
declare function idempotencyRequestHashFor<TInput, TOutput>(input: ExecuteToolInput<TInput, TOutput>): string;
|
|
3669
4581
|
declare function executeTool<TInput = unknown, TOutput = unknown>(input: ExecuteToolInput<TInput, TOutput>): Promise<ToolCall>;
|
|
3670
4582
|
|
|
4583
|
+
interface PersistedErrorCompatibilityDiagnostic {
|
|
4584
|
+
readonly adapter: "postgres" | "redis";
|
|
4585
|
+
readonly operation: "idempotency_alias_rewrite";
|
|
4586
|
+
readonly key: string;
|
|
4587
|
+
readonly legacyCode: string;
|
|
4588
|
+
readonly canonicalCode: string;
|
|
4589
|
+
readonly outcome: "rewrite_failed";
|
|
4590
|
+
}
|
|
4591
|
+
|
|
3671
4592
|
declare class PostgresToolIdempotencyStore implements ToolIdempotencyStore {
|
|
4593
|
+
#private;
|
|
3672
4594
|
readonly client: SqlClient$1;
|
|
3673
|
-
constructor(client: SqlClient$1
|
|
4595
|
+
constructor(client: SqlClient$1, options?: {
|
|
4596
|
+
readonly onCompatibilityDiagnostic?: (diagnostic: PersistedErrorCompatibilityDiagnostic) => void;
|
|
4597
|
+
});
|
|
3674
4598
|
lookup(key: string, requestHash: string): Promise<ToolIdempotencyRecord | null>;
|
|
3675
4599
|
claim(input: ToolIdempotencyClaim): Promise<ToolIdempotencyClaimResult>;
|
|
3676
4600
|
complete(key: string, requestHash: string, outcome: ToolIdempotencyOutcome): Promise<void>;
|
|
@@ -3827,6 +4751,7 @@ interface RedisStoreOptions {
|
|
|
3827
4751
|
readonly nowMs?: () => number;
|
|
3828
4752
|
readonly maxTransactionRetries?: number;
|
|
3829
4753
|
readonly closeClient?: boolean;
|
|
4754
|
+
readonly onCompatibilityDiagnostic?: (diagnostic: PersistedErrorCompatibilityDiagnostic) => void;
|
|
3830
4755
|
}
|
|
3831
4756
|
|
|
3832
4757
|
declare class RedisSessionStore implements SessionStore {
|
|
@@ -3931,13 +4856,13 @@ declare function createPostgresRedisDurableRuntimeStore(options: PostgresRedisDu
|
|
|
3931
4856
|
interface SqlClient {
|
|
3932
4857
|
query<TRow extends Record<string, unknown> = Record<string, unknown>>(text: string, params?: readonly unknown[]): Promise<{
|
|
3933
4858
|
rows: readonly TRow[];
|
|
3934
|
-
rowCount
|
|
4859
|
+
rowCount?: number | null;
|
|
3935
4860
|
}>;
|
|
3936
4861
|
}
|
|
3937
4862
|
interface SqlPool {
|
|
3938
4863
|
query<TRow extends Record<string, unknown> = Record<string, unknown>>(text: string, params?: readonly unknown[]): Promise<{
|
|
3939
4864
|
rows: readonly TRow[];
|
|
3940
|
-
rowCount
|
|
4865
|
+
rowCount?: number | null;
|
|
3941
4866
|
}>;
|
|
3942
4867
|
connect(): Promise<SqlClient & {
|
|
3943
4868
|
readonly release: () => void;
|
|
@@ -3972,5 +4897,5 @@ declare class PostgresMemory implements Memory {
|
|
|
3972
4897
|
}
|
|
3973
4898
|
declare function createPostgresMemory(options: PostgresMemoryOptions): PostgresMemory;
|
|
3974
4899
|
|
|
3975
|
-
export { ADAPTER_DEFAULTS, AssemblyAiSttProvider, AsyncQueue, BackendUnavailableError, CartesiaTtsProvider, ConversationPolicy, CorruptRecordError, DEFAULT_DURABLE_RUNTIME_POLICY, DTMF_DIGITS, DeepgramSttProvider, DurableError, EVENT_KIND_MAP, ElevenLabsSttProvider, ElevenLabsTtsProvider, InMemoryMemory, InMemorySessionLeaseStore, InMemorySessionStore, InMemoryToolCallStore, InMemoryToolIdempotencyStore, InMemoryTurnStore, InvalidArgumentError, LeaseLostError, LeaseUnavailableError, MemoryBackendUnavailableError, MemoryEntryTooLargeError, MemorySessionQuotaExceededError, NodeMediaPlane, PCM16_16K_MONO, PCM16_8K_MONO, PROVIDER_API_VERSIONS, PROVIDER_CATALOG, PROVIDER_ERROR_CODES, PROVIDER_NAMES, PROVIDER_STABILITY, PipelineVoiceLoop, PipelineVoiceLoopBuilder, RUNTIME_SAMPLE_RATE_HZ, RecordConflictError, RecordNotFoundError, STT_ERROR_CODES, STT_STREAM_ENDED_REASON, SarvamSttProvider, SessionReaper, SessionRecoveryCoordinator, SonioxSttProvider, TELEPHONY_SAMPLE_RATE_HZ, TVIC_ERROR_MARKER, TVIC_ERROR_NAMES, TvicThrowableError, TwilioMediaStreamCallHandle, TwilioMediaStreamsProvider, WEB_CLIENT_AUDIO_CLOSE_CODES, WEB_CLIENT_AUDIO_DEFAULTS, WebClientAudioCallHandle, WebClientAudioProvider, assertMemoryCapability, assertMemoryPolicySupported, assertPcm16leFormat, authError, base64ToBytes, bytesToBase64, cancelledError, canonicalizeTwilioData, computeTwilioSignature, connectionError, counterIdGenerator, createAssemblyAiSttProvider, createAudioNormalizer, createCartesiaTtsProvider, createDeepgramSttProvider, createDefaultIdGenerator, createElevenLabsSttProvider, createElevenLabsTtsProvider, createInMemoryDurableRuntimeStore, createInMemoryMemory, createInMemorySessionStore, createInMemoryToolCallStore, createInMemoryTurnStore, createMediaEvent, createNodeMediaPlane, createOpenAiResponsesLlmProvider, createPostgresDurableRuntimeStore, createPostgresMemory, createPostgresRedisDurableRuntimeStore, createRedisDurableRuntimeStore, createRuntime, createSarvamSttProvider, createSonioxSttProvider, createSttSession, createSystemClock, createToolRegistry, createTwilioMediaStreamsProvider, createVoiceAgent, createWebClientAudioProvider, defineAgent, defineTool, deliverAssistantText, durationMsForPcm16le, evaluateProviderCompatibility, executeTool, formatMemoryContextAsSystemBlock, formatPreCallContextAsSystemBlock, frameCountForPcm16le, getSttRecoveryControl, idempotencyKeyFor, idempotencyRequestHashFor, internalError, interruptedError, isDtmfDigit, isIncrementalTextToSpeechProvider, isInputMediaEvent, isNormalizedError, isOutputMediaEvent, isProviderKind, isReconstructableAudioFormat, isSampleRateHz, isTerminalSession, isTerminalTurn, isTranscriptSegmentEvent, isTvicError, isTvicErrorName, kindForMediaEvent, matchPath, mediaError, monotonicOffsetMs, mulawToPcm16le, normalizeLegacyError, normalizeUnknownError, normalizedError, nowTimestamp, pcm16leToMulaw, providerError, rateLimitError, requireProviderKind, resamplePcm16le, resolvePreCallContext, resolvePreCallMemory, runPostgresMemoryMigrations, runPostgresMigrations, sameAudioFormat, shouldDeliverText, signVoiceSessionToken, signatureError, splitPcm16leFrames, stableStringify, supportsAudioFormat, supportsLanguage, supportsModel, terminalSessionFromRequest, terminalTurnFromRequest, timeoutError, toTimestamp, toolError, toolInputError, tvicErrorFromJSON, unknownErrorMessage, validateJsonSchemaSubset, validationError, verifyTwilioSignature, verifyVoiceSessionToken, withSttReconnect };
|
|
3976
|
-
export type { ActiveSession, ActiveTurn, Agent, AgentAudioPolicy, AgentContextPolicy, AgentId, AgentMemoryPolicy, AgentProviders, AnyMediaEventInit, AssemblyAiProviderConfig, AssemblyAiSttProviderOptions, AssistantTextRecord, AudioFormat, AudioNormalizationMode, AudioNormalizer, AudioNormalizerOptions, AudioPayload, BackoffStrategy, Brand, Call, CallControlCapability, CallDirection, CallHandle, CallId, CallStatus, CancelledSession, CancelledTurn, CartesiaProviderConfig, CartesiaTtsProviderOptions, ChannelKind, ChannelLayout, Clock, CompletedSession, CompletedTurn, ConnectedCall, ConnectionObservabilityEvent, ConversationPolicyOptions, CounterIdGenerator, CreateVoiceAgentOptions, CreatedCall, CreatedSession, DeepgramProviderConfig, DeepgramSttProviderOptions, DefineAgentInput, DefineToolInput, DtmfDigit, DtmfReceivedEvent, DualProtocolResult, DurableErrorCode, DurableOutboxEvent, DurableRuntimeMetric, DurableRuntimePolicy, DurableRuntimeStore, DurableSessionTransaction, ElevenLabsSttCommitStrategy, ElevenLabsSttProviderConfig, ElevenLabsSttProviderOptions, ElevenLabsTtsProviderConfig, ElevenLabsTtsProviderOptions, EndSessionReason, EndSessionRequest, EndTurnRequest, EndedCall, ErrorCategory, ExecuteToolInput, FailedCall, FailedSession, FailedToolCall, FailedToolCallStatus, FailedTurn, HealthCheckResult, HealthSnapshot, IdGenerator, IdempotencyPolicy, InMemoryDurableRuntimeStore, InMemoryDurableRuntimeStoreOptions, InMemoryMemoryOptions, InboundCallContext, InboundMediaEvent, IncrementalTextToSpeechProvider, InputAudioChunk, InputMediaEvent, InternalMediaEvent, InterruptRequestedEvent, InterruptionMode, InterruptionPolicy, JsonSchemaDocument, JsonValue, LLMProvider, LlmCompletion, LlmCompletionRequest, LlmInlineToolCall, LlmMessage, LlmMessageRole, LlmProviderConfig, LlmStreamEvent, LlmUsage, MediaAudioChunkEvent, MediaAudioCommittedEvent, MediaDirection, MediaErrorEvent, MediaEvent, MediaEventId, MediaEventKind, MediaEventType, MediaStreamEndedEvent, MediaStreamStartedEvent, MediaTransport, MediaTransportKind, Memory, MemoryCapabilities, MemoryEntry, MemoryEntryId, MemoryKind, MemoryPutOptions, MemoryQuery, MemoryRef, MemoryScope, NodeMediaPlaneConnection, NodeMediaPlaneConnectionErrorHandler, NodeMediaPlaneConnectionHandler, NodeMediaPlaneOptions, NodeMediaPlaneRequestHandler, NormalizedAudioEncoding, NormalizedError, OpenAiProviderConfig, OpenAiResponsesLlmProviderOptions, OrganizationId, OutboundCallRequest, OutputAudioChunk, OutputMediaEvent, PersonaConfig, PipelineVoiceLoopOptions, PipelineVoiceLoopResult, PostgresDurableStoreOptions, PostgresMemoryOptions, PostgresMigration, PostgresRedisDurableStoreOptions, PreCallContext, PreCallContextResolver, PreCallMemoryContext, PreCallMemoryResolver, Provider, ProviderAudioCapabilities, ProviderCancellationCapabilities, ProviderCapabilities, ProviderCatalogEntry, ProviderCompatibility, ProviderCompatibilityIssue, ProviderCompatibilityIssueCode, ProviderDataPolicy, ProviderEventId, ProviderForKind, ProviderKind, ProviderPlayoutCapabilities, ProviderRequirements, ProviderStability, ProviderStreamingCapabilities, ProviderToolCapabilities, ProviderTransport, QueuedToolCall, RecoveryPollResult, RedisClient, RedisMulti, RedisScanOptions, RedisSetResult, RedisStoreOptions, RequiredProviderCapabilities, RetryPolicy, RingingCall, RunningToolCall, Runtime, RuntimeOptions, RuntimeProvider, RuntimeServiceLifecycle, SampleRateHz, SarvamOutputMode, SarvamProviderConfig, SarvamSttProviderOptions, SchemaValidationResult, Session, SessionAttachment, SessionAttachmentHealth, SessionCancellationReason, SessionEndEvent, SessionEndMemorySnapshot, SessionId, SessionLease, SessionLeaseStore, SessionMemoryFinalization, SessionMetricsRecorder, SessionReaperOptions, SessionRecoveryCoordinatorOptions, SessionRuntimeMetadata, SessionSnapshot, SessionState, SessionStatus, SessionStore, SonioxProviderConfig, SonioxStructuredContext, SonioxSttProviderOptions, SpeechToTextProvider, SqlClient$1 as SqlClient, SqlPool$1 as SqlPool, SqlResult, StartAttachedSessionOptions, StartSessionOptions, StartTurnRequest, StartingSession, StoredSessionRecord, StoredToolCallRecord, StoredTurnRecord, StreamEndReason, SttCommitMode, SttOpenRequest, SttProviderConfig, SttReconnectOptions, SttRecoveryControl, SttRecoveryState, SttSession, SttSessionInputOptions, SttSessionOptions, SttStream, SttTimestampOrigin, SucceededToolCall, TelephonyProvider, TelephonyProviderConfig, TerminalSession, TerminalSessionDraft, TerminalSessionStatus, TerminalToolCall, TerminalTurn, TextDeliveryMode, TextToSpeechProvider, TimeoutAction, TimeoutPolicy, Timestamp, ToolCall, ToolCallId, ToolCallRuntimeMetadata, ToolCallStatus, ToolCallStore, ToolDefinition, ToolExecutionContext, ToolExecutor, ToolId, ToolIdempotencyClaim, ToolIdempotencyClaimResult, ToolIdempotencyLease, ToolIdempotencyOutcome, ToolIdempotencyRecord, ToolIdempotencyStatus, ToolIdempotencyStore, ToolLogger, ToolName, ToolRegistry, ToolTenant, TranscriptEndpointEvent, TranscriptEndpointReason, TranscriptEvent, TranscriptEventType, TranscriptSegmentEvent, TranscriptSegmentEventType, TranscriptSpeechStartedEvent, TransportAudioEncoding, TransportAudioFormat, TtsAlignmentEvent, TtsAlignmentUnit, TtsEvent, TtsFlushAcknowledgement, TtsFlushCompletedEvent, TtsFlushId, TtsFlushResult, TtsProviderConfig, TtsSession, TtsSessionOpenRequest, TtsStream, TtsSynthesisRequest, Turn, TurnCancellationReason, TurnCommitRequestedEvent, TurnDetectionMode, TurnId, TurnInput, TurnLatency, TurnLatencyRecord, TurnOutput, TurnRuntimeMetadata, TurnStatus, TurnStore, TvicErrorName, TwilioFlatParams, TwilioMediaStreamCallHandleOptions, TwilioMediaStreamSocket, TwilioParamValue, TwilioParams, UserId, VerifyTwilioOptions, VerifyVoiceSessionTokenOptions, VoiceAgent, VoiceAgentCallHandleContext, VoiceAgentCallHandleFactory, VoiceAgentModels, VoiceAgentProviderNames, VoiceAgentProviders, VoiceAgentRun, VoiceAgentRunOptions, VoiceAgentSession, VoiceEvent, WebClientAudioCallHandleOptions, WebClientAudioConnectionEvent, WebClientAudioProviderOptions, WebClientAudioSocket, WorkflowId };
|
|
4900
|
+
export { ADAPTER_DEFAULTS, AssemblyAiSttProvider, AsyncQueue, AsyncQueueConsumerError, BackendUnavailableError, CartesiaSttProvider, CartesiaTtsProvider, ConversationPolicy, CorruptRecordError, DEFAULT_DURABLE_RUNTIME_POLICY, DTMF_DIGITS, DeepgramSttProvider, DurableError, EVENT_KIND_MAP, ElevenLabsSttProvider, ElevenLabsTtsHttpStreamProvider, ElevenLabsTtsProvider, ElevenLabsTtsRestProvider, InMemoryMemory, InMemorySessionLeaseStore, InMemorySessionStore, InMemoryToolCallStore, InMemoryToolIdempotencyStore, InMemoryTurnStore, InvalidArgumentError, LeaseLostError, LeaseUnavailableError, MAX_CARTESIA_INPUT_UTF16_CODE_UNITS, MAX_CARTESIA_INPUT_UTF8_BYTES, MAX_PROVIDER_AUDIO_OFFSET_MS, MemoryBackendUnavailableError, MemoryEntryTooLargeError, MemorySessionQuotaExceededError, NodeMediaPlane, PCM16_16K_MONO, PCM16_8K_MONO, PROVIDER_API_VERSIONS, PROVIDER_CATALOG, PROVIDER_ERROR_CODES, PROVIDER_NAMES, PROVIDER_STABILITY, PROVIDER_STABILITY_LEVELS, PipelineVoiceLoop, PipelineVoiceLoopBuilder, RUNTIME_SAMPLE_RATE_HZ, RecordConflictError, RecordNotFoundError, STT_ERROR_CODES, STT_STREAM_ENDED_REASON, SarvamSttProvider, SarvamTtsHttpStreamProvider, SarvamTtsProvider, SarvamTtsRestProvider, SessionReaper, SessionRecoveryCoordinator, SonioxSttProvider, TELEPHONY_SAMPLE_RATE_HZ, TVIC_ERROR_CODES, TVIC_ERROR_CODE_ALIASES, TVIC_ERROR_MARKER, TVIC_ERROR_NAMES, TWILIO_MAX_AUDIO_EVENT_BYTES, TvicThrowableError, TwilioMediaStreamCallHandle, TwilioMediaStreamsProvider, VoiceRuntimeFinalizationError, WEB_CLIENT_AUDIO_ACK_RETENTION_MS, WEB_CLIENT_AUDIO_CLOSE_CODES, WEB_CLIENT_AUDIO_DEFAULTS, WebClientAudioCallHandle, WebClientAudioProvider, assertMemoryCapability, assertMemoryPolicySupported, assertPcm16leFormat, authError, base64ToBytes, bytesToBase64, cancelledError, canonicalizeTwilioData, computeTwilioSignature, connectionError, counterIdGenerator, createAssemblyAiSttProvider, createAudioNormalizer, createCartesiaSttProvider, createCartesiaTtsProvider, createDeepgramSttProvider, createDefaultIdGenerator, createElevenLabsSttProvider, createElevenLabsTtsHttpStreamProvider, createElevenLabsTtsProvider, createElevenLabsTtsRestProvider, createGroqChatLlmProvider, createInMemoryDurableRuntimeStore, createInMemoryMemory, createInMemorySessionStore, createInMemoryToolCallStore, createInMemoryTurnStore, createMediaEvent, createNodeMediaPlane, createOpenAiResponsesLlmProvider, createPostgresDurableRuntimeStore, createPostgresMemory, createPostgresRedisDurableRuntimeStore, createRedisDurableRuntimeStore, createRuntime, createSarvamSttProvider, createSarvamTtsHttpStreamProvider, createSarvamTtsProvider, createSarvamTtsRestProvider, createSonioxSttProvider, createSttSession, createSystemClock, createToolRegistry, createTtsFailoverProvider, createTwilioMediaStreamsProvider, createVoiceAgent, createWebClientAudioProvider, defineAgent, defineTool, deliverAssistantText, durationMsForPcm16le, evaluateProviderCompatibility, executeTool, formatMemoryContextAsSystemBlock, formatPreCallContextAsSystemBlock, frameCountForPcm16le, getSttRecoveryControl, idempotencyKeyFor, idempotencyRequestHashFor, internalError, interruptedError, isDtmfDigit, isIncrementalTextToSpeechProvider, isInputMediaEvent, isNormalizedError, isOutputMediaEvent, isProviderKind, isReconstructableAudioFormat, isSampleRateHz, isTerminalSession, isTerminalTurn, isTranscriptSegmentEvent, isTvicError, isTvicErrorName, kindForMediaEvent, matchPath, mediaError, monotonicOffsetMs, mulawToPcm16le, normalizeLegacyError, normalizeUnknownError, normalizedError, nowTimestamp, pcm16leToMulaw, providerError, rateLimitError, requireProviderKind, resamplePcm16le, resolvePreCallContext, resolvePreCallMemory, runPostgresMemoryMigrations, runPostgresMigrations, sameAudioFormat, shouldDeliverText, signVoiceSessionToken, signatureError, splitPcm16leFrames, stableStringify, supportsAudioFormat, supportsBatchModel, supportsLanguage, supportsModel, terminalSessionFromRequest, terminalSourceForRequest, terminalTurnFromRequest, timeoutError, toTimestamp, toolError, toolInputError, tvicErrorFromJSON, unknownErrorMessage, validateJsonSchemaSubset, validationError, verifyTwilioSignature, verifyVoiceSessionToken, withSttReconnect };
|
|
4901
|
+
export type { ActiveSession, ActiveTurn, Agent, AgentAudioPolicy, AgentContextPolicy, AgentId, AgentMemoryPolicy, AgentProviders, AnyMediaEventInit, AssemblyAiProviderConfig, AssemblyAiSttProviderOptions, AssistantTextRecord, AudioFormat, AudioNormalizationMode, AudioNormalizer, AudioNormalizerOptions, AudioPayload, BackoffStrategy, Brand, Call, CallControlCapability, CallDirection, CallHandle, CallId, CallSnapshot, CallStatus, CancelledSession, CancelledTurn, CartesiaGenerationConfig, CartesiaProviderConfig, CartesiaSttMode, CartesiaSttProviderConfig, CartesiaSttProviderOptions, CartesiaTtsProviderOptions, ChannelKind, ChannelLayout, CleanupErrorSummary, CleanupStage, Clock, CompletedSession, CompletedTurn, ConnectedCall, ConnectionObservabilityEvent, ConversationPolicyOptions, CounterIdGenerator, CreateVoiceAgentOptions, CreatedCall, CreatedSession, DeepgramProviderConfig, DeepgramSttProviderOptions, DefineAgentInput, DefineToolInput, DtmfDigit, DtmfReceivedEvent, DualProtocolResult, DurableErrorCode, DurableOutboxEvent, DurableRuntimeMetric, DurableRuntimePolicy, DurableRuntimeStore, DurableSessionTransaction, ElevenLabsBatchSttRequest, ElevenLabsBatchSttResult, ElevenLabsBatchTimestampGranularity, ElevenLabsDialogueInput, ElevenLabsDialogueProvider, ElevenLabsDialogueSynthesisRequest, ElevenLabsDialogueTurnOptions, ElevenLabsEntityDetection, ElevenLabsHttpTtsProviderOptions, ElevenLabsPronunciationDictionaryLocator, ElevenLabsSttCommitStrategy, ElevenLabsSttProviderConfig, ElevenLabsSttProviderOptions, ElevenLabsTextNormalization, ElevenLabsTtsHttpSynthesisRequest, ElevenLabsTtsProviderConfig, ElevenLabsTtsProviderOptions, ElevenLabsTtsSendTextOptions, EndSessionReason, EndSessionRequest, EndTurnRequest, EndedCall, ErrorCategory, ExecuteToolInput, FailedCall, FailedSession, FailedToolCall, FailedToolCallStatus, FailedTurn, GroqChatLlmProviderOptions, GroqProviderConfig, HealthCheckResult, HealthSnapshot, IdGenerator, IdempotencyPolicy, InMemoryDurableRuntimeStore, InMemoryDurableRuntimeStoreOptions, InMemoryMemoryOptions, InboundCallContext, InboundMediaEvent, IncrementalTextToSpeechProvider, InputAudioChunk, InputMediaEvent, InternalMediaEvent, InterruptRequestedEvent, InterruptionMode, InterruptionPolicy, JsonSchemaDocument, JsonValue, LLMProvider, LiveTerminalSource, LlmCompletion, LlmCompletionRequest, LlmInlineToolCall, LlmMessage, LlmMessageRole, LlmProviderConfig, LlmStreamEvent, LlmUsage, MediaAudioChunkEvent, MediaAudioCommittedEvent, MediaDirection, MediaErrorEvent, MediaEvent, MediaEventId, MediaEventKind, MediaEventType, MediaStreamEndedEvent, MediaStreamStartedEvent, MediaTransport, MediaTransportKind, Memory, MemoryCapabilities, MemoryEntry, MemoryEntryId, MemoryKind, MemoryPutOptions, MemoryQuery, MemoryRef, MemoryScope, NodeMediaPlaneConnection, NodeMediaPlaneConnectionErrorHandler, NodeMediaPlaneConnectionHandler, NodeMediaPlaneOptions, NodeMediaPlaneRequestHandler, NormalizedAudioEncoding, NormalizedError, OpenAiProviderConfig, OpenAiResponsesLlmProviderOptions, OrganizationId, OutboundCallRequest, OutputAudioChunk, OutputMediaEvent, PersonaConfig, PipelineVoiceLoopOptions, PipelineVoiceLoopResult, PostgresDurableStoreOptions, PostgresMemoryOptions, PostgresMigration, PostgresRedisDurableStoreOptions, PreCallContext, PreCallContextResolver, PreCallMemoryContext, PreCallMemoryResolver, Provider, ProviderAudioCapabilities, ProviderBatchCapabilities, ProviderCancellationCapabilities, ProviderCapabilities, ProviderCatalogEntry, ProviderClock, ProviderCompatibility, ProviderCompatibilityIssue, ProviderCompatibilityIssueCode, ProviderDataPolicy, ProviderEventId, ProviderForKind, ProviderKind, ProviderPlayoutCapabilities, ProviderRequirements, ProviderStability, ProviderStreamingCapabilities, ProviderToolCapabilities, ProviderTransport, QueuedToolCall, RecoveryPollResult, RedisClient, RedisMulti, RedisScanOptions, RedisSetResult, RedisStoreOptions, RequiredProviderCapabilities, RetryPolicy, RingingCall, RunningToolCall, Runtime, RuntimeOptions, RuntimeProvider, RuntimeServiceLifecycle, SampleRateHz, SarvamOutputMode, SarvamProviderConfig, SarvamSttProviderOptions, SarvamTtsHttpProviderOptions, SarvamTtsProviderConfig, SarvamTtsProviderOptions, SchemaValidationResult, Session, SessionAttachment, SessionAttachmentHealth, SessionCancellationReason, SessionEndEvent, SessionEndMemorySnapshot, SessionId, SessionLease, SessionLeaseStore, SessionMemoryFinalization, SessionMetricsRecorder, SessionReaperOptions, SessionRecoveryCoordinatorOptions, SessionRuntimeMetadata, SessionSnapshot, SessionState, SessionStatus, SessionStore, SonioxProviderConfig, SonioxStructuredContext, SonioxSttProviderOptions, SpeechToTextProvider, SqlClient$1 as SqlClient, SqlPool$1 as SqlPool, SqlResult, StartAttachedSessionOptions, StartSessionOptions, StartTurnRequest, StartingSession, StoredSessionRecord, StoredToolCallRecord, StoredTurnRecord, StreamEndReason, SttBatchTimestampGranularity, SttBatchTranscription, SttBatchTranscriptionRequest, SttBatchWord, SttCommitMode, SttOpenRequest, SttProviderConfig, SttReconnectOptions, SttRecoveryControl, SttRecoveryState, SttSession, SttSessionInputOptions, SttSessionOptions, SttStream, SttTimestampOrigin, SucceededToolCall, TelephonyProvider, TelephonyProviderConfig, TerminalSession, TerminalSessionDraft, TerminalSessionStatus, TerminalSource, TerminalToolCall, TerminalTurn, TextDeliveryMode, TextToSpeechProvider, TimeoutAction, TimeoutPolicy, Timestamp, ToolCall, ToolCallId, ToolCallRuntimeMetadata, ToolCallStatus, ToolCallStore, ToolDefinition, ToolExecutionContext, ToolExecutor, ToolId, ToolIdempotencyClaim, ToolIdempotencyClaimResult, ToolIdempotencyLease, ToolIdempotencyOutcome, ToolIdempotencyRecord, ToolIdempotencyStatus, ToolIdempotencyStore, ToolLogger, ToolName, ToolRegistry, ToolTenant, TranscriptEndpointEvent, TranscriptEndpointReason, TranscriptEvent, TranscriptEventType, TranscriptSegmentEvent, TranscriptSegmentEventType, TranscriptSpeechStartedEvent, TransportAudioEncoding, TransportAudioFormat, TtsAlignmentEvent, TtsAlignmentUnit, TtsEvent, TtsFailoverContext, TtsFailoverPhase, TtsFailoverProviderOptions, TtsFlushAcknowledgement, TtsFlushCompletedEvent, TtsFlushId, TtsFlushResult, TtsProviderConfig, TtsSession, TtsSessionOpenRequest, TtsStream, TtsSynthesisRequest, Turn, TurnCancellationReason, TurnCommitRequestedEvent, TurnDetectionMode, TurnId, TurnInput, TurnLatency, TurnLatencyRecord, TurnOutput, TurnRuntimeMetadata, TurnStatus, TurnStore, TvicErrorName, TwilioFlatParams, TwilioMediaStreamCallHandleOptions, TwilioMediaStreamSocket, TwilioParamValue, TwilioParams, UpgradeAuthorization, UserId, VerifyTwilioOptions, VerifyVoiceSessionTokenOptions, VoiceAgent, VoiceAgentCallHandleContext, VoiceAgentCallHandleFactory, VoiceAgentModels, VoiceAgentProviderNames, VoiceAgentProviders, VoiceAgentRun, VoiceAgentRunOptions, VoiceAgentSession, VoiceEvent, VoiceRuntimeFailureMetadata, WebClientAudioCallHandleOptions, WebClientAudioConnectionEvent, WebClientAudioProviderOptions, WebClientAudioSocket, WorkflowId };
|