@liyang8246/dsh-codetime 0.1.8 → 0.1.9

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/lib/index.js +8 -5
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -1303,14 +1303,17 @@ var SessionFolder = class {
1303
1303
  const modelBucket = this.modelBucket(accumulator, time, model);
1304
1304
  modelBucket.callCount += 1;
1305
1305
  if (usage) {
1306
+ const cacheRead = usage.cacheReadTokens ?? 0;
1307
+ const cacheWrite = usage.cacheWriteTokens ?? 0;
1308
+ const inputTokens = usage.inputTokens + cacheRead + cacheWrite;
1306
1309
  const tokens = {
1307
- inputTokens: usage.inputTokens,
1308
- cachedInputTokens: 0,
1309
- cacheCreationInputTokens: usage.cacheWriteTokens ?? 0,
1310
- cacheReadInputTokens: usage.cacheReadTokens ?? 0,
1310
+ inputTokens,
1311
+ cachedInputTokens: cacheRead + cacheWrite,
1312
+ cacheCreationInputTokens: cacheWrite,
1313
+ cacheReadInputTokens: cacheRead,
1311
1314
  outputTokens: usage.outputTokens,
1312
1315
  reasoningOutputTokens: usage.reasoningTokens ?? 0,
1313
- totalTokens: usage.totalTokens ?? usage.inputTokens + usage.outputTokens
1316
+ totalTokens: usage.totalTokens ?? inputTokens + usage.outputTokens
1314
1317
  };
1315
1318
  addTokens(modelRollup, tokens);
1316
1319
  addTokens(modelBucket, tokens);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@liyang8246/dsh-codetime",
3
3
  "type": "module",
4
- "version": "0.1.8",
4
+ "version": "0.1.9",
5
5
  "description": "Report DeepSeek Harness coding activity to codetime.dev; set the upload token in Settings.",
6
6
  "repository": { "type": "git", "url": "https://github.com/liyang8246/dsh-zolin.git", "directory": "packages/dsh-codetime" },
7
7
  "exports": {