@polka-codes/cli-shared 0.9.34 → 0.9.35
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 +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -38267,10 +38267,10 @@ class UsageMeter {
|
|
|
38267
38267
|
};
|
|
38268
38268
|
const usage = "totalUsage" in resp ? resp.totalUsage : resp.usage;
|
|
38269
38269
|
const result = this.#calculageUsage(usage, resp.providerMetadata, modelInfo);
|
|
38270
|
-
this.#totals.input += result.input;
|
|
38271
|
-
this.#totals.output += result.output;
|
|
38272
|
-
this.#totals.cachedRead += result.cachedRead;
|
|
38273
|
-
this.#totals.cost += result.cost;
|
|
38270
|
+
this.#totals.input += result.input || 0;
|
|
38271
|
+
this.#totals.output += result.output || 0;
|
|
38272
|
+
this.#totals.cachedRead += result.cachedRead || 0;
|
|
38273
|
+
this.#totals.cost += result.cost || 0;
|
|
38274
38274
|
this.#totals.messageCount += 1;
|
|
38275
38275
|
}
|
|
38276
38276
|
setUsage(newUsage) {
|