mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-30 03:53:34 +00:00
fix(ruvllm): Normalize native RuvLlmEngine to RuvLLMEngine
The native module exports RuvLlmEngine (camelCase) but the JS wrapper expected RuvLLMEngine (ALL_CAPS acronym). This caused isNativeLoaded() to return false even though native module was available. Fix: Add normalization layer in native.ts to handle both naming conventions, mapping RuvLlmEngine -> RuvLLMEngine. Bump version to 0.2.2 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
03fa15e2e6
commit
beaee27952
2 changed files with 19 additions and 2 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue