/** * WASM Runtime Module * * WASM-backed runtime implementation for llmswitch-core integration. * Provides shadow/primary dual-loading, priority matrix, and switch capabilities. */ export type WasmRuntimeMode = 'shadow' | 'primary' | 'split'; export interface WasmRuntimeConfig { mode: WasmRuntimeMode; wasmPath?: string; fallbackOnError?: boolean; shadowTimeoutMs?: number; } export interface WasmRuntimeMetrics { requestsTotal: number; requestsShadow: number; errorsTotal: number; shadowLatencyMs: number; lastError?: string; } /** * WASM Runtime instance interface */ export interface WasmRuntime { readonly mode: WasmRuntimeMode; readonly isReady: boolean; readonly metrics: WasmRuntimeMetrics; /** * Initialize the WASM runtime */ initialize(): Promise; /** * Shutdown the WASM runtime */ shutdown(): Promise; } /** * WASM Runtime factory options */ export interface WasmRuntimeFactoryOptions { config: WasmRuntimeConfig; onError?: (error: Error) => void; onMetricsUpdate?: (metrics: WasmRuntimeMetrics) => void; } /** * Create a new WASM runtime instance */ export declare function createWasmRuntime(options: WasmRuntimeFactoryOptions): WasmRuntime; /** * Default WASM runtime configuration */ export declare function getDefaultWasmRuntimeConfig(): WasmRuntimeConfig; /** * Resolve WASM runtime mode from environment */ export declare function resolveWasmRuntimeModeFromEnv(): WasmRuntimeMode;