@monoes/monomindcli 1.14.2 → 1.14.3

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.
@@ -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; flex-shrink: 0; border-bottom: 1px solid var(--border); padding: 0 16px; min-height: 36px; flex-direction: row; gap: 8px; align-items: center; overflow-x: auto; }
453
- #alerts-rail.has-alerts { display: flex; }
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); }
@@ -4044,7 +4044,7 @@ async function loadChatViewSessions() {
4044
4044
  // include events that arrived via SSE right before the fetch, so we preserve their
4045
4045
  // buffered events and merge them back after (same pattern as _odtLoadChatSessions).
4046
4046
  const _prevChatSessions = { ...chatVSessions };
4047
- const data = await apiFetch('/api/mastermind/sessions');
4047
+ const data = await apiFetch('/api/mastermind/sessions' + (DIR ? '?project=' + encodeURIComponent(DIR) : ''));
4048
4048
  chatVSessions = {};
4049
4049
  chatVGroupMap = {};
4050
4050
  chatVSessionGroupMap = {};
@@ -4453,7 +4453,7 @@ function connectChatViewSSE() {
4453
4453
  if (chatVSseSource) return;
4454
4454
  const dot = document.getElementById('chat-v-live-dot');
4455
4455
  const lbl = document.getElementById('chat-v-live-lbl');
4456
- chatVSseSource = new EventSource('/api/mastermind-stream');
4456
+ chatVSseSource = new EventSource('/api/mastermind-stream' + (DIR ? '?project=' + encodeURIComponent(DIR) : ''));
4457
4457
  chatVSseSource.onopen = () => { dot && dot.classList.add('on'); lbl && (lbl.textContent = 'LIVE'); };
4458
4458
  chatVSseSource.onmessage = e => {
4459
4459
  try { handleChatViewEvent(JSON.parse(e.data)); } catch(_) {}
@@ -4478,6 +4478,7 @@ function handleChatViewEvent(ev) {
4478
4478
  // Org events (org:comms, org:agent:online, org:checkpoint, etc.) may carry a session field
4479
4479
  // from the org run's session ID — route them directly to the feed if the session matches,
4480
4480
  // or append them unconditionally when the chat view is showing the "live" placeholder.
4481
+ if (ev.project && DIR && ev.project !== DIR) return;
4481
4482
  const isOrgEvent = ev.type && (ev.type.startsWith('org:') || ev.type.startsWith('run:') || ev.type.startsWith('loop:'));
4482
4483
  if (!ev.session && !isOrgEvent) return;
4483
4484
  if (ev.session) {
@@ -6926,7 +6927,7 @@ function _odtOrgSessionMatch(s) {
6926
6927
  const after = str[idx + prefix.length];
6927
6928
  return after === undefined || !/[a-z0-9_-]/.test(after);
6928
6929
  };
6929
- if (_orgBound(prompt, 'running org: ' + orgLc) || _orgBound(prompt, 'org: ' + orgLc)) return true;
6930
+ if (_orgBound(prompt, 'running org: ' + orgLc) || _orgBound(prompt, 'org: ' + orgLc) || _orgBound(prompt, 'running ' + orgLc + ' org:')) return true;
6930
6931
  return (s.events || []).some(ev => (ev.org || '').toLowerCase() === orgLc);
6931
6932
  }
6932
6933
 
@@ -7105,7 +7106,7 @@ async function _odtLoadChatSessions() {
7105
7106
  // Orgs running via _repeat loops emit session:start/complete events to the mastermind
7106
7107
  // event store; these never appear in the run list and are otherwise invisible.
7107
7108
  try {
7108
- const _mmSessR = await apiFetch('/api/mastermind/sessions');
7109
+ const _mmSessR = await apiFetch('/api/mastermind/sessions' + (DIR ? '?project=' + encodeURIComponent(DIR) : ''));
7109
7110
  if (_v2SelOrg === _loadedForOrg) {
7110
7111
  const _mmAll = Array.isArray(_mmSessR) ? _mmSessR : Object.values(_mmSessR.sessions || {});
7111
7112
  const _mmMatch = _mmAll.filter(_odtOrgSessionMatch).filter(s => !_odtChatSessions.find(x => x.id === s.id));
@@ -7135,7 +7136,7 @@ async function _odtLoadChatSessions() {
7135
7136
  if (_v2SelOrg !== _loadedForOrg) return;
7136
7137
  // Fallback: mastermind lifecycle events (pre-run-file era sessions)
7137
7138
  try {
7138
- const r = await apiFetch('/api/mastermind/sessions');
7139
+ const r = await apiFetch('/api/mastermind/sessions' + (DIR ? '?project=' + encodeURIComponent(DIR) : ''));
7139
7140
  if (_v2SelOrg !== _loadedForOrg) return;
7140
7141
  const all = Array.isArray(r) ? r : Object.values(r.sessions || {});
7141
7142
  _odtChatSessions = all.filter(_odtOrgSessionMatch).map(s => {
@@ -7743,7 +7744,7 @@ function _odtConnectChatSSE() {
7743
7744
  if (_odtChatSseSource) return;
7744
7745
  const dot = document.getElementById('odt-chat-live-dot');
7745
7746
  const lbl = document.getElementById('odt-chat-live-lbl');
7746
- _odtChatSseSource = new EventSource('/api/mastermind-stream');
7747
+ _odtChatSseSource = new EventSource('/api/mastermind-stream' + (DIR ? '?project=' + encodeURIComponent(DIR) : ''));
7747
7748
  _odtChatSseSource.onopen = () => { dot?.classList.add('on'); if (lbl) lbl.textContent = 'LIVE'; };
7748
7749
  _odtChatSseSource.onmessage = e => {
7749
7750
  try { _odtHandleLiveEvent(JSON.parse(e.data)); } catch(_) {}
@@ -7762,6 +7763,7 @@ function _odtConnectChatSSE() {
7762
7763
  }
7763
7764
 
7764
7765
  function _odtHandleLiveEvent(ev) {
7766
+ if (ev?.project && DIR && ev.project !== DIR) return;
7765
7767
  // Deduplicate SSE reconnect replays (server replays last 50 events on every reconnect)
7766
7768
  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
7769
  if (_odtChatSeenKeys.has(_odtDedupKey)) return;
@@ -8435,7 +8437,7 @@ function filterOrgList(q) {
8435
8437
  if (src) src.close();
8436
8438
  // Do NOT reset seenKeys here — the server replays ~50 events on every reconnect and
8437
8439
  // clearing the set lets all replays through, duplicating _v2OrgEventLog and _activity entries.
8438
- src = new EventSource('/api/mastermind-stream');
8440
+ src = new EventSource('/api/mastermind-stream' + (DIR ? '?project=' + encodeURIComponent(DIR) : ''));
8439
8441
  src.onmessage = e => {
8440
8442
  try {
8441
8443
  const ev = JSON.parse(e.data);
@@ -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 root2 = projectDir || process.cwd();
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.2",
3
+ "version": "1.14.3",
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",