moflo 4.6.12 → 4.7.1
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/settings.json +4 -4
- package/.claude/workflow-state.json +1 -5
- package/README.md +1 -1
- package/bin/hooks.mjs +7 -3
- package/bin/setup-project.mjs +1 -1
- package/package.json +1 -1
- package/src/@claude-flow/cli/README.md +452 -7536
- package/src/@claude-flow/cli/dist/src/commands/doctor.js +1 -1
- package/src/@claude-flow/cli/dist/src/commands/embeddings.js +4 -4
- package/src/@claude-flow/cli/dist/src/commands/init.js +35 -8
- package/src/@claude-flow/cli/dist/src/commands/swarm.js +2 -2
- package/src/@claude-flow/cli/dist/src/init/claudemd-generator.js +316 -294
- package/src/@claude-flow/cli/dist/src/init/executor.js +461 -465
- package/src/@claude-flow/cli/dist/src/init/helpers-generator.d.ts +0 -36
- package/src/@claude-flow/cli/dist/src/init/helpers-generator.js +146 -1124
- package/src/@claude-flow/cli/dist/src/init/index.d.ts +1 -1
- package/src/@claude-flow/cli/dist/src/init/index.js +1 -1
- package/src/@claude-flow/cli/dist/src/init/moflo-init.js +78 -5
- package/src/@claude-flow/cli/dist/src/init/settings-generator.js +50 -120
- package/src/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js +275 -32
- package/src/@claude-flow/cli/dist/src/plugins/store/discovery.js +4 -204
- package/src/@claude-flow/cli/dist/src/plugins/tests/standalone-test.js +4 -4
- package/src/@claude-flow/cli/dist/src/runtime/headless.d.ts +3 -3
- package/src/@claude-flow/cli/dist/src/runtime/headless.js +31 -31
- package/src/@claude-flow/cli/dist/src/services/agentic-flow-bridge.d.ts +3 -3
- package/src/@claude-flow/cli/dist/src/services/agentic-flow-bridge.js +3 -1
- package/src/@claude-flow/cli/dist/src/services/headless-worker-executor.js +14 -0
- package/src/@claude-flow/cli/dist/src/services/workflow-gate.js +21 -1
- package/src/@claude-flow/cli/dist/src/transfer/store/tests/standalone-test.js +4 -4
- package/src/@claude-flow/cli/package.json +1 -1
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Hooks MCP Tools
|
|
3
3
|
* Provides intelligent hooks functionality via MCP protocol
|
|
4
4
|
*/
|
|
5
|
-
import { mkdirSync, writeFileSync, existsSync, readFileSync, statSync } from 'fs';
|
|
6
|
-
import { dirname, join, resolve } from 'path';
|
|
5
|
+
import { mkdirSync, writeFileSync, existsSync, readFileSync, statSync, readdirSync } from 'fs';
|
|
6
|
+
import { dirname, join, resolve, extname } from 'path';
|
|
7
7
|
// Real vector search functions - lazy loaded to avoid circular imports
|
|
8
8
|
let searchEntriesFn = null;
|
|
9
9
|
async function getRealSearchFunction() {
|
|
@@ -1107,21 +1107,9 @@ export const hooksPostTask = {
|
|
|
1107
1107
|
}
|
|
1108
1108
|
catch { /* non-critical */ }
|
|
1109
1109
|
}
|
|
1110
|
-
//
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
const storeFn = await getRealStoreFunction();
|
|
1114
|
-
if (storeFn) {
|
|
1115
|
-
await storeFn({
|
|
1116
|
-
key: `routing-decision:${taskId}`,
|
|
1117
|
-
namespace: 'patterns',
|
|
1118
|
-
value: JSON.stringify({ task: taskText, agent, success, quality, keywords: outcomeKeywords }),
|
|
1119
|
-
tags: ['routing-decision'],
|
|
1120
|
-
});
|
|
1121
|
-
}
|
|
1122
|
-
}
|
|
1123
|
-
catch { /* non-critical */ }
|
|
1124
|
-
}
|
|
1110
|
+
// Routing learnings are persisted via the file-based routing-outcomes.json above.
|
|
1111
|
+
// No redundant write to the memory DB — the JSON file is the authoritative source
|
|
1112
|
+
// for the routing loop (loadRoutingOutcomes → learnedPatternsFromOutcomes → route).
|
|
1125
1113
|
const duration = Date.now() - startTime;
|
|
1126
1114
|
return {
|
|
1127
1115
|
taskId,
|
|
@@ -1204,6 +1192,209 @@ export const hooksExplain = {
|
|
|
1204
1192
|
},
|
|
1205
1193
|
};
|
|
1206
1194
|
// Pretrain hook - repository analysis for intelligence bootstrap
|
|
1195
|
+
/** Recursively collect files matching given extensions up to a limit */
|
|
1196
|
+
function collectFiles(dir, extensions, limit, collected = []) {
|
|
1197
|
+
if (collected.length >= limit)
|
|
1198
|
+
return collected;
|
|
1199
|
+
let entries;
|
|
1200
|
+
try {
|
|
1201
|
+
entries = readdirSync(dir);
|
|
1202
|
+
}
|
|
1203
|
+
catch {
|
|
1204
|
+
return collected;
|
|
1205
|
+
}
|
|
1206
|
+
for (const entry of entries) {
|
|
1207
|
+
if (collected.length >= limit)
|
|
1208
|
+
break;
|
|
1209
|
+
const fullPath = join(dir, entry);
|
|
1210
|
+
// Skip common non-source directories
|
|
1211
|
+
if (entry === 'node_modules' || entry === '.git' || entry === 'dist' || entry === 'build' || entry === '.next' || entry === 'coverage')
|
|
1212
|
+
continue;
|
|
1213
|
+
try {
|
|
1214
|
+
const stat = statSync(fullPath);
|
|
1215
|
+
if (stat.isDirectory()) {
|
|
1216
|
+
collectFiles(fullPath, extensions, limit, collected);
|
|
1217
|
+
}
|
|
1218
|
+
else if (stat.isFile() && extensions.has(extname(entry).slice(1))) {
|
|
1219
|
+
collected.push(fullPath);
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
catch {
|
|
1223
|
+
// skip unreadable
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
return collected;
|
|
1227
|
+
}
|
|
1228
|
+
/** Simple hash for dedup */
|
|
1229
|
+
function simpleHash(str) {
|
|
1230
|
+
let h = 0;
|
|
1231
|
+
for (let i = 0; i < str.length; i++) {
|
|
1232
|
+
h = ((h << 5) - h + str.charCodeAt(i)) | 0;
|
|
1233
|
+
}
|
|
1234
|
+
return Math.abs(h).toString(36);
|
|
1235
|
+
}
|
|
1236
|
+
/** Extract code patterns from file contents */
|
|
1237
|
+
function extractPatterns(files) {
|
|
1238
|
+
const importCounts = new Map();
|
|
1239
|
+
const exportPatterns = { default: 0, named: 0 };
|
|
1240
|
+
const errorPatterns = new Map();
|
|
1241
|
+
const namingStyles = { camelCase: 0, snake_case: 0, PascalCase: 0 };
|
|
1242
|
+
const structurePatterns = new Map();
|
|
1243
|
+
const apiPatterns = new Map();
|
|
1244
|
+
const functionSigs = [];
|
|
1245
|
+
for (const file of files) {
|
|
1246
|
+
let content;
|
|
1247
|
+
try {
|
|
1248
|
+
content = readFileSync(file, 'utf-8');
|
|
1249
|
+
}
|
|
1250
|
+
catch {
|
|
1251
|
+
continue;
|
|
1252
|
+
}
|
|
1253
|
+
const lines = content.split('\n');
|
|
1254
|
+
for (const line of lines) {
|
|
1255
|
+
const trimmed = line.trim();
|
|
1256
|
+
// Import patterns
|
|
1257
|
+
const importMatch = trimmed.match(/^import\s+.*?from\s+['"]([^'"]+)['"]/);
|
|
1258
|
+
if (importMatch) {
|
|
1259
|
+
const mod = importMatch[1].startsWith('.') ? '<relative>' : importMatch[1].split('/')[0];
|
|
1260
|
+
importCounts.set(mod, (importCounts.get(mod) || 0) + 1);
|
|
1261
|
+
}
|
|
1262
|
+
const requireMatch = trimmed.match(/require\(['"]([^'"]+)['"]\)/);
|
|
1263
|
+
if (requireMatch) {
|
|
1264
|
+
const mod = requireMatch[1].startsWith('.') ? '<relative>' : requireMatch[1].split('/')[0];
|
|
1265
|
+
importCounts.set(mod, (importCounts.get(mod) || 0) + 1);
|
|
1266
|
+
}
|
|
1267
|
+
// Python imports
|
|
1268
|
+
const pyImport = trimmed.match(/^(?:from\s+(\S+)\s+import|import\s+(\S+))/);
|
|
1269
|
+
if (pyImport) {
|
|
1270
|
+
const mod = (pyImport[1] || pyImport[2]).split('.')[0];
|
|
1271
|
+
importCounts.set(mod, (importCounts.get(mod) || 0) + 1);
|
|
1272
|
+
}
|
|
1273
|
+
// Export patterns
|
|
1274
|
+
if (/^export\s+default\b/.test(trimmed))
|
|
1275
|
+
exportPatterns.default++;
|
|
1276
|
+
else if (/^export\s+(?:const|function|class|interface|type|enum)\b/.test(trimmed))
|
|
1277
|
+
exportPatterns.named++;
|
|
1278
|
+
// Error handling patterns
|
|
1279
|
+
if (/\bcatch\s*\(/.test(trimmed)) {
|
|
1280
|
+
const errType = trimmed.match(/catch\s*\(\s*(\w+)/)?.[1] || 'generic';
|
|
1281
|
+
errorPatterns.set(errType, (errorPatterns.get(errType) || 0) + 1);
|
|
1282
|
+
}
|
|
1283
|
+
if (/throw\s+new\s+(\w+)/.test(trimmed)) {
|
|
1284
|
+
const errClass = trimmed.match(/throw\s+new\s+(\w+)/)?.[1] || 'Error';
|
|
1285
|
+
errorPatterns.set(`throw:${errClass}`, (errorPatterns.get(`throw:${errClass}`) || 0) + 1);
|
|
1286
|
+
}
|
|
1287
|
+
// Function signatures (collect first 50)
|
|
1288
|
+
if (functionSigs.length < 50) {
|
|
1289
|
+
const fnMatch = trimmed.match(/^(?:export\s+)?(?:async\s+)?function\s+(\w+)/);
|
|
1290
|
+
if (fnMatch)
|
|
1291
|
+
functionSigs.push(fnMatch[1]);
|
|
1292
|
+
const arrowMatch = trimmed.match(/^(?:export\s+)?const\s+(\w+)\s*=\s*(?:async\s+)?\(/);
|
|
1293
|
+
if (arrowMatch)
|
|
1294
|
+
functionSigs.push(arrowMatch[1]);
|
|
1295
|
+
}
|
|
1296
|
+
// Naming conventions from identifiers
|
|
1297
|
+
const identifiers = trimmed.match(/\b[a-zA-Z_]\w{2,}\b/g) || [];
|
|
1298
|
+
for (const id of identifiers.slice(0, 5)) {
|
|
1299
|
+
if (/^[a-z][a-zA-Z0-9]*$/.test(id) && /[A-Z]/.test(id))
|
|
1300
|
+
namingStyles.camelCase++;
|
|
1301
|
+
else if (/_/.test(id) && id === id.toLowerCase())
|
|
1302
|
+
namingStyles.snake_case++;
|
|
1303
|
+
else if (/^[A-Z][a-zA-Z0-9]*$/.test(id) && /[a-z]/.test(id))
|
|
1304
|
+
namingStyles.PascalCase++;
|
|
1305
|
+
}
|
|
1306
|
+
// API/Route patterns
|
|
1307
|
+
const routeMatch = trimmed.match(/\.(get|post|put|patch|delete|use)\s*\(\s*['"\/]/i);
|
|
1308
|
+
if (routeMatch) {
|
|
1309
|
+
const method = routeMatch[1].toUpperCase();
|
|
1310
|
+
apiPatterns.set(method, (apiPatterns.get(method) || 0) + 1);
|
|
1311
|
+
}
|
|
1312
|
+
if (/router\.|app\.|@(Get|Post|Put|Delete|Patch)\b/.test(trimmed)) {
|
|
1313
|
+
apiPatterns.set('route-definition', (apiPatterns.get('route-definition') || 0) + 1);
|
|
1314
|
+
}
|
|
1315
|
+
if (/middleware|\.use\(/.test(trimmed)) {
|
|
1316
|
+
apiPatterns.set('middleware', (apiPatterns.get('middleware') || 0) + 1);
|
|
1317
|
+
}
|
|
1318
|
+
// Structure patterns
|
|
1319
|
+
if (/return\s*\{\s*success/.test(trimmed)) {
|
|
1320
|
+
structurePatterns.set('return-success-object', (structurePatterns.get('return-success-object') || 0) + 1);
|
|
1321
|
+
}
|
|
1322
|
+
if (/class\s+\w+Service\b/.test(trimmed)) {
|
|
1323
|
+
structurePatterns.set('service-class', (structurePatterns.get('service-class') || 0) + 1);
|
|
1324
|
+
}
|
|
1325
|
+
if (/class\s+\w+Controller\b/.test(trimmed)) {
|
|
1326
|
+
structurePatterns.set('controller-class', (structurePatterns.get('controller-class') || 0) + 1);
|
|
1327
|
+
}
|
|
1328
|
+
if (/class\s+\w+Repository\b/.test(trimmed)) {
|
|
1329
|
+
structurePatterns.set('repository-class', (structurePatterns.get('repository-class') || 0) + 1);
|
|
1330
|
+
}
|
|
1331
|
+
if (/interface\s+\w+/.test(trimmed)) {
|
|
1332
|
+
structurePatterns.set('typed-interface', (structurePatterns.get('typed-interface') || 0) + 1);
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
const patterns = [];
|
|
1337
|
+
// Top imports by frequency
|
|
1338
|
+
const sortedImports = [...importCounts.entries()].sort((a, b) => b[1] - a[1]).slice(0, 15);
|
|
1339
|
+
if (sortedImports.length > 0) {
|
|
1340
|
+
patterns.push({
|
|
1341
|
+
type: 'import',
|
|
1342
|
+
value: `Top modules: ${sortedImports.map(([m, c]) => `${m}(${c})`).join(', ')}`,
|
|
1343
|
+
count: sortedImports.reduce((s, [, c]) => s + c, 0),
|
|
1344
|
+
examples: sortedImports.slice(0, 5).map(([m]) => m),
|
|
1345
|
+
});
|
|
1346
|
+
}
|
|
1347
|
+
// Export patterns
|
|
1348
|
+
if (exportPatterns.default + exportPatterns.named > 0) {
|
|
1349
|
+
patterns.push({
|
|
1350
|
+
type: 'export',
|
|
1351
|
+
value: `default:${exportPatterns.default} named:${exportPatterns.named}`,
|
|
1352
|
+
count: exportPatterns.default + exportPatterns.named,
|
|
1353
|
+
examples: exportPatterns.named > exportPatterns.default
|
|
1354
|
+
? ['Named exports preferred']
|
|
1355
|
+
: ['Default exports preferred'],
|
|
1356
|
+
});
|
|
1357
|
+
}
|
|
1358
|
+
// Error handling
|
|
1359
|
+
const sortedErrors = [...errorPatterns.entries()].sort((a, b) => b[1] - a[1]).slice(0, 10);
|
|
1360
|
+
if (sortedErrors.length > 0) {
|
|
1361
|
+
patterns.push({
|
|
1362
|
+
type: 'error-handling',
|
|
1363
|
+
value: sortedErrors.map(([t, c]) => `${t}(${c})`).join(', '),
|
|
1364
|
+
count: sortedErrors.reduce((s, [, c]) => s + c, 0),
|
|
1365
|
+
examples: sortedErrors.slice(0, 3).map(([t]) => t),
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
// Naming conventions
|
|
1369
|
+
const dominant = namingStyles.camelCase >= namingStyles.snake_case ? 'camelCase' : 'snake_case';
|
|
1370
|
+
patterns.push({
|
|
1371
|
+
type: 'naming',
|
|
1372
|
+
value: `camelCase:${namingStyles.camelCase} snake_case:${namingStyles.snake_case} PascalCase:${namingStyles.PascalCase} dominant:${dominant}`,
|
|
1373
|
+
count: namingStyles.camelCase + namingStyles.snake_case + namingStyles.PascalCase,
|
|
1374
|
+
examples: functionSigs.slice(0, 5),
|
|
1375
|
+
});
|
|
1376
|
+
// Structure patterns
|
|
1377
|
+
const sortedStructures = [...structurePatterns.entries()].sort((a, b) => b[1] - a[1]);
|
|
1378
|
+
if (sortedStructures.length > 0) {
|
|
1379
|
+
patterns.push({
|
|
1380
|
+
type: 'structure',
|
|
1381
|
+
value: sortedStructures.map(([t, c]) => `${t}(${c})`).join(', '),
|
|
1382
|
+
count: sortedStructures.reduce((s, [, c]) => s + c, 0),
|
|
1383
|
+
examples: sortedStructures.slice(0, 3).map(([t]) => t),
|
|
1384
|
+
});
|
|
1385
|
+
}
|
|
1386
|
+
// API patterns
|
|
1387
|
+
const sortedApi = [...apiPatterns.entries()].sort((a, b) => b[1] - a[1]);
|
|
1388
|
+
if (sortedApi.length > 0) {
|
|
1389
|
+
patterns.push({
|
|
1390
|
+
type: 'api-pattern',
|
|
1391
|
+
value: sortedApi.map(([t, c]) => `${t}(${c})`).join(', '),
|
|
1392
|
+
count: sortedApi.reduce((s, [, c]) => s + c, 0),
|
|
1393
|
+
examples: sortedApi.slice(0, 3).map(([t]) => t),
|
|
1394
|
+
});
|
|
1395
|
+
}
|
|
1396
|
+
return patterns;
|
|
1397
|
+
}
|
|
1207
1398
|
export const hooksPretrain = {
|
|
1208
1399
|
name: 'hooks_pretrain',
|
|
1209
1400
|
description: 'Analyze repository to bootstrap intelligence (4-step pipeline)',
|
|
@@ -1212,32 +1403,84 @@ export const hooksPretrain = {
|
|
|
1212
1403
|
properties: {
|
|
1213
1404
|
path: { type: 'string', description: 'Repository path' },
|
|
1214
1405
|
depth: { type: 'string', description: 'Analysis depth (shallow, medium, deep)' },
|
|
1406
|
+
fileTypes: { type: 'string', description: 'Comma-separated file extensions to scan (default: ts,js,py,md)' },
|
|
1215
1407
|
skipCache: { type: 'boolean', description: 'Skip cached analysis' },
|
|
1216
1408
|
},
|
|
1217
1409
|
},
|
|
1218
1410
|
handler: async (params) => {
|
|
1219
|
-
const
|
|
1411
|
+
const repoPath = resolve(params.path || '.');
|
|
1220
1412
|
const depth = params.depth || 'medium';
|
|
1413
|
+
const fileTypesStr = params.fileTypes || 'ts,js,py,md';
|
|
1221
1414
|
const startTime = Date.now();
|
|
1222
|
-
//
|
|
1223
|
-
const
|
|
1415
|
+
// Determine file limit by depth
|
|
1416
|
+
const fileLimit = depth === 'deep' ? 100 : depth === 'shallow' ? 30 : 60;
|
|
1417
|
+
const extensions = new Set(fileTypesStr.split(',').map(e => e.trim()));
|
|
1418
|
+
// Phase 1: Retrieve - collect source files
|
|
1419
|
+
const retrieveStart = Date.now();
|
|
1420
|
+
const files = collectFiles(repoPath, extensions, fileLimit);
|
|
1421
|
+
const retrieveDuration = Date.now() - retrieveStart;
|
|
1422
|
+
// Phase 2: Judge - extract patterns from files
|
|
1423
|
+
const judgeStart = Date.now();
|
|
1424
|
+
const patterns = extractPatterns(files);
|
|
1425
|
+
const judgeDuration = Date.now() - judgeStart;
|
|
1426
|
+
// Phase 3: Distill - store patterns in memory DB
|
|
1427
|
+
const distillStart = Date.now();
|
|
1428
|
+
let patternsStored = 0;
|
|
1429
|
+
let storageErrors = 0;
|
|
1430
|
+
const storeFn = await getRealStoreFunction();
|
|
1431
|
+
if (storeFn) {
|
|
1432
|
+
for (const pattern of patterns) {
|
|
1433
|
+
const hash = simpleHash(`${pattern.type}:${pattern.value}`);
|
|
1434
|
+
try {
|
|
1435
|
+
await storeFn({
|
|
1436
|
+
key: `pattern-${pattern.type}-${hash}`,
|
|
1437
|
+
value: JSON.stringify({
|
|
1438
|
+
type: pattern.type,
|
|
1439
|
+
value: pattern.value,
|
|
1440
|
+
count: pattern.count,
|
|
1441
|
+
examples: pattern.examples,
|
|
1442
|
+
filesAnalyzed: files.length,
|
|
1443
|
+
extractedAt: new Date().toISOString(),
|
|
1444
|
+
}),
|
|
1445
|
+
namespace: 'patterns',
|
|
1446
|
+
generateEmbeddingFlag: true,
|
|
1447
|
+
tags: [pattern.type, 'pretrain', `depth-${depth}`],
|
|
1448
|
+
});
|
|
1449
|
+
patternsStored++;
|
|
1450
|
+
}
|
|
1451
|
+
catch {
|
|
1452
|
+
storageErrors++;
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
const distillDuration = Date.now() - distillStart;
|
|
1457
|
+
// Phase 4: Consolidate - summary
|
|
1458
|
+
const consolidateStart = Date.now();
|
|
1459
|
+
const consolidateDuration = Date.now() - consolidateStart;
|
|
1224
1460
|
return {
|
|
1225
|
-
path,
|
|
1461
|
+
path: repoPath,
|
|
1226
1462
|
depth,
|
|
1463
|
+
fileTypes: fileTypesStr,
|
|
1227
1464
|
stats: {
|
|
1228
|
-
filesAnalyzed:
|
|
1229
|
-
patternsExtracted:
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1465
|
+
filesAnalyzed: files.length,
|
|
1466
|
+
patternsExtracted: patterns.length,
|
|
1467
|
+
patternsStored,
|
|
1468
|
+
storageErrors,
|
|
1469
|
+
patternTypes: patterns.map(p => p.type),
|
|
1233
1470
|
},
|
|
1471
|
+
patterns: patterns.map(p => ({
|
|
1472
|
+
type: p.type,
|
|
1473
|
+
summary: p.value,
|
|
1474
|
+
count: p.count,
|
|
1475
|
+
examples: p.examples,
|
|
1476
|
+
})),
|
|
1234
1477
|
pipeline: {
|
|
1235
|
-
retrieve: { status: 'completed',
|
|
1236
|
-
judge: { status: 'completed',
|
|
1237
|
-
distill: { status: 'completed',
|
|
1238
|
-
consolidate: { status: 'completed', duration:
|
|
1478
|
+
retrieve: { status: 'completed', filesFound: files.length, duration: retrieveDuration },
|
|
1479
|
+
judge: { status: 'completed', patternsFound: patterns.length, duration: judgeDuration },
|
|
1480
|
+
distill: { status: storeFn ? 'completed' : 'skipped', stored: patternsStored, errors: storageErrors, duration: distillDuration },
|
|
1481
|
+
consolidate: { status: 'completed', duration: consolidateDuration },
|
|
1239
1482
|
},
|
|
1240
|
-
duration: Date.now() - startTime
|
|
1483
|
+
duration: Date.now() - startTime,
|
|
1241
1484
|
};
|
|
1242
1485
|
},
|
|
1243
1486
|
};
|
|
@@ -1993,7 +2236,7 @@ export const hooksPatternStore = {
|
|
|
1993
2236
|
storeResult = await storeFn({
|
|
1994
2237
|
key: patternId,
|
|
1995
2238
|
value: JSON.stringify({ pattern, type, confidence, metadata, timestamp }),
|
|
1996
|
-
namespace: '
|
|
2239
|
+
namespace: 'patterns',
|
|
1997
2240
|
generateEmbeddingFlag: true,
|
|
1998
2241
|
tags: [type, `confidence-${Math.round(confidence * 100)}`, 'reasoning-pattern'],
|
|
1999
2242
|
});
|
|
@@ -197,10 +197,10 @@ export class PluginDiscoveryService {
|
|
|
197
197
|
totalPlugins: plugins.length,
|
|
198
198
|
totalDownloads: plugins.reduce((sum, p) => sum + p.downloads, 0),
|
|
199
199
|
totalAuthors: 1,
|
|
200
|
-
featured: ['@claude-flow/
|
|
201
|
-
trending: [
|
|
202
|
-
newest: [
|
|
203
|
-
official: ['@claude-flow/
|
|
200
|
+
featured: ['@claude-flow/security', '@claude-flow/claims'],
|
|
201
|
+
trending: [],
|
|
202
|
+
newest: [],
|
|
203
|
+
official: ['@claude-flow/security', '@claude-flow/claims'],
|
|
204
204
|
compatibilityMatrix: [
|
|
205
205
|
{ pluginId: '@claude-flow/neural', pluginVersion: '3.0.0', claudeFlowVersions: ['3.x'], tested: true },
|
|
206
206
|
{ pluginId: '@claude-flow/security', pluginVersion: '3.0.0', claudeFlowVersions: ['3.x'], tested: true },
|
|
@@ -531,124 +531,6 @@ export class PluginDiscoveryService {
|
|
|
531
531
|
verified: true,
|
|
532
532
|
trustLevel: 'official',
|
|
533
533
|
},
|
|
534
|
-
// Agentic QE - AI-powered quality engineering
|
|
535
|
-
{
|
|
536
|
-
id: '@claude-flow/plugin-agentic-qe',
|
|
537
|
-
name: '@claude-flow/plugin-agentic-qe',
|
|
538
|
-
displayName: 'Agentic Quality Engineering',
|
|
539
|
-
description: 'AI-powered quality engineering with 58 agents that write tests, find bugs, predict defects, scan security, and perform chaos engineering safely.',
|
|
540
|
-
version: '3.0.0-alpha.3',
|
|
541
|
-
cid: 'bafybeiagenticqeplugin2024',
|
|
542
|
-
size: 285000,
|
|
543
|
-
checksum: 'sha256:agenticqe2024xyz',
|
|
544
|
-
author: officialAuthor,
|
|
545
|
-
license: 'MIT',
|
|
546
|
-
categories: ['ai-ml', 'devops', 'security'],
|
|
547
|
-
tags: ['testing', 'qe', 'tdd', 'security', 'chaos-engineering', 'coverage', 'defect-prediction', 'agents'],
|
|
548
|
-
keywords: ['quality', 'testing', 'agents', 'tdd', 'security'],
|
|
549
|
-
downloads: 1200,
|
|
550
|
-
rating: 4.8,
|
|
551
|
-
ratingCount: 24,
|
|
552
|
-
lastUpdated: baseTime,
|
|
553
|
-
createdAt: '2026-01-20T00:00:00Z',
|
|
554
|
-
minClaudeFlowVersion: '3.0.0',
|
|
555
|
-
dependencies: [
|
|
556
|
-
{ name: '@claude-flow/core', version: '^3.0.0' },
|
|
557
|
-
],
|
|
558
|
-
type: 'integration',
|
|
559
|
-
hooks: [
|
|
560
|
-
'aqe:generate-tests',
|
|
561
|
-
'aqe:analyze-coverage',
|
|
562
|
-
'aqe:security-scan',
|
|
563
|
-
'aqe:predict-defects',
|
|
564
|
-
'aqe:chaos-inject',
|
|
565
|
-
],
|
|
566
|
-
commands: [
|
|
567
|
-
'aqe generate-tests',
|
|
568
|
-
'aqe tdd-cycle',
|
|
569
|
-
'aqe security-scan',
|
|
570
|
-
'aqe predict-defects',
|
|
571
|
-
'aqe chaos-inject',
|
|
572
|
-
'aqe quality-gate',
|
|
573
|
-
'aqe visual-regression',
|
|
574
|
-
],
|
|
575
|
-
permissions: ['filesystem', 'network', 'memory'],
|
|
576
|
-
exports: [
|
|
577
|
-
'TestGenerator',
|
|
578
|
-
'CoverageAnalyzer',
|
|
579
|
-
'SecurityScanner',
|
|
580
|
-
'DefectPredictor',
|
|
581
|
-
'ChaosInjector',
|
|
582
|
-
'QualityGate',
|
|
583
|
-
],
|
|
584
|
-
verified: true,
|
|
585
|
-
trustLevel: 'official',
|
|
586
|
-
securityAudit: {
|
|
587
|
-
auditor: 'claude-flow-security-team',
|
|
588
|
-
auditDate: '2026-01-20T00:00:00Z',
|
|
589
|
-
auditVersion: '3.0.0-alpha.3',
|
|
590
|
-
passed: true,
|
|
591
|
-
issues: [],
|
|
592
|
-
},
|
|
593
|
-
},
|
|
594
|
-
// Prime Radiant - Mathematical coherence and consensus verification
|
|
595
|
-
{
|
|
596
|
-
id: '@claude-flow/plugin-prime-radiant',
|
|
597
|
-
name: '@claude-flow/plugin-prime-radiant',
|
|
598
|
-
displayName: 'Prime Radiant',
|
|
599
|
-
description: 'Mathematical AI that catches contradictions, verifies consensus, prevents hallucinations, and analyzes swarm stability using sheaf cohomology and spectral graph theory.',
|
|
600
|
-
version: '0.1.5',
|
|
601
|
-
cid: 'bafybeiprimeradiantplugin2024',
|
|
602
|
-
size: 195000,
|
|
603
|
-
checksum: 'sha256:primeradiant2024xyz',
|
|
604
|
-
author: officialAuthor,
|
|
605
|
-
license: 'MIT',
|
|
606
|
-
categories: ['ai-ml', 'agents'],
|
|
607
|
-
tags: ['coherence', 'consensus', 'mathematics', 'validation', 'hallucination-prevention', 'spectral', 'causal'],
|
|
608
|
-
keywords: ['coherence', 'consensus', 'validation', 'mathematics'],
|
|
609
|
-
downloads: 850,
|
|
610
|
-
rating: 4.9,
|
|
611
|
-
ratingCount: 18,
|
|
612
|
-
lastUpdated: baseTime,
|
|
613
|
-
createdAt: '2026-01-20T00:00:00Z',
|
|
614
|
-
minClaudeFlowVersion: '3.0.0',
|
|
615
|
-
dependencies: [
|
|
616
|
-
{ name: '@claude-flow/core', version: '^3.0.0' },
|
|
617
|
-
],
|
|
618
|
-
type: 'integration',
|
|
619
|
-
hooks: [
|
|
620
|
-
'pr:pre-memory-store',
|
|
621
|
-
'pr:pre-consensus',
|
|
622
|
-
'pr:post-swarm-task',
|
|
623
|
-
'pr:pre-rag-retrieval',
|
|
624
|
-
],
|
|
625
|
-
commands: [
|
|
626
|
-
'pr coherence-check',
|
|
627
|
-
'pr consensus-verify',
|
|
628
|
-
'pr spectral-analyze',
|
|
629
|
-
'pr causal-infer',
|
|
630
|
-
'pr memory-gate',
|
|
631
|
-
'pr quantum-topology',
|
|
632
|
-
],
|
|
633
|
-
permissions: ['memory', 'hooks'],
|
|
634
|
-
exports: [
|
|
635
|
-
'CoherenceChecker',
|
|
636
|
-
'ConsensusVerifier',
|
|
637
|
-
'SpectralAnalyzer',
|
|
638
|
-
'CausalInference',
|
|
639
|
-
'MemoryGate',
|
|
640
|
-
'QuantumTopology',
|
|
641
|
-
],
|
|
642
|
-
verified: true,
|
|
643
|
-
trustLevel: 'official',
|
|
644
|
-
securityAudit: {
|
|
645
|
-
auditor: 'claude-flow-security-team',
|
|
646
|
-
auditDate: '2026-01-20T00:00:00Z',
|
|
647
|
-
auditVersion: '0.1.5',
|
|
648
|
-
passed: true,
|
|
649
|
-
issues: [],
|
|
650
|
-
},
|
|
651
|
-
},
|
|
652
534
|
// Domain-specific plugins
|
|
653
535
|
{
|
|
654
536
|
id: '@claude-flow/plugin-healthcare-clinical',
|
|
@@ -942,83 +824,6 @@ export class PluginDiscoveryService {
|
|
|
942
824
|
verified: true,
|
|
943
825
|
trustLevel: 'official',
|
|
944
826
|
},
|
|
945
|
-
// Gas Town Bridge - Multi-agent orchestrator integration
|
|
946
|
-
{
|
|
947
|
-
id: '@claude-flow/plugin-gastown-bridge',
|
|
948
|
-
name: '@claude-flow/plugin-gastown-bridge',
|
|
949
|
-
displayName: 'Gas Town Bridge',
|
|
950
|
-
description: 'Gas Town orchestrator integration with WASM-accelerated formula parsing, Beads sync, convoy management, and graph analysis (352x faster).',
|
|
951
|
-
version: '0.1.0',
|
|
952
|
-
cid: 'bafybeigastownbridgeplugin2024',
|
|
953
|
-
size: 485000,
|
|
954
|
-
checksum: 'sha256:gastownbridge2024xyz',
|
|
955
|
-
author: officialAuthor,
|
|
956
|
-
license: 'MIT',
|
|
957
|
-
categories: ['integrations', 'agents'],
|
|
958
|
-
tags: ['gastown', 'orchestration', 'beads', 'formulas', 'wasm', 'convoy', 'workflows'],
|
|
959
|
-
keywords: ['gastown', 'orchestration', 'beads'],
|
|
960
|
-
downloads: 0,
|
|
961
|
-
rating: 0,
|
|
962
|
-
ratingCount: 0,
|
|
963
|
-
lastUpdated: baseTime,
|
|
964
|
-
createdAt: '2026-01-24T00:00:00Z',
|
|
965
|
-
minClaudeFlowVersion: '3.0.0',
|
|
966
|
-
dependencies: [{ name: '@claude-flow/core', version: '^3.0.0' }],
|
|
967
|
-
type: 'integration',
|
|
968
|
-
hooks: ['gastown:sync', 'gastown:formula', 'gastown:convoy'],
|
|
969
|
-
commands: ['gastown beads', 'gastown convoy', 'gastown formula', 'gastown sync'],
|
|
970
|
-
permissions: ['filesystem', 'memory', 'network'],
|
|
971
|
-
exports: ['BeadsBridge', 'ConvoyManager', 'FormulaEngine', 'GastownSync'],
|
|
972
|
-
verified: true,
|
|
973
|
-
trustLevel: 'official',
|
|
974
|
-
securityAudit: {
|
|
975
|
-
auditor: 'claude-flow-security-team',
|
|
976
|
-
auditDate: '2026-01-24T00:00:00Z',
|
|
977
|
-
auditVersion: '0.1.0',
|
|
978
|
-
passed: true,
|
|
979
|
-
issues: [],
|
|
980
|
-
},
|
|
981
|
-
},
|
|
982
|
-
// Teammate Plugin - Claude Code v2.1.19+ integration
|
|
983
|
-
{
|
|
984
|
-
id: '@claude-flow/teammate-plugin',
|
|
985
|
-
name: '@claude-flow/teammate-plugin',
|
|
986
|
-
displayName: 'Teammate Plugin',
|
|
987
|
-
description: 'Native TeammateTool integration for Claude Code v2.1.19+. Multi-agent team orchestration with plan approval workflows, delegation, messaging, and BMSSP-optimized topology routing. 21 MCP tools.',
|
|
988
|
-
version: '1.0.0-alpha.1',
|
|
989
|
-
cid: 'bafybeiteammateplugin2026',
|
|
990
|
-
size: 387000,
|
|
991
|
-
checksum: 'sha256:e335dd24ec2e68e8952c517794421a0b18dfb23f',
|
|
992
|
-
author: officialAuthor,
|
|
993
|
-
license: 'MIT',
|
|
994
|
-
categories: ['agents', 'integrations'],
|
|
995
|
-
tags: ['teammate', 'claude-code', 'multi-agent', 'swarm', 'orchestration', 'bmssp'],
|
|
996
|
-
keywords: ['teammate', 'claude-code', 'multi-agent'],
|
|
997
|
-
downloads: 0,
|
|
998
|
-
rating: 0,
|
|
999
|
-
ratingCount: 0,
|
|
1000
|
-
lastUpdated: baseTime,
|
|
1001
|
-
createdAt: '2026-01-25T00:00:00Z',
|
|
1002
|
-
minClaudeFlowVersion: '3.0.0',
|
|
1003
|
-
dependencies: [
|
|
1004
|
-
{ name: '@claude-flow/core', version: '^3.0.0' },
|
|
1005
|
-
{ name: 'eventemitter3', version: '^5.0.1' },
|
|
1006
|
-
],
|
|
1007
|
-
type: 'integration',
|
|
1008
|
-
hooks: ['teammate:spawn', 'teammate:message', 'teammate:plan', 'teammate:delegate'],
|
|
1009
|
-
commands: ['teammate spawn', 'teammate team', 'teammate message', 'teammate plan'],
|
|
1010
|
-
permissions: ['filesystem', 'memory', 'network'],
|
|
1011
|
-
exports: ['TeammateBridge', 'createTeammateBridge', 'TEAMMATE_MCP_TOOLS', 'TopologyOptimizer', 'SemanticRouter'],
|
|
1012
|
-
verified: true,
|
|
1013
|
-
trustLevel: 'official',
|
|
1014
|
-
securityAudit: {
|
|
1015
|
-
auditor: 'claude-flow-security-team',
|
|
1016
|
-
auditDate: '2026-01-25T00:00:00Z',
|
|
1017
|
-
auditVersion: '1.0.0-alpha.1',
|
|
1018
|
-
passed: true,
|
|
1019
|
-
issues: [],
|
|
1020
|
-
},
|
|
1021
|
-
},
|
|
1022
827
|
];
|
|
1023
828
|
}
|
|
1024
829
|
/**
|
|
@@ -1028,15 +833,12 @@ export class PluginDiscoveryService {
|
|
|
1028
833
|
const basePlugins = this.getDemoPlugins();
|
|
1029
834
|
// Only fetch stats for real npm packages
|
|
1030
835
|
const realNpmPackages = [
|
|
1031
|
-
'@claude-flow/plugin-agentic-qe',
|
|
1032
|
-
'@claude-flow/plugin-prime-radiant',
|
|
1033
836
|
'@claude-flow/claims',
|
|
1034
837
|
'@claude-flow/security',
|
|
1035
838
|
'@claude-flow/plugins',
|
|
1036
839
|
'@claude-flow/embeddings',
|
|
1037
840
|
'@claude-flow/neural',
|
|
1038
841
|
'@claude-flow/performance',
|
|
1039
|
-
'@claude-flow/teammate-plugin',
|
|
1040
842
|
// Domain-specific plugins
|
|
1041
843
|
'@claude-flow/plugin-healthcare-clinical',
|
|
1042
844
|
'@claude-flow/plugin-financial-risk',
|
|
@@ -1050,8 +852,6 @@ export class PluginDiscoveryService {
|
|
|
1050
852
|
'@claude-flow/plugin-cognitive-kernel',
|
|
1051
853
|
'@claude-flow/plugin-quantum-optimizer',
|
|
1052
854
|
'@claude-flow/plugin-hyperbolic-reasoning',
|
|
1053
|
-
// Gas Town Bridge
|
|
1054
|
-
'@claude-flow/plugin-gastown-bridge',
|
|
1055
855
|
];
|
|
1056
856
|
// Fetch stats in parallel
|
|
1057
857
|
const statsPromises = realNpmPackages.map(pkg => fetchNpmStats(pkg));
|
|
@@ -173,10 +173,10 @@ async function main() {
|
|
|
173
173
|
console.log(' 🎉 All tests passed! Plugin Store is working correctly.');
|
|
174
174
|
console.log('');
|
|
175
175
|
console.log(' Available CLI Commands:');
|
|
176
|
-
console.log(' npx
|
|
177
|
-
console.log(' npx
|
|
178
|
-
console.log(' npx
|
|
179
|
-
console.log(' npx
|
|
176
|
+
console.log(' npx moflo plugins list');
|
|
177
|
+
console.log(' npx moflo plugins list --official');
|
|
178
|
+
console.log(' npx moflo plugins search -q "plugin creator"');
|
|
179
|
+
console.log(' npx moflo plugins info -n plugin-creator');
|
|
180
180
|
console.log('');
|
|
181
181
|
}
|
|
182
182
|
process.exit(failed > 0 ? 1 : 0);
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Runs without TTY for daemon processes and scheduled tasks
|
|
5
5
|
*
|
|
6
6
|
* Usage:
|
|
7
|
-
* npx
|
|
8
|
-
* npx
|
|
9
|
-
* npx
|
|
7
|
+
* npx moflo headless --worker <type>
|
|
8
|
+
* npx moflo headless --daemon
|
|
9
|
+
* npx moflo headless --benchmark
|
|
10
10
|
*
|
|
11
11
|
* Environment:
|
|
12
12
|
* CLAUDE_FLOW_HEADLESS=true
|