monomind 1.10.21 → 1.10.22
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.
|
@@ -1470,6 +1470,60 @@ const handlers = {
|
|
|
1470
1470
|
console.log('[OK] Session restored: session-' + Date.now());
|
|
1471
1471
|
}
|
|
1472
1472
|
} catch (e) { console.log('[WARN] Session restore failed: ' + e.message); }
|
|
1473
|
+
|
|
1474
|
+
// Stale helper detection — compare local helper hashes against the
|
|
1475
|
+
// bundled (npm-installed) monomind copy and warn if they drift. This
|
|
1476
|
+
// is what alerts the user that 'monomind init upgrade' would pick up
|
|
1477
|
+
// new features (graph fallback routing, telemetry counters, etc).
|
|
1478
|
+
try {
|
|
1479
|
+
var crypto = require('crypto');
|
|
1480
|
+
// Walk up from this file to find the monomind package root (looks for
|
|
1481
|
+
// package.json with name === 'monomind' or '@monomind/cli').
|
|
1482
|
+
function _findBundledHelpers() {
|
|
1483
|
+
var helperPaths = [
|
|
1484
|
+
path.join(__dirname),
|
|
1485
|
+
path.join(CWD, 'node_modules', 'monomind', '.claude', 'helpers'),
|
|
1486
|
+
path.join(CWD, 'node_modules', '@monoes', 'monomindcli', '.claude', 'helpers'),
|
|
1487
|
+
];
|
|
1488
|
+
try {
|
|
1489
|
+
var globalRoot = require('child_process')
|
|
1490
|
+
.execSync('npm root -g 2>/dev/null', { encoding: 'utf-8', timeout: 2000 })
|
|
1491
|
+
.trim();
|
|
1492
|
+
if (globalRoot) {
|
|
1493
|
+
helperPaths.push(path.join(globalRoot, 'monomind', '.claude', 'helpers'));
|
|
1494
|
+
helperPaths.push(path.join(globalRoot, '@monoes', 'monomindcli', '.claude', 'helpers'));
|
|
1495
|
+
}
|
|
1496
|
+
} catch (_) {}
|
|
1497
|
+
for (var i = 0; i < helperPaths.length; i++) {
|
|
1498
|
+
if (fs.existsSync(path.join(helperPaths[i], 'hook-handler.cjs')) &&
|
|
1499
|
+
helperPaths[i] !== path.join(CWD, '.claude', 'helpers')) {
|
|
1500
|
+
return helperPaths[i];
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
return null;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
var bundledDir = _findBundledHelpers();
|
|
1507
|
+
if (bundledDir) {
|
|
1508
|
+
var helpersToCheck = ['hook-handler.cjs', 'statusline.cjs'];
|
|
1509
|
+
var stale = [];
|
|
1510
|
+
for (var hi = 0; hi < helpersToCheck.length; hi++) {
|
|
1511
|
+
var hName = helpersToCheck[hi];
|
|
1512
|
+
var localF = path.join(CWD, '.claude', 'helpers', hName);
|
|
1513
|
+
var bundledF = path.join(bundledDir, hName);
|
|
1514
|
+
if (!fs.existsSync(localF) || !fs.existsSync(bundledF)) continue;
|
|
1515
|
+
try {
|
|
1516
|
+
var hashL = crypto.createHash('sha256').update(fs.readFileSync(localF)).digest('hex');
|
|
1517
|
+
var hashB = crypto.createHash('sha256').update(fs.readFileSync(bundledF)).digest('hex');
|
|
1518
|
+
if (hashL !== hashB) stale.push(hName);
|
|
1519
|
+
} catch (_) {}
|
|
1520
|
+
}
|
|
1521
|
+
if (stale.length > 0) {
|
|
1522
|
+
console.log('[STALE_HELPERS] Project helpers differ from bundled version: ' + stale.join(', '));
|
|
1523
|
+
console.log(' Run `npx monomind@latest init upgrade` to refresh and pick up the latest features.');
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
} catch (e) { /* non-fatal */ }
|
|
1473
1527
|
// Initialize intelligence (with timeout — #1530)
|
|
1474
1528
|
// Respects monomind.neural.enabled kill switch from settings.json
|
|
1475
1529
|
var neuralEnabled = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monomind",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.22",
|
|
4
4
|
"description": "Monomind - 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",
|
|
@@ -411,6 +411,86 @@ async function checkMonograph() {
|
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
413
|
// Check agentic-flow v1 integration (filesystem-based to avoid slow WASM/DB init)
|
|
414
|
+
// Resolve the path to the bundled (npm-installed) copy of a helper file.
|
|
415
|
+
// Walks up from this module's location to find the package root, then joins
|
|
416
|
+
// the relative path. Returns null if not found.
|
|
417
|
+
function _resolveBundledHelper(relativePath) {
|
|
418
|
+
try {
|
|
419
|
+
const thisFile = fileURLToPath(import.meta.url);
|
|
420
|
+
let dir = dirname(thisFile);
|
|
421
|
+
for (;;) {
|
|
422
|
+
const candidate = join(dir, 'package.json');
|
|
423
|
+
if (existsSync(candidate)) {
|
|
424
|
+
try {
|
|
425
|
+
const pkg = JSON.parse(readFileSync(candidate, 'utf8'));
|
|
426
|
+
if (pkg.name === '@monomind/cli' || pkg.name === 'monomind') {
|
|
427
|
+
const helperPath = join(dir, relativePath);
|
|
428
|
+
return existsSync(helperPath) ? helperPath : null;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
catch { /* keep walking */ }
|
|
432
|
+
}
|
|
433
|
+
const parent = dirname(dir);
|
|
434
|
+
if (parent === dir)
|
|
435
|
+
return null;
|
|
436
|
+
dir = parent;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
catch {
|
|
440
|
+
return null;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
// Compare per-project helper file content vs the bundled (npm) version.
|
|
444
|
+
// Returns the list of files that drifted.
|
|
445
|
+
async function _detectStaleHelpers() {
|
|
446
|
+
const stale = [];
|
|
447
|
+
const missing = [];
|
|
448
|
+
const helpers = ['hook-handler.cjs', 'statusline.cjs', 'router.cjs', 'graphify-freshen.cjs'];
|
|
449
|
+
const crypto = await import('node:crypto');
|
|
450
|
+
for (const name of helpers) {
|
|
451
|
+
const local = join(process.cwd(), '.claude', 'helpers', name);
|
|
452
|
+
if (!existsSync(local))
|
|
453
|
+
continue;
|
|
454
|
+
const bundled = _resolveBundledHelper(join('.claude', 'helpers', name));
|
|
455
|
+
if (!bundled) {
|
|
456
|
+
missing.push(name);
|
|
457
|
+
continue;
|
|
458
|
+
}
|
|
459
|
+
try {
|
|
460
|
+
const hashLocal = crypto.createHash('sha256').update(readFileSync(local)).digest('hex');
|
|
461
|
+
const hashBundled = crypto.createHash('sha256').update(readFileSync(bundled)).digest('hex');
|
|
462
|
+
if (hashLocal !== hashBundled)
|
|
463
|
+
stale.push(name);
|
|
464
|
+
}
|
|
465
|
+
catch { /* skip */ }
|
|
466
|
+
}
|
|
467
|
+
return { stale, missing };
|
|
468
|
+
}
|
|
469
|
+
async function checkHelpersFresh() {
|
|
470
|
+
try {
|
|
471
|
+
const { stale, missing } = await _detectStaleHelpers();
|
|
472
|
+
if (stale.length === 0 && missing.length === 0) {
|
|
473
|
+
return { name: 'Helper Files', status: 'pass', message: 'Project helpers match bundled version' };
|
|
474
|
+
}
|
|
475
|
+
if (stale.length > 0) {
|
|
476
|
+
return {
|
|
477
|
+
name: 'Helper Files',
|
|
478
|
+
status: 'warn',
|
|
479
|
+
message: `${stale.length} stale helper(s) in .claude/helpers/: ${stale.join(', ')}`,
|
|
480
|
+
fix: 'monomind init upgrade',
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
return {
|
|
484
|
+
name: 'Helper Files',
|
|
485
|
+
status: 'warn',
|
|
486
|
+
message: `Could not locate bundled copies of: ${missing.join(', ')}`,
|
|
487
|
+
fix: 'Reinstall monomind or run `monomind init upgrade`',
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
catch (e) {
|
|
491
|
+
return { name: 'Helper Files', status: 'warn', message: `check failed: ${e instanceof Error ? e.message : 'unknown'}` };
|
|
492
|
+
}
|
|
493
|
+
}
|
|
414
494
|
async function checkAgenticFlow() {
|
|
415
495
|
try {
|
|
416
496
|
// Walk common node_modules paths to find agentic-flow/package.json
|
|
@@ -523,6 +603,7 @@ export const doctorCommand = {
|
|
|
523
603
|
checkDiskSpace,
|
|
524
604
|
checkBuildTools,
|
|
525
605
|
checkMonograph,
|
|
606
|
+
checkHelpersFresh,
|
|
526
607
|
checkAgenticFlow
|
|
527
608
|
];
|
|
528
609
|
const componentMap = {
|
|
@@ -540,6 +621,7 @@ export const doctorCommand = {
|
|
|
540
621
|
'disk': checkDiskSpace,
|
|
541
622
|
'typescript': checkBuildTools,
|
|
542
623
|
'monograph': checkMonograph,
|
|
624
|
+
'helpers': checkHelpersFresh,
|
|
543
625
|
'agentic-flow': checkAgenticFlow
|
|
544
626
|
};
|
|
545
627
|
let checksToRun = allChecks;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monoes/monomindcli",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Monomind 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",
|