@monoes/monomindcli 1.14.2 → 1.14.4
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/dist/src/ui/dashboard.html +14 -15
- package/dist/src/ui/server.mjs +4 -2
- package/package.json +1 -1
|
@@ -449,8 +449,8 @@ html, body { height: 100%; background: var(--bg); color: var(--text-hi); font-fa
|
|
|
449
449
|
.hv2-val.red { color: var(--red); }
|
|
450
450
|
|
|
451
451
|
/* ── alerts rail ─────────────────────────────────────────── */
|
|
452
|
-
#alerts-rail { display: none
|
|
453
|
-
#alerts-rail.has-alerts { display:
|
|
452
|
+
#alerts-rail { display: none !important; }
|
|
453
|
+
#alerts-rail.has-alerts { display: none !important; }
|
|
454
454
|
.alert-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 4px 10px; border-radius: 10px; cursor: default; white-space: nowrap; user-select: none; }
|
|
455
455
|
.alert-item:hover .al-x { opacity: 1; }
|
|
456
456
|
.alert-warn { background: oklch(72% 0.18 75 / 0.1); color: oklch(78% 0.18 75); border: 1px solid oklch(72% 0.18 75 / 0.25); }
|
|
@@ -1443,9 +1443,6 @@ textarea.sess-note-input:focus { border-color:var(--accent); }
|
|
|
1443
1443
|
<span id="live-cost-ticker" title="Current session accumulated cost"></span>
|
|
1444
1444
|
<span id="topbar-activity"></span>
|
|
1445
1445
|
<div id="tb-right">
|
|
1446
|
-
<button class="btn" onclick="openMastermind()" style="color:oklch(65% 0.16 295);border-color:oklch(65% 0.16 295 / 0.4)" title="Mastermind — orgs, skills, loops, metrics">⬡ Mastermind</button>
|
|
1447
|
-
<button class="btn" onclick="switchView('orgs')" title="Manage autonomous organisations" style="color:oklch(70% 0.14 185);border-color:oklch(70% 0.14 185 / 0.4)">⬡ Orgs</button>
|
|
1448
|
-
<button class="btn" onclick="switchView('orgs')" title="Manage autonomous organisations" style="color:oklch(70% 0.14 185);border-color:oklch(70% 0.14 185 / 0.4)">⬡ Orgs</button>
|
|
1449
1446
|
<button class="btn" id="btn-budget" onclick="openBudgetModal()" title="Set daily/monthly cost budget">⚑ Budget</button>
|
|
1450
1447
|
<button class="btn" onclick="openCmdPalette()">⌕ Search <kbd style="font-size:10px;opacity:0.6;margin-left:3px">⌘K</kbd></button>
|
|
1451
1448
|
<button class="btn" onclick="openShortcutHelp()" title="Keyboard shortcuts (?)">? Help</button>
|
|
@@ -4044,7 +4041,7 @@ async function loadChatViewSessions() {
|
|
|
4044
4041
|
// include events that arrived via SSE right before the fetch, so we preserve their
|
|
4045
4042
|
// buffered events and merge them back after (same pattern as _odtLoadChatSessions).
|
|
4046
4043
|
const _prevChatSessions = { ...chatVSessions };
|
|
4047
|
-
const data = await apiFetch('/api/mastermind/sessions');
|
|
4044
|
+
const data = await apiFetch('/api/mastermind/sessions' + (DIR ? '?project=' + encodeURIComponent(DIR) : ''));
|
|
4048
4045
|
chatVSessions = {};
|
|
4049
4046
|
chatVGroupMap = {};
|
|
4050
4047
|
chatVSessionGroupMap = {};
|
|
@@ -4271,7 +4268,7 @@ function appendChatViewEvent(ev, animate) {
|
|
|
4271
4268
|
const _auTok = (ev.tokens_in || ev.tokens_out) ? ((ev.tokens_in||0)).toLocaleString() + '↑ ' + ((ev.tokens_out||0)).toLocaleString() + '↓' : '';
|
|
4272
4269
|
el = mkCVSys('◈ ' + esc(_auAgent) + (_auTok ? ' · ' + _auTok : '') + (_auCost ? ' · ' + _auCost : ''), ts);
|
|
4273
4270
|
} else if (ev.type === 'agent:message') {
|
|
4274
|
-
el = mkCVAgent(ev.agent || ev.name || '?', ev.msg || ev.message || '', ts, ev.type);
|
|
4271
|
+
el = mkCVAgent(ev.agent || ev.name || ev.role || '?', ev.msg || ev.message || ev.content || '', ts, ev.type);
|
|
4275
4272
|
} else if (ev.type === 'session:start') {
|
|
4276
4273
|
el = mkCVSys('Session started' + (ev.prompt ? ': ' + esc(ev.prompt.slice(0,80)) : ''), ts);
|
|
4277
4274
|
} else if (ev.type === 'session:complete') {
|
|
@@ -4318,7 +4315,7 @@ function appendChatViewEvent(ev, animate) {
|
|
|
4318
4315
|
function _cvExcerptText(ev) {
|
|
4319
4316
|
const t = ev.type || '';
|
|
4320
4317
|
if (t === 'intercom' || t === 'org:comms') return (ev.from || ev.role || '?') + ' → ' + (ev.to || '?') + ': ' + (ev.msg || ev.message || '').slice(0, 80);
|
|
4321
|
-
if (t === 'agent:message') return (ev.agent || ev.name || '?') + ': ' + (ev.msg || ev.message || '').slice(0, 80);
|
|
4318
|
+
if (t === 'agent:message') return (ev.agent || ev.name || ev.role || '?') + ': ' + (ev.msg || ev.message || ev.content || '').slice(0, 80);
|
|
4322
4319
|
if (t === 'agent:result') return (ev.agent || ev.from || '?') + ': ' + (ev.result || ev.msg || ev.message || ev.summary || '').slice(0, 80);
|
|
4323
4320
|
if (t === 'agent:spawn') return 'spawned ' + (ev.to || ev.agent || ev.role || '?') + (ev.task || ev.briefing ? ': ' + (ev.task || ev.briefing || '').slice(0, 50) : '');
|
|
4324
4321
|
if (t === 'org:agent:online') return (ev.title || ev.role || '?') + ' online';
|
|
@@ -4453,7 +4450,7 @@ function connectChatViewSSE() {
|
|
|
4453
4450
|
if (chatVSseSource) return;
|
|
4454
4451
|
const dot = document.getElementById('chat-v-live-dot');
|
|
4455
4452
|
const lbl = document.getElementById('chat-v-live-lbl');
|
|
4456
|
-
chatVSseSource = new EventSource('/api/mastermind-stream');
|
|
4453
|
+
chatVSseSource = new EventSource('/api/mastermind-stream' + (DIR ? '?project=' + encodeURIComponent(DIR) : ''));
|
|
4457
4454
|
chatVSseSource.onopen = () => { dot && dot.classList.add('on'); lbl && (lbl.textContent = 'LIVE'); };
|
|
4458
4455
|
chatVSseSource.onmessage = e => {
|
|
4459
4456
|
try { handleChatViewEvent(JSON.parse(e.data)); } catch(_) {}
|
|
@@ -4478,6 +4475,7 @@ function handleChatViewEvent(ev) {
|
|
|
4478
4475
|
// Org events (org:comms, org:agent:online, org:checkpoint, etc.) may carry a session field
|
|
4479
4476
|
// from the org run's session ID — route them directly to the feed if the session matches,
|
|
4480
4477
|
// or append them unconditionally when the chat view is showing the "live" placeholder.
|
|
4478
|
+
if (ev.project && DIR && ev.project !== DIR) return;
|
|
4481
4479
|
const isOrgEvent = ev.type && (ev.type.startsWith('org:') || ev.type.startsWith('run:') || ev.type.startsWith('loop:'));
|
|
4482
4480
|
if (!ev.session && !isOrgEvent) return;
|
|
4483
4481
|
if (ev.session) {
|
|
@@ -6926,7 +6924,7 @@ function _odtOrgSessionMatch(s) {
|
|
|
6926
6924
|
const after = str[idx + prefix.length];
|
|
6927
6925
|
return after === undefined || !/[a-z0-9_-]/.test(after);
|
|
6928
6926
|
};
|
|
6929
|
-
if (_orgBound(prompt, 'running org: ' + orgLc) || _orgBound(prompt, 'org: ' + orgLc)) return true;
|
|
6927
|
+
if (_orgBound(prompt, 'running org: ' + orgLc) || _orgBound(prompt, 'org: ' + orgLc) || _orgBound(prompt, 'running ' + orgLc + ' org:')) return true;
|
|
6930
6928
|
return (s.events || []).some(ev => (ev.org || '').toLowerCase() === orgLc);
|
|
6931
6929
|
}
|
|
6932
6930
|
|
|
@@ -7105,7 +7103,7 @@ async function _odtLoadChatSessions() {
|
|
|
7105
7103
|
// Orgs running via _repeat loops emit session:start/complete events to the mastermind
|
|
7106
7104
|
// event store; these never appear in the run list and are otherwise invisible.
|
|
7107
7105
|
try {
|
|
7108
|
-
const _mmSessR = await apiFetch('/api/mastermind/sessions');
|
|
7106
|
+
const _mmSessR = await apiFetch('/api/mastermind/sessions' + (DIR ? '?project=' + encodeURIComponent(DIR) : ''));
|
|
7109
7107
|
if (_v2SelOrg === _loadedForOrg) {
|
|
7110
7108
|
const _mmAll = Array.isArray(_mmSessR) ? _mmSessR : Object.values(_mmSessR.sessions || {});
|
|
7111
7109
|
const _mmMatch = _mmAll.filter(_odtOrgSessionMatch).filter(s => !_odtChatSessions.find(x => x.id === s.id));
|
|
@@ -7135,7 +7133,7 @@ async function _odtLoadChatSessions() {
|
|
|
7135
7133
|
if (_v2SelOrg !== _loadedForOrg) return;
|
|
7136
7134
|
// Fallback: mastermind lifecycle events (pre-run-file era sessions)
|
|
7137
7135
|
try {
|
|
7138
|
-
const r = await apiFetch('/api/mastermind/sessions');
|
|
7136
|
+
const r = await apiFetch('/api/mastermind/sessions' + (DIR ? '?project=' + encodeURIComponent(DIR) : ''));
|
|
7139
7137
|
if (_v2SelOrg !== _loadedForOrg) return;
|
|
7140
7138
|
const all = Array.isArray(r) ? r : Object.values(r.sessions || {});
|
|
7141
7139
|
_odtChatSessions = all.filter(_odtOrgSessionMatch).map(s => {
|
|
@@ -7698,7 +7696,7 @@ function _odtAppendEvent(ev, animate) {
|
|
|
7698
7696
|
} else if (ev.type === 'intercom') {
|
|
7699
7697
|
el = mkCVIntercom(ev.from, ev.to, ev.msg || '', ts);
|
|
7700
7698
|
} else if (ev.type === 'agent:message') {
|
|
7701
|
-
el = mkCVAgent(ev.agent || ev.name || '?', ev.msg || ev.message || '', ts, ev.type);
|
|
7699
|
+
el = mkCVAgent(ev.agent || ev.name || ev.role || '?', ev.msg || ev.message || ev.content || '', ts, ev.type);
|
|
7702
7700
|
} else if (ev.type === 'session:start') {
|
|
7703
7701
|
el = mkCVSys('▶ ' + esc((ev.prompt || '').replace(/^running org:\s*/i,'').slice(0,80) || 'Session started'), ts);
|
|
7704
7702
|
} else if (ev.type === 'session:complete') {
|
|
@@ -7743,7 +7741,7 @@ function _odtConnectChatSSE() {
|
|
|
7743
7741
|
if (_odtChatSseSource) return;
|
|
7744
7742
|
const dot = document.getElementById('odt-chat-live-dot');
|
|
7745
7743
|
const lbl = document.getElementById('odt-chat-live-lbl');
|
|
7746
|
-
_odtChatSseSource = new EventSource('/api/mastermind-stream');
|
|
7744
|
+
_odtChatSseSource = new EventSource('/api/mastermind-stream' + (DIR ? '?project=' + encodeURIComponent(DIR) : ''));
|
|
7747
7745
|
_odtChatSseSource.onopen = () => { dot?.classList.add('on'); if (lbl) lbl.textContent = 'LIVE'; };
|
|
7748
7746
|
_odtChatSseSource.onmessage = e => {
|
|
7749
7747
|
try { _odtHandleLiveEvent(JSON.parse(e.data)); } catch(_) {}
|
|
@@ -7762,6 +7760,7 @@ function _odtConnectChatSSE() {
|
|
|
7762
7760
|
}
|
|
7763
7761
|
|
|
7764
7762
|
function _odtHandleLiveEvent(ev) {
|
|
7763
|
+
if (ev?.project && DIR && ev.project !== DIR) return;
|
|
7765
7764
|
// Deduplicate SSE reconnect replays (server replays last 50 events on every reconnect)
|
|
7766
7765
|
const _odtDedupKey = (ev?.ts||'') + '|' + (ev?.type||'') + '|' + (ev?.runId||ev?.session||'') + '|' + (ev?.from||ev?.role||ev?.agent||'') + '|' + (ev?.result||ev?.msg||ev?.message||ev?.summary||'').slice(0,20);
|
|
7767
7766
|
if (_odtChatSeenKeys.has(_odtDedupKey)) return;
|
|
@@ -8435,7 +8434,7 @@ function filterOrgList(q) {
|
|
|
8435
8434
|
if (src) src.close();
|
|
8436
8435
|
// Do NOT reset seenKeys here — the server replays ~50 events on every reconnect and
|
|
8437
8436
|
// clearing the set lets all replays through, duplicating _v2OrgEventLog and _activity entries.
|
|
8438
|
-
src = new EventSource('/api/mastermind-stream');
|
|
8437
|
+
src = new EventSource('/api/mastermind-stream' + (DIR ? '?project=' + encodeURIComponent(DIR) : ''));
|
|
8439
8438
|
src.onmessage = e => {
|
|
8440
8439
|
try {
|
|
8441
8440
|
const ev = JSON.parse(e.data);
|
package/dist/src/ui/server.mjs
CHANGED
|
@@ -4778,9 +4778,11 @@ export async function startServer({ port = 4242, projectDir, openBrowser = true
|
|
|
4778
4778
|
});
|
|
4779
4779
|
res.write(': connected\n\n');
|
|
4780
4780
|
mmSseClients.add(res);
|
|
4781
|
-
// Replay last 50 events from disk
|
|
4781
|
+
// Replay last 50 events from disk (use ?project= param if provided)
|
|
4782
4782
|
try {
|
|
4783
|
-
const
|
|
4783
|
+
const _sseQp = new URL('http://x' + req.url).searchParams;
|
|
4784
|
+
const _sseProj = _sseQp.get('project');
|
|
4785
|
+
const root2 = _sseProj || projectDir || process.cwd();
|
|
4784
4786
|
const evFile = path.join(root2, 'data', 'mastermind-events.jsonl');
|
|
4785
4787
|
const lines = fs.readFileSync(evFile, 'utf8').trim().split('\n').filter(Boolean).slice(-50);
|
|
4786
4788
|
for (const l of lines) res.write(`data: ${l}\n\n`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monoes/monomindcli",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.4",
|
|
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",
|