gitnexus 1.1.2 → 1.1.4
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.
|
@@ -31,10 +31,19 @@ export const initEmbedder = async () => {
|
|
|
31
31
|
const devicesToTry = ['webgpu', 'cpu'];
|
|
32
32
|
for (const device of devicesToTry) {
|
|
33
33
|
try {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
// Silence stdout during model load — ONNX Runtime and transformers.js
|
|
35
|
+
// may write progress/init messages to stdout which corrupts MCP stdio protocol.
|
|
36
|
+
const origWrite = process.stdout.write;
|
|
37
|
+
process.stdout.write = (() => true);
|
|
38
|
+
try {
|
|
39
|
+
embedderInstance = await pipeline('feature-extraction', MODEL_ID, {
|
|
40
|
+
device: device,
|
|
41
|
+
dtype: 'fp32',
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
process.stdout.write = origWrite;
|
|
46
|
+
}
|
|
38
47
|
console.error(`GitNexus: Embedding model loaded (${device})`);
|
|
39
48
|
return embedderInstance;
|
|
40
49
|
}
|
|
@@ -82,8 +82,19 @@ export const initKuzu = async (repoId, dbPath) => {
|
|
|
82
82
|
throw new Error(`KuzuDB not found at ${dbPath}. Run: gitnexus analyze`);
|
|
83
83
|
}
|
|
84
84
|
evictLRU();
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
// Silence stdout during KuzuDB init — native module may write to stdout
|
|
86
|
+
// which corrupts the MCP stdio protocol.
|
|
87
|
+
const origWrite = process.stdout.write;
|
|
88
|
+
process.stdout.write = (() => true);
|
|
89
|
+
let db;
|
|
90
|
+
let conn;
|
|
91
|
+
try {
|
|
92
|
+
db = new kuzu.Database(dbPath);
|
|
93
|
+
conn = new kuzu.Connection(db);
|
|
94
|
+
}
|
|
95
|
+
finally {
|
|
96
|
+
process.stdout.write = origWrite;
|
|
97
|
+
}
|
|
87
98
|
pool.set(repoId, { db, conn, lastUsed: Date.now(), dbPath });
|
|
88
99
|
ensureIdleTimer();
|
|
89
100
|
};
|
package/package.json
CHANGED