claude-scope 0.6.15 → 0.6.17

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.
@@ -1517,16 +1517,17 @@ var activeToolsStyles = {
1517
1517
  for (const tool of data.running) {
1518
1518
  allToolNames.add(tool.name);
1519
1519
  }
1520
- for (const name of data.completed.keys()) {
1520
+ for (const [name] of data.completed.slice(0, 3)) {
1521
1521
  allToolNames.add(name);
1522
1522
  }
1523
+ const completedMap = new Map(data.completed);
1523
1524
  const runningCounts = /* @__PURE__ */ new Map();
1524
1525
  for (const tool of data.running) {
1525
1526
  runningCounts.set(tool.name, (runningCounts.get(tool.name) ?? 0) + 1);
1526
1527
  }
1527
1528
  for (const name of allToolNames) {
1528
1529
  const runningCount = runningCounts.get(name) ?? 0;
1529
- const completedCount = data.completed.get(name) ?? 0;
1530
+ const completedCount = completedMap.get(name) ?? 0;
1530
1531
  if (runningCount > 0 && completedCount > 0) {
1531
1532
  const nameStr = colorize(name, c.tools.name);
1532
1533
  const runningStr = colorize(`${runningCount} running`, c.tools.running);
@@ -1558,7 +1559,7 @@ var activeToolsStyles = {
1558
1559
  for (const tool of data.running) {
1559
1560
  parts.push(`[${colorize(tool.name, c.tools.name)}]`);
1560
1561
  }
1561
- for (const [name] of Array.from(data.completed.entries()).slice(0, 3)) {
1562
+ for (const [name] of data.completed.slice(0, 3)) {
1562
1563
  parts.push(`[${colorize(name, c.tools.completed)}]`);
1563
1564
  }
1564
1565
  if (parts.length === 0) {
@@ -1607,7 +1608,7 @@ var activeToolsStyles = {
1607
1608
  const label = colorize("Running:", c.tools.running);
1608
1609
  parts.push(`${label} ${formatTool(tool.name, tool.target, c)}`);
1609
1610
  }
1610
- const sorted = Array.from(data.completed.entries()).sort((a, b) => b[1] - a[1]).slice(0, 3);
1611
+ const sorted = data.completed.slice(0, 3);
1611
1612
  for (const [name, count] of sorted) {
1612
1613
  const label = colorize("Completed:", c.tools.completed);
1613
1614
  const countStr = colorize(`(${count}x)`, c.tools.count);
@@ -1628,7 +1629,7 @@ var activeToolsStyles = {
1628
1629
  const indicator = colorize("\u25D0", c.tools.running);
1629
1630
  return `${indicator} ${formatTool(t.name, t.target, c)}`;
1630
1631
  }),
1631
- ...Array.from(data.completed.entries()).slice(0, 3).map(([name, count]) => {
1632
+ ...data.completed.slice(0, 3).map(([name, count]) => {
1632
1633
  const indicator = colorize("\u2713", c.tools.completed);
1633
1634
  const countStr = colorize(`\xD7${count}`, c.tools.count);
1634
1635
  return `${indicator} ${name} ${countStr}`;
@@ -1650,7 +1651,7 @@ var activeToolsStyles = {
1650
1651
  const bullet = colorize("\u25CF", c.semantic.info);
1651
1652
  parts.push(`${bullet} ${formatTool(tool.name, tool.target, c)}`);
1652
1653
  }
1653
- for (const [name] of Array.from(data.completed.entries()).slice(0, 3)) {
1654
+ for (const [name] of data.completed.slice(0, 3)) {
1654
1655
  const bullet = colorize("\u25CF", c.tools.completed);
1655
1656
  parts.push(`${bullet} ${name}`);
1656
1657
  }
@@ -1750,9 +1751,9 @@ var ActiveToolsWidget = class extends StdinDataWidget {
1750
1751
  this.style = style;
1751
1752
  }
1752
1753
  /**
1753
- * Aggregate completed tools by name
1754
+ * Aggregate completed tools by name and sort by count (descending)
1754
1755
  * @param tools - Array of tool entries
1755
- * @returns Map of tool name to count
1756
+ * @returns Array of [name, count] tuples sorted by count descending
1756
1757
  */
1757
1758
  aggregateCompleted(tools) {
1758
1759
  const counts = /* @__PURE__ */ new Map();
@@ -1762,7 +1763,12 @@ var ActiveToolsWidget = class extends StdinDataWidget {
1762
1763
  counts.set(tool.name, current + 1);
1763
1764
  }
1764
1765
  }
1765
- return counts;
1766
+ return Array.from(counts.entries()).sort((a, b) => {
1767
+ if (b[1] !== a[1]) {
1768
+ return b[1] - a[1];
1769
+ }
1770
+ return a[0].localeCompare(b[0]);
1771
+ });
1766
1772
  }
1767
1773
  /**
1768
1774
  * Prepare render data from tools
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-scope",
3
- "version": "0.6.15",
3
+ "version": "0.6.17",
4
4
  "description": "Claude Code plugin for session status and analytics",
5
5
  "license": "MIT",
6
6
  "type": "module",