ccgather 2.0.26 → 2.0.28
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 +10 -21
- 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.28" : "0.0.0";
|
|
312
312
|
colors = {
|
|
313
313
|
primary: import_chalk.default.hex("#DA7756"),
|
|
314
314
|
// Claude coral
|
|
@@ -1373,35 +1373,24 @@ async function submit(options) {
|
|
|
1373
1373
|
expiredCost += prevData.cost;
|
|
1374
1374
|
}
|
|
1375
1375
|
});
|
|
1376
|
-
const lastSubmit = new Date(prev.lastSubmissionAt);
|
|
1377
|
-
const now = /* @__PURE__ */ new Date();
|
|
1378
|
-
const hoursDiff = Math.floor((now.getTime() - lastSubmit.getTime()) / (1e3 * 60 * 60));
|
|
1379
|
-
const daysDiff = Math.floor(hoursDiff / 24);
|
|
1380
|
-
const timeSince = daysDiff > 0 ? `${daysDiff}d ago` : hoursDiff > 0 ? `${hoursDiff}h ago` : "just now";
|
|
1381
1376
|
console.log(sectionHeader("\u{1F4C8}", "Since Last Submit"));
|
|
1382
1377
|
await sleep(40);
|
|
1383
1378
|
console.log();
|
|
1384
1379
|
const prevTokens = prev.totalTokens || 0;
|
|
1385
1380
|
const prevCost = prev.totalCost || 0;
|
|
1386
1381
|
console.log(
|
|
1387
|
-
` ${colors.
|
|
1382
|
+
` ${colors.dim(`Last : \u26A1 ${formatNumber(prevTokens)} \u2502 \u{1F4B0} ${formatCost(prevCost)}`)}`
|
|
1383
|
+
);
|
|
1384
|
+
await sleep(50);
|
|
1385
|
+
const tokenChange = usageData.totalTokens - prevTokens;
|
|
1386
|
+
const costChange = usageData.totalCost - prevCost;
|
|
1387
|
+
const tokenSign = tokenChange >= 0 ? "+" : "";
|
|
1388
|
+
const costSign = costChange >= 0 ? "+" : "";
|
|
1389
|
+
console.log(
|
|
1390
|
+
` ${colors.muted("Now :")} \u26A1 ${colors.primary(`${tokenSign}${formatNumber(tokenChange)}`)} ${colors.dim("\u2502")} \u{1F4B0} ${colors.warning(`${costSign}${formatCost(costChange)}`)}`
|
|
1388
1391
|
);
|
|
1389
1392
|
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);
|
|
1402
|
-
}
|
|
1403
1393
|
if (expiredDates.length > 0) {
|
|
1404
|
-
console.log();
|
|
1405
1394
|
console.log(
|
|
1406
1395
|
` ${colors.warning("\u26A0")} ${colors.dim(`${expiredDates.length} day${expiredDates.length > 1 ? "s" : ""} expired (30-day window)`)}`
|
|
1407
1396
|
);
|