claude-scope 0.6.14 → 0.6.16

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.
@@ -1415,7 +1415,7 @@ var VSCODE_DARK_PLUS_THEME = {
1415
1415
  };
1416
1416
 
1417
1417
  // src/ui/theme/index.ts
1418
- var DEFAULT_THEME = VSCODE_DARK_PLUS_THEME.colors;
1418
+ var DEFAULT_THEME = MONOKAI_THEME.colors;
1419
1419
 
1420
1420
  // src/widgets/core/stdin-data-widget.ts
1421
1421
  var StdinDataWidget = class {
@@ -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) {
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
@@ -1972,11 +1978,6 @@ function formatCurrency(usd) {
1972
1978
  }
1973
1979
  return `$${usd.toFixed(2)}`;
1974
1980
  }
1975
- function createProgressBar(percentage, width) {
1976
- const filled = Math.round(percentage / 100 * width);
1977
- const empty = width - filled;
1978
- return "\u2588".repeat(filled) + "\u2591".repeat(empty);
1979
- }
1980
1981
  function getCacheColor(hitRate, colors) {
1981
1982
  if (hitRate > 70) {
1982
1983
  return colors.cache.high;
@@ -1988,74 +1989,70 @@ function getCacheColor(hitRate, colors) {
1988
1989
  }
1989
1990
  var cacheMetricsStyles = {
1990
1991
  /**
1991
- * balanced: 💾 70% cached (35.0k tokens) with color coding
1992
+ * balanced: 💾 35.0k cache with color coding
1992
1993
  */
1993
1994
  balanced: (data, colors) => {
1994
- const { hitRate, cacheRead } = data;
1995
+ const { cacheRead, hitRate } = data;
1995
1996
  const color = colors ? getCacheColor(hitRate, colors) : "";
1996
- const percentage = color ? `${color}${hitRate.toFixed(0)}%` : `${hitRate.toFixed(0)}%`;
1997
- const tokens = colors ? `${colors.cache.read}${formatK(cacheRead)} tokens` : `${formatK(cacheRead)} tokens`;
1998
- return `\u{1F4BE} ${percentage} cached (${tokens})`;
1997
+ const amount = color ? `${color}${formatK(cacheRead)} cache` : `${formatK(cacheRead)} cache`;
1998
+ return `\u{1F4BE} ${amount}`;
1999
1999
  },
2000
2000
  /**
2001
- * compact: Cache: 70%
2001
+ * compact: Cache: 35.0k
2002
2002
  */
2003
2003
  compact: (data, colors) => {
2004
- const hitRate = data.hitRate.toFixed(0);
2004
+ const { cacheRead } = data;
2005
+ const amount = formatK(cacheRead);
2005
2006
  if (colors) {
2006
- return `${colors.cache.read}Cache: ${hitRate}%`;
2007
+ return `${colors.cache.read}Cache: ${amount}`;
2007
2008
  }
2008
- return `Cache: ${hitRate}%`;
2009
+ return `Cache: ${amount}`;
2009
2010
  },
2010
2011
  /**
2011
- * playful: 💾 [███████░] 70% with progress bar
2012
+ * playful: 💾 35.0k cache
2012
2013
  */
2013
- playful: (data, colors) => {
2014
- const { hitRate } = data;
2015
- const bar = createProgressBar(hitRate, 7);
2016
- const color = colors ? getCacheColor(hitRate, colors) : "";
2017
- const barAndPercent = color ? `${color}[${bar}] ${hitRate.toFixed(0)}%` : `[${bar}] ${hitRate.toFixed(0)}%`;
2018
- return `\u{1F4BE} ${barAndPercent}`;
2014
+ playful: (data, _colors) => {
2015
+ const { cacheRead } = data;
2016
+ const amount = formatK(cacheRead);
2017
+ return `\u{1F4BE} ${amount} cache`;
2019
2018
  },
2020
2019
  /**
2021
- * verbose: Cache: 35.0k tokens (70%) | $0.03 saved
2020
+ * verbose: Cache: 35.0k | $0.03 saved
2022
2021
  */
2023
2022
  verbose: (data, colors) => {
2024
- const { cacheRead, hitRate, savings } = data;
2025
- const tokens = colors ? `${colors.cache.read}${formatK(cacheRead)} tokens` : `${formatK(cacheRead)} tokens`;
2026
- const percent = `${hitRate.toFixed(0)}%`;
2023
+ const { cacheRead, savings } = data;
2024
+ const amount = formatK(cacheRead);
2027
2025
  const saved = colors ? `${colors.cache.write}${formatCurrency(savings)} saved` : `${formatCurrency(savings)} saved`;
2028
- return `Cache: ${tokens} (${percent}) | ${saved}`;
2026
+ return `Cache: ${amount} | ${saved}`;
2029
2027
  },
2030
2028
  /**
2031
- * labeled: Cache Hit: 70% | $0.03 saved
2029
+ * labeled: Cache: 35.0k | $0.03 saved
2032
2030
  */
2033
2031
  labeled: (data, colors) => {
2034
- const { hitRate, savings } = data;
2035
- const percent = colors ? `${colors.cache.read}${hitRate.toFixed(0)}%` : `${hitRate.toFixed(0)}%`;
2032
+ const { cacheRead, savings } = data;
2033
+ const amount = formatK(cacheRead);
2036
2034
  const saved = colors ? `${colors.cache.write}${formatCurrency(savings)} saved` : `${formatCurrency(savings)} saved`;
2037
- return `Cache Hit: ${percent} | ${saved}`;
2035
+ return `Cache: ${amount} | ${saved}`;
2038
2036
  },
2039
2037
  /**
2040
- * indicator: ● 70% cached
2038
+ * indicator: ● 35.0k cache with color coding
2041
2039
  */
2042
2040
  indicator: (data, colors) => {
2043
- const { hitRate } = data;
2041
+ const { cacheRead, hitRate } = data;
2044
2042
  const color = colors ? getCacheColor(hitRate, colors) : "";
2045
- const percentage = color ? `${color}${hitRate.toFixed(0)}%` : `${hitRate.toFixed(0)}%`;
2046
- return `\u25CF ${percentage} cached`;
2043
+ const amount = color ? `${color}${formatK(cacheRead)} cache` : `${formatK(cacheRead)} cache`;
2044
+ return `\u25CF ${amount}`;
2047
2045
  },
2048
2046
  /**
2049
- * breakdown: Multi-line with ├─ Read: and └─ Write: breakdown
2047
+ * breakdown: Single-line with Hit: and Write: breakdown
2050
2048
  */
2051
2049
  breakdown: (data, colors) => {
2052
- const { cacheRead, cacheWrite, hitRate, savings } = data;
2053
- const color = colors ? getCacheColor(hitRate, colors) : "";
2054
- const percent = color ? `${color}${hitRate.toFixed(0)}%` : `${hitRate.toFixed(0)}%`;
2050
+ const { cacheRead, cacheWrite, savings } = data;
2051
+ const amount = formatK(cacheRead);
2055
2052
  const saved = colors ? `${colors.cache.write}${formatCurrency(savings)} saved` : `${formatCurrency(savings)} saved`;
2056
- const read = colors ? `${colors.cache.read}${formatK(cacheRead)}` : formatK(cacheRead);
2057
- const write = colors ? `${colors.cache.write}${formatK(cacheWrite)}` : formatK(cacheWrite);
2058
- return [`\u{1F4BE} ${percent} cached | ${saved}`, `\u251C\u2500 Read: ${read}`, `\u2514\u2500 Write: ${write}`].join("\n");
2053
+ const read = formatK(cacheRead);
2054
+ const write = formatK(cacheWrite);
2055
+ return `\u{1F4BE} ${amount} cache | Hit: ${read}, Write: ${write} | ${saved}`;
2059
2056
  }
2060
2057
  };
2061
2058
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-scope",
3
- "version": "0.6.14",
3
+ "version": "0.6.16",
4
4
  "description": "Claude Code plugin for session status and analytics",
5
5
  "license": "MIT",
6
6
  "type": "module",