dsh-context-compression-improved 0.13.3 → 0.13.4
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-external/dsh-context-compression-improved",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.4",
|
|
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": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-context-compression-improved",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.4",
|
|
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",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PTC disclosurePolicy awareness (F5).
|
|
3
|
+
*
|
|
4
|
+
* Plan: cci-longterm-refactor v0.13.5
|
|
5
|
+
*
|
|
6
|
+
* When the host preset uses disclosurePolicy='full', the first-turn schema
|
|
7
|
+
* is already ~30K tokens (dsh-ops #994 evidence). Aggressive tool-result
|
|
8
|
+
* trimming becomes less necessary because the per-request token overhead is
|
|
9
|
+
* dominated by schema, not tool output.
|
|
10
|
+
*
|
|
11
|
+
* This module provides the adjustment function: full → historyMinReclaim × 1.2.
|
|
12
|
+
*
|
|
13
|
+
* @module dsh-context-compression-improved/runtime/ptc-disclosure
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export type DisclosurePolicy = 'on-demand' | 'full' | undefined
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Compute the effective minReclaim based on disclosure policy.
|
|
20
|
+
* Under 'full', schema already eats the budget → relax tool-result aging by 20%.
|
|
21
|
+
*
|
|
22
|
+
* @param baseMinReclaim - The profile's base minReclaim in tokens
|
|
23
|
+
* @param policy - The disclosure policy as read from the host (undefined = unknown/old host)
|
|
24
|
+
* @returns The effective minReclaim value
|
|
25
|
+
*/
|
|
26
|
+
export function effectiveMinReclaim(baseMinReclaim: number, policy: DisclosurePolicy): number {
|
|
27
|
+
if (policy === 'full') {
|
|
28
|
+
return Math.round(baseMinReclaim * 1.2)
|
|
29
|
+
}
|
|
30
|
+
// 'on-demand' or undefined (old host) → no change
|
|
31
|
+
return baseMinReclaim
|
|
32
|
+
}
|