ccgather 2.0.6 → 2.0.7
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 +28 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -329,7 +329,7 @@ var init_ui = __esm({
|
|
|
329
329
|
"use strict";
|
|
330
330
|
import_chalk = __toESM(require("chalk"));
|
|
331
331
|
import_string_width = __toESM(require("string-width"));
|
|
332
|
-
VERSION = true ? "2.0.
|
|
332
|
+
VERSION = true ? "2.0.7" : "0.0.0";
|
|
333
333
|
colors = {
|
|
334
334
|
primary: import_chalk.default.hex("#DA7756"),
|
|
335
335
|
// Claude coral
|
|
@@ -1369,6 +1369,33 @@ async function submit(options) {
|
|
|
1369
1369
|
const lineLength = 40 - text.length;
|
|
1370
1370
|
return ` ${colors.white.bold(text)}${colors.dim("\u2500".repeat(Math.max(0, lineLength)))}`;
|
|
1371
1371
|
};
|
|
1372
|
+
if (result.previous) {
|
|
1373
|
+
const prev = result.previous;
|
|
1374
|
+
const tokenDiff = usageData.totalTokens - prev.totalTokens;
|
|
1375
|
+
const costDiff = usageData.totalCost - prev.totalCost;
|
|
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
|
+
console.log(sectionHeader("\u{1F4C8}", "Since Last Submit"));
|
|
1382
|
+
console.log();
|
|
1383
|
+
console.log(` ${colors.muted("Last submitted:")} ${colors.dim(timeSince)}`);
|
|
1384
|
+
if (tokenDiff > 0) {
|
|
1385
|
+
console.log(
|
|
1386
|
+
` ${colors.muted("New tokens:")} ${colors.success(`+${formatNumber(tokenDiff)}`)}`
|
|
1387
|
+
);
|
|
1388
|
+
}
|
|
1389
|
+
if (costDiff > 0) {
|
|
1390
|
+
console.log(
|
|
1391
|
+
` ${colors.muted("New spending:")} ${colors.success(`+${formatCost(costDiff)}`)}`
|
|
1392
|
+
);
|
|
1393
|
+
}
|
|
1394
|
+
if (tokenDiff === 0 && costDiff === 0) {
|
|
1395
|
+
console.log(` ${colors.dim("No new usage since last submission")}`);
|
|
1396
|
+
}
|
|
1397
|
+
console.log();
|
|
1398
|
+
}
|
|
1372
1399
|
if (result.rank || result.countryRank) {
|
|
1373
1400
|
console.log();
|
|
1374
1401
|
console.log(sectionHeader("\u{1F4CA}", "Your Ranking"));
|