monomind 1.15.0 → 1.15.2
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.15.
|
|
3
|
+
"version": "1.15.2",
|
|
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",
|
|
@@ -61,8 +61,7 @@
|
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"semver": "^7.6.0",
|
|
63
63
|
"@monoes/monograph": "^1.2.1",
|
|
64
|
-
"@monoes/monobrowse": "^1.0.0"
|
|
65
|
-
"@monoes/monoplaybook": "^1.0.0"
|
|
64
|
+
"@monoes/monobrowse": "^1.0.0"
|
|
66
65
|
},
|
|
67
66
|
"overrides": {
|
|
68
67
|
"hono": ">=4.12.21",
|
|
@@ -153,4 +152,4 @@
|
|
|
153
152
|
"access": "public",
|
|
154
153
|
"tag": "latest"
|
|
155
154
|
}
|
|
156
|
-
}
|
|
155
|
+
}
|
|
@@ -680,27 +680,37 @@ export const workflowTools = [
|
|
|
680
680
|
const rawParams = input.params ?? {};
|
|
681
681
|
// Sanitize params — string values only
|
|
682
682
|
const params = Object.fromEntries(Object.entries(rawParams).map(([k, v]) => [k, String(v)]));
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
const
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
683
|
+
const { spawn } = await import('node:child_process');
|
|
684
|
+
const _args = ['run', '--file', absPath, '--json'];
|
|
685
|
+
for (const [k, v] of Object.entries(params))
|
|
686
|
+
_args.push('--param', `${k}=${v}`);
|
|
687
|
+
const env = { ...process.env };
|
|
688
|
+
if (input.port !== undefined)
|
|
689
|
+
env['CDP_PORT'] = String(input.port);
|
|
690
|
+
const record = await new Promise((resolve) => {
|
|
691
|
+
const child = spawn('monoes', _args, { env });
|
|
692
|
+
let stdout = '';
|
|
693
|
+
let stderr = '';
|
|
694
|
+
child.stdout?.on('data', (d) => { stdout += d; });
|
|
695
|
+
child.stderr?.on('data', (d) => { stderr += d; });
|
|
696
|
+
const _kill = setTimeout(() => { child.kill(); resolve({ status: 'timeout', error: `Timed out after ${timeoutMs}ms` }); }, timeoutMs);
|
|
697
|
+
child.on('close', (code) => {
|
|
698
|
+
clearTimeout(_kill);
|
|
699
|
+
if (code === 0) {
|
|
700
|
+
try {
|
|
701
|
+
resolve({ status: 'complete', output: JSON.parse(stdout) });
|
|
702
|
+
}
|
|
703
|
+
catch {
|
|
704
|
+
resolve({ status: 'complete', output: stdout.trim() });
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
else {
|
|
708
|
+
resolve({ status: 'failed', error: (stderr.trim() || stdout.trim()) });
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
child.on('error', (e) => { clearTimeout(_kill); resolve({ status: 'failed', error: e.message }); });
|
|
692
712
|
});
|
|
693
|
-
return
|
|
694
|
-
playbookId: record.playbookId,
|
|
695
|
-
playbookName: record.playbookName,
|
|
696
|
-
status: record.status,
|
|
697
|
-
itemsProcessed: record.itemsProcessed,
|
|
698
|
-
itemsTotal: record.itemsTotal,
|
|
699
|
-
durationMs: record.completedAt && record.startedAt
|
|
700
|
-
? record.completedAt - record.startedAt
|
|
701
|
-
: undefined,
|
|
702
|
-
error: record.error,
|
|
703
|
-
};
|
|
713
|
+
return record;
|
|
704
714
|
},
|
|
705
715
|
},
|
|
706
716
|
];
|
|
@@ -8164,7 +8164,7 @@ function _odtHandleLiveEvent(ev) {
|
|
|
8164
8164
|
}
|
|
8165
8165
|
} else if (runSess) {
|
|
8166
8166
|
(runSess.events = runSess.events || []).push(ev);
|
|
8167
|
-
if (runSess._runMeta) runSess._runMeta.eventCount = (runSess._runMeta.eventCount || 0) + 1;
|
|
8167
|
+
if (runSess._runMeta) { runSess._runMeta.eventCount = (runSess._runMeta.eventCount || 0) + 1; if (runSess._runMeta.eventCount % 5 === 0) _odtPopulateChatSel(); }
|
|
8168
8168
|
if (ev.type === 'run:cycle:complete' || ev.type === 'org:checkpoint') { if (runSess._runMeta) runSess._runMeta.cycleCount = (runSess._runMeta.cycleCount || 0) + 1; _odtPopulateChatSel(); }
|
|
8169
8169
|
// Backfill prompt from first boss directive when run:start had no goal field
|
|
8170
8170
|
if (!runSess.prompt && ev.type === 'org:comms' && (ev.from === 'boss' || ev.role === 'boss') && ev.msg) {
|
|
@@ -583,7 +583,7 @@ export async function startServer({ port = 4242, projectDir, openBrowser = true
|
|
|
583
583
|
// Only accept paths that resolve to an existing directory AND are not
|
|
584
584
|
// the filesystem root (/), AND are not obviously system paths.
|
|
585
585
|
// Cap to 4096 chars to prevent OOM from huge path strings.
|
|
586
|
-
const _rawProject = event.project;
|
|
586
|
+
const _rawProject = event.project ?? event.projectDir;
|
|
587
587
|
let eventProject = null;
|
|
588
588
|
if (typeof _rawProject === 'string' && _rawProject.length > 0 && _rawProject.length <= 4096
|
|
589
589
|
&& path.isAbsolute(_rawProject)) {
|
|
@@ -5043,6 +5043,22 @@ export async function startServer({ port = 4242, projectDir, openBrowser = true
|
|
|
5043
5043
|
}
|
|
5044
5044
|
}
|
|
5045
5045
|
runs.sort((a, b) => (b.startedAt || 0) - (a.startedAt || 0));
|
|
5046
|
+
// Threads fallback: if no run files found, synthesize a run from the org threads file
|
|
5047
|
+
// so orgs whose boss never emitted runId-tagged events still show in the chat dropdown.
|
|
5048
|
+
if (runs.length === 0) {
|
|
5049
|
+
for (const _rpd of _rProjDirs) {
|
|
5050
|
+
const _tf = path.join(_rpd, '.monomind', 'orgs', `${_rOrgName}-threads.jsonl`);
|
|
5051
|
+
if (!fs.existsSync(_tf)) continue;
|
|
5052
|
+
const _tLines = fs.readFileSync(_tf, 'utf8').split('\n').filter(Boolean);
|
|
5053
|
+
if (!_tLines.length) continue;
|
|
5054
|
+
const _tEvs = _tLines.map(l => { try { return JSON.parse(l); } catch { return null; } }).filter(Boolean);
|
|
5055
|
+
if (!_tEvs.length) continue;
|
|
5056
|
+
const _firstTs = _tEvs[0].ts ? (typeof _tEvs[0].ts === 'number' ? _tEvs[0].ts : new Date(_tEvs[0].ts).getTime()) : Date.now();
|
|
5057
|
+
const _lastTs = _tEvs[_tEvs.length-1].ts ? (typeof _tEvs[_tEvs.length-1].ts === 'number' ? _tEvs[_tEvs.length-1].ts : new Date(_tEvs[_tEvs.length-1].ts).getTime()) : _firstTs;
|
|
5058
|
+
runs.push({ id: `threads-${_rOrgName}`, orgName: _rOrgName, goal: `${_rOrgName} threads`, status: 'complete', startedAt: _firstTs, endedAt: _lastTs, eventCount: _tEvs.length, _threadsFile: _tf });
|
|
5059
|
+
break;
|
|
5060
|
+
}
|
|
5061
|
+
}
|
|
5046
5062
|
res.writeHead(200, { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*', 'Cache-Control': 'no-cache' });
|
|
5047
5063
|
res.end(JSON.stringify(runs));
|
|
5048
5064
|
} catch (_) { res.writeHead(500); res.end('[]'); }
|
|
@@ -5060,6 +5076,21 @@ export async function startServer({ port = 4242, projectDir, openBrowser = true
|
|
|
5060
5076
|
_rvRunId.length > 80 || !/^[a-z0-9][a-z0-9_-]*$/i.test(_rvRunId)) { res.writeHead(400); res.end('{"error":"Invalid org or run id"}'); return; }
|
|
5061
5077
|
const _rvExplicitDir = _rvQs.get('dir');
|
|
5062
5078
|
const _rvServerRoot = path.resolve(_rvExplicitDir || projectDir || process.cwd());
|
|
5079
|
+
// Threads fallback: threads-${orgName} is a synthetic runId served from threads file
|
|
5080
|
+
if (_rvRunId === `threads-${_rvOrgName}`) {
|
|
5081
|
+
const _rvProjDirsT = new Set([_rvServerRoot]);
|
|
5082
|
+
if (!_rvExplicitDir) { try { JSON.parse(fs.readFileSync(path.join(_rvServerRoot, 'data', 'known-projects.json'), 'utf8')).forEach(p => _rvProjDirsT.add(p)); } catch(_) {} }
|
|
5083
|
+
for (const _rvpd of _rvProjDirsT) {
|
|
5084
|
+
const _tf = path.join(_rvpd, '.monomind', 'orgs', `${_rvOrgName}-threads.jsonl`);
|
|
5085
|
+
if (!fs.existsSync(_tf)) continue;
|
|
5086
|
+
const _tLines = fs.readFileSync(_tf, 'utf8').split('\n').filter(Boolean);
|
|
5087
|
+
const _tEvs = _tLines.map(l => { try { const e = JSON.parse(l); return { type: 'org:comms', from: e.role || e.from || 'agent', to: e.to || 'all', msg: e.message || e.msg || '', ts: e.ts ? (typeof e.ts === 'number' ? e.ts : new Date(e.ts).getTime()) : Date.now(), org: _rvOrgName, runId: _rvRunId }; } catch { return null; } }).filter(Boolean);
|
|
5088
|
+
res.writeHead(200, { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*' });
|
|
5089
|
+
res.end(JSON.stringify(_tEvs));
|
|
5090
|
+
return;
|
|
5091
|
+
}
|
|
5092
|
+
res.writeHead(404); res.end('{"error":"threads file not found"}'); return;
|
|
5093
|
+
}
|
|
5063
5094
|
// Search across known projects
|
|
5064
5095
|
const _rvProjDirs = new Set([_rvServerRoot]);
|
|
5065
5096
|
if (!_rvExplicitDir) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monoes/monomindcli",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.2",
|
|
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",
|
|
@@ -89,8 +89,7 @@
|
|
|
89
89
|
"ws": "^8.21.0",
|
|
90
90
|
"@noble/ed25519": "^2.1.0",
|
|
91
91
|
"@monoes/monograph": "^1.2.1",
|
|
92
|
-
"@monoes/monobrowse": "^1.0.1"
|
|
93
|
-
"@monoes/monoplaybook": "^1.0.1"
|
|
92
|
+
"@monoes/monobrowse": "^1.0.1"
|
|
94
93
|
},
|
|
95
94
|
"optionalDependencies": {
|
|
96
95
|
"sql.js": "^1.14.1",
|
|
@@ -107,4 +106,4 @@
|
|
|
107
106
|
"access": "public",
|
|
108
107
|
"tag": "latest"
|
|
109
108
|
}
|
|
110
|
-
}
|
|
109
|
+
}
|