ccgather 2.0.21 → 2.0.23
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/dist/index.js +36 -22
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -107,15 +107,19 @@ function createProfessionalHeader() {
|
|
|
107
107
|
);
|
|
108
108
|
return lines;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
const paddedLines = lines.map((line) => {
|
|
112
|
-
const visibleLength = getDisplayWidth(line);
|
|
113
|
-
const padding = width - 2 - visibleLength;
|
|
114
|
-
return `${box.vertical} ${line}${" ".repeat(Math.max(0, padding))} ${box.vertical}`;
|
|
115
|
-
});
|
|
110
|
+
async function printAnimatedBox(lines, width = 47, lineDelay = 60) {
|
|
116
111
|
const top = colors.dim(` ${box.topLeft}${box.horizontal.repeat(width)}${box.topRight}`);
|
|
117
112
|
const bottom = colors.dim(` ${box.bottomLeft}${box.horizontal.repeat(width)}${box.bottomRight}`);
|
|
118
|
-
|
|
113
|
+
console.log(top);
|
|
114
|
+
await sleep(lineDelay / 2);
|
|
115
|
+
for (const line of lines) {
|
|
116
|
+
const visibleLength = getDisplayWidth(line);
|
|
117
|
+
const padding = width - 2 - visibleLength;
|
|
118
|
+
const paddedLine = `${box.vertical} ${line}${" ".repeat(Math.max(0, padding))} ${box.vertical}`;
|
|
119
|
+
console.log(colors.dim(" ") + paddedLine);
|
|
120
|
+
await sleep(lineDelay);
|
|
121
|
+
}
|
|
122
|
+
console.log(bottom);
|
|
119
123
|
}
|
|
120
124
|
function _stripAnsi(str) {
|
|
121
125
|
return str.replace(/\x1B\[[0-9;]*[a-zA-Z]/g, "");
|
|
@@ -304,7 +308,7 @@ var init_ui = __esm({
|
|
|
304
308
|
"use strict";
|
|
305
309
|
import_chalk = __toESM(require("chalk"));
|
|
306
310
|
import_string_width = __toESM(require("string-width"));
|
|
307
|
-
VERSION = true ? "2.0.
|
|
311
|
+
VERSION = true ? "2.0.23" : "0.0.0";
|
|
308
312
|
colors = {
|
|
309
313
|
primary: import_chalk.default.hex("#DA7756"),
|
|
310
314
|
// Claude coral
|
|
@@ -1281,15 +1285,15 @@ async function submit(options) {
|
|
|
1281
1285
|
color: "cyan",
|
|
1282
1286
|
indent: 2
|
|
1283
1287
|
}).start();
|
|
1284
|
-
await sleep(300);
|
|
1285
1288
|
if (!scannedData) {
|
|
1289
|
+
await sleep(400);
|
|
1286
1290
|
processSpinner.fail(colors.error("No usage data found."));
|
|
1287
1291
|
console.log(` ${colors.muted("Make sure you have used Claude Code at least once.")}
|
|
1288
1292
|
`);
|
|
1289
1293
|
process.exit(1);
|
|
1290
1294
|
}
|
|
1291
1295
|
const usageData = ccgatherToUsageData(scannedData);
|
|
1292
|
-
await sleep(
|
|
1296
|
+
await sleep(800);
|
|
1293
1297
|
processSpinner.succeed(colors.success("Scan complete!"));
|
|
1294
1298
|
console.log();
|
|
1295
1299
|
const formatDate = (dateStr) => {
|
|
@@ -1318,11 +1322,9 @@ async function submit(options) {
|
|
|
1318
1322
|
);
|
|
1319
1323
|
}
|
|
1320
1324
|
if (usageData.hasOpusUsage) {
|
|
1321
|
-
summaryLines.push(
|
|
1322
|
-
`${colors.muted("Models")} ${colors.max("\u2726 Opus User")}`
|
|
1323
|
-
);
|
|
1325
|
+
summaryLines.push(`${colors.muted("Models")} ${colors.max("\u2726 Opus User")}`);
|
|
1324
1326
|
}
|
|
1325
|
-
|
|
1327
|
+
await printAnimatedBox(summaryLines, 52, 60);
|
|
1326
1328
|
console.log();
|
|
1327
1329
|
const projectCount = Object.keys(scannedData.projects).length;
|
|
1328
1330
|
console.log(
|
|
@@ -1384,8 +1386,10 @@ async function submit(options) {
|
|
|
1384
1386
|
const daysDiff = Math.floor(hoursDiff / 24);
|
|
1385
1387
|
const timeSince = daysDiff > 0 ? `${daysDiff}d ago` : hoursDiff > 0 ? `${hoursDiff}h ago` : "just now";
|
|
1386
1388
|
console.log(sectionHeader("\u{1F4C8}", "Since Last Submit"));
|
|
1389
|
+
await sleep(40);
|
|
1387
1390
|
console.log();
|
|
1388
1391
|
console.log(` ${colors.muted("Last submitted:")} ${colors.dim(timeSince)}`);
|
|
1392
|
+
await sleep(50);
|
|
1389
1393
|
console.log();
|
|
1390
1394
|
if (newTokens > 0 || updatedDates.length > 0) {
|
|
1391
1395
|
const parts = [];
|
|
@@ -1406,29 +1410,36 @@ async function submit(options) {
|
|
|
1406
1410
|
);
|
|
1407
1411
|
}
|
|
1408
1412
|
console.log(` ${parts.join(" ")}`);
|
|
1413
|
+
await sleep(50);
|
|
1409
1414
|
}
|
|
1410
1415
|
if (expiredDates.length > 0) {
|
|
1411
1416
|
console.log();
|
|
1417
|
+
await sleep(40);
|
|
1412
1418
|
console.log(
|
|
1413
1419
|
` ${colors.warning("\u26A0")} ${colors.dim(`${expiredDates.length} day${expiredDates.length > 1 ? "s" : ""} expired (30-day limit): -${formatNumber(expiredTokens)}`)}`
|
|
1414
1420
|
);
|
|
1421
|
+
await sleep(50);
|
|
1415
1422
|
}
|
|
1416
1423
|
if (newDates.length > 0) {
|
|
1417
1424
|
console.log();
|
|
1425
|
+
await sleep(40);
|
|
1418
1426
|
const displayDates = newDates.slice(-5);
|
|
1419
1427
|
if (newDates.length > 5) {
|
|
1420
1428
|
console.log(` ${colors.dim(`... and ${newDates.length - 5} more days`)}`);
|
|
1429
|
+
await sleep(40);
|
|
1421
1430
|
}
|
|
1422
|
-
|
|
1431
|
+
for (const d of displayDates) {
|
|
1423
1432
|
const dateStr = d.date.slice(5).replace("-", "/");
|
|
1424
1433
|
console.log(
|
|
1425
1434
|
` ${colors.dim("\u2022")} ${colors.white(dateStr)}: ${colors.success(`+${formatNumber(d.tokens)}`)} ${colors.dim(`(${formatCost(d.cost)})`)}`
|
|
1426
1435
|
);
|
|
1427
|
-
|
|
1436
|
+
await sleep(40);
|
|
1437
|
+
}
|
|
1428
1438
|
}
|
|
1429
1439
|
if (updatedDates.length > 0 && newDates.length === 0) {
|
|
1430
1440
|
console.log();
|
|
1431
|
-
|
|
1441
|
+
await sleep(40);
|
|
1442
|
+
for (const d of updatedDates.slice(-3)) {
|
|
1432
1443
|
const prevData = previousDailyMap.get(d.date);
|
|
1433
1444
|
if (prevData) {
|
|
1434
1445
|
const dateStr = d.date.slice(5).replace("-", "/");
|
|
@@ -1436,13 +1447,16 @@ async function submit(options) {
|
|
|
1436
1447
|
console.log(
|
|
1437
1448
|
` ${colors.dim("\u2022")} ${colors.white(dateStr)}: ${formatNumber(prevData.tokens)} \u2192 ${formatNumber(d.tokens)} ${colors.success(`(+${formatNumber(tokenIncrease)})`)}`
|
|
1438
1449
|
);
|
|
1450
|
+
await sleep(40);
|
|
1439
1451
|
}
|
|
1440
|
-
}
|
|
1452
|
+
}
|
|
1441
1453
|
}
|
|
1442
1454
|
if (newTokens === 0 && updatedDates.length === 0 && expiredDates.length === 0) {
|
|
1443
1455
|
console.log(` ${colors.dim("No changes since last submission")}`);
|
|
1456
|
+
await sleep(50);
|
|
1444
1457
|
}
|
|
1445
1458
|
console.log();
|
|
1459
|
+
await sleep(60);
|
|
1446
1460
|
const rankSpinner = (0, import_ora2.default)({
|
|
1447
1461
|
text: colors.dim("Calculating ranking..."),
|
|
1448
1462
|
color: "cyan"
|
|
@@ -1470,11 +1484,11 @@ async function submit(options) {
|
|
|
1470
1484
|
console.log();
|
|
1471
1485
|
const previousTokens = result.previous?.totalTokens || 0;
|
|
1472
1486
|
const previousLevelInfo = getLevelProgress(previousTokens);
|
|
1473
|
-
const
|
|
1474
|
-
const
|
|
1487
|
+
const previousLevelNum = previousLevelInfo.current.level;
|
|
1488
|
+
const serverLevel = result.currentLevel || currentLevel.level;
|
|
1475
1489
|
let levelChangeText = "";
|
|
1476
|
-
if (previousTokens > 0 &&
|
|
1477
|
-
const levelChange =
|
|
1490
|
+
if (previousTokens > 0 && serverLevel > previousLevelNum) {
|
|
1491
|
+
const levelChange = serverLevel - previousLevelNum;
|
|
1478
1492
|
levelChangeText = ` ${colors.success(`\u2191${levelChange}`)}`;
|
|
1479
1493
|
}
|
|
1480
1494
|
await sleep(200);
|