ccgather 2.0.26 → 2.0.27

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.
Files changed (2) hide show
  1. package/dist/index.js +15 -15
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -308,7 +308,7 @@ var init_ui = __esm({
308
308
  "use strict";
309
309
  import_chalk = __toESM(require("chalk"));
310
310
  import_string_width = __toESM(require("string-width"));
311
- VERSION = true ? "2.0.26" : "0.0.0";
311
+ VERSION = true ? "2.0.27" : "0.0.0";
312
312
  colors = {
313
313
  primary: import_chalk.default.hex("#DA7756"),
314
314
  // Claude coral
@@ -1384,24 +1384,24 @@ async function submit(options) {
1384
1384
  const prevTokens = prev.totalTokens || 0;
1385
1385
  const prevCost = prev.totalCost || 0;
1386
1386
  console.log(
1387
- ` ${colors.muted("Last:")} ${colors.dim(timeSince)} ${colors.dim("\u2502")} \u26A1 ${colors.primary(formatNumber(prevTokens))} ${colors.dim("\u2502")} \u{1F4B0} ${colors.warning(formatCost(prevCost))}`
1387
+ ` ${colors.muted("Last:")} ${colors.dim(timeSince.padEnd(7))} ${colors.dim("\u2502")} \u26A1 ${colors.primary(formatNumber(prevTokens).padStart(8))} ${colors.dim("\u2502")} \u{1F4B0} ${colors.warning(formatCost(prevCost))}`
1388
1388
  );
1389
1389
  await sleep(50);
1390
- if (newTokens > 0 || expiredTokens > 0) {
1391
- const netTokens = newTokens - expiredTokens;
1392
- const netCost = newCost - expiredCost;
1393
- const tokenSign = netTokens >= 0 ? "+" : "";
1394
- const costSign = netCost >= 0 ? "+" : "";
1395
- console.log(
1396
- ` ${colors.muted("This:")} ${colors.white("now")} ${colors.dim("\u2502")} \u26A1 ${colors.primary(`${tokenSign}${formatNumber(netTokens)}`)} ${colors.dim("\u2502")} \u{1F4B0} ${colors.warning(`${costSign}${formatCost(netCost)}`)}`
1397
- );
1398
- await sleep(50);
1399
- } else if (newTokens === 0 && expiredTokens === 0) {
1400
- console.log(` ${colors.dim("No changes since last submission")}`);
1401
- await sleep(50);
1390
+ const currentTokens = usageData.totalTokens;
1391
+ const currentCost = usageData.totalCost;
1392
+ const tokenChange = currentTokens - prevTokens;
1393
+ const costChange = currentCost - prevCost;
1394
+ let changeDisplay = "";
1395
+ if (tokenChange !== 0 || costChange !== 0) {
1396
+ const tokenSign = tokenChange >= 0 ? "+" : "";
1397
+ const costSign = costChange >= 0 ? "+" : "";
1398
+ changeDisplay = ` ${colors.dim("(")}${colors.primary(`${tokenSign}${formatNumber(tokenChange)}`)}${colors.dim(")")}`;
1402
1399
  }
1400
+ console.log(
1401
+ ` ${colors.muted("Now:")} ${colors.white("now").padEnd(7)} ${colors.dim("\u2502")} \u26A1 ${colors.primary(formatNumber(currentTokens).padStart(8))} ${colors.dim("\u2502")} \u{1F4B0} ${colors.warning(formatCost(currentCost))}${changeDisplay}`
1402
+ );
1403
+ await sleep(50);
1403
1404
  if (expiredDates.length > 0) {
1404
- console.log();
1405
1405
  console.log(
1406
1406
  ` ${colors.warning("\u26A0")} ${colors.dim(`${expiredDates.length} day${expiredDates.length > 1 ? "s" : ""} expired (30-day window)`)}`
1407
1407
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccgather",
3
- "version": "2.0.26",
3
+ "version": "2.0.27",
4
4
  "description": "CLI tool for syncing Claude Code usage data to CCgather leaderboard",
5
5
  "bin": {
6
6
  "ccgather": "dist/index.js",