@yemi33/minions 0.1.610 → 0.1.612

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,8 +1,12 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.610 (2026-04-08)
3
+ ## 0.1.612 (2026-04-08)
4
+
5
+ ### Features
6
+ - clickable pinned notes and skills with full content + doc-chat
4
7
 
5
8
  ### Fixes
9
+ - accurate LLM call timing and agent metrics on engine page
6
10
  - worktree count now checks for .git file instead of any directory
7
11
 
8
12
  ## 0.1.609 (2026-04-08)
@@ -65,7 +65,7 @@ function renderMetrics(metrics) {
65
65
 
66
66
  function fmtAvgRuntime(m) {
67
67
  const total = m.totalRuntimeMs || 0;
68
- const count = (m.tasksCompleted || 0) + (m.tasksErrored || 0);
68
+ const count = m.timedTasks || 0;
69
69
  if (!count || !total) return '-';
70
70
  const avgMin = total / count / 60000;
71
71
  return avgMin < 1 ? '<1m' : Math.round(avgMin) + 'm';
@@ -106,7 +106,8 @@ function renderLlmPerf(metrics) {
106
106
  for (const [type, m] of entries) {
107
107
  const calls = m.calls || 0;
108
108
  const totalMs = m.totalDurationMs || 0;
109
- const avgMs = calls > 0 ? totalMs / calls : 0;
109
+ const timedCalls = m.timedCalls || 0;
110
+ const avgMs = timedCalls > 0 ? totalMs / timedCalls : 0;
110
111
  const fmtTotal = totalMs < 60000 ? Math.round(totalMs / 1000) + 's' : Math.round(totalMs / 60000) + 'm';
111
112
  const fmtAvg = avgMs < 1000 ? Math.round(avgMs) + 'ms' : avgMs < 60000 ? Math.round(avgMs / 1000) + 's' : Math.round(avgMs / 60000) + 'm';
112
113
  const cost = m.costUsd ? '$' + m.costUsd.toFixed(2) : '-';
@@ -8,15 +8,17 @@ function renderPinned(entries) {
8
8
  el.innerHTML = '<p class="empty">No pinned notes. Pin important context that all agents should see.</p>';
9
9
  return;
10
10
  }
11
- el.innerHTML = entries.map(e =>
12
- '<div style="padding:8px 12px;margin-bottom:6px;background:var(--surface2);border-left:3px solid ' +
11
+ // Store entries for click-to-view (full content available in status response)
12
+ window._pinnedEntries = entries;
13
+ el.innerHTML = entries.map((e, i) =>
14
+ '<div class="pinned-card" data-file="pinned:' + escHtml(e.title) + '" style="padding:8px 12px;margin-bottom:6px;background:var(--surface2);border-left:3px solid ' +
13
15
  (e.level === 'critical' ? 'var(--red)' : e.level === 'warning' ? 'var(--yellow)' : 'var(--blue)') +
14
- ';border-radius:4px">' +
16
+ ';border-radius:4px;cursor:pointer" onclick="openPinnedView(' + i + ')">' +
15
17
  '<div style="display:flex;justify-content:space-between;align-items:center">' +
16
18
  '<strong style="font-size:var(--text-md)">' + escHtml(e.title) + '</strong>' +
17
- '<button class="pr-pager-btn" style="font-size:9px;padding:1px 6px;color:var(--red);border-color:var(--red)" data-pin-title="' + escHtml(e.title) + '" onclick="removePinnedNote(this.dataset.pinTitle)">Unpin</button>' +
19
+ '<button class="pr-pager-btn" style="font-size:9px;padding:1px 6px;color:var(--red);border-color:var(--red)" data-pin-title="' + escHtml(e.title) + '" onclick="event.stopPropagation();removePinnedNote(this.dataset.pinTitle)">Unpin</button>' +
18
20
  '</div>' +
19
- '<div style="font-size:var(--text-sm);color:var(--muted);margin-top:4px">' + renderMd(e.content.slice(0, 200)) + '</div>' +
21
+ '<div style="font-size:var(--text-sm);color:var(--muted);margin-top:4px">' + renderMd(e.content.slice(0, 200)) + (e.content.length > 200 ? '...' : '') + '</div>' +
20
22
  '</div>'
21
23
  ).join('');
22
24
  }
@@ -57,4 +59,17 @@ async function removePinnedNote(title) {
57
59
  } catch (e) { alert('Error: ' + e.message); refresh(); }
58
60
  }
59
61
 
60
- window.MinionsPinned = { renderPinned, openPinNoteModal, submitPinnedNote, removePinnedNote };
62
+ function openPinnedView(idx) {
63
+ const entry = (window._pinnedEntries || [])[idx];
64
+ if (!entry) return;
65
+ document.getElementById('modal-title').textContent = entry.title;
66
+ document.getElementById('modal-body').innerHTML = renderMd(entry.content);
67
+ document.getElementById('modal-body').style.fontFamily = "'Segoe UI', system-ui, sans-serif";
68
+ document.getElementById('modal-body').style.whiteSpace = 'normal';
69
+ document.getElementById('modal').classList.add('open');
70
+ _modalDocContext = { title: entry.title, content: entry.content, selection: '' };
71
+ _modalFilePath = 'pinned.md';
72
+ showModalQa();
73
+ }
74
+
75
+ window.MinionsPinned = { renderPinned, openPinNoteModal, submitPinnedNote, removePinnedNote, openPinnedView };
@@ -76,16 +76,23 @@ function renderSkills(skills) {
76
76
  }
77
77
 
78
78
  function openSkill(file, source, dir) {
79
+ document.getElementById('modal-title').textContent = file;
80
+ document.getElementById('modal-body').innerHTML = '<p style="color:var(--muted)">Loading...</p>';
81
+ document.getElementById('modal').classList.add('open');
79
82
  fetch('/api/skill?file=' + encodeURIComponent(file) + '&source=' + encodeURIComponent(source || 'claude-code') + (dir ? '&dir=' + encodeURIComponent(dir) : ''))
80
83
  .then(r => r.text())
81
84
  .then(content => {
82
85
  document.getElementById('modal-title').textContent = file;
83
- document.getElementById('modal-body').textContent = content;
84
- document.getElementById('modal-body').style.fontFamily = 'Consolas, monospace';
85
- document.getElementById('modal-body').style.whiteSpace = 'pre-wrap';
86
- document.getElementById('modal').classList.add('open');
86
+ document.getElementById('modal-body').innerHTML = renderMd(content);
87
+ document.getElementById('modal-body').style.fontFamily = "'Segoe UI', system-ui, sans-serif";
88
+ document.getElementById('modal-body').style.whiteSpace = 'normal';
89
+ _modalDocContext = { title: file, content: content, selection: '' };
90
+ _modalFilePath = (dir ? dir + '/' : 'skills/') + file;
91
+ showModalQa();
87
92
  })
88
- .catch(() => {});
93
+ .catch(() => {
94
+ document.getElementById('modal-body').innerHTML = '<p style="color:var(--red)">Failed to load skill.</p>';
95
+ });
89
96
  }
90
97
 
91
98
  window.MinionsSkills = { renderSkills, openSkill };
package/engine/cli.js CHANGED
@@ -562,12 +562,12 @@ const commands = {
562
562
  console.log(`Active processes: ${e.activeProcesses.size}`);
563
563
 
564
564
  const metricsPath = path.join(ENGINE_DIR, 'metrics.json');
565
- const metrics = safeJson(metricsPath);
566
- if (metrics && Object.keys(metrics).length > 0) {
565
+ const metricsData = safeJson(metricsPath);
566
+ if (metricsData && Object.keys(metricsData).length > 0) {
567
567
  console.log('\nMetrics:');
568
568
  console.log(` ${'Agent'.padEnd(12)} ${'Done'.padEnd(6)} ${'Err'.padEnd(6)} ${'PRs'.padEnd(6)} ${'Appr'.padEnd(6)} ${'Rej'.padEnd(6)} ${'Reviews'.padEnd(8)} ${'Cost'.padEnd(8)}`);
569
569
  console.log(' ' + '-'.repeat(64));
570
- for (const [id, m] of Object.entries(metrics)) {
570
+ for (const [id, m] of Object.entries(metricsData)) {
571
571
  if (id.startsWith('_')) continue;
572
572
  const cost = m.totalCostUsd ? '$' + m.totalCostUsd.toFixed(1) : '-';
573
573
  console.log(` ${id.padEnd(12)} ${String(m.tasksCompleted || 0).padEnd(6)} ${String(m.tasksErrored || 0).padEnd(6)} ${String(m.prsCreated || 0).padEnd(6)} ${String(m.prsApproved || 0).padEnd(6)} ${String(m.prsRejected || 0).padEnd(6)} ${String(m.reviewsDone || 0).padEnd(8)} ${cost.padEnd(8)}`);
@@ -1023,7 +1023,10 @@ function updateMetrics(agentId, dispatchItem, result, taskUsage, prsCreatedCount
1023
1023
  const runtimeMs = dispatchItem.started_at
1024
1024
  ? Date.now() - new Date(dispatchItem.started_at).getTime()
1025
1025
  : 0;
1026
- if (runtimeMs > 0) m.totalRuntimeMs = (m.totalRuntimeMs || 0) + runtimeMs;
1026
+ if (runtimeMs > 0) {
1027
+ m.totalRuntimeMs = (m.totalRuntimeMs || 0) + runtimeMs;
1028
+ m.timedTasks = (m.timedTasks || 0) + 1;
1029
+ }
1027
1030
 
1028
1031
  if (result === DISPATCH_RESULT.SUCCESS) {
1029
1032
  m.tasksCompleted++;
@@ -1047,7 +1050,10 @@ function updateMetrics(agentId, dispatchItem, result, taskUsage, prsCreatedCount
1047
1050
  }
1048
1051
  const eng = metrics._engine['agent-dispatch'];
1049
1052
  eng.calls++;
1050
- if (runtimeMs > 0) eng.totalDurationMs = (eng.totalDurationMs || 0) + runtimeMs;
1053
+ if (runtimeMs > 0) {
1054
+ eng.totalDurationMs = (eng.totalDurationMs || 0) + runtimeMs;
1055
+ eng.timedCalls = (eng.timedCalls || 0) + 1;
1056
+ }
1051
1057
  if (taskUsage) {
1052
1058
  eng.costUsd += taskUsage.costUsd || 0;
1053
1059
  eng.inputTokens += taskUsage.inputTokens || 0;
package/engine/llm.js CHANGED
@@ -27,7 +27,10 @@ function trackEngineUsage(category, usage) {
27
27
  cat.outputTokens += usage.outputTokens || 0;
28
28
  cat.cacheRead += usage.cacheRead || 0;
29
29
  cat.cacheCreation = (cat.cacheCreation || 0) + (usage.cacheCreation || 0);
30
- if (usage.durationMs) cat.totalDurationMs = (cat.totalDurationMs || 0) + usage.durationMs;
30
+ if (usage.durationMs) {
31
+ cat.totalDurationMs = (cat.totalDurationMs || 0) + usage.durationMs;
32
+ cat.timedCalls = (cat.timedCalls || 0) + 1;
33
+ }
31
34
 
32
35
  const today = ts().slice(0, 10);
33
36
  if (!metrics._daily) metrics._daily = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.610",
3
+ "version": "0.1.612",
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"