moflo 4.6.4 → 4.6.5
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/build-embeddings.mjs
CHANGED
|
@@ -282,7 +282,9 @@ function getEntriesNeedingEmbeddings(db, namespace = null, forceAll = false) {
|
|
|
282
282
|
const params = [];
|
|
283
283
|
|
|
284
284
|
if (!forceAll) {
|
|
285
|
-
|
|
285
|
+
// Include entries with no embedding OR entries with hash/fallback embeddings
|
|
286
|
+
// that should be upgraded to Xenova when available
|
|
287
|
+
sql += ` AND (embedding IS NULL OR embedding = '' OR embedding_model IN ('domain-aware-hash-v1', 'hash-fallback', 'local'))`;
|
|
286
288
|
}
|
|
287
289
|
|
|
288
290
|
if (namespace) {
|
|
@@ -408,7 +410,22 @@ async function main() {
|
|
|
408
410
|
const stats = getEmbeddingStats(db);
|
|
409
411
|
|
|
410
412
|
// Write changes back to disk (sql.js operates in-memory)
|
|
411
|
-
if (embedded > 0)
|
|
413
|
+
if (embedded > 0) {
|
|
414
|
+
saveDb(db);
|
|
415
|
+
|
|
416
|
+
// Delete stale HNSW index so the CLI rebuilds from fresh vectors
|
|
417
|
+
const hnswPaths = [
|
|
418
|
+
resolve(projectRoot, '.swarm/hnsw.index'),
|
|
419
|
+
resolve(projectRoot, '.swarm/hnsw.metadata.json'),
|
|
420
|
+
];
|
|
421
|
+
for (const p of hnswPaths) {
|
|
422
|
+
if (existsSync(p)) {
|
|
423
|
+
const { unlinkSync } = await import('fs');
|
|
424
|
+
unlinkSync(p);
|
|
425
|
+
log(`Deleted stale HNSW index: ${p}`);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
412
429
|
db.close();
|
|
413
430
|
|
|
414
431
|
console.log('');
|
|
@@ -665,20 +665,26 @@ async function main() {
|
|
|
665
665
|
const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
|
|
666
666
|
log(`Done in ${elapsed}s — ${allChunks.length} chunks written to code-map namespace`);
|
|
667
667
|
|
|
668
|
-
// 7.
|
|
668
|
+
// 7. Generate embeddings inline (not detached — ensures Xenova runs reliably)
|
|
669
669
|
if (!skipEmbeddings) {
|
|
670
|
-
//
|
|
671
|
-
const
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
670
|
+
// Prefer moflo's own bin script, fall back to project's .claude/scripts/
|
|
671
|
+
const embedCandidates = [
|
|
672
|
+
resolve(dirname(fileURLToPath(import.meta.url)), 'build-embeddings.mjs'),
|
|
673
|
+
resolve(projectRoot, '.claude/scripts/build-embeddings.mjs'),
|
|
674
|
+
];
|
|
675
|
+
const embedScript = embedCandidates.find(p => existsSync(p));
|
|
676
|
+
if (embedScript) {
|
|
677
|
+
log('Generating embeddings for code-map...');
|
|
678
|
+
try {
|
|
679
|
+
execSync(`node "${embedScript}" --namespace code-map`, {
|
|
680
|
+
cwd: projectRoot,
|
|
681
|
+
stdio: 'inherit',
|
|
682
|
+
timeout: 120000,
|
|
683
|
+
windowsHide: true,
|
|
684
|
+
});
|
|
685
|
+
} catch (err) {
|
|
686
|
+
log(`Warning: embedding generation failed: ${err.message?.split('\n')[0]}`);
|
|
687
|
+
}
|
|
682
688
|
}
|
|
683
689
|
}
|
|
684
690
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "moflo",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.5",
|
|
4
4
|
"description": "MoFlo — AI agent orchestration for Claude Code. Forked from ruflo/claude-flow with patches applied to source, plus feature-level orchestration.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moflo/cli",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MoFlo CLI — AI agent orchestration with specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
|
|
6
6
|
"main": "dist/src/index.js",
|