ccgather 2.0.25 → 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 +20 -61
  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.25" : "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
@@ -1381,72 +1381,31 @@ async function submit(options) {
1381
1381
  console.log(sectionHeader("\u{1F4C8}", "Since Last Submit"));
1382
1382
  await sleep(40);
1383
1383
  console.log();
1384
- console.log(` ${colors.muted("Last submitted:")} ${colors.dim(timeSince)}`);
1384
+ const prevTokens = prev.totalTokens || 0;
1385
+ const prevCost = prev.totalCost || 0;
1386
+ console.log(
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
+ );
1385
1389
  await sleep(50);
1386
- console.log();
1387
- if (newTokens > 0 || updatedDates.length > 0) {
1388
- const parts = [];
1389
- if (newTokens > 0) {
1390
- parts.push(colors.success(`+${formatNumber(newTokens)}`));
1391
- parts.push(colors.success(`+${formatCost(newCost)}`));
1392
- }
1393
- if (newDates.length > 0) {
1394
- parts.push(
1395
- colors.primary(`+${newDates.length} new day${newDates.length > 1 ? "s" : ""}`)
1396
- );
1397
- }
1398
- if (updatedDates.length > 0 && newDates.length === 0) {
1399
- parts.push(
1400
- colors.primary(
1401
- `${updatedDates.length} day${updatedDates.length > 1 ? "s" : ""} updated`
1402
- )
1403
- );
1404
- }
1405
- console.log(` ${parts.join(" ")}`);
1406
- 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(")")}`;
1407
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);
1408
1404
  if (expiredDates.length > 0) {
1409
- console.log();
1410
- await sleep(40);
1411
1405
  console.log(
1412
- ` ${colors.warning("\u26A0")} ${colors.dim(`${expiredDates.length} day${expiredDates.length > 1 ? "s" : ""} expired (30-day limit): -${formatNumber(expiredTokens)}`)}`
1406
+ ` ${colors.warning("\u26A0")} ${colors.dim(`${expiredDates.length} day${expiredDates.length > 1 ? "s" : ""} expired (30-day window)`)}`
1413
1407
  );
1414
- await sleep(50);
1415
- }
1416
- if (newDates.length > 0) {
1417
- console.log();
1418
1408
  await sleep(40);
1419
- const displayDates = newDates.slice(-5);
1420
- if (newDates.length > 5) {
1421
- console.log(` ${colors.dim(`... and ${newDates.length - 5} more days`)}`);
1422
- await sleep(40);
1423
- }
1424
- for (const d of displayDates) {
1425
- const dateStr = d.date.slice(5).replace("-", "/");
1426
- console.log(
1427
- ` ${colors.dim("\u2022")} ${colors.white(dateStr)}: ${colors.success(`+${formatNumber(d.tokens)}`)} ${colors.dim(`(${formatCost(d.cost)})`)}`
1428
- );
1429
- await sleep(40);
1430
- }
1431
- }
1432
- if (updatedDates.length > 0 && newDates.length === 0) {
1433
- console.log();
1434
- await sleep(40);
1435
- for (const d of updatedDates.slice(-3)) {
1436
- const prevData = previousDailyMap.get(d.date);
1437
- if (prevData) {
1438
- const dateStr = d.date.slice(5).replace("-", "/");
1439
- const tokenIncrease = d.tokens - prevData.tokens;
1440
- console.log(
1441
- ` ${colors.dim("\u2022")} ${colors.white(dateStr)}: ${formatNumber(prevData.tokens)} \u2192 ${formatNumber(d.tokens)} ${colors.success(`(+${formatNumber(tokenIncrease)})`)}`
1442
- );
1443
- await sleep(40);
1444
- }
1445
- }
1446
- }
1447
- if (newTokens === 0 && updatedDates.length === 0 && expiredDates.length === 0) {
1448
- console.log(` ${colors.dim("No changes since last submission")}`);
1449
- await sleep(50);
1450
1409
  }
1451
1410
  console.log();
1452
1411
  await sleep(60);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccgather",
3
- "version": "2.0.25",
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",