monomind 1.9.4 → 1.9.5
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.
|
|
3
|
+
"version": "1.9.5",
|
|
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",
|
|
@@ -350,16 +350,62 @@ export async function executeInit(options) {
|
|
|
350
350
|
return result;
|
|
351
351
|
}
|
|
352
352
|
/**
|
|
353
|
-
* Initialize the Monograph knowledge graph
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
*
|
|
353
|
+
* Initialize the Monograph knowledge graph.
|
|
354
|
+
* Spawns buildAsync as a detached child process to avoid SQLite lock contention.
|
|
355
|
+
* Uses the same build.lock file as graphify-freshen.cjs — if a session-start
|
|
356
|
+
* hook build is already running, we skip to avoid SQLITE_BUSY.
|
|
357
357
|
*/
|
|
358
358
|
async function initKnowledgeGraph(targetDir, result) {
|
|
359
|
-
const { mkdirSync } = await import('fs');
|
|
359
|
+
const { mkdirSync, statSync, unlinkSync, writeFileSync, existsSync } = await import('fs');
|
|
360
360
|
const outputDir = path.join(targetDir, '.monomind', 'graph');
|
|
361
361
|
mkdirSync(outputDir, { recursive: true });
|
|
362
|
-
|
|
362
|
+
const lockPath = path.join(outputDir, 'build.lock');
|
|
363
|
+
const now = Date.now();
|
|
364
|
+
// If graphify-freshen.cjs (session-start hook) already holds a fresh lock, skip.
|
|
365
|
+
try {
|
|
366
|
+
const stat = statSync(lockPath);
|
|
367
|
+
if (now - stat.mtimeMs < 5 * 60 * 1000) {
|
|
368
|
+
result.skipped.push('knowledge graph build: already in progress (session-start hook running)');
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
unlinkSync(lockPath);
|
|
372
|
+
}
|
|
373
|
+
catch { /* no lock — proceed */ }
|
|
374
|
+
// Resolve @monoes/monograph from the CLI package's own node_modules first
|
|
375
|
+
// (correct for npm/npx installs), then fall back to user project node_modules.
|
|
376
|
+
let entryPoint = null;
|
|
377
|
+
try {
|
|
378
|
+
const cliRequire = createRequire(import.meta.url);
|
|
379
|
+
entryPoint = cliRequire.resolve('@monoes/monograph/dist/src/index.js');
|
|
380
|
+
}
|
|
381
|
+
catch {
|
|
382
|
+
const fallback = path.join(targetDir, 'node_modules', '@monoes', 'monograph', 'dist', 'src', 'index.js');
|
|
383
|
+
if (existsSync(fallback))
|
|
384
|
+
entryPoint = fallback;
|
|
385
|
+
}
|
|
386
|
+
if (!entryPoint) {
|
|
387
|
+
result.skipped.push('knowledge graph: @monoes/monograph not found');
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
// Acquire lock before spawning so graphify-freshen.cjs sees it and skips
|
|
391
|
+
try {
|
|
392
|
+
writeFileSync(lockPath, String(process.pid));
|
|
393
|
+
}
|
|
394
|
+
catch { /* non-fatal */ }
|
|
395
|
+
const { spawn } = await import('child_process');
|
|
396
|
+
const script = `
|
|
397
|
+
import { buildAsync } from ${JSON.stringify('file://' + entryPoint)};
|
|
398
|
+
import { unlinkSync } from 'fs';
|
|
399
|
+
try { await buildAsync(${JSON.stringify(targetDir)}); } finally {
|
|
400
|
+
try { unlinkSync(${JSON.stringify(lockPath)}); } catch {}
|
|
401
|
+
}`;
|
|
402
|
+
const child = spawn(process.execPath, ['--input-type=module', '--eval', script], {
|
|
403
|
+
detached: true,
|
|
404
|
+
stdio: 'ignore',
|
|
405
|
+
cwd: targetDir,
|
|
406
|
+
});
|
|
407
|
+
child.unref();
|
|
408
|
+
result.created.files.push('.monomind/graph/ (knowledge graph building in background)');
|
|
363
409
|
}
|
|
364
410
|
/**
|
|
365
411
|
* Start the monomind daemon with background workers.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monoes/monomindcli",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.5",
|
|
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",
|