claude-code-cache-fix 3.5.3 → 3.5.5
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.
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Third-Party Licenses
|
|
2
|
+
====================
|
|
3
|
+
|
|
4
|
+
1. claude-usage-dashboard — NDJSON proxy log schema
|
|
5
|
+
|
|
6
|
+
Source: https://github.com/fgrosswig/claude-usage-dashboard
|
|
7
|
+
Author: Falk Grosswig (@fgrosswig)
|
|
8
|
+
License: Apache License 2.0
|
|
9
|
+
|
|
10
|
+
The proxy NDJSON log schema used by tools/usage-to-dashboard-ndjson.mjs
|
|
11
|
+
(field names, structure, file naming convention, cache_health semantics,
|
|
12
|
+
and cost_factor methodology) originates from the claude-usage-dashboard.
|
|
13
|
+
|
|
14
|
+
Used under the Apache License, Version 2.0.
|
|
15
|
+
https://www.apache.org/licenses/LICENSE-2.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-cache-fix",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.5",
|
|
4
4
|
"description": "Cache optimization proxy and interceptor for Claude Code. Fixes prompt cache bugs, stabilizes prefix, reduces quota burn.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./preload.mjs",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"claude-fixed.bat",
|
|
16
16
|
"proxy/",
|
|
17
17
|
"bin/",
|
|
18
|
-
"templates/"
|
|
18
|
+
"templates/",
|
|
19
|
+
"THIRD_PARTY_LICENSES"
|
|
19
20
|
],
|
|
20
21
|
"engines": {
|
|
21
22
|
"node": ">=18"
|
|
@@ -71,11 +71,15 @@ function parseHeaders(headers) {
|
|
|
71
71
|
const overage_status = get("anthropic-ratelimit-unified-overage-status");
|
|
72
72
|
const overage_util = num("anthropic-ratelimit-unified-overage-utilization");
|
|
73
73
|
const overage_reset = parseInt(get("anthropic-ratelimit-unified-overage-reset")) || 0;
|
|
74
|
+
const unified_reset = parseInt(get("anthropic-ratelimit-unified-reset")) || 0;
|
|
74
75
|
const fallback_pct = get("anthropic-ratelimit-unified-fallback-percentage");
|
|
75
76
|
const representative = get("anthropic-ratelimit-unified-representative-claim");
|
|
76
77
|
const surpassed = get("anthropic-ratelimit-unified-7d-surpassed-threshold");
|
|
77
78
|
|
|
78
|
-
|
|
79
|
+
// Accept any reset timestamp — accounts without 5h/7d quota windows (overage
|
|
80
|
+
// billing) return anthropic-ratelimit-unified-reset and/or
|
|
81
|
+
// anthropic-ratelimit-unified-overage-reset instead.
|
|
82
|
+
if (!q5h_reset && !q7d_reset && !unified_reset && !overage_reset) return null;
|
|
79
83
|
|
|
80
84
|
const now = new Date();
|
|
81
85
|
const hour = now.getUTCHours();
|
|
@@ -82,8 +82,13 @@
|
|
|
82
82
|
* ANTHROPIC_PROXY_LOG_DIR Override output directory (matches fgrosswig's
|
|
83
83
|
* dashboard env var so both tools stay in sync).
|
|
84
84
|
*
|
|
85
|
-
* Part of claude-code-cache-fix.
|
|
85
|
+
* Part of claude-code-cache-fix.
|
|
86
86
|
* https://github.com/cnighswonger/claude-code-cache-fix
|
|
87
|
+
*
|
|
88
|
+
* The NDJSON proxy log schema (field names, structure, file naming convention,
|
|
89
|
+
* cache_health semantics) originates from fgrosswig/claude-usage-dashboard
|
|
90
|
+
* and is used under the Apache License 2.0.
|
|
91
|
+
* https://github.com/fgrosswig/claude-usage-dashboard
|
|
87
92
|
*/
|
|
88
93
|
|
|
89
94
|
import { readFileSync, writeFileSync, appendFileSync, existsSync, mkdirSync, statSync, watch } from 'node:fs';
|