diff --git a/npm/packages/ruvllm/package.json b/npm/packages/ruvllm/package.json index e28846bba..4f9cccbd4 100644 --- a/npm/packages/ruvllm/package.json +++ b/npm/packages/ruvllm/package.json @@ -1,6 +1,6 @@ { "name": "@ruvector/ruvllm", - "version": "0.2.1", + "version": "0.2.2", "description": "Self-learning LLM orchestration with SONA adaptive learning, HNSW memory, FastGRNN routing, and SIMD inference", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/npm/packages/ruvllm/src/native.ts b/npm/packages/ruvllm/src/native.ts index b9a1a42f0..c92acfcf1 100644 --- a/npm/packages/ruvllm/src/native.ts +++ b/npm/packages/ruvllm/src/native.ts @@ -10,12 +10,22 @@ import { join } from 'path'; let nativeModule: NativeRuvLLM | null = null; interface NativeRuvLLM { + // Native exports RuvLlmEngine (camelCase), we normalize to RuvLLMEngine RuvLLMEngine: new (config?: NativeConfig) => NativeEngine; SimdOperations: new () => NativeSimdOps; version: () => string; hasSimdSupport: () => boolean; } +// Raw native module interface (actual export names) +interface RawNativeModule { + RuvLlmEngine?: new (config?: NativeConfig) => NativeEngine; + RuvLLMEngine?: new (config?: NativeConfig) => NativeEngine; + SimdOperations: new () => NativeSimdOps; + version: () => string; + hasSimdSupport: () => boolean; +} + interface NativeConfig { embedding_dim?: number; router_hidden_dim?: number; @@ -131,7 +141,14 @@ function loadNativeModule(): NativeRuvLLM | null { for (const attempt of attempts) { try { - nativeModule = attempt() as NativeRuvLLM; + const raw = attempt() as RawNativeModule; + // Normalize: native exports RuvLlmEngine, we expose as RuvLLMEngine + nativeModule = { + RuvLLMEngine: raw.RuvLLMEngine ?? raw.RuvLlmEngine!, + SimdOperations: raw.SimdOperations, + version: raw.version, + hasSimdSupport: raw.hasSimdSupport, + }; return nativeModule; } catch { // Continue to next attempt