claude-flow 3.5.28 → 3.5.30
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/.claude/helpers/intelligence.cjs +14 -4
- package/.claude/helpers/statusline.cjs +100 -76
- package/package.json +1 -2
- package/v3/@claude-flow/cli/dist/src/init/helpers-generator.js +14 -4
- package/v3/@claude-flow/cli/dist/src/mcp-client.js +0 -6
- package/v3/@claude-flow/cli/dist/src/mcp-tools/index.d.ts +0 -2
- package/v3/@claude-flow/cli/dist/src/mcp-tools/index.js +0 -2
- package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js +6 -47
- package/v3/@claude-flow/cli/dist/src/ruvector/index.d.ts +0 -2
- package/v3/@claude-flow/cli/dist/src/ruvector/index.js +0 -4
- package/v3/@claude-flow/cli/package.json +3 -6
|
@@ -65,7 +65,8 @@ function bootstrapFromMemoryFiles() {
|
|
|
65
65
|
var items = fs.readdirSync(candidates[i], { withFileTypes: true, recursive: true });
|
|
66
66
|
for (var j = 0; j < items.length; j++) {
|
|
67
67
|
if (items[j].name === "MEMORY.md") {
|
|
68
|
-
var
|
|
68
|
+
var parentDir = items[j].parentPath || items[j].path || candidates[i];
|
|
69
|
+
var fp = path.join(parentDir, items[j].name);
|
|
69
70
|
files.push(fp);
|
|
70
71
|
}
|
|
71
72
|
}
|
|
@@ -96,15 +97,24 @@ function bootstrapFromMemoryFiles() {
|
|
|
96
97
|
|
|
97
98
|
function loadEntries() {
|
|
98
99
|
var store = readJSON(STORE_PATH);
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
// Support both formats: flat array or { entries: [...] }
|
|
101
|
+
var entries = null;
|
|
102
|
+
if (store) {
|
|
103
|
+
if (Array.isArray(store) && store.length > 0) {
|
|
104
|
+
entries = store;
|
|
105
|
+
} else if (store.entries && store.entries.length > 0) {
|
|
106
|
+
entries = store.entries;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (entries) {
|
|
110
|
+
return entries.map(function(e, i) {
|
|
101
111
|
return {
|
|
102
112
|
id: e.id || ("entry-" + i),
|
|
103
113
|
content: e.content || e.value || "",
|
|
104
114
|
summary: e.summary || e.key || "",
|
|
105
115
|
category: e.category || e.namespace || "default",
|
|
106
116
|
confidence: e.confidence || 0.5,
|
|
107
|
-
sourceFile: e.sourceFile || "",
|
|
117
|
+
sourceFile: e.sourceFile || (e.metadata && e.metadata.sourceFile) || "",
|
|
108
118
|
words: tokenize((e.content || e.value || "") + " " + (e.summary || e.key || "")),
|
|
109
119
|
};
|
|
110
120
|
});
|
|
@@ -236,49 +236,64 @@ function getV3Progress() {
|
|
|
236
236
|
|
|
237
237
|
// Security status (pure file reads)
|
|
238
238
|
function getSecurityStatus() {
|
|
239
|
-
const totalCves = 3;
|
|
240
239
|
const auditData = readJSON(path.join(CWD, '.claude-flow', 'security', 'audit-status.json'));
|
|
241
240
|
if (auditData) {
|
|
241
|
+
// Check freshness — flag if audit is older than 7 days
|
|
242
|
+
const auditAge = auditData.lastAudit ? Date.now() - new Date(auditData.lastAudit).getTime() : Infinity;
|
|
243
|
+
const isStale = auditAge > 7 * 24 * 60 * 60 * 1000;
|
|
242
244
|
return {
|
|
243
|
-
status: auditData.status || 'PENDING',
|
|
245
|
+
status: isStale ? 'STALE' : (auditData.status || 'PENDING'),
|
|
244
246
|
cvesFixed: auditData.cvesFixed || 0,
|
|
245
|
-
totalCves: auditData.totalCves ||
|
|
247
|
+
totalCves: auditData.totalCves || 0,
|
|
246
248
|
};
|
|
247
249
|
}
|
|
248
250
|
|
|
249
|
-
let
|
|
251
|
+
let scanCount = 0;
|
|
250
252
|
try {
|
|
251
253
|
const scanDir = path.join(CWD, '.claude', 'security-scans');
|
|
252
254
|
if (fs.existsSync(scanDir)) {
|
|
253
|
-
|
|
255
|
+
scanCount = fs.readdirSync(scanDir).filter(f => f.endsWith('.json')).length;
|
|
254
256
|
}
|
|
255
257
|
} catch { /* ignore */ }
|
|
256
258
|
|
|
257
259
|
return {
|
|
258
|
-
status:
|
|
259
|
-
cvesFixed,
|
|
260
|
-
totalCves,
|
|
260
|
+
status: scanCount > 0 ? 'SCANNED' : 'NONE',
|
|
261
|
+
cvesFixed: 0,
|
|
262
|
+
totalCves: 0,
|
|
261
263
|
};
|
|
262
264
|
}
|
|
263
265
|
|
|
264
266
|
// Swarm status (pure file reads, NO ps aux)
|
|
265
267
|
function getSwarmStatus() {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
268
|
+
// Check swarm state file — only trust if recently updated (within 5 min)
|
|
269
|
+
const staleThresholdMs = 5 * 60 * 1000;
|
|
270
|
+
const now = Date.now();
|
|
271
|
+
|
|
272
|
+
const swarmStatePath = path.join(CWD, '.claude-flow', 'swarm', 'swarm-state.json');
|
|
273
|
+
const swarmState = readJSON(swarmStatePath);
|
|
274
|
+
if (swarmState) {
|
|
275
|
+
const updatedAt = swarmState.updatedAt || swarmState.startedAt;
|
|
276
|
+
const age = updatedAt ? now - new Date(updatedAt).getTime() : Infinity;
|
|
277
|
+
if (age < staleThresholdMs) {
|
|
278
|
+
return {
|
|
279
|
+
activeAgents: swarmState.agents?.length || swarmState.agentCount || 0,
|
|
280
|
+
maxAgents: swarmState.maxAgents || CONFIG.maxAgents,
|
|
281
|
+
coordinationActive: true,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
273
284
|
}
|
|
274
285
|
|
|
275
|
-
const
|
|
276
|
-
if (
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
286
|
+
const activityData = readJSON(path.join(CWD, '.claude-flow', 'metrics', 'swarm-activity.json'));
|
|
287
|
+
if (activityData?.swarm) {
|
|
288
|
+
const updatedAt = activityData.timestamp || activityData.swarm.timestamp;
|
|
289
|
+
const age = updatedAt ? now - new Date(updatedAt).getTime() : Infinity;
|
|
290
|
+
if (age < staleThresholdMs) {
|
|
291
|
+
return {
|
|
292
|
+
activeAgents: activityData.swarm.agent_count || 0,
|
|
293
|
+
maxAgents: CONFIG.maxAgents,
|
|
294
|
+
coordinationActive: activityData.swarm.coordination_active || activityData.swarm.active || false,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
282
297
|
}
|
|
283
298
|
|
|
284
299
|
return { activeAgents: 0, maxAgents: CONFIG.maxAgents, coordinationActive: false };
|
|
@@ -298,8 +313,9 @@ function getSystemMetrics() {
|
|
|
298
313
|
if (learningData?.intelligence?.score !== undefined) {
|
|
299
314
|
intelligencePct = Math.min(100, Math.floor(learningData.intelligence.score));
|
|
300
315
|
} else {
|
|
301
|
-
|
|
302
|
-
const
|
|
316
|
+
// Use actual vector/entry counts — 2000 entries = 100%
|
|
317
|
+
const fromPatterns = learning.patterns > 0 ? Math.min(100, Math.floor(learning.patterns / 20)) : 0;
|
|
318
|
+
const fromVectors = agentdb.vectorCount > 0 ? Math.min(100, Math.floor(agentdb.vectorCount / 20)) : 0;
|
|
303
319
|
intelligencePct = Math.max(fromPatterns, fromVectors);
|
|
304
320
|
}
|
|
305
321
|
|
|
@@ -334,15 +350,7 @@ function getSystemMetrics() {
|
|
|
334
350
|
|
|
335
351
|
// ADR status (count files only — don't read contents)
|
|
336
352
|
function getADRStatus() {
|
|
337
|
-
|
|
338
|
-
if (complianceData) {
|
|
339
|
-
const checks = complianceData.checks || {};
|
|
340
|
-
const total = Object.keys(checks).length;
|
|
341
|
-
const impl = Object.values(checks).filter(c => c.compliant).length;
|
|
342
|
-
return { count: total, implemented: impl, compliance: complianceData.compliance || 0 };
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
// Fallback: just count ADR files (don't read them)
|
|
353
|
+
// Count actual ADR files first — compliance JSON may be stale
|
|
346
354
|
const adrPaths = [
|
|
347
355
|
path.join(CWD, 'v3', 'implementation', 'adrs'),
|
|
348
356
|
path.join(CWD, 'docs', 'adrs'),
|
|
@@ -355,10 +363,8 @@ function getADRStatus() {
|
|
|
355
363
|
const files = fs.readdirSync(adrPath).filter(f =>
|
|
356
364
|
f.endsWith('.md') && (f.startsWith('ADR-') || f.startsWith('adr-') || /^\d{4}-/.test(f))
|
|
357
365
|
);
|
|
358
|
-
//
|
|
359
|
-
|
|
360
|
-
const compliance = files.length > 0 ? Math.floor((implemented / files.length) * 100) : 0;
|
|
361
|
-
return { count: files.length, implemented, compliance };
|
|
366
|
+
// Report actual count — don't guess compliance without reading files
|
|
367
|
+
return { count: files.length, implemented: files.length, compliance: 0 };
|
|
362
368
|
}
|
|
363
369
|
} catch { /* ignore */ }
|
|
364
370
|
}
|
|
@@ -369,13 +375,20 @@ function getADRStatus() {
|
|
|
369
375
|
// Hooks status (shared settings cache)
|
|
370
376
|
function getHooksStatus() {
|
|
371
377
|
let enabled = 0;
|
|
372
|
-
|
|
378
|
+
let total = 0;
|
|
373
379
|
const settings = getSettings();
|
|
374
380
|
|
|
375
381
|
if (settings?.hooks) {
|
|
376
382
|
for (const category of Object.keys(settings.hooks)) {
|
|
377
|
-
const
|
|
378
|
-
if (Array.isArray(
|
|
383
|
+
const matchers = settings.hooks[category];
|
|
384
|
+
if (!Array.isArray(matchers)) continue;
|
|
385
|
+
for (const matcher of matchers) {
|
|
386
|
+
const hooks = matcher?.hooks;
|
|
387
|
+
if (Array.isArray(hooks)) {
|
|
388
|
+
total += hooks.length;
|
|
389
|
+
enabled += hooks.length;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
379
392
|
}
|
|
380
393
|
}
|
|
381
394
|
|
|
@@ -383,6 +396,7 @@ function getHooksStatus() {
|
|
|
383
396
|
const hooksDir = path.join(CWD, '.claude', 'hooks');
|
|
384
397
|
if (fs.existsSync(hooksDir)) {
|
|
385
398
|
const hookFiles = fs.readdirSync(hooksDir).filter(f => f.endsWith('.js') || f.endsWith('.sh')).length;
|
|
399
|
+
total = Math.max(total, hookFiles);
|
|
386
400
|
enabled = Math.max(enabled, hookFiles);
|
|
387
401
|
}
|
|
388
402
|
} catch { /* ignore */ }
|
|
@@ -390,52 +404,52 @@ function getHooksStatus() {
|
|
|
390
404
|
return { enabled, total };
|
|
391
405
|
}
|
|
392
406
|
|
|
393
|
-
// AgentDB stats
|
|
407
|
+
// AgentDB stats — count real entries, not file-size heuristics
|
|
394
408
|
function getAgentDBStats() {
|
|
395
409
|
let vectorCount = 0;
|
|
396
410
|
let dbSizeKB = 0;
|
|
397
411
|
let namespaces = 0;
|
|
398
412
|
let hasHnsw = false;
|
|
399
413
|
|
|
414
|
+
// 1. Count real entries from auto-memory-store.json
|
|
415
|
+
const storePath = path.join(CWD, '.claude-flow', 'data', 'auto-memory-store.json');
|
|
416
|
+
const storeStat = safeStat(storePath);
|
|
417
|
+
if (storeStat) {
|
|
418
|
+
dbSizeKB += storeStat.size / 1024;
|
|
419
|
+
try {
|
|
420
|
+
const store = JSON.parse(fs.readFileSync(storePath, 'utf-8'));
|
|
421
|
+
if (Array.isArray(store)) vectorCount += store.length;
|
|
422
|
+
else if (store?.entries) vectorCount += store.entries.length;
|
|
423
|
+
} catch { /* fall back to size estimate */ }
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// 2. Count entries from ranked-context.json
|
|
427
|
+
const rankedPath = path.join(CWD, '.claude-flow', 'data', 'ranked-context.json');
|
|
428
|
+
try {
|
|
429
|
+
const ranked = readJSON(rankedPath);
|
|
430
|
+
if (ranked?.entries?.length > vectorCount) vectorCount = ranked.entries.length;
|
|
431
|
+
} catch { /* ignore */ }
|
|
432
|
+
|
|
433
|
+
// 3. Add DB file sizes
|
|
400
434
|
const dbFiles = [
|
|
401
|
-
path.join(CWD, '.swarm', 'memory.db'),
|
|
402
|
-
path.join(CWD, '.claude-flow', 'memory.db'),
|
|
403
|
-
path.join(CWD, '.claude', 'memory.db'),
|
|
404
435
|
path.join(CWD, 'data', 'memory.db'),
|
|
436
|
+
path.join(CWD, '.claude-flow', 'memory.db'),
|
|
437
|
+
path.join(CWD, '.swarm', 'memory.db'),
|
|
405
438
|
];
|
|
406
|
-
|
|
407
439
|
for (const f of dbFiles) {
|
|
408
440
|
const stat = safeStat(f);
|
|
409
441
|
if (stat) {
|
|
410
|
-
dbSizeKB
|
|
411
|
-
|
|
412
|
-
namespaces = 1;
|
|
413
|
-
break;
|
|
442
|
+
dbSizeKB += stat.size / 1024;
|
|
443
|
+
namespaces++;
|
|
414
444
|
}
|
|
415
445
|
}
|
|
416
446
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
path.join(CWD, '.agentdb'),
|
|
422
|
-
];
|
|
423
|
-
for (const dir of dbDirs) {
|
|
424
|
-
try {
|
|
425
|
-
if (fs.existsSync(dir) && fs.statSync(dir).isDirectory()) {
|
|
426
|
-
const files = fs.readdirSync(dir);
|
|
427
|
-
namespaces = files.filter(f => f.endsWith('.db') || f.endsWith('.sqlite')).length;
|
|
428
|
-
for (const file of files) {
|
|
429
|
-
const stat = safeStat(path.join(dir, file));
|
|
430
|
-
if (stat?.isFile()) dbSizeKB += stat.size / 1024;
|
|
431
|
-
}
|
|
432
|
-
vectorCount = Math.floor(dbSizeKB / 2);
|
|
433
|
-
break;
|
|
434
|
-
}
|
|
435
|
-
} catch { /* ignore */ }
|
|
436
|
-
}
|
|
437
|
-
}
|
|
447
|
+
// 4. Check for graph data
|
|
448
|
+
const graphPath = path.join(CWD, 'data', 'memory.graph');
|
|
449
|
+
const graphStat = safeStat(graphPath);
|
|
450
|
+
if (graphStat) dbSizeKB += graphStat.size / 1024;
|
|
438
451
|
|
|
452
|
+
// 5. HNSW index
|
|
439
453
|
const hnswPaths = [
|
|
440
454
|
path.join(CWD, '.swarm', 'hnsw.index'),
|
|
441
455
|
path.join(CWD, '.claude-flow', 'hnsw.index'),
|
|
@@ -444,11 +458,21 @@ function getAgentDBStats() {
|
|
|
444
458
|
const stat = safeStat(p);
|
|
445
459
|
if (stat) {
|
|
446
460
|
hasHnsw = true;
|
|
447
|
-
vectorCount = Math.max(vectorCount, Math.floor(stat.size / 512));
|
|
448
461
|
break;
|
|
449
462
|
}
|
|
450
463
|
}
|
|
451
464
|
|
|
465
|
+
// HNSW is available if memory package is present
|
|
466
|
+
if (!hasHnsw) {
|
|
467
|
+
const memPkgPaths = [
|
|
468
|
+
path.join(CWD, 'v3', '@claude-flow', 'memory', 'dist'),
|
|
469
|
+
path.join(CWD, 'node_modules', '@claude-flow', 'memory'),
|
|
470
|
+
];
|
|
471
|
+
for (const p of memPkgPaths) {
|
|
472
|
+
if (fs.existsSync(p)) { hasHnsw = true; break; }
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
|
|
452
476
|
return { vectorCount, dbSizeKB: Math.floor(dbSizeKB), namespaces, hasHnsw };
|
|
453
477
|
}
|
|
454
478
|
|
|
@@ -457,7 +481,7 @@ function getTestStats() {
|
|
|
457
481
|
let testFiles = 0;
|
|
458
482
|
|
|
459
483
|
function countTestFiles(dir, depth = 0) {
|
|
460
|
-
if (depth >
|
|
484
|
+
if (depth > 6) return;
|
|
461
485
|
try {
|
|
462
486
|
if (!fs.existsSync(dir)) return;
|
|
463
487
|
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
@@ -474,10 +498,10 @@ function getTestStats() {
|
|
|
474
498
|
} catch { /* ignore */ }
|
|
475
499
|
}
|
|
476
500
|
|
|
477
|
-
|
|
501
|
+
// Scan all source directories
|
|
502
|
+
for (const d of ['tests', 'test', '__tests__', 'src', 'v3']) {
|
|
478
503
|
countTestFiles(path.join(CWD, d));
|
|
479
504
|
}
|
|
480
|
-
countTestFiles(path.join(CWD, 'src'));
|
|
481
505
|
|
|
482
506
|
// Estimate ~4 test cases per file (avoids reading every file)
|
|
483
507
|
return { testFiles, testCases: testFiles * 4 };
|
|
@@ -658,8 +682,8 @@ function generateDashboard() {
|
|
|
658
682
|
// Line 2: Swarm + Hooks + CVE + Memory + Intelligence
|
|
659
683
|
const swarmInd = swarm.coordinationActive ? `${c.brightGreen}\u25C9${c.reset}` : `${c.dim}\u25CB${c.reset}`;
|
|
660
684
|
const agentsColor = swarm.activeAgents > 0 ? c.brightGreen : c.red;
|
|
661
|
-
const secIcon = security.status === 'CLEAN' ? '\uD83D\uDFE2' : security.status === 'IN_PROGRESS' ? '\uD83D\uDFE1' : '\uD83D\uDD34';
|
|
662
|
-
const secColor = security.status === 'CLEAN' ? c.brightGreen : security.status === 'IN_PROGRESS' ? c.brightYellow : c.brightRed;
|
|
685
|
+
const secIcon = security.status === 'CLEAN' ? '\uD83D\uDFE2' : (security.status === 'IN_PROGRESS' || security.status === 'STALE') ? '\uD83D\uDFE1' : '\uD83D\uDD34';
|
|
686
|
+
const secColor = security.status === 'CLEAN' ? c.brightGreen : (security.status === 'IN_PROGRESS' || security.status === 'STALE') ? c.brightYellow : c.brightRed;
|
|
663
687
|
const hooksColor = hooks.enabled > 0 ? c.brightGreen : c.dim;
|
|
664
688
|
const intellColor = system.intelligencePct >= 80 ? c.brightGreen : system.intelligencePct >= 40 ? c.brightYellow : c.dim;
|
|
665
689
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-flow",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.30",
|
|
4
4
|
"description": "Ruflo - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"v3:security": "npm run security:audit && npm run security:test"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@ruvector/ruvllm-wasm": "^2.0.0",
|
|
58
57
|
"semver": "^7.6.0",
|
|
59
58
|
"zod": "^3.22.4"
|
|
60
59
|
},
|
|
@@ -663,7 +663,8 @@ export function generateIntelligenceStub() {
|
|
|
663
663
|
' var items = fs.readdirSync(candidates[i], { withFileTypes: true, recursive: true });',
|
|
664
664
|
' for (var j = 0; j < items.length; j++) {',
|
|
665
665
|
' if (items[j].name === "MEMORY.md") {',
|
|
666
|
-
' var
|
|
666
|
+
' var parentDir = items[j].parentPath || items[j].path || candidates[i];',
|
|
667
|
+
' var fp = path.join(parentDir, items[j].name);',
|
|
667
668
|
' files.push(fp);',
|
|
668
669
|
' }',
|
|
669
670
|
' }',
|
|
@@ -695,15 +696,24 @@ export function generateIntelligenceStub() {
|
|
|
695
696
|
'// Load entries from auto-memory-store or bootstrap from MEMORY.md',
|
|
696
697
|
'function loadEntries() {',
|
|
697
698
|
' var store = readJSON(STORE_PATH);',
|
|
698
|
-
'
|
|
699
|
-
'
|
|
699
|
+
' // Support both formats: flat array or { entries: [...] }',
|
|
700
|
+
' var entries = null;',
|
|
701
|
+
' if (store) {',
|
|
702
|
+
' if (Array.isArray(store) && store.length > 0) {',
|
|
703
|
+
' entries = store;',
|
|
704
|
+
' } else if (store.entries && store.entries.length > 0) {',
|
|
705
|
+
' entries = store.entries;',
|
|
706
|
+
' }',
|
|
707
|
+
' }',
|
|
708
|
+
' if (entries) {',
|
|
709
|
+
' return entries.map(function(e, i) {',
|
|
700
710
|
' return {',
|
|
701
711
|
' id: e.id || ("entry-" + i),',
|
|
702
712
|
' content: e.content || e.value || "",',
|
|
703
713
|
' summary: e.summary || e.key || "",',
|
|
704
714
|
' category: e.category || e.namespace || "default",',
|
|
705
715
|
' confidence: e.confidence || 0.5,',
|
|
706
|
-
' sourceFile: e.sourceFile || "",',
|
|
716
|
+
' sourceFile: e.sourceFile || (e.metadata && e.metadata.sourceFile) || "",',
|
|
707
717
|
' words: tokenize((e.content || e.value || "") + " " + (e.summary || e.key || "")),',
|
|
708
718
|
' };',
|
|
709
719
|
' });',
|
|
@@ -34,9 +34,6 @@ import { coordinationTools } from './mcp-tools/coordination-tools.js';
|
|
|
34
34
|
import { browserTools } from './mcp-tools/browser-tools.js';
|
|
35
35
|
// Phase 6: AgentDB v3 controller tools
|
|
36
36
|
import { agentdbTools } from './mcp-tools/agentdb-tools.js';
|
|
37
|
-
// RuVector WASM tools
|
|
38
|
-
import { ruvllmWasmTools } from './mcp-tools/ruvllm-tools.js';
|
|
39
|
-
import { wasmAgentTools } from './mcp-tools/wasm-agent-tools.js';
|
|
40
37
|
/**
|
|
41
38
|
* MCP Tool Registry
|
|
42
39
|
* Maps tool names to their handler functions
|
|
@@ -76,9 +73,6 @@ registerTools([
|
|
|
76
73
|
...browserTools,
|
|
77
74
|
// Phase 6: AgentDB v3 controller tools
|
|
78
75
|
...agentdbTools,
|
|
79
|
-
// RuVector WASM tools
|
|
80
|
-
...ruvllmWasmTools,
|
|
81
|
-
...wasmAgentTools,
|
|
82
76
|
]);
|
|
83
77
|
/**
|
|
84
78
|
* MCP Client Error
|
|
@@ -20,6 +20,4 @@ export { transferTools } from './transfer-tools.js';
|
|
|
20
20
|
export { securityTools } from './security-tools.js';
|
|
21
21
|
export { embeddingsTools } from './embeddings-tools.js';
|
|
22
22
|
export { claimsTools } from './claims-tools.js';
|
|
23
|
-
export { wasmAgentTools } from './wasm-agent-tools.js';
|
|
24
|
-
export { ruvllmWasmTools } from './ruvllm-tools.js';
|
|
25
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -19,6 +19,4 @@ export { transferTools } from './transfer-tools.js';
|
|
|
19
19
|
export { securityTools } from './security-tools.js';
|
|
20
20
|
export { embeddingsTools } from './embeddings-tools.js';
|
|
21
21
|
export { claimsTools } from './claims-tools.js';
|
|
22
|
-
export { wasmAgentTools } from './wasm-agent-tools.js';
|
|
23
|
-
export { ruvllmWasmTools } from './ruvllm-tools.js';
|
|
24
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1315,42 +1315,6 @@ export async function loadEmbeddingModel(options) {
|
|
|
1315
1315
|
loadTime: Date.now() - startTime
|
|
1316
1316
|
};
|
|
1317
1317
|
}
|
|
1318
|
-
// Fallback: Check for ruvector ONNX embedder (bundled MiniLM-L6-v2 since v0.2.15)
|
|
1319
|
-
// v0.2.16: LoRA B=0 fix makes AdaptiveEmbedder safe (identity when untrained)
|
|
1320
|
-
// Note: isReady() returns false until first embed() call (lazy init), so we
|
|
1321
|
-
// skip the isReady() gate and verify with a probe embed instead.
|
|
1322
|
-
const ruvector = await import('ruvector').catch(() => null);
|
|
1323
|
-
if (ruvector?.initOnnxEmbedder) {
|
|
1324
|
-
try {
|
|
1325
|
-
await ruvector.initOnnxEmbedder();
|
|
1326
|
-
// Fallback: OptimizedOnnxEmbedder (raw ONNX, lazy-inits on first embed)
|
|
1327
|
-
const onnxEmb = ruvector.getOptimizedOnnxEmbedder?.();
|
|
1328
|
-
if (onnxEmb?.embed) {
|
|
1329
|
-
// Probe embed to trigger lazy ONNX init and verify it works
|
|
1330
|
-
const probe = await onnxEmb.embed('test');
|
|
1331
|
-
if (probe && probe.length > 0 && (Array.isArray(probe) ? probe.some((v) => v !== 0) : true)) {
|
|
1332
|
-
if (verbose) {
|
|
1333
|
-
console.log(`Loading ruvector ONNX embedder (all-MiniLM-L6-v2, ${probe.length}d)...`);
|
|
1334
|
-
}
|
|
1335
|
-
embeddingModelState = {
|
|
1336
|
-
loaded: true,
|
|
1337
|
-
model: (text) => onnxEmb.embed(text),
|
|
1338
|
-
tokenizer: null,
|
|
1339
|
-
dimensions: probe.length || 384
|
|
1340
|
-
};
|
|
1341
|
-
return {
|
|
1342
|
-
success: true,
|
|
1343
|
-
dimensions: probe.length || 384,
|
|
1344
|
-
modelName: 'ruvector/onnx',
|
|
1345
|
-
loadTime: Date.now() - startTime
|
|
1346
|
-
};
|
|
1347
|
-
}
|
|
1348
|
-
}
|
|
1349
|
-
}
|
|
1350
|
-
catch {
|
|
1351
|
-
// ruvector ONNX init failed, continue to next fallback
|
|
1352
|
-
}
|
|
1353
|
-
}
|
|
1354
1318
|
// Legacy fallback: Check for agentic-flow core embeddings
|
|
1355
1319
|
const agenticFlow = await import('agentic-flow').catch(() => null);
|
|
1356
1320
|
if (agenticFlow && agenticFlow.embeddings) {
|
|
@@ -1414,17 +1378,12 @@ export async function generateEmbedding(text) {
|
|
|
1414
1378
|
if (state.model && typeof state.model === 'function') {
|
|
1415
1379
|
try {
|
|
1416
1380
|
const output = await state.model(text, { pooling: 'mean', normalize: true });
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
:
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
embedding,
|
|
1424
|
-
dimensions: embedding.length,
|
|
1425
|
-
model: 'onnx'
|
|
1426
|
-
};
|
|
1427
|
-
}
|
|
1381
|
+
const embedding = Array.from(output.data);
|
|
1382
|
+
return {
|
|
1383
|
+
embedding,
|
|
1384
|
+
dimensions: embedding.length,
|
|
1385
|
+
model: 'onnx'
|
|
1386
|
+
};
|
|
1428
1387
|
}
|
|
1429
1388
|
catch {
|
|
1430
1389
|
// Fall through to fallback
|
|
@@ -23,8 +23,6 @@ export { FlashAttention, getFlashAttention, resetFlashAttention, computeAttentio
|
|
|
23
23
|
export { LoRAAdapter, getLoRAAdapter, resetLoRAAdapter, createLoRAAdapter, adaptEmbedding, trainLoRA, getLoRAStats, DEFAULT_RANK, DEFAULT_ALPHA, INPUT_DIM as LORA_INPUT_DIM, OUTPUT_DIM as LORA_OUTPUT_DIM, type LoRAConfig, type LoRAWeights, type AdaptationResult, type LoRAStats, } from './lora-adapter.js';
|
|
24
24
|
export { ModelRouter, getModelRouter, resetModelRouter, createModelRouter, routeToModel, routeToModelFull, analyzeTaskComplexity, getModelRouterStats, recordModelOutcome, MODEL_CAPABILITIES, COMPLEXITY_INDICATORS, type ClaudeModel, type ModelRouterConfig, type ModelRoutingResult, type ComplexityAnalysis, } from './model-router.js';
|
|
25
25
|
export { SemanticRouter, createSemanticRouter, type Intent, type RouteResult, type RouterConfig, } from './semantic-router.js';
|
|
26
|
-
export { isRuvllmWasmAvailable, initRuvllmWasm, getRuvllmStatus, createHnswRouter, createSonaInstant, createMicroLora, formatChat, createKvCache, createGenerateConfig, createBufferPool, createInferenceArena, HNSW_MAX_SAFE_PATTERNS, type HnswRouterConfig, type HnswPattern, type HnswRouteResult, type SonaConfig, type MicroLoraConfig, type ChatMessage, type GenerateOptions, type RuvllmStatus, } from './ruvllm-wasm.js';
|
|
27
|
-
export { isAgentWasmAvailable, initAgentWasm, createWasmAgent, promptWasmAgent, executeWasmTool, getWasmAgent, listWasmAgents, terminateWasmAgent, getWasmAgentState, getWasmAgentTools, getWasmAgentTodos, exportWasmState, createWasmMcpServer, listGalleryTemplates, getGalleryCount, getGalleryCategories, searchGalleryTemplates, getGalleryTemplate, createAgentFromTemplate, buildRvfContainer, buildRvfFromTemplate, type WasmAgentConfig, type WasmAgentInfo, type GalleryTemplate, type GalleryTemplateDetail, type ToolResult, } from './agent-wasm.js';
|
|
28
26
|
/**
|
|
29
27
|
* Check if ruvector packages are available
|
|
30
28
|
*/
|
|
@@ -33,10 +33,6 @@ export { FlashAttention, getFlashAttention, resetFlashAttention, computeAttentio
|
|
|
33
33
|
export { LoRAAdapter, getLoRAAdapter, resetLoRAAdapter, createLoRAAdapter, adaptEmbedding, trainLoRA, getLoRAStats, DEFAULT_RANK, DEFAULT_ALPHA, INPUT_DIM as LORA_INPUT_DIM, OUTPUT_DIM as LORA_OUTPUT_DIM, } from './lora-adapter.js';
|
|
34
34
|
export { ModelRouter, getModelRouter, resetModelRouter, createModelRouter, routeToModel, routeToModelFull, analyzeTaskComplexity, getModelRouterStats, recordModelOutcome, MODEL_CAPABILITIES, COMPLEXITY_INDICATORS, } from './model-router.js';
|
|
35
35
|
export { SemanticRouter, createSemanticRouter, } from './semantic-router.js';
|
|
36
|
-
// ── RuVector LLM WASM (inference utilities) ─────────────────
|
|
37
|
-
export { isRuvllmWasmAvailable, initRuvllmWasm, getRuvllmStatus, createHnswRouter, createSonaInstant, createMicroLora, formatChat, createKvCache, createGenerateConfig, createBufferPool, createInferenceArena, HNSW_MAX_SAFE_PATTERNS, } from './ruvllm-wasm.js';
|
|
38
|
-
// ── Agent WASM (sandboxed agent runtime) ────────────────────
|
|
39
|
-
export { isAgentWasmAvailable, initAgentWasm, createWasmAgent, promptWasmAgent, executeWasmTool, getWasmAgent, listWasmAgents, terminateWasmAgent, getWasmAgentState, getWasmAgentTools, getWasmAgentTodos, exportWasmState, createWasmMcpServer, listGalleryTemplates, getGalleryCount, getGalleryCategories, searchGalleryTemplates, getGalleryTemplate, createAgentFromTemplate, buildRvfContainer, buildRvfFromTemplate, } from './agent-wasm.js';
|
|
40
36
|
/**
|
|
41
37
|
* Check if ruvector packages are available
|
|
42
38
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claude-flow/cli",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -97,14 +97,11 @@
|
|
|
97
97
|
"@claude-flow/guidance": "^3.0.0-alpha.1",
|
|
98
98
|
"@claude-flow/memory": "^3.0.0-alpha.11",
|
|
99
99
|
"@claude-flow/plugin-gastown-bridge": "^0.1.3",
|
|
100
|
+
"agentic-flow": "^3.0.0-alpha.1",
|
|
100
101
|
"@ruvector/attention": "^0.1.4",
|
|
101
102
|
"@ruvector/learning-wasm": "^0.1.29",
|
|
102
103
|
"@ruvector/router": "^0.1.27",
|
|
103
|
-
"@ruvector/
|
|
104
|
-
"@ruvector/ruvllm-wasm": "^2.0.2",
|
|
105
|
-
"@ruvector/sona": "^0.1.5",
|
|
106
|
-
"agentic-flow": "^3.0.0-alpha.1",
|
|
107
|
-
"ruvector": "^0.2.16"
|
|
104
|
+
"@ruvector/sona": "^0.1.5"
|
|
108
105
|
},
|
|
109
106
|
"publishConfig": {
|
|
110
107
|
"access": "public",
|