claude-code-cache-fix 1.6.2 → 1.6.3

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/package.json +4 -1
  2. package/preload.mjs +29 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-cache-fix",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "description": "Fixes prompt cache regression in Claude Code that causes up to 20x cost increase on resumed sessions",
5
5
  "type": "module",
6
6
  "exports": "./preload.mjs",
@@ -12,6 +12,9 @@
12
12
  "engines": {
13
13
  "node": ">=18"
14
14
  },
15
+ "scripts": {
16
+ "test": "node --test 'test/**/*.test.mjs'"
17
+ },
15
18
  "keywords": [
16
19
  "claude-code",
17
20
  "claude",
package/preload.mjs CHANGED
@@ -648,6 +648,7 @@ function dumpGrowthBookFlags() {
648
648
  cold_compact: features.tengu_cold_compact,
649
649
  system_prompt_global_cache: features.tengu_system_prompt_global_cache,
650
650
  compact_cache_prefix: features.tengu_compact_cache_prefix,
651
+ onyx_plover: features.tengu_onyx_plover,
651
652
  };
652
653
  debugLog("GROWTHBOOK FLAGS:", JSON.stringify(interesting, null, 2));
653
654
  } catch (e) {
@@ -1240,3 +1241,31 @@ async function drainTTLFromClone(clone, model, quotaHeaders) {
1240
1241
  }
1241
1242
  }
1242
1243
  }
1244
+
1245
+ // --------------------------------------------------------------------------
1246
+ // Test exports
1247
+ // --------------------------------------------------------------------------
1248
+ //
1249
+ // These exports exist for unit testing the pure functions in this file. They
1250
+ // have no effect on the interceptor's runtime behavior — production callers
1251
+ // load this module via NODE_OPTIONS=--import and never use named imports.
1252
+ // Tests import from this file directly: `import { sortSkillsBlock } from
1253
+ // '../preload.mjs'`. The fetch patching above runs at import time but is
1254
+ // harmless in a test process since tests do not make fetch calls.
1255
+
1256
+ export {
1257
+ sortSkillsBlock,
1258
+ sortDeferredToolsBlock,
1259
+ pinBlockContent,
1260
+ stripSessionKnowledge,
1261
+ stabilizeFingerprint,
1262
+ computeFingerprint,
1263
+ isSkillsBlock,
1264
+ isDeferredToolsBlock,
1265
+ isHooksBlock,
1266
+ isMcpBlock,
1267
+ isRelocatableBlock,
1268
+ rewriteOutputEfficiencyInstruction,
1269
+ normalizeOutputEfficiencyReplacement,
1270
+ _pinnedBlocks, // exported so tests can reset between runs
1271
+ };