ccgather 2.0.25 → 2.0.26
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 +18 -59
- 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.
|
|
311
|
+
VERSION = true ? "2.0.26" : "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
|
-
|
|
1384
|
+
const prevTokens = prev.totalTokens || 0;
|
|
1385
|
+
const prevCost = prev.totalCost || 0;
|
|
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))}`
|
|
1388
|
+
);
|
|
1385
1389
|
await sleep(50);
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
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(" ")}`);
|
|
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")}`);
|
|
1406
1401
|
await sleep(50);
|
|
1407
1402
|
}
|
|
1408
1403
|
if (expiredDates.length > 0) {
|
|
1409
1404
|
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
|
|
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
|
-
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
1408
|
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);
|