dsh-context-compression-improved 0.14.0 → 0.14.1
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/package.json +1 -1
- package/packages/selector/dsh.plugin.json +1 -1
- package/packages/selector/lib/profiles.d.ts +9 -0
- package/packages/selector/lib/pruner.js +2 -2
- package/packages/selector/package.json +1 -1
- package/packages/selector/src/profiles.ts +9 -0
- package/packages/selector/src/runtime/fold-router.ts +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-external/dsh-context-compression-improved",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"description": "Token-saving, auditable tool-result context-compression selector with code-skeleton gate for DeepSeek Harness — fewer tokens on every turn",
|
|
6
6
|
"engines": {
|
|
@@ -157,6 +157,15 @@ interface ContextCompressionSettings {
|
|
|
157
157
|
* 0 disables the check. Default 1000.
|
|
158
158
|
*/
|
|
159
159
|
minNetGain?: number;
|
|
160
|
+
/**
|
|
161
|
+
* F8 (v0.14.5): Zero-copy mode — when true, no fallback copies are written;
|
|
162
|
+
* retrieve reads only from the session log. Default false (v0.14), true (v0.15+).
|
|
163
|
+
*/
|
|
164
|
+
zeroCopy?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* F19 (v0.14.6): Enable self-update pre-download checking.
|
|
167
|
+
*/
|
|
168
|
+
updateCheck?: boolean;
|
|
160
169
|
}
|
|
161
170
|
//#endregion
|
|
162
171
|
export { PresetOptionsSettings as i, ContextCompressionSettings as n, CustomCompressionPolicy as r, CompressionProfile as t };
|
|
@@ -3160,9 +3160,9 @@ function foldTier(inputTokens) {
|
|
|
3160
3160
|
return inputTokens <= FOLD_TIER_LIMITS.strataMax ? "strata" : "local35";
|
|
3161
3161
|
}
|
|
3162
3162
|
const FOLD_SYSTEM = "You are writing a short connective narrative for a durable context card. Summarize ONLY the material given below: what was attempted and what was concluded, in 2-6 bullets. The card already contains verbatim error lines, file manifests, and code skeletons that were DELIBERATELY withheld from you. Never restate, guess, or reconstitute withheld output; never add facts not present in the material. Output only the bullets.";
|
|
3163
|
-
/** Rough meter aligned with the replay corpus estimator (CJK-aware). */
|
|
3163
|
+
/** Rough meter aligned with the replay corpus estimator (CJK-aware, F9 fix: all CJK ranges). */
|
|
3164
3164
|
function foldTokens(text) {
|
|
3165
|
-
const cjk = (text.match(/[\u4e00-\u9fff]/g) ?? []).length;
|
|
3165
|
+
const cjk = (text.match(/[\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uac00-\ud7af]/g) ?? []).length;
|
|
3166
3166
|
return Math.ceil(cjk / 1.5 + (text.length - cjk) / 4);
|
|
3167
3167
|
}
|
|
3168
3168
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-context-compression-improved",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "Token-saving context-compression selector bundle for DeepSeek Harness — fewer tool-result tokens on every turn, fully auditable",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -457,6 +457,15 @@ export interface ContextCompressionSettings {
|
|
|
457
457
|
* 0 disables the check. Default 1000.
|
|
458
458
|
*/
|
|
459
459
|
minNetGain?: number
|
|
460
|
+
/**
|
|
461
|
+
* F8 (v0.14.5): Zero-copy mode — when true, no fallback copies are written;
|
|
462
|
+
* retrieve reads only from the session log. Default false (v0.14), true (v0.15+).
|
|
463
|
+
*/
|
|
464
|
+
zeroCopy?: boolean
|
|
465
|
+
/**
|
|
466
|
+
* F19 (v0.14.6): Enable self-update pre-download checking.
|
|
467
|
+
*/
|
|
468
|
+
updateCheck?: boolean
|
|
460
469
|
}
|
|
461
470
|
|
|
462
471
|
/**
|
|
@@ -52,9 +52,10 @@ export interface FoldPrompt {
|
|
|
52
52
|
readonly inputTokens: number
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
/** Rough meter aligned with the replay corpus estimator (CJK-aware). */
|
|
55
|
+
/** Rough meter aligned with the replay corpus estimator (CJK-aware, F9 fix: all CJK ranges). */
|
|
56
56
|
function foldTokens(text: string): number {
|
|
57
|
-
|
|
57
|
+
// F9 (v0.14.5): cover CJK Unified + Extension A + Kana + Hangul
|
|
58
|
+
const cjk = (text.match(/[\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uac00-\ud7af]/g) ?? []).length
|
|
58
59
|
return Math.ceil(cjk / 1.5 + (text.length - cjk) / 4)
|
|
59
60
|
}
|
|
60
61
|
|