@yemi33/minions 0.1.228 → 0.1.229

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.229 (2026-04-03)
4
+
5
+ ### Fixes
6
+ - consolidate temp agent metrics into one row
7
+
3
8
  ## 0.1.228 (2026-04-03)
4
9
 
5
10
  ### Features
@@ -48,8 +48,26 @@ function renderMetrics(metrics) {
48
48
  renderContextPressure(metrics);
49
49
  return;
50
50
  }
51
+ // Consolidate temp-* agents into one row
52
+ var permanent = agents.filter(function(a) { return !a[0].startsWith('temp-'); });
53
+ var temps = agents.filter(function(a) { return a[0].startsWith('temp-'); });
54
+ var rows = permanent.slice();
55
+ if (temps.length > 0) {
56
+ var merged = { tasksCompleted: 0, tasksErrored: 0, prsCreated: 0, prsApproved: 0, prsRejected: 0, reviewsDone: 0 };
57
+ for (var t = 0; t < temps.length; t++) {
58
+ var tm = temps[t][1];
59
+ merged.tasksCompleted += tm.tasksCompleted || 0;
60
+ merged.tasksErrored += tm.tasksErrored || 0;
61
+ merged.prsCreated += tm.prsCreated || 0;
62
+ merged.prsApproved += tm.prsApproved || 0;
63
+ merged.prsRejected += tm.prsRejected || 0;
64
+ merged.reviewsDone += tm.reviewsDone || 0;
65
+ }
66
+ rows.push(['Temp Agents (' + temps.length + ')', merged]);
67
+ }
68
+
51
69
  let html = '<table class="pr-table"><thead><tr><th>Agent</th><th>Done</th><th>Errors</th><th>PRs</th><th>Approved</th><th>Rejected</th><th>Rate</th><th>Reviews</th></tr></thead><tbody>';
52
- for (const [id, m] of agents) {
70
+ for (const [id, m] of rows) {
53
71
  const rate = m.prsCreated > 0 ? Math.round((m.prsApproved / m.prsCreated) * 100) + '%' : '-';
54
72
  const rateColor = m.prsCreated > 0 ? (m.prsApproved / m.prsCreated >= 0.7 ? 'var(--green)' : 'var(--red)') : 'var(--muted)';
55
73
  html += '<tr>' +
@@ -141,8 +159,25 @@ function renderTokenUsage(metrics) {
141
159
  html += '</div>';
142
160
  }
143
161
 
144
- // Per-agent token table
145
- const agentsWithUsage = agents.filter(([, m]) => (m.totalCostUsd || 0) > 0);
162
+ // Per-agent token table (consolidate temp agents)
163
+ var permAgents = agents.filter(function(a) { return !a[0].startsWith('temp-'); });
164
+ var tempAgents = agents.filter(function(a) { return a[0].startsWith('temp-'); });
165
+ var tokenRows = permAgents.slice();
166
+ if (tempAgents.length > 0) {
167
+ var tempMerged = { totalCostUsd: 0, totalInputTokens: 0, totalOutputTokens: 0, totalCacheRead: 0, tasksCompleted: 0, tasksErrored: 0, model: '' };
168
+ for (var ti = 0; ti < tempAgents.length; ti++) {
169
+ var tm = tempAgents[ti][1];
170
+ tempMerged.totalCostUsd += tm.totalCostUsd || 0;
171
+ tempMerged.totalInputTokens += tm.totalInputTokens || 0;
172
+ tempMerged.totalOutputTokens += tm.totalOutputTokens || 0;
173
+ tempMerged.totalCacheRead += tm.totalCacheRead || 0;
174
+ tempMerged.tasksCompleted += tm.tasksCompleted || 0;
175
+ tempMerged.tasksErrored += tm.tasksErrored || 0;
176
+ if (!tempMerged.model && tm.model) tempMerged.model = tm.model;
177
+ }
178
+ tokenRows.push(['Temp Agents (' + tempAgents.length + ')', tempMerged]);
179
+ }
180
+ var agentsWithUsage = tokenRows.filter(function(a) { return (a[1].totalCostUsd || 0) > 0; });
146
181
  if (agentsWithUsage.length > 0) {
147
182
  html += '<div style="font-size:10px;color:var(--muted);margin:12px 0 4px;font-weight:600;text-transform:uppercase;letter-spacing:0.5px">Agent Usage</div>';
148
183
  html += '<table class="token-agent-table"><thead><tr><th>Agent</th><th>Model</th><th>Cost</th><th>Input</th><th>Output</th><th>Cache</th><th>$/task</th></tr></thead><tbody>';
package/engine/cleanup.js CHANGED
@@ -35,20 +35,23 @@ function runCleanup(config, verbose = false) {
35
35
  const projects = getProjects(config);
36
36
  let cleaned = { tempFiles: 0, liveOutputs: 0, worktrees: 0, zombies: 0 };
37
37
 
38
- // 1. Clean stale temp prompt/sysprompt files (older than 1 hour)
38
+ // 1. Clean stale temp prompt/sysprompt files and orphaned safeWrite .tmp.* files (older than 1 hour)
39
39
  const oneHourAgo = Date.now() - 3600000;
40
40
  try {
41
41
  const tmpDir = path.join(ENGINE_DIR, 'tmp');
42
42
  const scanDirs = [ENGINE_DIR, ...(fs.existsSync(tmpDir) ? [tmpDir] : [])];
43
43
  for (const dir of scanDirs) {
44
44
  for (const f of fs.readdirSync(dir)) {
45
- if (f.startsWith('prompt-') || f.startsWith('sysprompt-') || f.startsWith('tmp-sysprompt-')) {
45
+ const isPromptTemp = f.startsWith('prompt-') || f.startsWith('sysprompt-') || f.startsWith('tmp-sysprompt-');
46
+ const isSafeWriteTemp = /\.tmp\.\d+\.\d+$/.test(f);
47
+ if (isPromptTemp || isSafeWriteTemp) {
46
48
  const fp = path.join(dir, f);
47
49
  try {
48
50
  const stat = fs.statSync(fp);
49
51
  if (stat.mtimeMs < oneHourAgo) {
50
52
  fs.unlinkSync(fp);
51
53
  cleaned.tempFiles++;
54
+ if (isSafeWriteTemp) log('info', `Cleaned orphaned temp file: ${f}`);
52
55
  }
53
56
  } catch { /* cleanup */ }
54
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.228",
3
+ "version": "0.1.229",
4
4
  "description": "Multi-agent AI dev team that runs from ~/.minions/ — five autonomous agents share a single engine, dashboard, and knowledge base",
5
5
  "bin": {
6
6
  "minions": "bin/minions.js"