import type { Providers } from "../../../SofyaTranscriber"; import type { BatchReprocessConfig } from "../batchReprocess"; import type { SttAuditIngestionConfig } from "../sttAuditIngestion"; import { DirectModeAuth } from "../auth"; import type { SofyaGatewayPlan } from "./parsers/sofyaGateway"; export type { SofyaGatewayPlan }; /** * Execution variants of a session. Adapter selection switches on this * discriminant, never on the public Provider identity (ADR-0007). */ export type SessionPlanVariant = "whisper_stream" | "whisper_batch" | "oracle" | "sofya_gateway"; export interface WhisperResilienceOptions { connectTimeoutMs?: number; healthCheckIntervalMs?: number; maxBufferedAmountBytes?: number; drainStallTimeoutMs?: number; preRecoveryReplayMs?: number; reconnectBaseDelayMs?: number; reconnectMaxDelayMs?: number; reconnectDelayGrowFactor?: number; minConnectionUptimeMs?: number; maxReconnectAttempts?: number; } /** * Whisper Stream recipe. `realtimeUrl` and `headers` never carry * credentials: the Auth strategy stays in `auth` (and the deprecated * `legacyToken`) until the adapter materializes it through `auth.ts`. */ export interface WhisperStreamPlan { variant: "whisper_stream"; providerIdentity: "sofya_as_service" | "sofya_whisper_flow" | "stt_wvad"; realtimeUrl: string; protocols?: string | string[]; headers?: Record; auth?: DirectModeAuth; legacyToken?: string; language: string; transcriptionLanguage?: string; translationLanguage?: string; externalId?: string; audioPersistence?: "durable" | "memory"; /** Audio frame duration (20–500 ms); the adapter defaults to 100. */ chunkMs?: number; resilience?: WhisperResilienceOptions; finalUpload?: { mode?: "stream" | "blob"; format?: "pcm" | "wav"; endpoint?: string; }; batchReprocess?: BatchReprocessConfig; auditIngestion?: SttAuditIngestionConfig; debug?: boolean | { enabled?: boolean; advancedMetrics?: boolean; }; } /** * Whisper Batch recipe (Batch session, ADR-0001): one HTTP upload on stop, * no WebSocket. `uploadUrl` and `headers` never carry credentials. */ export interface WhisperBatchPlan { variant: "whisper_batch"; providerIdentity: "sofya_as_service" | "sofya_whisper_flow" | "stt_wvad"; uploadUrl: string; headers?: Record; auth?: DirectModeAuth; legacyToken?: string; language: string; transcriptionLanguage?: string; translationLanguage?: string; externalId?: string; audioPersistence?: "durable" | "memory"; parseResponse?: (response: Response) => Promise; } export interface OraclePlan { variant: "oracle"; providerIdentity: "oracle" | "sofya_compliance"; language: string; region: string; compartmentId: string; /** OCI session token; never described, logged or placed in a URL. */ token: string; } export type SessionPlan = WhisperStreamPlan | WhisperBatchPlan | OraclePlan | SofyaGatewayPlan; export type SessionPlanErrorCode = "MISSING_ENDPOINT" | "INVALID_ENDPOINT" | "UNSUPPORTED_PROVIDER" | "BATCH_UNSUPPORTED" | "INVALID_ORACLE_CONFIG" | "INVALID_PLAN" | "DISCOVERY_FAILED"; /** Safe resolution failure: stable code, fixed message, no raw cause. */ export declare class SessionPlanError extends Error { readonly code: SessionPlanErrorCode; constructor(code: SessionPlanErrorCode); } export interface SessionPlanDescription { variant: SessionPlanVariant; providerIdentity: Providers; endpoint?: string; authType?: DirectModeAuth["type"] | "single_use_token"; } export declare const describeEndpoint: (url: string) => string; /** Allowlisted, credential-free description of a plan for diagnostics. */ export declare const describeSessionPlan: (plan: SessionPlan) => SessionPlanDescription; //# sourceMappingURL=types.d.ts.map