moflo 4.6.10 → 4.6.11
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.
|
@@ -458,12 +458,13 @@ function getHooksStatus() {
|
|
|
458
458
|
return { enabled, total };
|
|
459
459
|
}
|
|
460
460
|
|
|
461
|
-
// AgentDB stats
|
|
461
|
+
// AgentDB stats — queries real count from sqlite when possible, falls back to file size estimate
|
|
462
462
|
function getAgentDBStats() {
|
|
463
463
|
let vectorCount = 0;
|
|
464
464
|
let dbSizeKB = 0;
|
|
465
465
|
let namespaces = 0;
|
|
466
466
|
let hasHnsw = false;
|
|
467
|
+
let dbPath = null;
|
|
467
468
|
|
|
468
469
|
const dbFiles = [
|
|
469
470
|
path.join(CWD, '.swarm', 'memory.db'),
|
|
@@ -476,31 +477,25 @@ function getAgentDBStats() {
|
|
|
476
477
|
const stat = safeStat(f);
|
|
477
478
|
if (stat) {
|
|
478
479
|
dbSizeKB = stat.size / 1024;
|
|
479
|
-
|
|
480
|
-
namespaces = 1;
|
|
480
|
+
dbPath = f;
|
|
481
481
|
break;
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
484
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
path.join(CWD, '.agentdb'),
|
|
490
|
-
];
|
|
491
|
-
for (const dir of dbDirs) {
|
|
485
|
+
// Try to get real count from sqlite (fast — single COUNT query)
|
|
486
|
+
if (dbPath) {
|
|
487
|
+
const countOutput = safeExec(`node -e "const S=require('sql.js');const f=require('fs');S().then(Q=>{const d=new Q.Database(f.readFileSync('${dbPath.replace(/\\/g, '/')}'));const s=d.prepare('SELECT COUNT(*) as c FROM memory_entries WHERE status=\\"active\\" AND embedding IS NOT NULL');s.step();console.log(JSON.stringify(s.getAsObject()));s.free();const n=d.prepare('SELECT COUNT(DISTINCT namespace) as n FROM memory_entries WHERE status=\\"active\\"');n.step();console.log(JSON.stringify(n.getAsObject()));n.free();d.close();})"`, 3000);
|
|
488
|
+
if (countOutput) {
|
|
492
489
|
try {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
}
|
|
503
|
-
} catch { /* ignore */ }
|
|
490
|
+
const lines = countOutput.trim().split('\n');
|
|
491
|
+
vectorCount = JSON.parse(lines[0]).c || 0;
|
|
492
|
+
namespaces = lines[1] ? JSON.parse(lines[1]).n || 0 : 0;
|
|
493
|
+
} catch { /* fall back to estimate */ }
|
|
494
|
+
}
|
|
495
|
+
// Fallback to file size estimate if query failed
|
|
496
|
+
if (vectorCount === 0) {
|
|
497
|
+
vectorCount = Math.floor(dbSizeKB / 2);
|
|
498
|
+
namespaces = 1;
|
|
504
499
|
}
|
|
505
500
|
}
|
|
506
501
|
|
|
@@ -509,10 +504,8 @@ function getAgentDBStats() {
|
|
|
509
504
|
path.join(CWD, '.claude-flow', 'hnsw.index'),
|
|
510
505
|
];
|
|
511
506
|
for (const p of hnswPaths) {
|
|
512
|
-
|
|
513
|
-
if (stat) {
|
|
507
|
+
if (safeStat(p)) {
|
|
514
508
|
hasHnsw = true;
|
|
515
|
-
vectorCount = Math.max(vectorCount, Math.floor(stat.size / 512));
|
|
516
509
|
break;
|
|
517
510
|
}
|
|
518
511
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "moflo",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.11",
|
|
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.11",
|
|
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",
|