monomind 1.10.44 → 1.10.46

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.44",
3
+ "version": "1.10.46",
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",
@@ -34,7 +34,8 @@ const initAction = async (ctx) => {
34
34
  if (initialized.monomind)
35
35
  output.printInfo(' Found: .monomind/config.yaml');
36
36
  output.printInfo('Use --force to reinitialize');
37
- if (ctx.interactive) {
37
+ const yes = ctx.flags.yes || process.env.CI === 'true';
38
+ if (ctx.interactive && !yes) {
38
39
  const proceed = await confirm({
39
40
  message: 'Do you want to reinitialize? This will overwrite existing configuration.',
40
41
  default: false,
@@ -43,8 +44,8 @@ const initAction = async (ctx) => {
43
44
  return { success: true, message: 'Initialization cancelled' };
44
45
  }
45
46
  }
46
- else {
47
- return { success: false, exitCode: 1, message: 'Already initialized' };
47
+ else if (!yes) {
48
+ return { success: false, exitCode: 1, message: 'Already initialized. Use --force or --yes to reinitialize.' };
48
49
  }
49
50
  }
50
51
  output.writeln();
@@ -849,6 +850,13 @@ export const initCommand = {
849
850
  type: 'boolean',
850
851
  default: false,
851
852
  },
853
+ {
854
+ name: 'yes',
855
+ short: 'y',
856
+ description: 'Skip confirmation prompts (also honoured via CI=true env var)',
857
+ type: 'boolean',
858
+ default: false,
859
+ },
852
860
  {
853
861
  name: 'minimal',
854
862
  short: 'm',
@@ -640,12 +640,14 @@ export async function executeUpgrade(targetDir, upgradeSettings = false) {
640
640
  fs.mkdirSync(fullPath, { recursive: true });
641
641
  }
642
642
  }
643
- // 0. ALWAYS update critical helpers (force overwrite)
643
+ // 0. ALWAYS update critical helpers + subdirectories (force overwrite)
644
644
  const sourceHelpersForUpgrade = findSourceHelpersDir();
645
645
  if (sourceHelpersForUpgrade) {
646
+ const destHelpersDir = path.join(targetDir, '.claude', 'helpers');
647
+ // Copy top-level critical files atomically
646
648
  const criticalHelpers = ['auto-memory-hook.mjs', 'hook-handler.cjs', 'intelligence.cjs'];
647
649
  for (const helperName of criticalHelpers) {
648
- const targetPath = path.join(targetDir, '.claude', 'helpers', helperName);
650
+ const targetPath = path.join(destHelpersDir, helperName);
649
651
  const sourcePath = path.join(sourceHelpersForUpgrade, helperName);
650
652
  if (fs.existsSync(sourcePath)) {
651
653
  if (fs.existsSync(targetPath)) {
@@ -654,18 +656,32 @@ export async function executeUpgrade(targetDir, upgradeSettings = false) {
654
656
  else {
655
657
  result.created.push(`.claude/helpers/${helperName}`);
656
658
  }
657
- // Atomic copy-via-rename: a SIGINT/crash during copy would leave a
658
- // half-written hook-handler.cjs which Claude Code executes on every
659
- // hook event — partial JS could disable security checks silently.
660
- {
661
- const tmp = targetPath + '.tmp';
662
- fs.copyFileSync(sourcePath, tmp);
663
- try {
664
- fs.chmodSync(tmp, 0o755);
665
- }
666
- catch { }
667
- fs.renameSync(tmp, targetPath);
659
+ // Atomic copy-via-rename so a partial write can't leave a broken hook
660
+ const tmp = targetPath + '.tmp';
661
+ fs.copyFileSync(sourcePath, tmp);
662
+ try {
663
+ fs.chmodSync(tmp, 0o755);
664
+ }
665
+ catch { }
666
+ fs.renameSync(tmp, targetPath);
667
+ }
668
+ }
669
+ // Always sync subdirectories (utils/, handlers/) — these are required by hook-handler.cjs
670
+ for (const subdir of ['utils', 'handlers']) {
671
+ const srcSubdir = path.join(sourceHelpersForUpgrade, subdir);
672
+ const destSubdir = path.join(destHelpersDir, subdir);
673
+ 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);
668
683
  }
684
+ result.updated.push(`.claude/helpers/${subdir}/`);
669
685
  }
670
686
  }
671
687
  }
@@ -1266,29 +1282,34 @@ async function writeHelpers(targetDir, options, result) {
1266
1282
  const helpersDir = path.join(targetDir, '.claude', 'helpers');
1267
1283
  // Find source helpers directory (works for npm package and local dev)
1268
1284
  const sourceHelpersDir = findSourceHelpersDir(options.sourceBaseDir);
1269
- // Try to copy existing helpers from source first
1285
+ // Try to copy existing helpers from source first (recursive — includes utils/ and handlers/)
1270
1286
  if (sourceHelpersDir && fs.existsSync(sourceHelpersDir)) {
1271
- const helperFiles = fs.readdirSync(sourceHelpersDir);
1272
1287
  let copiedCount = 0;
1273
- for (const file of helperFiles) {
1274
- const sourcePath = path.join(sourceHelpersDir, file);
1275
- const destPath = path.join(helpersDir, file);
1276
- // Skip directories and only copy files
1277
- if (!fs.statSync(sourcePath).isFile())
1278
- continue;
1279
- if (!fs.existsSync(destPath) || options.force) {
1280
- fs.copyFileSync(sourcePath, destPath);
1281
- // Make shell scripts and mjs files executable
1282
- if (file.endsWith('.sh') || file.endsWith('.mjs')) {
1283
- fs.chmodSync(destPath, '755');
1288
+ const copyRecursive = (srcDir, destDir, relBase) => {
1289
+ fs.mkdirSync(destDir, { recursive: true });
1290
+ for (const entry of fs.readdirSync(srcDir, { withFileTypes: true })) {
1291
+ const srcPath = path.join(srcDir, entry.name);
1292
+ const destPath = path.join(destDir, entry.name);
1293
+ const relPath = relBase ? `${relBase}/${entry.name}` : entry.name;
1294
+ if (entry.isDirectory()) {
1295
+ copyRecursive(srcPath, destPath, relPath);
1296
+ }
1297
+ else {
1298
+ if (!fs.existsSync(destPath) || options.force) {
1299
+ fs.copyFileSync(srcPath, destPath);
1300
+ if (entry.name.endsWith('.sh') || entry.name.endsWith('.mjs')) {
1301
+ fs.chmodSync(destPath, '755');
1302
+ }
1303
+ result.created.files.push(`.claude/helpers/${relPath}`);
1304
+ copiedCount++;
1305
+ }
1306
+ else {
1307
+ result.skipped.push(`.claude/helpers/${relPath}`);
1308
+ }
1284
1309
  }
1285
- result.created.files.push(`.claude/helpers/${file}`);
1286
- copiedCount++;
1287
- }
1288
- else {
1289
- result.skipped.push(`.claude/helpers/${file}`);
1290
1310
  }
1291
- }
1311
+ };
1312
+ copyRecursive(sourceHelpersDir, helpersDir, '');
1292
1313
  if (copiedCount > 0) {
1293
1314
  return; // Skip generating if we copied from source
1294
1315
  }
@@ -1453,10 +1474,6 @@ mcp:
1453
1474
  const gitignore = `# Monomind — exclude files that may contain secrets or sensitive prompt data
1454
1475
  # Sessions contain conversation history (prompts, code snippets, user data)
1455
1476
  sessions/
1456
- # Pending insights may contain raw prompt text
1457
- data/pending-insights.jsonl
1458
- # Routing feedback contains user prompt text
1459
- routing-feedback.jsonl
1460
1477
  # Security scan results may expose vulnerability details
1461
1478
  security/
1462
1479
  # Temporary and machine-specific files
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monoes/monomindcli",
3
- "version": "1.10.44",
3
+ "version": "1.10.46",
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",