monomind 1.10.46 → 1.10.47

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monomind",
3
- "version": "1.10.46",
3
+ "version": "1.10.47",
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",
@@ -666,21 +666,13 @@ export async function executeUpgrade(targetDir, upgradeSettings = false) {
666
666
  fs.renameSync(tmp, targetPath);
667
667
  }
668
668
  }
669
- // Always sync subdirectories (utils/, handlers/) — these are required by hook-handler.cjs
669
+ // Always recursively sync subdirectories (utils/, handlers/) — required by hook-handler.cjs.
670
+ // Uses recursive copy so any future nested subdirs are also covered.
670
671
  for (const subdir of ['utils', 'handlers']) {
671
672
  const srcSubdir = path.join(sourceHelpersForUpgrade, subdir);
672
673
  const destSubdir = path.join(destHelpersDir, subdir);
673
674
  if (fs.existsSync(srcSubdir)) {
674
- fs.mkdirSync(destSubdir, { recursive: true });
675
- for (const entry of fs.readdirSync(srcSubdir, { withFileTypes: true })) {
676
- if (!entry.isFile())
677
- continue;
678
- const src = path.join(srcSubdir, entry.name);
679
- const dest = path.join(destSubdir, entry.name);
680
- const tmp = dest + '.tmp';
681
- fs.copyFileSync(src, tmp);
682
- fs.renameSync(tmp, dest);
683
- }
675
+ copyDirRecursive(srcSubdir, destSubdir);
684
676
  result.updated.push(`.claude/helpers/${subdir}/`);
685
677
  }
686
678
  }
@@ -1226,12 +1218,19 @@ async function copyAgents(targetDir, options, result) {
1226
1218
  }
1227
1219
  /**
1228
1220
  * Find source helpers directory.
1229
- * Validates that the directory contains hook-handler.cjs to avoid
1230
- * returning the target directory or an incomplete source.
1221
+ * Validates that the directory contains hook-handler.cjs AND its required
1222
+ * subdirectory files (utils/telemetry.cjs etc.) to avoid accepting a partial
1223
+ * or corrupted source that would reproduce the missing-utils/ bug class.
1231
1224
  */
1232
1225
  function findSourceHelpersDir(sourceBaseDir) {
1233
1226
  const possiblePaths = [];
1234
- const SENTINEL_FILE = 'hook-handler.cjs'; // Must exist in valid source
1227
+ // All sentinel files must exist — hook-handler.cjs requires these at startup
1228
+ const SENTINEL_FILES = [
1229
+ 'hook-handler.cjs',
1230
+ path.join('utils', 'telemetry.cjs'),
1231
+ path.join('utils', 'monograph.cjs'),
1232
+ path.join('utils', 'micro-agents.cjs'),
1233
+ ];
1235
1234
  // If explicit source base directory is provided, check it first
1236
1235
  if (sourceBaseDir) {
1237
1236
  possiblePaths.push(path.join(sourceBaseDir, '.claude', 'helpers'));
@@ -1267,9 +1266,9 @@ function findSourceHelpersDir(sourceBaseDir) {
1267
1266
  path.join(process.cwd(), '..', '..', '.claude', 'helpers'),
1268
1267
  ];
1269
1268
  possiblePaths.push(...cwdBased);
1270
- // Return first path that exists AND contains the sentinel file
1269
+ // Return first path that exists AND contains ALL sentinel files
1271
1270
  for (const p of possiblePaths) {
1272
- if (fs.existsSync(p) && fs.existsSync(path.join(p, SENTINEL_FILE))) {
1271
+ if (fs.existsSync(p) && SENTINEL_FILES.every(f => fs.existsSync(path.join(p, f)))) {
1273
1272
  return p;
1274
1273
  }
1275
1274
  }
@@ -1318,9 +1317,9 @@ async function writeHelpers(targetDir, options, result) {
1318
1317
  const helpers = {
1319
1318
  'pre-commit': generatePreCommitHook(),
1320
1319
  'post-commit': generatePostCommitHook(),
1321
- 'session.js': generateSessionManager(),
1322
- 'router.js': generateAgentRouter(),
1323
- 'memory.js': generateMemoryHelper(),
1320
+ 'session.cjs': generateSessionManager(),
1321
+ 'router.cjs': generateAgentRouter(),
1322
+ 'memory.cjs': generateMemoryHelper(),
1324
1323
  'hook-handler.cjs': generateHookHandler(),
1325
1324
  'intelligence.cjs': generateIntelligenceStub(),
1326
1325
  'auto-memory-hook.mjs': generateAutoMemoryHook(),
@@ -401,9 +401,9 @@ export function generateHookHandler() {
401
401
  ' return null;',
402
402
  '}',
403
403
  '',
404
- "const router = safeRequire(path.join(helpersDir, 'router.js'));",
405
- "const session = safeRequire(path.join(helpersDir, 'session.js'));",
406
- "const memory = safeRequire(path.join(helpersDir, 'memory.js'));",
404
+ "const router = safeRequire(path.join(helpersDir, 'router.cjs'));",
405
+ "const session = safeRequire(path.join(helpersDir, 'session.cjs'));",
406
+ "const memory = safeRequire(path.join(helpersDir, 'memory.cjs'));",
407
407
  "const intelligence = safeRequire(path.join(helpersDir, 'intelligence.cjs'));",
408
408
  '',
409
409
  'const [,, command, ...args] = process.argv;',
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monoes/monomindcli",
3
- "version": "1.10.46",
3
+ "version": "1.10.47",
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",