@polka-codes/core 0.9.92 → 0.9.93

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2420,6 +2420,9 @@ var UsageMeter = class {
2420
2420
  let requestsWithCache = 0;
2421
2421
  for (const entry of entries) {
2422
2422
  const metadata = entry.metadata;
2423
+ if (typeof metadata !== "object" || metadata === null) {
2424
+ continue;
2425
+ }
2423
2426
  const cachedTokens = metadata.cachedPromptTokens ?? metadata.cacheReadTokens ?? metadata.prompt_cache_hit_tokens ?? 0;
2424
2427
  if (cachedTokens > 0) {
2425
2428
  totalCachedTokens += cachedTokens;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polka-codes/core",
3
- "version": "0.9.92",
3
+ "version": "0.9.93",
4
4
  "license": "AGPL-3.0",
5
5
  "author": "github@polka.codes",
6
6
  "type": "module",