@speeq/core 0.2.0 → 0.4.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/dist/index.d.cts CHANGED
@@ -1,6 +1,9 @@
1
1
  export { DEFAULT_ERROR_MESSAGES, ERROR_CODES, ERROR_HTTP_STATUS, ErrorCode, PublicError, SpeeqError, SpeeqErrorOptions, isAbortError, isErrorCode, isSpeeqError, toPublicError, toSpeeqError } from './errors.cjs';
2
2
  import { z } from 'zod';
3
- export { DEFAULT_SECRET_KEYS, Listener, REDACTED, SafeJsonResult, SentenceChunker, SentenceChunkerOptions, SseMessage, SseParser, TruncateResult, TypedEmitter, combineSignals, createId, encodeSse, mapProviderHttpError, parseRetryAfter, providerFetch, readSseData, redactKeys, redactText, safeJsonParse, safeJsonStringify, sleep, truncate } from './utils.cjs';
3
+ import { a as StreamingMode, V as VoiceInfo } from './speech-provider-D0YChUSt.cjs';
4
+ export { A as AudioFormat, P as ProviderKind, b as SttCapabilities, c as SttHints, S as SttProvider, d as SttRequest, e as SttResult, f as TtsCapabilities, T as TtsProvider, g as TtsRequest, h as TtsResult, i as VoiceParam } from './speech-provider-D0YChUSt.cjs';
5
+ import { V as Vocabulary } from './index-DPp4Fwdy.cjs';
6
+ export { C as CorrectionChange, a as CorrectionOptions, b as CorrectionResult, D as DEFAULT_SECRET_KEYS, L as Listener, R as REDACTED, S as SafeJsonResult, c as ScriptName, d as SentenceChunker, e as SentenceChunkerOptions, f as SseMessage, g as SseParser, T as TruncateResult, h as TypedEmitter, i as VocabularyTerm, j as autoVocabulary, k as baseLanguage, l as combineSignals, m as correctWithVocabulary, n as createId, o as detectScripts, p as encodeSse, q as guessLanguageFromScript, r as mapProviderHttpError, s as parseRetryAfter, t as providerFetch, u as readSseData, v as redactKeys, w as redactText, x as safeJsonParse, y as safeJsonStringify, z as sleep, A as sttPromptFromVocabulary, B as toIso639_1, E as truncate, F as vocabularyHints } from './index-DPp4Fwdy.cjs';
4
7
 
5
8
  /** Version of the HTTP + SSE protocol. Every protocol event carries it. */
6
9
  declare const PROTOCOL_VERSION: 1;
@@ -25,6 +28,8 @@ declare const ErrorCodeSchema: z.ZodEnum<{
25
28
  NOT_FOUND: "NOT_FOUND";
26
29
  CONFLICT: "CONFLICT";
27
30
  RATE_LIMITED: "RATE_LIMITED";
31
+ SPEECH_UNAVAILABLE: "SPEECH_UNAVAILABLE";
32
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
28
33
  PROVIDER_ERROR: "PROVIDER_ERROR";
29
34
  TOOL_ERROR: "TOOL_ERROR";
30
35
  TOOL_TIMEOUT: "TOOL_TIMEOUT";
@@ -201,12 +206,25 @@ interface LLMProvider {
201
206
  stream(request: LLMRequest): AsyncIterable<LLMStreamChunk>;
202
207
  }
203
208
 
209
+ /** Recognition features exposed by a client input. */
210
+ interface SpeechInputCapabilities {
211
+ streaming: StreamingMode;
212
+ detectsLanguage: boolean;
213
+ processing: "local" | "remote";
214
+ providerId?: string;
215
+ }
204
216
  /** Callbacks for a {@link SpeechInput} recognition session. */
205
217
  interface SpeechInputHandlers {
206
218
  /** Partial transcript while the user is speaking. */
207
219
  onInterim?(transcript: string): void;
208
- /** Final transcript of one utterance. */
220
+ /**
221
+ * Final transcript. In single-utterance mode this is called once when recognition ends. In
222
+ * {@link SpeechInputOptions.continuous} mode it is called for every finished phrase while
223
+ * recognition keeps running.
224
+ */
209
225
  onFinal(transcript: string): void;
226
+ /** Sound that looks like speech was detected (before any transcript exists). Optional. */
227
+ onSpeechStart?(): void;
210
228
  /** Recognition failed (no permission, no speech, network). */
211
229
  onError?(error: {
212
230
  code: "not-allowed" | "no-speech" | "network" | "aborted" | "unsupported" | "other";
@@ -221,9 +239,15 @@ interface SpeechInputOptions {
221
239
  language: string;
222
240
  /** Emit interim transcripts. Default `true`. */
223
241
  interimResults?: boolean;
242
+ /**
243
+ * Keep listening after a pause and deliver each finished phrase through `onFinal`. Used for
244
+ * hands-free calls. Default `false` (one utterance, then recognition ends).
245
+ */
246
+ continuous?: boolean;
224
247
  }
225
248
  /** Speech-to-text. The default implementation uses the browser Web Speech API. */
226
249
  interface SpeechInput {
250
+ readonly capabilities?: SpeechInputCapabilities;
227
251
  /** Whether speech recognition can work in this environment. */
228
252
  readonly supported: boolean;
229
253
  start(options: SpeechInputOptions, handlers: SpeechInputHandlers): void;
@@ -234,11 +258,18 @@ interface SpeechInput {
234
258
  }
235
259
  /** Options for {@link SpeechOutput.speak}. */
236
260
  interface SpeakOptions {
261
+ voiceId?: string;
262
+ rate?: number;
263
+ pitch?: number;
264
+ volume?: number;
265
+ style?: string;
237
266
  language: string;
238
267
  signal?: AbortSignal;
239
268
  }
240
269
  /** Text-to-speech. The default implementation uses the browser `speechSynthesis` API. */
241
270
  interface SpeechOutput {
271
+ prepare?(text: string, options: SpeakOptions): void;
272
+ listVoices?(language?: string): Promise<readonly VoiceInfo[]>;
242
273
  /** Whether speech synthesis exists in this environment. */
243
274
  readonly supported: boolean;
244
275
  /** Whether a voice exists for `language` on this device. */
@@ -247,6 +278,10 @@ interface SpeechOutput {
247
278
  speak(text: string, options: SpeakOptions): Promise<void>;
248
279
  /** Stops speaking and clears the queue. */
249
280
  cancel(): void;
281
+ /** Pauses the current utterance so that `resume()` can continue from the same spot. Optional. */
282
+ pause?(): void;
283
+ /** Continues after `pause()`. Optional. */
284
+ resume?(): void;
250
285
  }
251
286
 
252
287
  /** A tool call as recorded on an assistant message. */
@@ -315,6 +350,8 @@ declare const ConversationEventBodySchema: z.ZodDiscriminatedUnion<[z.ZodObject<
315
350
  NOT_FOUND: "NOT_FOUND";
316
351
  CONFLICT: "CONFLICT";
317
352
  RATE_LIMITED: "RATE_LIMITED";
353
+ SPEECH_UNAVAILABLE: "SPEECH_UNAVAILABLE";
354
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
318
355
  PROVIDER_ERROR: "PROVIDER_ERROR";
319
356
  TOOL_ERROR: "TOOL_ERROR";
320
357
  TOOL_TIMEOUT: "TOOL_TIMEOUT";
@@ -359,6 +396,8 @@ declare const ConversationEventBodySchema: z.ZodDiscriminatedUnion<[z.ZodObject<
359
396
  NOT_FOUND: "NOT_FOUND";
360
397
  CONFLICT: "CONFLICT";
361
398
  RATE_LIMITED: "RATE_LIMITED";
399
+ SPEECH_UNAVAILABLE: "SPEECH_UNAVAILABLE";
400
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
362
401
  PROVIDER_ERROR: "PROVIDER_ERROR";
363
402
  TOOL_ERROR: "TOOL_ERROR";
364
403
  TOOL_TIMEOUT: "TOOL_TIMEOUT";
@@ -453,6 +492,8 @@ declare const NewConversationEventSchema: z.ZodIntersection<z.ZodObject<{
453
492
  NOT_FOUND: "NOT_FOUND";
454
493
  CONFLICT: "CONFLICT";
455
494
  RATE_LIMITED: "RATE_LIMITED";
495
+ SPEECH_UNAVAILABLE: "SPEECH_UNAVAILABLE";
496
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
456
497
  PROVIDER_ERROR: "PROVIDER_ERROR";
457
498
  TOOL_ERROR: "TOOL_ERROR";
458
499
  TOOL_TIMEOUT: "TOOL_TIMEOUT";
@@ -497,6 +538,8 @@ declare const NewConversationEventSchema: z.ZodIntersection<z.ZodObject<{
497
538
  NOT_FOUND: "NOT_FOUND";
498
539
  CONFLICT: "CONFLICT";
499
540
  RATE_LIMITED: "RATE_LIMITED";
541
+ SPEECH_UNAVAILABLE: "SPEECH_UNAVAILABLE";
542
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
500
543
  PROVIDER_ERROR: "PROVIDER_ERROR";
501
544
  TOOL_ERROR: "TOOL_ERROR";
502
545
  TOOL_TIMEOUT: "TOOL_TIMEOUT";
@@ -594,6 +637,8 @@ declare const ConversationEventSchema: z.ZodIntersection<z.ZodObject<{
594
637
  NOT_FOUND: "NOT_FOUND";
595
638
  CONFLICT: "CONFLICT";
596
639
  RATE_LIMITED: "RATE_LIMITED";
640
+ SPEECH_UNAVAILABLE: "SPEECH_UNAVAILABLE";
641
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
597
642
  PROVIDER_ERROR: "PROVIDER_ERROR";
598
643
  TOOL_ERROR: "TOOL_ERROR";
599
644
  TOOL_TIMEOUT: "TOOL_TIMEOUT";
@@ -638,6 +683,8 @@ declare const ConversationEventSchema: z.ZodIntersection<z.ZodObject<{
638
683
  NOT_FOUND: "NOT_FOUND";
639
684
  CONFLICT: "CONFLICT";
640
685
  RATE_LIMITED: "RATE_LIMITED";
686
+ SPEECH_UNAVAILABLE: "SPEECH_UNAVAILABLE";
687
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
641
688
  PROVIDER_ERROR: "PROVIDER_ERROR";
642
689
  TOOL_ERROR: "TOOL_ERROR";
643
690
  TOOL_TIMEOUT: "TOOL_TIMEOUT";
@@ -812,6 +859,8 @@ declare const SessionDetailResponseSchema: z.ZodObject<{
812
859
  NOT_FOUND: "NOT_FOUND";
813
860
  CONFLICT: "CONFLICT";
814
861
  RATE_LIMITED: "RATE_LIMITED";
862
+ SPEECH_UNAVAILABLE: "SPEECH_UNAVAILABLE";
863
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
815
864
  PROVIDER_ERROR: "PROVIDER_ERROR";
816
865
  TOOL_ERROR: "TOOL_ERROR";
817
866
  TOOL_TIMEOUT: "TOOL_TIMEOUT";
@@ -856,6 +905,8 @@ declare const SessionDetailResponseSchema: z.ZodObject<{
856
905
  NOT_FOUND: "NOT_FOUND";
857
906
  CONFLICT: "CONFLICT";
858
907
  RATE_LIMITED: "RATE_LIMITED";
908
+ SPEECH_UNAVAILABLE: "SPEECH_UNAVAILABLE";
909
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
859
910
  PROVIDER_ERROR: "PROVIDER_ERROR";
860
911
  TOOL_ERROR: "TOOL_ERROR";
861
912
  TOOL_TIMEOUT: "TOOL_TIMEOUT";
@@ -1022,6 +1073,8 @@ declare const ErrorRollupEventSchema: z.ZodObject<{
1022
1073
  NOT_FOUND: "NOT_FOUND";
1023
1074
  CONFLICT: "CONFLICT";
1024
1075
  RATE_LIMITED: "RATE_LIMITED";
1076
+ SPEECH_UNAVAILABLE: "SPEECH_UNAVAILABLE";
1077
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
1025
1078
  PROVIDER_ERROR: "PROVIDER_ERROR";
1026
1079
  TOOL_ERROR: "TOOL_ERROR";
1027
1080
  TOOL_TIMEOUT: "TOOL_TIMEOUT";
@@ -1099,6 +1152,8 @@ declare const TelemetryEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1099
1152
  NOT_FOUND: "NOT_FOUND";
1100
1153
  CONFLICT: "CONFLICT";
1101
1154
  RATE_LIMITED: "RATE_LIMITED";
1155
+ SPEECH_UNAVAILABLE: "SPEECH_UNAVAILABLE";
1156
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
1102
1157
  PROVIDER_ERROR: "PROVIDER_ERROR";
1103
1158
  TOOL_ERROR: "TOOL_ERROR";
1104
1159
  TOOL_TIMEOUT: "TOOL_TIMEOUT";
@@ -1187,6 +1242,8 @@ declare const TelemetryBatchSchema: z.ZodObject<{
1187
1242
  NOT_FOUND: "NOT_FOUND";
1188
1243
  CONFLICT: "CONFLICT";
1189
1244
  RATE_LIMITED: "RATE_LIMITED";
1245
+ SPEECH_UNAVAILABLE: "SPEECH_UNAVAILABLE";
1246
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
1190
1247
  PROVIDER_ERROR: "PROVIDER_ERROR";
1191
1248
  TOOL_ERROR: "TOOL_ERROR";
1192
1249
  TOOL_TIMEOUT: "TOOL_TIMEOUT";
@@ -1225,6 +1282,11 @@ declare const CreateSessionRequestSchema: z.ZodObject<{
1225
1282
  type CreateSessionRequest = z.infer<typeof CreateSessionRequestSchema>;
1226
1283
  /** Public configuration the client receives when a session starts. */
1227
1284
  declare const ClientConfigSchema: z.ZodObject<{
1285
+ speech: z.ZodOptional<z.ZodObject<{
1286
+ stt: z.ZodBoolean;
1287
+ tts: z.ZodBoolean;
1288
+ detectsLanguage: z.ZodOptional<z.ZodBoolean>;
1289
+ }, z.core.$strip>>;
1228
1290
  agentName: z.ZodString;
1229
1291
  languages: z.ZodArray<z.ZodString>;
1230
1292
  defaultLanguage: z.ZodString;
@@ -1248,6 +1310,11 @@ declare const CreateSessionResponseSchema: z.ZodObject<{
1248
1310
  sessionToken: z.ZodString;
1249
1311
  expiresAt: z.ZodString;
1250
1312
  config: z.ZodObject<{
1313
+ speech: z.ZodOptional<z.ZodObject<{
1314
+ stt: z.ZodBoolean;
1315
+ tts: z.ZodBoolean;
1316
+ detectsLanguage: z.ZodOptional<z.ZodBoolean>;
1317
+ }, z.core.$strip>>;
1251
1318
  agentName: z.ZodString;
1252
1319
  languages: z.ZodArray<z.ZodString>;
1253
1320
  defaultLanguage: z.ZodString;
@@ -1267,6 +1334,14 @@ declare const CreateSessionResponseSchema: z.ZodObject<{
1267
1334
  type CreateSessionResponse = z.infer<typeof CreateSessionResponseSchema>;
1268
1335
  /** Body of `POST /session/:id/turn`. */
1269
1336
  declare const TurnRequestSchema: z.ZodObject<{
1337
+ inputLanguage: z.ZodOptional<z.ZodString>;
1338
+ transcript: z.ZodOptional<z.ZodObject<{
1339
+ raw: z.ZodString;
1340
+ confidence: z.ZodOptional<z.ZodNumber>;
1341
+ provider: z.ZodOptional<z.ZodString>;
1342
+ corrected: z.ZodOptional<z.ZodBoolean>;
1343
+ ambiguous: z.ZodOptional<z.ZodArray<z.ZodString>>;
1344
+ }, z.core.$strip>>;
1270
1345
  text: z.ZodString;
1271
1346
  language: z.ZodString;
1272
1347
  context: z.ZodOptional<z.ZodObject<{
@@ -1298,6 +1373,8 @@ declare const ErrorResponseSchema: z.ZodObject<{
1298
1373
  NOT_FOUND: "NOT_FOUND";
1299
1374
  CONFLICT: "CONFLICT";
1300
1375
  RATE_LIMITED: "RATE_LIMITED";
1376
+ SPEECH_UNAVAILABLE: "SPEECH_UNAVAILABLE";
1377
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
1301
1378
  PROVIDER_ERROR: "PROVIDER_ERROR";
1302
1379
  TOOL_ERROR: "TOOL_ERROR";
1303
1380
  TOOL_TIMEOUT: "TOOL_TIMEOUT";
@@ -1325,6 +1402,7 @@ type HealthResponse = z.infer<typeof HealthResponseSchema>;
1325
1402
  /** First event of every stream. */
1326
1403
  declare const TurnStartedEventSchema: z.ZodObject<{
1327
1404
  type: z.ZodLiteral<"turn.started">;
1405
+ inputLanguage: z.ZodOptional<z.ZodString>;
1328
1406
  sessionId: z.ZodString;
1329
1407
  language: z.ZodString;
1330
1408
  protocolVersion: z.ZodLiteral<1>;
@@ -1371,6 +1449,8 @@ declare const ToolFinishedEventSchema: z.ZodObject<{
1371
1449
  NOT_FOUND: "NOT_FOUND";
1372
1450
  CONFLICT: "CONFLICT";
1373
1451
  RATE_LIMITED: "RATE_LIMITED";
1452
+ SPEECH_UNAVAILABLE: "SPEECH_UNAVAILABLE";
1453
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
1374
1454
  PROVIDER_ERROR: "PROVIDER_ERROR";
1375
1455
  TOOL_ERROR: "TOOL_ERROR";
1376
1456
  TOOL_TIMEOUT: "TOOL_TIMEOUT";
@@ -1411,6 +1491,8 @@ declare const ErrorEventSchema: z.ZodObject<{
1411
1491
  NOT_FOUND: "NOT_FOUND";
1412
1492
  CONFLICT: "CONFLICT";
1413
1493
  RATE_LIMITED: "RATE_LIMITED";
1494
+ SPEECH_UNAVAILABLE: "SPEECH_UNAVAILABLE";
1495
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
1414
1496
  PROVIDER_ERROR: "PROVIDER_ERROR";
1415
1497
  TOOL_ERROR: "TOOL_ERROR";
1416
1498
  TOOL_TIMEOUT: "TOOL_TIMEOUT";
@@ -1448,6 +1530,7 @@ declare const TurnFinishedEventSchema: z.ZodObject<{
1448
1530
  /** Every event the server may stream to the client (SSE `event:` = `type`). */
1449
1531
  declare const ProtocolEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1450
1532
  type: z.ZodLiteral<"turn.started">;
1533
+ inputLanguage: z.ZodOptional<z.ZodString>;
1451
1534
  sessionId: z.ZodString;
1452
1535
  language: z.ZodString;
1453
1536
  protocolVersion: z.ZodLiteral<1>;
@@ -1486,6 +1569,8 @@ declare const ProtocolEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1486
1569
  NOT_FOUND: "NOT_FOUND";
1487
1570
  CONFLICT: "CONFLICT";
1488
1571
  RATE_LIMITED: "RATE_LIMITED";
1572
+ SPEECH_UNAVAILABLE: "SPEECH_UNAVAILABLE";
1573
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
1489
1574
  PROVIDER_ERROR: "PROVIDER_ERROR";
1490
1575
  TOOL_ERROR: "TOOL_ERROR";
1491
1576
  TOOL_TIMEOUT: "TOOL_TIMEOUT";
@@ -1520,6 +1605,8 @@ declare const ProtocolEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1520
1605
  NOT_FOUND: "NOT_FOUND";
1521
1606
  CONFLICT: "CONFLICT";
1522
1607
  RATE_LIMITED: "RATE_LIMITED";
1608
+ SPEECH_UNAVAILABLE: "SPEECH_UNAVAILABLE";
1609
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
1523
1610
  PROVIDER_ERROR: "PROVIDER_ERROR";
1524
1611
  TOOL_ERROR: "TOOL_ERROR";
1525
1612
  TOOL_TIMEOUT: "TOOL_TIMEOUT";
@@ -1565,6 +1652,104 @@ type ProtocolEventInput = ProtocolEvent extends infer E ? E extends ProtocolEven
1565
1652
  /** All protocol event types, in a stable order. */
1566
1653
  declare const PROTOCOL_EVENT_TYPES: readonly ["turn.started", "assistant.delta", "assistant.message", "tool.started", "tool.finished", "navigate", "confirmation.required", "error", "turn.finished"];
1567
1654
 
1655
+ /** Voice metadata returned by configured synthesizers. */
1656
+ declare const VoiceInfoSchema: z.ZodObject<{
1657
+ id: z.ZodString;
1658
+ name: z.ZodString;
1659
+ languages: z.ZodArray<z.ZodString>;
1660
+ locale: z.ZodOptional<z.ZodString>;
1661
+ gender: z.ZodOptional<z.ZodEnum<{
1662
+ female: "female";
1663
+ male: "male";
1664
+ neutral: "neutral";
1665
+ }>>;
1666
+ accent: z.ZodOptional<z.ZodString>;
1667
+ styles: z.ZodOptional<z.ZodArray<z.ZodString>>;
1668
+ provider: z.ZodString;
1669
+ processing: z.ZodEnum<{
1670
+ local: "local";
1671
+ remote: "remote";
1672
+ }>;
1673
+ streaming: z.ZodBoolean;
1674
+ supports: z.ZodObject<{
1675
+ rate: z.ZodBoolean;
1676
+ pitch: z.ZodBoolean;
1677
+ volume: z.ZodBoolean;
1678
+ style: z.ZodBoolean;
1679
+ }, z.core.$strip>;
1680
+ }, z.core.$strip>;
1681
+ /** Wire schema for TranscribeQuery. */
1682
+ declare const TranscribeQuerySchema: z.ZodObject<{
1683
+ language: z.ZodOptional<z.ZodString>;
1684
+ utteranceId: z.ZodOptional<z.ZodString>;
1685
+ }, z.core.$strip>;
1686
+ /** Validated TranscribeQuery payload. */
1687
+ type TranscribeQuery = z.infer<typeof TranscribeQuerySchema>;
1688
+ /** Wire schema for TranscribeResponse. */
1689
+ declare const TranscribeResponseSchema: z.ZodObject<{
1690
+ raw: z.ZodOptional<z.ZodString>;
1691
+ corrected: z.ZodOptional<z.ZodBoolean>;
1692
+ ambiguous: z.ZodOptional<z.ZodArray<z.ZodString>>;
1693
+ text: z.ZodString;
1694
+ silent: z.ZodOptional<z.ZodBoolean>;
1695
+ language: z.ZodOptional<z.ZodString>;
1696
+ languageConfidence: z.ZodOptional<z.ZodNumber>;
1697
+ confidence: z.ZodOptional<z.ZodNumber>;
1698
+ providerId: z.ZodOptional<z.ZodString>;
1699
+ providerMs: z.ZodOptional<z.ZodNumber>;
1700
+ audioMs: z.ZodOptional<z.ZodNumber>;
1701
+ }, z.core.$strip>;
1702
+ /** Validated TranscribeResponse payload. */
1703
+ type TranscribeResponse = z.infer<typeof TranscribeResponseSchema>;
1704
+ /** Wire schema for SynthesizeRequest. */
1705
+ declare const SynthesizeRequestSchema: z.ZodObject<{
1706
+ text: z.ZodString;
1707
+ language: z.ZodString;
1708
+ voiceId: z.ZodOptional<z.ZodString>;
1709
+ rate: z.ZodOptional<z.ZodNumber>;
1710
+ pitch: z.ZodOptional<z.ZodNumber>;
1711
+ volume: z.ZodOptional<z.ZodNumber>;
1712
+ style: z.ZodOptional<z.ZodString>;
1713
+ format: z.ZodOptional<z.ZodEnum<{
1714
+ mp3: "mp3";
1715
+ wav: "wav";
1716
+ opus: "opus";
1717
+ pcm16: "pcm16";
1718
+ }>>;
1719
+ }, z.core.$strip>;
1720
+ /** Validated SynthesizeRequest payload. */
1721
+ type SynthesizeRequest = z.infer<typeof SynthesizeRequestSchema>;
1722
+ /** Wire schema for VoicesResponse. */
1723
+ declare const VoicesResponseSchema: z.ZodObject<{
1724
+ voices: z.ZodArray<z.ZodObject<{
1725
+ id: z.ZodString;
1726
+ name: z.ZodString;
1727
+ languages: z.ZodArray<z.ZodString>;
1728
+ locale: z.ZodOptional<z.ZodString>;
1729
+ gender: z.ZodOptional<z.ZodEnum<{
1730
+ female: "female";
1731
+ male: "male";
1732
+ neutral: "neutral";
1733
+ }>>;
1734
+ accent: z.ZodOptional<z.ZodString>;
1735
+ styles: z.ZodOptional<z.ZodArray<z.ZodString>>;
1736
+ provider: z.ZodString;
1737
+ processing: z.ZodEnum<{
1738
+ local: "local";
1739
+ remote: "remote";
1740
+ }>;
1741
+ streaming: z.ZodBoolean;
1742
+ supports: z.ZodObject<{
1743
+ rate: z.ZodBoolean;
1744
+ pitch: z.ZodBoolean;
1745
+ volume: z.ZodBoolean;
1746
+ style: z.ZodBoolean;
1747
+ }, z.core.$strip>;
1748
+ }, z.core.$strip>>;
1749
+ }, z.core.$strip>;
1750
+ /** Validated VoicesResponse payload. */
1751
+ type VoicesResponse = z.infer<typeof VoicesResponseSchema>;
1752
+
1568
1753
  /** Creates an empty {@link SessionSummary} for a new session. For store adapters. */
1569
1754
  declare function emptySummary(session: NewSession): SessionSummary;
1570
1755
  /**
@@ -1588,5 +1773,8 @@ declare function isAfterCursor(session: {
1588
1773
  id: string;
1589
1774
  }): boolean;
1590
1775
 
1591
- export { AssistantDeltaEventSchema, AssistantMessageEventSchema, ClientConfigSchema, ConfirmRequestSchema, ConfirmationRequiredEventSchema, ConversationEventBodySchema, ConversationEventSchema, CreateSessionRequestSchema, CreateSessionResponseSchema, DEFAULT_LANGUAGES, ErrorCodeSchema, ErrorEventSchema, ErrorResponseSchema, ErrorRollupEventSchema, HealthResponseSchema, InputModeSchema, LANGUAGE_LABELS, LATENCY_BUCKETS_MS, LanguageSchema, LatencyHistogramSchema, MAX_TURN_TEXT_CHARS, NavigateEventSchema, NewConversationEventSchema, NewSessionSchema, PROTOCOL_EVENT_TYPES, PROTOCOL_VERSION, PageContextSchema, ProtocolEventSchema, RecordedToolCallSchema, SdkInitEventSchema, SessionDetailResponseSchema, SessionFilterSchema, SessionListResponseSchema, SessionSummarySchema, TELEMETRY_SCHEMA_VERSION, TelemetryBatchSchema, TelemetryEventSchema, TelemetryFeaturesSchema, ToolFinishedEventSchema, ToolKindSchema, ToolStartedEventSchema, TurnEndReasonSchema, TurnFinishedEventSchema, TurnRequestSchema, TurnStartedEventSchema, UsageRollupEventSchema, UsageSchema, applyEventToSummary, decodeCursor, emptySummary, encodeCursor, isAfterCursor };
1592
- export type { AgentContext, AgentUser, ClientConfig, ConfirmRequest, ConversationEvent, ConversationEventOf, ConversationEventType, ConversationStore, CreateSessionRequest, CreateSessionResponse, ErrorResponse, HealthResponse, InputMode, JsonSchema, KnowledgeResult, KnowledgeSource, LLMFinishReason, LLMMessage, LLMProvider, LLMRequest, LLMStreamChunk, LLMToolCall, LLMToolDefinition, Language, LatencyHistogram, ListEventsOptions, NewConversationEvent, NewConversationEventOf, NewSession, PageContext, ProtocolEvent, ProtocolEventInput, ProtocolEventOf, ProtocolEventType, RecordedToolCall, RetentionResult, SessionDetailResponse, SessionFilter, SessionListResponse, SessionPage, SessionSummary, SpeakOptions, SpeechInput, SpeechInputHandlers, SpeechInputOptions, SpeechOutput, TelemetryBatch, TelemetryEvent, TelemetryEventOf, TelemetryFeatures, TelemetryTransport, ToolKind, TurnEndReason, TurnRequest, Usage };
1776
+ /** Validate, copy and deeply freeze a vocabulary for repeated recognition. */
1777
+ declare function defineVocabulary(v: Vocabulary): Vocabulary;
1778
+
1779
+ export { AssistantDeltaEventSchema, AssistantMessageEventSchema, ClientConfigSchema, ConfirmRequestSchema, ConfirmationRequiredEventSchema, ConversationEventBodySchema, ConversationEventSchema, CreateSessionRequestSchema, CreateSessionResponseSchema, DEFAULT_LANGUAGES, ErrorCodeSchema, ErrorEventSchema, ErrorResponseSchema, ErrorRollupEventSchema, HealthResponseSchema, InputModeSchema, LANGUAGE_LABELS, LATENCY_BUCKETS_MS, LanguageSchema, LatencyHistogramSchema, MAX_TURN_TEXT_CHARS, NavigateEventSchema, NewConversationEventSchema, NewSessionSchema, PROTOCOL_EVENT_TYPES, PROTOCOL_VERSION, PageContextSchema, ProtocolEventSchema, RecordedToolCallSchema, SdkInitEventSchema, SessionDetailResponseSchema, SessionFilterSchema, SessionListResponseSchema, SessionSummarySchema, StreamingMode, SynthesizeRequestSchema, TELEMETRY_SCHEMA_VERSION, TelemetryBatchSchema, TelemetryEventSchema, TelemetryFeaturesSchema, ToolFinishedEventSchema, ToolKindSchema, ToolStartedEventSchema, TranscribeQuerySchema, TranscribeResponseSchema, TurnEndReasonSchema, TurnFinishedEventSchema, TurnRequestSchema, TurnStartedEventSchema, UsageRollupEventSchema, UsageSchema, Vocabulary, VoiceInfo, VoiceInfoSchema, VoicesResponseSchema, applyEventToSummary, decodeCursor, defineVocabulary, emptySummary, encodeCursor, isAfterCursor };
1780
+ export type { AgentContext, AgentUser, ClientConfig, ConfirmRequest, ConversationEvent, ConversationEventOf, ConversationEventType, ConversationStore, CreateSessionRequest, CreateSessionResponse, ErrorResponse, HealthResponse, InputMode, JsonSchema, KnowledgeResult, KnowledgeSource, LLMFinishReason, LLMMessage, LLMProvider, LLMRequest, LLMStreamChunk, LLMToolCall, LLMToolDefinition, Language, LatencyHistogram, ListEventsOptions, NewConversationEvent, NewConversationEventOf, NewSession, PageContext, ProtocolEvent, ProtocolEventInput, ProtocolEventOf, ProtocolEventType, RecordedToolCall, RetentionResult, SessionDetailResponse, SessionFilter, SessionListResponse, SessionPage, SessionSummary, SpeakOptions, SpeechInput, SpeechInputCapabilities, SpeechInputHandlers, SpeechInputOptions, SpeechOutput, SynthesizeRequest, TelemetryBatch, TelemetryEvent, TelemetryEventOf, TelemetryFeatures, TelemetryTransport, ToolKind, TranscribeQuery, TranscribeResponse, TurnEndReason, TurnRequest, Usage, VoicesResponse };