monomind 1.9.6 → 1.9.8
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.
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const fs = require('fs');
|
|
6
6
|
const { spawn } = require('child_process');
|
|
7
|
+
const { pathToFileURL } = require('url');
|
|
7
8
|
|
|
8
9
|
const projectDir = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
9
10
|
const graphDir = path.join(projectDir, '.monomind', 'graph');
|
|
@@ -70,7 +71,7 @@ try { fs.writeFileSync(lockPath, String(process.pid)); } catch { /* non-fatal */
|
|
|
70
71
|
|
|
71
72
|
// Spawn a detached node process to run buildAsync from @monoes/monograph (ESM)
|
|
72
73
|
const script = `
|
|
73
|
-
import { buildAsync } from ${JSON.stringify(
|
|
74
|
+
import { buildAsync } from ${JSON.stringify(pathToFileURL(entryPoint).href)};
|
|
74
75
|
import { unlinkSync } from 'fs';
|
|
75
76
|
try { await buildAsync(${JSON.stringify(projectDir)}); } finally {
|
|
76
77
|
try { unlinkSync(${JSON.stringify(lockPath)}); } catch {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monomind",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.8",
|
|
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",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as fs from 'fs';
|
|
6
6
|
import * as path from 'path';
|
|
7
|
-
import { fileURLToPath } from 'url';
|
|
7
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
8
8
|
import { createRequire } from 'module';
|
|
9
9
|
import { dirname } from 'path';
|
|
10
10
|
// ESM-compatible __dirname
|
|
@@ -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,19 +388,18 @@ 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 = `
|
|
404
|
-
import { buildAsync } from ${JSON.stringify(
|
|
402
|
+
import { buildAsync } from ${JSON.stringify(pathToFileURL(entryPoint).href)};
|
|
405
403
|
import { unlinkSync } from 'fs';
|
|
406
404
|
try { await buildAsync(${JSON.stringify(targetDir)}); } finally {
|
|
407
405
|
try { unlinkSync(${JSON.stringify(lockPath)}); } catch {}
|
|
@@ -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.
|
|
3
|
+
"version": "1.9.8",
|
|
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",
|