@monoes/monomindcli 1.14.1 → 1.14.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.
@@ -112,3 +112,20 @@ Follow _protocol.md Brain Write Procedure for domain `ops`.
112
112
 
113
113
 
114
114
  Invoke `Skill("mastermind:_repeat")` now to execute the REPEAT POSTAMBLE. This is a required tool call — do not skip it.
115
+
116
+ After the REPEAT POSTAMBLE completes, if a loop was started or continued (LOOP_ID is set), write the org name into the loop state file so the dashboard can detect running status:
117
+ ```bash
118
+ if [ -n "${LOOP_ID:-}" ]; then
119
+ LOOP_FILE=".monomind/loops/${LOOP_ID}.json"
120
+ if [ -f "$LOOP_FILE" ]; then
121
+ python3 -c "
122
+ import json, sys
123
+ f = sys.argv[1]; org = sys.argv[2]
124
+ d = json.load(open(f))
125
+ if 'orgName' not in d:
126
+ d['orgName'] = org
127
+ open(f, 'w').write(json.dumps(d, indent=2))
128
+ " "$LOOP_FILE" "${org_name}" 2>/dev/null || true
129
+ fi
130
+ fi
131
+ ```
@@ -3525,16 +3525,39 @@ export async function startServer({ port = 4242, projectDir, openBrowser = true
3525
3525
  const _loopRunning = (() => {
3526
3526
  try {
3527
3527
  if (!fs.existsSync(_loopsDir)) return false;
3528
+ // Get the org's state file mtime to correlate with loop activity
3529
+ const orgStateMtime = (() => {
3530
+ try { return fs.statSync(path.join(orgsDir, `${orgName}-state.json`)).mtimeMs; } catch { return 0; }
3531
+ })();
3532
+ // Also check org's most recent run file mtime
3533
+ const orgRunsDir = path.join(d, '.monomind', 'orgs', orgName, 'runs');
3534
+ const orgLastRunMtime = (() => {
3535
+ try {
3536
+ if (!fs.existsSync(orgRunsDir)) return 0;
3537
+ const runFiles = fs.readdirSync(orgRunsDir).filter(f => f.endsWith('.jsonl'));
3538
+ if (!runFiles.length) return 0;
3539
+ return Math.max(...runFiles.map(f => { try { return fs.statSync(path.join(orgRunsDir, f)).mtimeMs; } catch { return 0; } }));
3540
+ } catch { return 0; }
3541
+ })();
3542
+ const orgLastActivity = Math.max(orgStateMtime, orgLastRunMtime);
3528
3543
  return fs.readdirSync(_loopsDir).some(f => {
3529
3544
  if (!f.endsWith('.json') || f.endsWith('.stop')) return false;
3530
3545
  try {
3531
3546
  const lp = JSON.parse(fs.readFileSync(path.join(_loopsDir, f), 'utf8'));
3532
- return lp.status === 'running' && lp.command && lp.command.includes('runorg') && (lp.prompt || '').includes(orgName);
3547
+ if (!lp.command || !lp.command.includes('runorg')) return false;
3548
+ if (!['running', 'paused'].includes(lp.status)) return false;
3549
+ // Primary match: explicit orgName field (written by runorg command since v1.14.2)
3550
+ if (lp.orgName === orgName) return true;
3551
+ // Fallback: org name in prompt (early loop files that preserved --org flag)
3552
+ if ((lp.prompt || '').includes(orgName)) return true;
3553
+ // Heuristic: if loop's lastRunAt is within 3x wait interval of org's last activity
3554
+ const waitMs = (lp.wait || 60) * 3 * 1000;
3555
+ return orgLastActivity > 0 && Math.abs(orgLastActivity - (lp.lastRunAt || 0)) < waitMs;
3533
3556
  } catch { return false; }
3534
3557
  });
3535
3558
  } catch { return false; }
3536
3559
  })();
3537
- const running = !fs.existsSync(stopFile) && (activeOrgRuns.has(orgName) || Object.values(state.agents || {}).some(a => a.status === 'running') || _loopRunning);
3560
+ const running = !fs.existsSync(stopFile) && (activeOrgRuns.has(orgName) || ['running','active'].includes(state.status) || Object.values(state.agents || {}).some(a => a.status === 'running') || _loopRunning);
3538
3561
 
3539
3562
  // Read real tasks from the task store and group by status column
3540
3563
  const taskStoreData = readJsonSafe(path.join(d, '.monomind', 'tasks', 'store.json'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monoes/monomindcli",
3
- "version": "1.14.1",
3
+ "version": "1.14.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",