ccusage 15.9.2 → 15.9.3
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/_token-utils-WjkbrjKv.js +1 -8
- package/dist/{_types-B-1t4mxD.js → _types-C0oFKDO-.js} +497 -1082
- package/dist/calculate-cost-BDqO4yWA.js +0 -10
- package/dist/calculate-cost.d.ts +2 -2
- package/dist/calculate-cost.js +1 -1
- package/dist/{data-loader-PvTcFbip.d.ts → data-loader-B2FL7oh0.d.ts} +2 -2
- package/dist/{data-loader-KL1zbb-w.js → data-loader-B_nfl1Pr.js} +455 -1870
- package/dist/data-loader.d.ts +2 -2
- package/dist/data-loader.js +4 -4
- package/dist/debug-BoSgT8lp.js +109 -0
- package/dist/debug.js +5 -5
- package/dist/index.js +639 -2333
- package/dist/{logger-BrRa0CCy.js → logger-L_zzb0iT.js} +70 -267
- package/dist/logger.js +1 -1
- package/dist/{mcp-BBhsgnNL.js → mcp-Bqi6ayed.js} +1343 -4013
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +5 -5
- package/dist/{pricing-fetcher-C9P2YKDv.d.ts → pricing-fetcher-B5m_kEpz.d.ts} +1 -1
- package/dist/pricing-fetcher-ZrH9X6Xp.js +342 -0
- package/dist/pricing-fetcher.d.ts +1 -1
- package/dist/pricing-fetcher.js +3 -3
- package/dist/{prompt-lm8M58zJ.js → prompt-DsUFNEY7.js} +25 -49
- package/package.json +1 -1
- package/dist/debug-zMK0YYJP.js +0 -162
- package/dist/pricing-fetcher-DXFi0Cxk.js +0 -575
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calculates the total number of tokens across all token types
|
|
3
|
-
* Supports both raw usage data format and aggregated data format
|
|
4
|
-
* @param tokenCounts - Object containing counts for each token type
|
|
5
|
-
* @returns Total number of tokens
|
|
6
|
-
*/
|
|
7
1
|
function getTotalTokens(tokenCounts) {
|
|
8
|
-
const cacheCreation = "cacheCreationInputTokens" in tokenCounts ? tokenCounts.cacheCreationInputTokens : tokenCounts.cacheCreationTokens;
|
|
9
|
-
const cacheRead = "cacheReadInputTokens" in tokenCounts ? tokenCounts.cacheReadInputTokens : tokenCounts.cacheReadTokens;
|
|
2
|
+
const cacheCreation = "cacheCreationInputTokens" in tokenCounts ? tokenCounts.cacheCreationInputTokens : tokenCounts.cacheCreationTokens, cacheRead = "cacheReadInputTokens" in tokenCounts ? tokenCounts.cacheReadInputTokens : tokenCounts.cacheReadTokens;
|
|
10
3
|
return tokenCounts.inputTokens + tokenCounts.outputTokens + cacheCreation + cacheRead;
|
|
11
4
|
}
|
|
12
5
|
export { getTotalTokens };
|