import { z } from 'zod'; import type Buffer from 'bare-buffer'; import { type InferenceBackendDiagnostics } from './system-resources.js'; export declare const audioInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"base64">; value: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"filePath">; value: z.ZodString; }, z.core.$strip>], "type">; export declare const transcribeParamsSchema: z.ZodObject<{ modelId: z.ZodString; prompt: z.ZodOptional; metadata: z.ZodOptional; audioChunk: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"base64">; value: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"filePath">; value: z.ZodString; }, z.core.$strip>], "type">; hotwords: z.ZodOptional>; maxNewTokens: z.ZodOptional; }, z.core.$strip>; export declare const transcribeStatsSchema: z.ZodObject<{ audioDuration: z.ZodOptional; realTimeFactor: z.ZodOptional; tokensPerSecond: z.ZodOptional; totalTokens: z.ZodOptional; totalSegments: z.ZodOptional; whisperEncodeTime: z.ZodOptional; whisperDecodeTime: z.ZodOptional; encoderTime: z.ZodOptional; decoderTime: z.ZodOptional; melSpecTime: z.ZodOptional; backendDevice: z.ZodOptional; backendId: z.ZodOptional; gpuUnsupported: z.ZodOptional; gpuMemTotalMb: z.ZodOptional; gpuMemFreeMb: z.ZodOptional; totalTime: z.ZodOptional; totalWallMs: z.ZodOptional; totalSamples: z.ZodOptional; processCalls: z.ZodOptional; whisperSampleMs: z.ZodOptional; whisperBatchdMs: z.ZodOptional; whisperPromptMs: z.ZodOptional; totalTranscriptions: z.ZodOptional; modelLoadMs: z.ZodOptional; totalEncodedFrames: z.ZodOptional; encoderOnCoreml: z.ZodOptional; encoderUsedCoreml: z.ZodOptional; }, z.core.$strip>; /** * Compute backends the ASR engines report through `stats.backendId`, as the * addon's `BackendId` enum defines them. Exported so callers can decode the * number instead of hardcoding it. * * Kept as a literal because it feeds the contract, and checked against the * addon's enum by `satisfies`: a backend the addon adds or removes is a compile * error here rather than a silently short vocabulary. */ export declare const ASR_BACKEND_IDS: Readonly<{ readonly CPU: 0; readonly Metal: 1; readonly CUDA: 2; readonly Vulkan: 3; readonly OpenCL: 4; readonly Other: 99; }>; export type AsrBackendId = (typeof ASR_BACKEND_IDS)[keyof typeof ASR_BACKEND_IDS]; export declare const transcribeSpeakerSegmentSchema: z.ZodObject<{ speakerId: z.ZodNumber; startMs: z.ZodNumber; endMs: z.ZodNumber; }, z.core.$strip>; export type TranscribeSpeakerSegment = z.infer; export declare const transcribeSegmentSchema: z.ZodObject<{ text: z.ZodString; startMs: z.ZodNumber; endMs: z.ZodNumber; append: z.ZodBoolean; id: z.ZodNumber; speakerId: z.ZodOptional; speaker: z.ZodOptional; speakerSegments: z.ZodOptional>>; isEndOfTurn: z.ZodOptional; startsWord: z.ZodOptional; }, z.core.$strip>; export declare const vadStateEventSchema: z.ZodObject<{ speakerId: z.ZodOptional; speaking: z.ZodBoolean; probability: z.ZodNumber; source: z.ZodOptional>; }, z.core.$strip>; export declare const whisperEndOfTurnEventSchema: z.ZodObject<{ source: z.ZodLiteral<"whisper">; silenceDurationMs: z.ZodNumber; }, z.core.$strip>; export declare const parakeetEndOfTurnEventSchema: z.ZodObject<{ source: z.ZodLiteral<"parakeet">; }, z.core.$strip>; export declare const endOfTurnEventSchema: z.ZodPreprocess; silenceDurationMs: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"parakeet">; }, z.core.$strip>], "source">, unknown>; export declare const transcribeRequestSchema: z.ZodObject<{ modelId: z.ZodString; prompt: z.ZodOptional; metadata: z.ZodOptional; audioChunk: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"base64">; value: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"filePath">; value: z.ZodString; }, z.core.$strip>], "type">; hotwords: z.ZodOptional>; maxNewTokens: z.ZodOptional; type: z.ZodLiteral<"transcribe">; requestId: z.ZodOptional; }, z.core.$strip>; export declare const transcribeResponseSchema: z.ZodObject<{ text: z.ZodOptional; done: z.ZodOptional; stats: z.ZodOptional; realTimeFactor: z.ZodOptional; tokensPerSecond: z.ZodOptional; totalTokens: z.ZodOptional; totalSegments: z.ZodOptional; whisperEncodeTime: z.ZodOptional; whisperDecodeTime: z.ZodOptional; encoderTime: z.ZodOptional; decoderTime: z.ZodOptional; melSpecTime: z.ZodOptional; backendDevice: z.ZodOptional; backendId: z.ZodOptional; gpuUnsupported: z.ZodOptional; gpuMemTotalMb: z.ZodOptional; gpuMemFreeMb: z.ZodOptional; totalTime: z.ZodOptional; totalWallMs: z.ZodOptional; totalSamples: z.ZodOptional; processCalls: z.ZodOptional; whisperSampleMs: z.ZodOptional; whisperBatchdMs: z.ZodOptional; whisperPromptMs: z.ZodOptional; totalTranscriptions: z.ZodOptional; modelLoadMs: z.ZodOptional; totalEncodedFrames: z.ZodOptional; encoderOnCoreml: z.ZodOptional; encoderUsedCoreml: z.ZodOptional; }, z.core.$strip>>; error: z.ZodOptional; segment: z.ZodOptional; speaker: z.ZodOptional; speakerSegments: z.ZodOptional>>; isEndOfTurn: z.ZodOptional; startsWord: z.ZodOptional; }, z.core.$strip>>; vad: z.ZodOptional; speaking: z.ZodBoolean; probability: z.ZodNumber; source: z.ZodOptional>; }, z.core.$strip>>; endOfTurn: z.ZodOptional; silenceDurationMs: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"parakeet">; }, z.core.$strip>], "source">, unknown>>; diagnostics: z.ZodOptional; graphicsApi: z.ZodOptional>; driver: z.ZodOptional; }, z.core.$strip>>; gpuId: z.ZodOptional; fallback: z.ZodOptional; requestedDevice: z.ZodOptional>; reason: z.ZodString; }, z.core.$strip>>; probe: z.ZodOptional; backend: z.ZodString; reason: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>>; type: z.ZodLiteral<"transcribe">; }, z.core.$strip>; export type AudioInput = z.infer; export type TranscribeParams = z.infer; export type TranscribeSegment = z.infer; export type TranscribeClientParams = { modelId: string; audioChunk: string | Buffer; hotwords?: string[]; maxNewTokens?: number; prompt?: string; metadata?: boolean; }; export type TranscribeRequest = z.infer; export type TranscribeResponse = z.infer; /** * Per-call overrides for parakeet's duplex streaming session. * * Each field maps to its `streaming*`-prefixed counterpart in * `parakeetConfig` (see `parakeetRuntimeConfigSchema`). The `streaming` * prefix is intentionally dropped here because every field on this * object is already namespaced under the `parakeetStreamingConfig` * field of `transcribeStream({ ... })`. Any field omitted falls back * to the load-time value. */ export declare const parakeetStreamingRunConfigSchema: z.ZodObject<{ chunkMs: z.ZodOptional; historyMs: z.ZodOptional; leftContextMs: z.ZodOptional; rightLookaheadMs: z.ZodOptional; emitPartials: z.ZodOptional; emitEnergyVad: z.ZodOptional; emitSpeakerVad: z.ZodOptional; diarizationThreshold: z.ZodOptional; diarizationMinSegmentMs: z.ZodOptional; spkCacheEnable: z.ZodOptional; spkCacheLen: z.ZodOptional; fifoLen: z.ZodOptional; chunkLeftContextMs: z.ZodOptional; chunkRightContextMs: z.ZodOptional; spkCacheUpdatePeriod: z.ZodOptional; }, z.core.$strip>; export type ParakeetStreamingRunConfig = z.infer; export declare const transcribeStreamRequestSchema: z.ZodObject<{ modelId: z.ZodString; prompt: z.ZodOptional; metadata: z.ZodOptional; type: z.ZodLiteral<"transcribeStream">; emitVadEvents: z.ZodOptional; endOfTurnSilenceMs: z.ZodOptional; vadRunIntervalMs: z.ZodOptional; parakeetStreamingConfig: z.ZodOptional; historyMs: z.ZodOptional; leftContextMs: z.ZodOptional; rightLookaheadMs: z.ZodOptional; emitPartials: z.ZodOptional; emitEnergyVad: z.ZodOptional; emitSpeakerVad: z.ZodOptional; diarizationThreshold: z.ZodOptional; diarizationMinSegmentMs: z.ZodOptional; spkCacheEnable: z.ZodOptional; spkCacheLen: z.ZodOptional; fifoLen: z.ZodOptional; chunkLeftContextMs: z.ZodOptional; chunkRightContextMs: z.ZodOptional; spkCacheUpdatePeriod: z.ZodOptional; }, z.core.$strip>>; requestId: z.ZodOptional; }, z.core.$strip>; export declare const transcribeStreamResponseSchema: z.ZodObject<{ text: z.ZodOptional; done: z.ZodOptional; stats: z.ZodOptional; realTimeFactor: z.ZodOptional; tokensPerSecond: z.ZodOptional; totalTokens: z.ZodOptional; totalSegments: z.ZodOptional; whisperEncodeTime: z.ZodOptional; whisperDecodeTime: z.ZodOptional; encoderTime: z.ZodOptional; decoderTime: z.ZodOptional; melSpecTime: z.ZodOptional; backendDevice: z.ZodOptional; backendId: z.ZodOptional; gpuUnsupported: z.ZodOptional; gpuMemTotalMb: z.ZodOptional; gpuMemFreeMb: z.ZodOptional; totalTime: z.ZodOptional; totalWallMs: z.ZodOptional; totalSamples: z.ZodOptional; processCalls: z.ZodOptional; whisperSampleMs: z.ZodOptional; whisperBatchdMs: z.ZodOptional; whisperPromptMs: z.ZodOptional; totalTranscriptions: z.ZodOptional; modelLoadMs: z.ZodOptional; totalEncodedFrames: z.ZodOptional; encoderOnCoreml: z.ZodOptional; encoderUsedCoreml: z.ZodOptional; }, z.core.$strip>>; error: z.ZodOptional; segment: z.ZodOptional; speaker: z.ZodOptional; speakerSegments: z.ZodOptional>>; isEndOfTurn: z.ZodOptional; startsWord: z.ZodOptional; }, z.core.$strip>>; vad: z.ZodOptional; speaking: z.ZodBoolean; probability: z.ZodNumber; source: z.ZodOptional>; }, z.core.$strip>>; endOfTurn: z.ZodOptional; silenceDurationMs: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"parakeet">; }, z.core.$strip>], "source">, unknown>>; diagnostics: z.ZodOptional; graphicsApi: z.ZodOptional>; driver: z.ZodOptional; }, z.core.$strip>>; gpuId: z.ZodOptional; fallback: z.ZodOptional; requestedDevice: z.ZodOptional>; reason: z.ZodString; }, z.core.$strip>>; probe: z.ZodOptional; backend: z.ZodString; reason: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>>; type: z.ZodLiteral<"transcribeStream">; }, z.core.$strip>; export type TranscribeStreamRequest = z.infer; export type TranscribeStreamResponse = z.infer; export type TranscribeStreamClientParams = { modelId: string; prompt?: string; metadata?: boolean; emitVadEvents?: boolean; endOfTurnSilenceMs?: number; vadRunIntervalMs?: number; parakeetStreamingConfig?: ParakeetStreamingRunConfig; }; export interface TranscribeStreamSession { stats: Promise; /** Backend selection detail for the session, settled from the same terminal frame as `stats`. */ diagnostics: Promise; write(audioChunk: Uint8Array): void; end(): void; destroy(): void; [Symbol.asyncIterator](): AsyncIterator; } export interface TranscribeStreamMetadataSession { stats: Promise; /** Backend selection detail for the session, settled from the same terminal frame as `stats`. */ diagnostics: Promise; write(audioChunk: Uint8Array): void; end(): void; destroy(): void; [Symbol.asyncIterator](): AsyncIterator; } export type VadStateEvent = z.infer; export type WhisperEndOfTurnEvent = z.infer; export type ParakeetEndOfTurnEvent = z.infer; export type EndOfTurnEvent = z.infer; export type TranscribeStreamEvent = { type: 'text'; text: string; } | { type: 'segment'; segment: TranscribeSegment; } | ({ type: 'vad'; } & VadStateEvent) | ({ type: 'endOfTurn'; } & EndOfTurnEvent); export interface TranscribeStreamConversationSession { stats: Promise; /** Backend selection detail for the session, settled from the same terminal frame as `stats`. */ diagnostics: Promise; write(audioChunk: Uint8Array): void; end(): void; destroy(): void; [Symbol.asyncIterator](): AsyncIterator; } export type TranscribeStats = z.infer;