ccgather 2.0.13 → 2.0.14
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 +12 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -140,7 +140,10 @@ function formatNumber(num) {
|
|
|
140
140
|
return num.toLocaleString();
|
|
141
141
|
}
|
|
142
142
|
function formatCost(cost) {
|
|
143
|
-
|
|
143
|
+
if (cost >= 1e9) return `$${(cost / 1e9).toFixed(2)}B`;
|
|
144
|
+
if (cost >= 1e6) return `$${(cost / 1e6).toFixed(2)}M`;
|
|
145
|
+
if (cost >= 1e3) return `$${(cost / 1e3).toFixed(2)}K`;
|
|
146
|
+
return `$${cost.toFixed(2)}`;
|
|
144
147
|
}
|
|
145
148
|
function getLevelInfo(tokens) {
|
|
146
149
|
for (let i = LEVELS.length - 1; i >= 0; i--) {
|
|
@@ -295,7 +298,7 @@ var init_ui = __esm({
|
|
|
295
298
|
"use strict";
|
|
296
299
|
import_chalk = __toESM(require("chalk"));
|
|
297
300
|
import_string_width = __toESM(require("string-width"));
|
|
298
|
-
VERSION = true ? "2.0.
|
|
301
|
+
VERSION = true ? "2.0.14" : "0.0.0";
|
|
299
302
|
colors = {
|
|
300
303
|
primary: import_chalk.default.hex("#DA7756"),
|
|
301
304
|
// Claude coral
|
|
@@ -1294,21 +1297,21 @@ async function submit(options) {
|
|
|
1294
1297
|
const levelProgress = getLevelProgress(usageData.totalTokens);
|
|
1295
1298
|
const currentLevel = levelProgress.current;
|
|
1296
1299
|
const summaryLines = [
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
`${
|
|
1300
|
+
`${colors.muted("Total Cost")} \u{1F4B0}${colors.success(formatCost(usageData.totalCost))}`,
|
|
1301
|
+
`${colors.muted("Total Tokens")} \u26A1${colors.primary(formatNumber(usageData.totalTokens))}`,
|
|
1302
|
+
`${colors.muted("Period")} \u{1F4C5}${colors.warning(daysTrackedDisplay)}`,
|
|
1303
|
+
`${colors.muted("Level")} ${currentLevel.icon}${currentLevel.color(`${currentLevel.name}`)}`
|
|
1301
1304
|
];
|
|
1302
1305
|
if (usageData.ccplan) {
|
|
1303
1306
|
const planColor = getPlanColor(usageData.ccplan);
|
|
1304
|
-
const planIcon = usageData.ccplan.toLowerCase() === "max" ? "\u{1F680}" : "
|
|
1307
|
+
const planIcon = usageData.ccplan.toLowerCase() === "max" ? "\u{1F680}" : "";
|
|
1305
1308
|
summaryLines.push(
|
|
1306
|
-
`${
|
|
1309
|
+
`${colors.muted("Plan")} ${planIcon}${planColor(usageData.ccplan.toUpperCase())}`
|
|
1307
1310
|
);
|
|
1308
1311
|
}
|
|
1309
1312
|
if (usageData.hasOpusUsage) {
|
|
1310
1313
|
summaryLines.push(
|
|
1311
|
-
|
|
1314
|
+
`${colors.muted("Models")} ${colors.max("\u2726Opus User")}`
|
|
1312
1315
|
);
|
|
1313
1316
|
}
|
|
1314
1317
|
console.log(createBox(summaryLines));
|