monomind 1.9.6 → 1.9.7

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.9.6",
3
+ "version": "1.9.7",
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",
@@ -356,19 +356,18 @@ export async function executeInit(options) {
356
356
  * hook build is already running, we skip to avoid SQLITE_BUSY.
357
357
  */
358
358
  async function initKnowledgeGraph(targetDir, result) {
359
- const { mkdirSync, statSync, unlinkSync, writeFileSync, existsSync } = await import('fs');
360
359
  const outputDir = path.join(targetDir, '.monomind', 'graph');
361
- mkdirSync(outputDir, { recursive: true });
360
+ fs.mkdirSync(outputDir, { recursive: true });
362
361
  const lockPath = path.join(outputDir, 'build.lock');
363
362
  const now = Date.now();
364
363
  // If graphify-freshen.cjs (session-start hook) already holds a fresh lock, skip.
365
364
  try {
366
- const stat = statSync(lockPath);
365
+ const stat = fs.statSync(lockPath);
367
366
  if (now - stat.mtimeMs < 5 * 60 * 1000) {
368
367
  result.skipped.push('knowledge graph build: already in progress (session-start hook running)');
369
368
  return;
370
369
  }
371
- unlinkSync(lockPath);
370
+ fs.unlinkSync(lockPath);
372
371
  }
373
372
  catch { /* no lock — proceed */ }
374
373
  // Resolve @monoes/monograph from the CLI package's own node_modules first
@@ -380,7 +379,7 @@ async function initKnowledgeGraph(targetDir, result) {
380
379
  }
381
380
  catch {
382
381
  const fallback = path.join(targetDir, 'node_modules', '@monoes', 'monograph', 'dist', 'src', 'index.js');
383
- if (existsSync(fallback))
382
+ if (fs.existsSync(fallback))
384
383
  entryPoint = fallback;
385
384
  }
386
385
  if (!entryPoint) {
@@ -389,15 +388,14 @@ async function initKnowledgeGraph(targetDir, result) {
389
388
  }
390
389
  // Acquire lock before spawning so graphify-freshen.cjs sees it and skips
391
390
  try {
392
- writeFileSync(lockPath, String(process.pid));
391
+ fs.writeFileSync(lockPath, String(process.pid));
393
392
  }
394
393
  catch { /* non-fatal */ }
395
394
  const { spawn } = await import('child_process');
396
- const { openSync } = await import('fs');
397
395
  const logPath = path.join(outputDir, 'build.log');
398
396
  let logFd = 'ignore';
399
397
  try {
400
- logFd = openSync(logPath, 'a');
398
+ logFd = fs.openSync(logPath, 'a');
401
399
  }
402
400
  catch { /* non-fatal */ }
403
401
  const script = `
@@ -412,6 +410,13 @@ try { await buildAsync(${JSON.stringify(targetDir)}); } finally {
412
410
  cwd: targetDir,
413
411
  });
414
412
  child.unref();
413
+ // Close the parent's copy of the fd — the child has its own inherited copy
414
+ if (typeof logFd === 'number') {
415
+ try {
416
+ fs.closeSync(logFd);
417
+ }
418
+ catch { /* non-fatal */ }
419
+ }
415
420
  result.created.files.push('.monomind/graph/ (knowledge graph building in background)');
416
421
  }
417
422
  /**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monoes/monomindcli",
3
- "version": "1.9.6",
3
+ "version": "1.9.7",
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",