claude-scope 0.8.32 → 0.8.33
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/claude-scope.cjs +10 -7
- package/package.json +1 -1
package/dist/claude-scope.cjs
CHANGED
|
@@ -2752,13 +2752,16 @@ var init_cache_metrics_widget = __esm({
|
|
|
2752
2752
|
}
|
|
2753
2753
|
this.lastSessionId = data.session_id;
|
|
2754
2754
|
const usage = data.context_window?.current_usage;
|
|
2755
|
-
if (usage &&
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2755
|
+
if (usage && !sessionChanged) {
|
|
2756
|
+
const hasAnyTokens = (usage.input_tokens ?? 0) > 0 || (usage.output_tokens ?? 0) > 0 || (usage.cache_creation_input_tokens ?? 0) > 0 || (usage.cache_read_input_tokens ?? 0) > 0;
|
|
2757
|
+
if (hasAnyTokens) {
|
|
2758
|
+
this.cacheManager.setCachedUsage(data.session_id, {
|
|
2759
|
+
input_tokens: usage.input_tokens,
|
|
2760
|
+
output_tokens: usage.output_tokens,
|
|
2761
|
+
cache_creation_input_tokens: usage.cache_creation_input_tokens,
|
|
2762
|
+
cache_read_input_tokens: usage.cache_read_input_tokens
|
|
2763
|
+
});
|
|
2764
|
+
}
|
|
2762
2765
|
}
|
|
2763
2766
|
const metrics = this.calculateMetrics(data);
|
|
2764
2767
|
this.renderData = metrics ?? void 0;
|