ruvector 0.1.56 → 0.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +7 -8
- package/bin/mcp-server.js +1 -1
- package/dist/core/onnx-embedder.d.ts.map +1 -1
- package/dist/core/onnx-embedder.js +7 -3
- package/package.json +1 -1
- package/ruvector.db +0 -0
package/bin/cli.js
CHANGED
|
@@ -2314,14 +2314,13 @@ class Intelligence {
|
|
|
2314
2314
|
if (this.engine) {
|
|
2315
2315
|
try {
|
|
2316
2316
|
const results = await this.engine.recall(query, topK);
|
|
2317
|
+
// Return same format as sync recall() - direct memory objects
|
|
2317
2318
|
return results.map(r => ({
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
timestamp: r.created
|
|
2324
|
-
}
|
|
2319
|
+
id: r.id,
|
|
2320
|
+
content: r.content || '',
|
|
2321
|
+
memory_type: r.type || 'general',
|
|
2322
|
+
timestamp: r.created || new Date().toISOString(),
|
|
2323
|
+
score: r.score || 0
|
|
2325
2324
|
}));
|
|
2326
2325
|
} catch {}
|
|
2327
2326
|
}
|
|
@@ -3069,7 +3068,7 @@ hooksCmd.command('recall').description('Search memory').argument('<query...>', '
|
|
|
3069
3068
|
} else {
|
|
3070
3069
|
results = intel.recall(query.join(' '), parseInt(opts.topK));
|
|
3071
3070
|
}
|
|
3072
|
-
console.log(JSON.stringify({ query: query.join(' '), semantic: !!opts.semantic, results: results.map(r => ({ type: r.memory_type, content: r.content.slice(0, 200), timestamp: r.timestamp })) }, null, 2));
|
|
3071
|
+
console.log(JSON.stringify({ query: query.join(' '), semantic: !!opts.semantic, results: results.map(r => ({ type: r.memory_type || 'unknown', content: (r.content || '').slice(0, 200), timestamp: r.timestamp || '', score: r.score })) }, null, 2));
|
|
3073
3072
|
});
|
|
3074
3073
|
|
|
3075
3074
|
hooksCmd.command('pre-compact').description('Pre-compact hook').option('--auto', 'Auto mode').action(() => {
|
package/bin/mcp-server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onnx-embedder.d.ts","sourceRoot":"","sources":["../../src/core/onnx-embedder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"onnx-embedder.d.ts","sourceRoot":"","sources":["../../src/core/onnx-embedder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAWH,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB;AAYD;;GAEG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAOzC;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,GAAE,kBAAuB,GAAG,OAAO,CAAC,OAAO,CAAC,CAkExF;AAED;;GAEG;AACH,wBAAsB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAiBlE;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAyB5E;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAaxF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAiBjE;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED;;GAEG;AACH,wBAAgB,OAAO,IAAI,OAAO,CAEjC;AAED;;GAEG;AACH,wBAAgB,QAAQ,IAAI;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAM/E;AAGD,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAqB;gBAEvB,MAAM,GAAE,kBAAuB;IAIrC,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAIxB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAKtC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IAKhD,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAK/D,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,KAAK,IAAI,OAAO,CAEnB;CACF;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -59,6 +59,7 @@ exports.isReady = isReady;
|
|
|
59
59
|
exports.getStats = getStats;
|
|
60
60
|
const path = __importStar(require("path"));
|
|
61
61
|
const fs = __importStar(require("fs"));
|
|
62
|
+
const url_1 = require("url");
|
|
62
63
|
// Force native dynamic import (avoids TypeScript transpiling to require)
|
|
63
64
|
// eslint-disable-next-line @typescript-eslint/no-implied-eval
|
|
64
65
|
const dynamicImport = new Function('specifier', 'return import(specifier)');
|
|
@@ -102,8 +103,11 @@ async function initOnnxEmbedder(config = {}) {
|
|
|
102
103
|
if (!fs.existsSync(pkgPath)) {
|
|
103
104
|
throw new Error('ONNX WASM files not bundled. The onnx/ directory is missing.');
|
|
104
105
|
}
|
|
105
|
-
//
|
|
106
|
-
|
|
106
|
+
// Convert paths to file:// URLs for cross-platform ESM compatibility (Windows fix)
|
|
107
|
+
const pkgUrl = (0, url_1.pathToFileURL)(pkgPath).href;
|
|
108
|
+
const loaderUrl = (0, url_1.pathToFileURL)(loaderPath).href;
|
|
109
|
+
// Dynamic import of bundled modules using file:// URLs
|
|
110
|
+
wasmModule = await dynamicImport(pkgUrl);
|
|
107
111
|
// Initialize WASM module (loads the .wasm file)
|
|
108
112
|
const wasmPath = path.join(__dirname, 'onnx', 'pkg', 'ruvector_onnx_embeddings_wasm_bg.wasm');
|
|
109
113
|
if (wasmModule.default && typeof wasmModule.default === 'function') {
|
|
@@ -111,7 +115,7 @@ async function initOnnxEmbedder(config = {}) {
|
|
|
111
115
|
const wasmBytes = fs.readFileSync(wasmPath);
|
|
112
116
|
await wasmModule.default(wasmBytes);
|
|
113
117
|
}
|
|
114
|
-
const loaderModule = await dynamicImport(
|
|
118
|
+
const loaderModule = await dynamicImport(loaderUrl);
|
|
115
119
|
const { ModelLoader } = loaderModule;
|
|
116
120
|
// Create model loader with caching
|
|
117
121
|
const modelLoader = new ModelLoader({
|
package/package.json
CHANGED
package/ruvector.db
CHANGED
|
Binary file
|