dsh-context-compression-improved 0.8.0 → 0.9.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 (172) hide show
  1. package/.gitattributes +2 -2
  2. package/.githooks/pre-push +37 -37
  3. package/.github/workflows/ci.yml +39 -39
  4. package/CHANGELOG.de.md +41 -0
  5. package/CHANGELOG.es.md +41 -0
  6. package/CHANGELOG.fr.md +42 -0
  7. package/CHANGELOG.it.md +41 -0
  8. package/CHANGELOG.ja.md +35 -0
  9. package/CHANGELOG.ko.md +34 -0
  10. package/CHANGELOG.md +96 -0
  11. package/CHANGELOG.ru.md +37 -0
  12. package/CHANGELOG.zh.md +32 -0
  13. package/CONTRIBUTING.md +22 -22
  14. package/LICENSE +21 -21
  15. package/README.de.md +7 -9
  16. package/README.es.md +7 -9
  17. package/README.fr.md +7 -9
  18. package/README.it.md +7 -9
  19. package/README.ja.md +6 -2
  20. package/README.ko.md +6 -2
  21. package/README.md +96 -98
  22. package/README.ru.md +7 -9
  23. package/README.zh.md +89 -85
  24. package/SECURITY.md +18 -18
  25. package/THIRD_PARTY_NOTICES.md +14 -14
  26. package/docs/compat-0.1.5-report.md +77 -77
  27. package/docs/installation.de.md +5 -5
  28. package/docs/installation.es.md +5 -5
  29. package/docs/installation.fr.md +5 -5
  30. package/docs/installation.it.md +5 -5
  31. package/docs/installation.ja.md +5 -5
  32. package/docs/installation.ko.md +5 -5
  33. package/docs/installation.md +5 -5
  34. package/docs/installation.ru.md +5 -5
  35. package/docs/installation.zh.md +5 -5
  36. package/docs/repair-log.md +657 -657
  37. package/package.json +24 -22
  38. package/packages/selector/LICENSE +21 -21
  39. package/packages/selector/README.md +26 -26
  40. package/packages/selector/README.zh.md +24 -24
  41. package/packages/selector/THIRD_PARTY_NOTICES.md +32 -32
  42. package/packages/selector/cordis.patch.yml +27 -27
  43. package/packages/selector/docs/history-tool-call-working-set-spec.md +112 -112
  44. package/packages/selector/docs/native-tool-result-selector-spec.md +34 -34
  45. package/packages/selector/docs/subagent-cache-reuse-spec.md +46 -46
  46. package/packages/selector/dsh.plugin.json +16 -16
  47. package/packages/selector/lib/client.js +180 -22
  48. package/packages/selector/lib/host-generation.js +62 -0
  49. package/packages/selector/lib/index.js +208 -1
  50. package/packages/selector/lib/invariant.js +1 -1
  51. package/packages/selector/lib/pruner.js +46 -44
  52. package/packages/selector/lib/style.css +53 -53
  53. package/packages/selector/lib/tail-trim.js +73 -4
  54. package/packages/selector/package.json +80 -21
  55. package/packages/selector/screenshots.json +3 -3
  56. package/packages/selector/src/client/CustomPolicyEditor.tsx +216 -216
  57. package/packages/selector/src/client/EstimatorControls.tsx +277 -277
  58. package/packages/selector/src/client/bridge-scope.ts +125 -0
  59. package/packages/selector/src/client/index.ts +122 -36
  60. package/packages/selector/src/client/monitor-fab.ts +0 -2
  61. package/packages/selector/src/client/preset-options.ts +88 -88
  62. package/packages/selector/src/client/scope-face.ts +24 -24
  63. package/packages/selector/src/compat/host-generation.ts +96 -0
  64. package/packages/selector/src/compat/settings-lease.ts +108 -0
  65. package/packages/selector/src/compat/tool-result.ts +91 -0
  66. package/packages/selector/src/css-modules.d.ts +6 -6
  67. package/packages/selector/src/deepseek-v4-tokenizer.ts +205 -205
  68. package/packages/selector/src/estimator-catalog.ts +104 -104
  69. package/packages/selector/src/index.ts +8 -0
  70. package/packages/selector/src/invariant.ts +113 -113
  71. package/packages/selector/src/preset-overlay.ts +626 -626
  72. package/packages/selector/src/pruner/content.ts +198 -198
  73. package/packages/selector/src/pruner/session.ts +97 -96
  74. package/packages/selector/src/pruner/tuning.ts +23 -23
  75. package/packages/selector/src/pruner/types.ts +78 -78
  76. package/packages/selector/src/pruner.ts +61 -41
  77. package/packages/selector/src/runtime/adaptive-cost.ts +205 -205
  78. package/packages/selector/src/runtime/custom-policy.ts +278 -278
  79. package/packages/selector/src/runtime/deepseek-official-pricing.ts +298 -298
  80. package/packages/selector/src/runtime/deepseek-v4-vision-tokens.ts +254 -254
  81. package/packages/selector/src/runtime/measurement.ts +444 -431
  82. package/packages/selector/src/runtime/reducers.ts +1674 -1674
  83. package/packages/selector/src/runtime/retrieve.ts +7 -3
  84. package/packages/selector/src/runtime/session-events.ts +30 -30
  85. package/packages/selector/src/runtime/tail-trim.ts +175 -165
  86. package/packages/selector/src/runtime/token-count.ts +72 -72
  87. package/packages/selector/src/runtime/tokenpilot/advisor.ts +419 -419
  88. package/packages/selector/src/runtime/tokenpilot/benefit.ts +200 -200
  89. package/packages/selector/src/runtime/tokenpilot/dedup.ts +81 -81
  90. package/packages/selector/src/runtime/tokenpilot/estimator.ts +151 -151
  91. package/packages/selector/src/runtime/tokenpilot/locator.ts +128 -128
  92. package/packages/selector/src/runtime/tokenpilot/read-state.ts +98 -98
  93. package/packages/selector/src/runtime/tokenpilot/sidechannel.ts +303 -303
  94. package/packages/selector/src/runtime/toolclass.ts +103 -103
  95. package/packages/selector/src/runtime/value.ts +48 -48
  96. package/packages/selector/src/settings-bridge.ts +175 -0
  97. package/packages/selector/tests/advisor-report.host.spec.ts +223 -223
  98. package/packages/selector/tests/built/client-artifact.spec.ts +6 -9
  99. package/packages/selector/tests/cache-prefix-audit.spec.ts +123 -123
  100. package/packages/selector/tests/code-skeleton.client.spec.ts +98 -94
  101. package/packages/selector/tests/compat/compat-narrow-waist.spec.ts +150 -0
  102. package/packages/selector/tests/custom-contract.client.spec.ts +226 -223
  103. package/packages/selector/tests/estimator-catalog.spec.ts +70 -70
  104. package/packages/selector/tests/estimator-route-registration.host.spec.ts +199 -194
  105. package/packages/selector/tests/helpers/legacy-namespace.ts +35 -35
  106. package/packages/selector/tests/helpers/legacy-settings/index.ts +15 -15
  107. package/packages/selector/tests/helpers/legacy-settings/legacy/provider.d.ts +41 -41
  108. package/packages/selector/tests/helpers/legacy-settings/legacy/provider.js +647 -647
  109. package/packages/selector/tests/helpers/legacy-settings/legacy/redact.js +78 -78
  110. package/packages/selector/tests/helpers/legacy-settings/legacy/util-values.js +234 -234
  111. package/packages/selector/tests/host-preset-overlay.host.spec.ts +204 -204
  112. package/packages/selector/tests/preset-options-write.client.spec.ts +192 -188
  113. package/packages/selector/tests/preset-overlay-loader.e2e.host.spec.ts +200 -200
  114. package/packages/selector/tests/preset-overlay.host.spec.ts +246 -246
  115. package/packages/selector/tests/public/package-contract.client.spec.ts +11 -3
  116. package/packages/selector/tests/runtime/adaptive-cost.spec.ts +167 -167
  117. package/packages/selector/tests/runtime/advice-never-withholds.host.spec.ts +230 -230
  118. package/packages/selector/tests/runtime/advisor-invariant.spec.ts +272 -272
  119. package/packages/selector/tests/runtime/advisor.spec.ts +226 -226
  120. package/packages/selector/tests/runtime/auto-compact-config.spec.ts +523 -523
  121. package/packages/selector/tests/runtime/char-basis.spec.ts +30 -30
  122. package/packages/selector/tests/runtime/code-skeleton.spec.ts +152 -152
  123. package/packages/selector/tests/runtime/deepseek-official-pricing.spec.ts +186 -186
  124. package/packages/selector/tests/runtime/deepseek-v4-tokenizer.spec.ts +122 -122
  125. package/packages/selector/tests/runtime/deepseek-v4-vision-tokens.spec.ts +122 -122
  126. package/packages/selector/tests/runtime/deprecated-preset-options.spec.ts +96 -96
  127. package/packages/selector/tests/runtime/fixtures/profile-baseline.json +273 -273
  128. package/packages/selector/tests/runtime/fixtures/tokenizer-golden.json +106 -106
  129. package/packages/selector/tests/runtime/fixtures/vision-golden.json +459 -459
  130. package/packages/selector/tests/runtime/frequency-longstrings.spec.ts +74 -74
  131. package/packages/selector/tests/runtime/html-reducer.spec.ts +212 -212
  132. package/packages/selector/tests/runtime/line-mapping.spec.ts +153 -153
  133. package/packages/selector/tests/runtime/prose-reducers.spec.ts +133 -133
  134. package/packages/selector/tests/runtime/public/public-runtime.spec.ts +3 -3
  135. package/packages/selector/tests/runtime/read-input-cap.spec.ts +33 -33
  136. package/packages/selector/tests/runtime/search-reducer.spec.ts +110 -110
  137. package/packages/selector/tests/runtime/session-events.spec.ts +27 -27
  138. package/packages/selector/tests/runtime/sidechannel.spec.ts +241 -241
  139. package/packages/selector/tests/runtime/toc-and-bundled.spec.ts +159 -159
  140. package/packages/selector/tests/runtime/tokenizer-golden.spec.ts +53 -53
  141. package/packages/selector/tests/runtime/tokenpilot/benefit.spec.ts +217 -217
  142. package/packages/selector/tests/runtime/tokenpilot/dedup.spec.ts +52 -52
  143. package/packages/selector/tests/runtime/tokenpilot/estimator.spec.ts +79 -79
  144. package/packages/selector/tests/runtime/tokenpilot/locator.spec.ts +76 -76
  145. package/packages/selector/tests/runtime/tokenpilot/profile-baseline.spec.ts +116 -116
  146. package/packages/selector/tests/runtime/tokenpilot/read-state.spec.ts +82 -82
  147. package/packages/selector/tests/runtime/toolclass.spec.ts +156 -156
  148. package/packages/selector/tests/runtime/value.spec.ts +23 -23
  149. package/packages/selector/tests/settings-seat.client.spec.ts +45 -7
  150. package/packages/selector/tests/standing-generation.host.spec.ts +724 -724
  151. package/packages/selector/tests/subagent-cache-reuse.host.spec.ts +269 -269
  152. package/packages/selector/tests/support/cache-prefix-audit.ts +105 -105
  153. package/packages/selector/tests/support/mock-adapter.ts +37 -37
  154. package/packages/selector/tests/support/ui-primitives.tsx +34 -34
  155. package/packages/selector/tsconfig.json +11 -11
  156. package/packages/selector/tsdown.client.config.ts +102 -102
  157. package/packages/selector/tsdown.config.ts +20 -20
  158. package/scripts/capture-profile-baseline.mjs +42 -42
  159. package/scripts/cell-browser-e2e.mjs +354 -0
  160. package/scripts/generate-tokenizer-fixtures.py +81 -81
  161. package/scripts/generate-vision-fixtures.py +208 -208
  162. package/scripts/hosts.mjs +74 -0
  163. package/scripts/packed-components-smoke.mjs +763 -732
  164. package/scripts/packed-install-e2e.mjs +1330 -1273
  165. package/scripts/sync-hosts.mjs +174 -0
  166. package/scripts/toolclass-corpus-replay.mjs +281 -281
  167. package/scripts/verify-release.mjs +335 -318
  168. package/tsconfig.base.json +18 -18
  169. package/tsconfig.json +7 -7
  170. package/tsconfig.tests.json +15 -15
  171. package/vitest.built.config.ts +9 -9
  172. package/vitest.config.ts +46 -43
package/CONTRIBUTING.md CHANGED
@@ -1,22 +1,22 @@
1
- # Contributing
2
-
3
- Thank you for helping improve this community plugin.
4
-
5
- 1. Open an issue before large behavior or compatibility changes.
6
- 2. Keep every production change inside this repository; do not require a DeepSeek Harness core patch.
7
- 3. Add a failing regression first for compression, surface/recovery, preset, tokenizer, or cache-prefix behavior.
8
- 4. Run:
9
-
10
- ```sh
11
- pnpm install --frozen-lockfile
12
- pnpm test
13
- pnpm typecheck
14
- pnpm build
15
- pnpm verify:release
16
- pnpm pack:dry-run
17
- ```
18
-
19
- 5. Never commit API keys, `.env` files, real Session logs, prompts/tool results, user paths, generated tarballs, or NPM tokens.
20
- 6. Read [`docs/repair-log.md`](docs/repair-log.md) before starting a new branch or version. It is the cross-version ledger of install/boot defects; a class recorded there must be re-checked on every new line instead of being rediscovered. Note in particular that `lib/` is committed, so a built chunk an entry imports must be committed in the same change — `pnpm verify:release` enforces it — and that the tokenizer assets are content-addressed, so a checkout that rewrites their line endings breaks every consumer (the release gate now fails on CR bytes).
21
-
22
- Pull requests should explain the evidence for “triggered”, “enabled but skipped”, and fail-open behavior separately. A code path existing is not runtime proof. Changes to tokenizer/model compatibility require an official source, pinned revision, license, byte length, SHA-256, and negative tests.
1
+ # Contributing
2
+
3
+ Thank you for helping improve this community plugin.
4
+
5
+ 1. Open an issue before large behavior or compatibility changes.
6
+ 2. Keep every production change inside this repository; do not require a DeepSeek Harness core patch.
7
+ 3. Add a failing regression first for compression, surface/recovery, preset, tokenizer, or cache-prefix behavior.
8
+ 4. Run:
9
+
10
+ ```sh
11
+ pnpm install --frozen-lockfile
12
+ pnpm test
13
+ pnpm typecheck
14
+ pnpm build
15
+ pnpm verify:release
16
+ pnpm pack:dry-run
17
+ ```
18
+
19
+ 5. Never commit API keys, `.env` files, real Session logs, prompts/tool results, user paths, generated tarballs, or NPM tokens.
20
+ 6. Read [`docs/repair-log.md`](docs/repair-log.md) before starting a new branch or version. It is the cross-version ledger of install/boot defects; a class recorded there must be re-checked on every new line instead of being rediscovered. Note in particular that `lib/` is committed, so a built chunk an entry imports must be committed in the same change — `pnpm verify:release` enforces it — and that the tokenizer assets are content-addressed, so a checkout that rewrites their line endings breaks every consumer (the release gate now fails on CR bytes).
21
+
22
+ Pull requests should explain the evidence for “triggered”, “enabled but skipped”, and fail-open behavior separately. A code path existing is not runtime proof. Changes to tokenizer/model compatibility require an official source, pinned revision, license, byte length, SHA-256, and negative tests.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 WilliamShi666
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 WilliamShi666
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.de.md CHANGED
@@ -14,6 +14,10 @@
14
14
  > [!IMPORTANT]
15
15
  > Dieses Projekt unterstützt **ausschließlich DeepSeek-Modelle**. Verlustfreie Messung und verlustbehaftete Kompression hängen von den mitgelieferten offiziellen DeepSeek-Tokenizern ab (`deepseek-v4-flash`, `deepseek-v4-pro`, `deepseek-v4-flash-vision-exp`). Alles andere fällt offen aus (fail-open) und behält die ursprünglichen Tool-Ergebnisse bei. Das vollständige Sicherheitsmodell finden Sie im [Upstream-README](https://github.com/WilliamShi666/dsh-context-compression-selector#model-support-and-safety).
16
16
 
17
+ <!-- host-compat:begin — generated by scripts/sync-hosts.mjs from scripts/hosts.mjs; DO NOT EDIT -->
18
+ - **Unterstützte DSH-Hosts:** `0.1.0-rc.2` `0.1.0-rc.3` `0.1.0-rc.6` `0.1.0-rc.7` `0.1.0-rc.8` `0.1.1-rc.1` `0.1.1-rc.2` `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` (15 RC über die Linien 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0)
19
+ <!-- host-compat:end -->
20
+
17
21
  ## Was es ist
18
22
 
19
23
  Langlaufende Agent-Aufgaben sammeln große Mengen an Tool-Ausgaben an. Dieses Community-Plugin fügt auswählbare, prüfbare Richtlinien hinzu, um diesen Tool-Ergebnis-Kontext zu reduzieren, ohne den Kern des DeepSeek Harness zu verändern:
@@ -47,16 +51,10 @@ Wählen Sie ein Kompressionsprofil, stellen Sie den Auto-Compact-Auslösepegel e
47
51
 
48
52
  ## Installation
49
53
 
50
- **Empfohlen: Installation über npm.** Ein Dist-Tag pro Harness-Linie — `dsh-0.2.0` für die 0.2.0-Linie (dieser Zweig), `dsh-0.1.7` für die 0.1.7-Linie, `dsh-0.1.5` für die 0.1.5-Linie, `dsh-0.1.2` für die 0.1.2-Linie.
54
+ **Empfohlen: Installation über npm.** Eine einzige Version deckt alle unterstützten Harness-Linien ab — `latest` trägt die vollständige 15-rc-Aufzählung (0.1.0-rc.2 → 0.2.0-rc.2); die Runtime wählt die linien­spezifischen Codepfade selbst.
51
55
 
52
56
  ```sh
53
- dsh plugin --profile web add dsh-context-compression-improved@dsh-0.2.0
54
- # DSH 0.1.7 line:
55
- # dsh plugin --profile web add dsh-context-compression-improved@dsh-0.1.7
56
- # DSH 0.1.5 line:
57
- # dsh plugin --profile web add dsh-context-compression-improved@dsh-0.1.5
58
- # DSH 0.1.2 line:
59
- # dsh plugin --profile web add dsh-context-compression-improved@dsh-0.1.2
57
+ dsh plugin --profile web add dsh-context-compression-improved@latest
60
58
  dsh --profile web --dump-config
61
59
  ```
62
60
 
@@ -87,7 +85,7 @@ Beiträge folgen der Upstream-Disziplin: zuerst die fehlgeschlagene Regression h
87
85
 
88
86
  ## Kompatibilität
89
87
 
90
- - Gegen die offizielle DeepSeek Harness `dsh-v0.2.0-rc.1`-Veröffentlichung gebaut und getestet; die Peers deklarieren `>=0.2.0-rc.1 <0.2.1-0`, und das Plugin nutzt ausschließlich öffentliche Plugin- und Profil-APIs. Frühere Linien werden weiterhin über ihre eigenen Dist-Tags bedient (`dsh-0.1.7`, `dsh-0.1.5`, `dsh-0.1.2`).
88
+ - Gegen die offiziellen DeepSeek Harness Veröffentlichungen gebaut und getestet; die Peers enumerieren die vollständige Unterstützungsliste (`0.1.0-rc.2` → `0.2.0-rc.2`, sechs Linien) und das Plugin nutzt ausschließlich öffentliche Plugin- und Profil-APIs. Die Liste wird von `scripts/sync-hosts.mjs` aus `scripts/hosts.mjs` in den obigen verwalteten Block generiert.
91
89
  - Erfordert Node `^22.19.0 || >=24` und pnpm `11.7.0`.
92
90
  - Das Plugin nutzt nur öffentliche Harness-Erweiterungs-APIs und verändert keinen Harness-Kerncode. Inoffizielles Community-Projekt, weder mit DeepSeek verbunden noch von ihm unterstützt.
93
91
 
package/README.es.md CHANGED
@@ -14,6 +14,10 @@
14
14
  > [!IMPORTANT]
15
15
  > Este proyecto admite **únicamente modelos DeepSeek**. La medición sin pérdida y la compresión con pérdida dependen de los tokenizers oficiales de DeepSeek incluidos (`deepseek-v4-flash`, `deepseek-v4-pro`, `deepseek-v4-flash-vision-exp`). Todo lo demás falla de forma abierta (fail-open) y conserva los resultados de herramientas originales. Consulte el [README ascendente](https://github.com/WilliamShi666/dsh-context-compression-selector#model-support-and-safety) para conocer el modelo de seguridad completo.
16
16
 
17
+ <!-- host-compat:begin — generated by scripts/sync-hosts.mjs from scripts/hosts.mjs; DO NOT EDIT -->
18
+ - **Hosts DSH compatibles:** `0.1.0-rc.2` `0.1.0-rc.3` `0.1.0-rc.6` `0.1.0-rc.7` `0.1.0-rc.8` `0.1.1-rc.1` `0.1.1-rc.2` `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` (15 rc en las líneas 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0)
19
+ <!-- host-compat:end -->
20
+
17
21
  ## Qué es
18
22
 
19
23
  Las tareas de agentes de larga duración acumulan una gran cantidad de salida de herramientas. Este plugin comunitario añade políticas seleccionables y auditables para reducir ese contexto de resultados de herramientas sin modificar el núcleo de DeepSeek Harness:
@@ -47,16 +51,10 @@ Elija un perfil de compresión, configure el nivel de disparo de Auto Compact y
47
51
 
48
52
  ## Instalación
49
53
 
50
- **Recomendado: instalar desde npm.** Un dist-tag por línea de Harness — `dsh-0.2.0` para la línea 0.2.0 (esta rama), `dsh-0.1.7` para la línea 0.1.7, `dsh-0.1.5` para la línea 0.1.5, `dsh-0.1.2` para la línea 0.1.2.
54
+ **Recomendado: instalar desde npm.** Una única versión cubre todas las líneas de Harness compatibles — `latest` lleva la enumeración completa de 15 rc (0.1.0-rc.2 → 0.2.0-rc.2); el runtime elige por sí solo las rutas de código de cada línea.
51
55
 
52
56
  ```sh
53
- dsh plugin --profile web add dsh-context-compression-improved@dsh-0.2.0
54
- # DSH 0.1.7 line:
55
- # dsh plugin --profile web add dsh-context-compression-improved@dsh-0.1.7
56
- # DSH 0.1.5 line:
57
- # dsh plugin --profile web add dsh-context-compression-improved@dsh-0.1.5
58
- # DSH 0.1.2 line:
59
- # dsh plugin --profile web add dsh-context-compression-improved@dsh-0.1.2
57
+ dsh plugin --profile web add dsh-context-compression-improved@latest
60
58
  dsh --profile web --dump-config
61
59
  ```
62
60
 
@@ -87,7 +85,7 @@ Las contribuciones siguen la disciplina del upstream: añadir primero la regresi
87
85
 
88
86
  ## Compatibilidad
89
87
 
90
- - Compilado y probado contra la versión oficial `dsh-v0.2.0-rc.1` de DeepSeek Harness; los peers declaran `>=0.2.0-rc.1 <0.2.1-0` y el plugin usa solo API públicas de plugin y de perfil. Las líneas anteriores siguen atendidas desde sus propios dist-tag (`dsh-0.1.7`, `dsh-0.1.5`, `dsh-0.1.2`).
88
+ - Construido y probado contra las versiones oficiales de DeepSeek Harness; los peers enumeran la lista completa de soporte (`0.1.0-rc.2` → `0.2.0-rc.2`, seis líneas) y el plugin usa solo API públicas de plugin y de perfil. La lista la genera `scripts/sync-hosts.mjs` desde `scripts/hosts.mjs` hacia el bloque gestionado de arriba.
91
89
  - Requiere Node `^22.19.0 || >=24` y pnpm `11.7.0`.
92
90
  - El plugin usa solo API de extensión públicas del Harness y no modifica el código del núcleo del Harness. Proyecto comunitario no oficial, sin afiliación ni respaldo de DeepSeek.
93
91
 
package/README.fr.md CHANGED
@@ -14,6 +14,10 @@
14
14
  > [!IMPORTANT]
15
15
  > Ce projet prend en charge **uniquement les modèles DeepSeek**. La mesure sans perte et la compression avec perte dépendent des tokenizers DeepSeek officiels fournis (`deepseek-v4-flash`, `deepseek-v4-pro`, `deepseek-v4-flash-vision-exp`). Tout le reste échoue en mode ouvert (fail-open) et conserve les résultats d'outils originaux. Consultez le [README amont](https://github.com/WilliamShi666/dsh-context-compression-selector#model-support-and-safety) pour le modèle de sécurité complet.
16
16
 
17
+ <!-- host-compat:begin — generated by scripts/sync-hosts.mjs from scripts/hosts.mjs; DO NOT EDIT -->
18
+ - **Hôtes DSH pris en charge :** `0.1.0-rc.2` `0.1.0-rc.3` `0.1.0-rc.6` `0.1.0-rc.7` `0.1.0-rc.8` `0.1.1-rc.1` `0.1.1-rc.2` `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` (15 rc sur les lignes 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0)
19
+ <!-- host-compat:end -->
20
+
17
21
  ## Qu'est-ce que c'est
18
22
 
19
23
  Les tâches d'agent de longue durée accumulent une grande quantité de sorties d'outils. Ce plugin communautaire ajoute des politiques sélectionnables et auditables pour réduire ce contexte de résultats d'outils sans modifier le cœur de DeepSeek Harness :
@@ -47,16 +51,10 @@ Choisissez un profil de compression, réglez le niveau de déclenchement de l'Au
47
51
 
48
52
  ## Installation
49
53
 
50
- **Recommandé : installer depuis npm.** Un dist-tag par ligne Harness — `dsh-0.2.0` pour la ligne 0.2.0 (cette branche), `dsh-0.1.7` pour la ligne 0.1.7, `dsh-0.1.5` pour la ligne 0.1.5, `dsh-0.1.2` pour la ligne 0.1.2.
54
+ **Recommandé : installer depuis npm.** Une seule version couvre toutes les lignes Harness prises en charge — `latest` porte l'énumération complète des 15 rc (0.1.0-rc.2 → 0.2.0-rc.2) ; le runtime choisit lui-même les chemins de code propres à chaque ligne.
51
55
 
52
56
  ```sh
53
- dsh plugin --profile web add dsh-context-compression-improved@dsh-0.2.0
54
- # DSH 0.1.7 line:
55
- # dsh plugin --profile web add dsh-context-compression-improved@dsh-0.1.7
56
- # DSH 0.1.5 line:
57
- # dsh plugin --profile web add dsh-context-compression-improved@dsh-0.1.5
58
- # DSH 0.1.2 line:
59
- # dsh plugin --profile web add dsh-context-compression-improved@dsh-0.1.2
57
+ dsh plugin --profile web add dsh-context-compression-improved@latest
60
58
  dsh --profile web --dump-config
61
59
  ```
62
60
 
@@ -87,7 +85,7 @@ Les contributions suivent la discipline de l'amont : ajouter d'abord la régress
87
85
 
88
86
  ## Compatibilité
89
87
 
90
- - Construit et testé contre la version officielle DeepSeek Harness `dsh-v0.2.0-rc.1` ; les peers déclarent `>=0.2.0-rc.1 <0.2.1-0` et le plugin n'utilise que les API publiques de plugin et de profil. Les lignes antérieures restent servies depuis leurs propres dist-tags (`dsh-0.1.7`, `dsh-0.1.5`, `dsh-0.1.2`).
88
+ - Construit et testé contre les versions officielles de DeepSeek Harness ; les pairs énumèrent la liste complète de prise en charge (`0.1.0-rc.2` → `0.2.0-rc.2`, six lignes) et le plugin n'utilise que les API publiques de plugin et de profil. La liste est générée par `scripts/sync-hosts.mjs` depuis `scripts/hosts.mjs` vers le bloc géré ci-dessus.
91
89
  - Nécessite Node `^22.19.0 || >=24` et pnpm `11.7.0`.
92
90
  - Le plugin n'utilise que les API d'extension publiques du Harness et ne modifie pas le code du cœur du Harness. Projet communautaire non officiel, sans affiliation ni approbation de DeepSeek.
93
91
 
package/README.it.md CHANGED
@@ -14,6 +14,10 @@
14
14
  > [!IMPORTANT]
15
15
  > Questo progetto supporta **solo modelli DeepSeek**. La misura senza perdita e la compressione con perdita dipendono dai tokenizer DeepSeek ufficiali inclusi (`deepseek-v4-flash`, `deepseek-v4-pro`, `deepseek-v4-flash-vision-exp`). Tutto il resto fallisce in modo aperto (fail-open) e conserva i risultati degli strumenti originali. Vedere il [README upstream](https://github.com/WilliamShi666/dsh-context-compression-selector#model-support-and-safety) per il modello di sicurezza completo.
16
16
 
17
+ <!-- host-compat:begin — generated by scripts/sync-hosts.mjs from scripts/hosts.mjs; DO NOT EDIT -->
18
+ - **Host DSH supportati:** `0.1.0-rc.2` `0.1.0-rc.3` `0.1.0-rc.6` `0.1.0-rc.7` `0.1.0-rc.8` `0.1.1-rc.1` `0.1.1-rc.2` `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` (15 rc attraverso le linee 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0)
19
+ <!-- host-compat:end -->
20
+
17
21
  ## Che cos'è
18
22
 
19
23
  Le attività degli agenti di lunga durata accumulano grandi quantità di output degli strumenti. Questo plugin della community aggiunge politiche selezionabili e verificabili per ridurre questo contesto di risultati degli strumenti senza modificare il core di DeepSeek Harness:
@@ -47,16 +51,10 @@ Scegliere un profilo di compressione, impostare il livello di attivazione dell'A
47
51
 
48
52
  ## Installazione
49
53
 
50
- **Consigliato: installare da npm.** Un dist-tag per linea Harness — `dsh-0.2.0` per la linea 0.2.0 (questo ramo), `dsh-0.1.7` per la linea 0.1.7, `dsh-0.1.5` per la linea 0.1.5, `dsh-0.1.2` per la linea 0.1.2.
54
+ **Consigliato: installare da npm.** Un'unica versione copre tutte le linee Harness supportate — `latest` porta l'enumerazione completa dei 15 rc (0.1.0-rc.2 → 0.2.0-rc.2); il runtime sceglie da solo i percorsi di codice di ciascuna linea.
51
55
 
52
56
  ```sh
53
- dsh plugin --profile web add dsh-context-compression-improved@dsh-0.2.0
54
- # DSH 0.1.7 line:
55
- # dsh plugin --profile web add dsh-context-compression-improved@dsh-0.1.7
56
- # DSH 0.1.5 line:
57
- # dsh plugin --profile web add dsh-context-compression-improved@dsh-0.1.5
58
- # DSH 0.1.2 line:
59
- # dsh plugin --profile web add dsh-context-compression-improved@dsh-0.1.2
57
+ dsh plugin --profile web add dsh-context-compression-improved@latest
60
58
  dsh --profile web --dump-config
61
59
  ```
62
60
 
@@ -87,7 +85,7 @@ I contributi seguono la disciplina upstream: aggiungere prima la regressione che
87
85
 
88
86
  ## Compatibilità
89
87
 
90
- - Compilato e testato contro la release ufficiale DeepSeek Harness `dsh-v0.2.0-rc.1`; i peer dichiarano `>=0.2.0-rc.1 <0.2.1-0` e il plugin usa solo API pubbliche di plugin e profilo. Le linee precedenti restano servite dai propri dist-tag (`dsh-0.1.7`, `dsh-0.1.5`, `dsh-0.1.2`).
88
+ - Compilato e testato contro le release ufficiali di DeepSeek Harness; i peer enumerano l'elenco completo del supporto (`0.1.0-rc.2` → `0.2.0-rc.2`, sei linee) e il plugin usa solo API pubbliche di plugin e profilo. L'elenco è generato da `scripts/sync-hosts.mjs` da `scripts/hosts.mjs` nel blocco gestito qui sopra.
91
89
  - Richiede Node `^22.19.0 || >=24` e pnpm `11.7.0`.
92
90
  - Il plugin usa solo API di estensione pubbliche del Harness e non modifica il codice del core del Harness. Progetto comunitario non ufficiale, non affiliato né approvato da DeepSeek.
93
91
 
package/README.ja.md CHANGED
@@ -14,6 +14,10 @@
14
14
  > [!IMPORTANT]
15
15
  > 本プロジェクトは **DeepSeek モデルのみ**をサポートします。可逆的な計測と非可逆圧縮は、同梱の DeepSeek 公式トークナイザー(`deepseek-v4-flash`、`deepseek-v4-pro`、`deepseek-v4-flash-vision-exp`)に依存します。それ以外は fail-open で動作し、元のツール結果を保持します。安全モデルの詳細は[アップストリームの README](https://github.com/WilliamShi666/dsh-context-compression-selector#model-support-and-safety) を参照してください。
16
16
 
17
+ <!-- host-compat:begin — generated by scripts/sync-hosts.mjs from scripts/hosts.mjs; DO NOT EDIT -->
18
+ - **対応する DSH ホスト:** `0.1.0-rc.2` `0.1.0-rc.3` `0.1.0-rc.6` `0.1.0-rc.7` `0.1.0-rc.8` `0.1.1-rc.1` `0.1.1-rc.2` `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2`(0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 の 15 rc)
19
+ <!-- host-compat:end -->
20
+
17
21
  ## これは何か
18
22
 
19
23
  長時間稼働するエージェントタスクは大量のツール出力を蓄積します。本コミュニティプラグインは、DeepSeek Harness のコアを改変することなく、選択可能で監査可能なツール結果コンテキスト圧縮ポリシーを提供します:
@@ -47,7 +51,7 @@
47
51
 
48
52
  ## インストール
49
53
 
50
- ソースからビルドしてインストールします —— 本フォークは npm にも `dsh-context-compression-improved` として公開済みです(0.2.0 系は dist-tag `dsh-0.2.0`、0.1.7 系は `dsh-0.1.7`、0.1.5 系は `dsh-0.1.5`)。内部パッケージ名は意図的にアップストリームのままです:
54
+ ソースからビルドしてインストールします —— 本フォークは npm にも `dsh-context-compression-improved` として公開済みです(単一バージョンが全サポートラインをカバー:dist-tag `latest` が 15 rc 完全列挙 0.1.0-rc.2〜0.2.0-rc.2 を携え、ライン別コードパスはランタイムが自動選択)。内部パッケージ名は意図的にアップストリームのままです:
51
55
 
52
56
  ```sh
53
57
  git clone https://github.com/drscrewdriver/dsh-context-compression-improved.git
@@ -74,7 +78,7 @@ pnpm verify:release
74
78
 
75
79
  ## 互換性
76
80
 
77
- - 公式 DeepSeek Harness `dsh-v0.2.0-rc.1` リリースに対してビルド・テスト済み。peers は `>=0.2.0-rc.1 <0.2.1-0` を宣言し、公開されているプラグインおよびプロファイル API のみを使用します。それ以前の Harness 系はそれぞれの dist-tag(`dsh-0.1.7`、`dsh-0.1.5`、`dsh-0.1.2`)で提供を継続します。
81
+ - 公式 DeepSeek Harness リリースに対してビルド・テスト済み。peers はサポート対象の完全列挙(`0.1.0-rc.2`〜`0.2.0-rc.2`、6 ライン)を宣言し、公開されているプラグインおよびプロファイル API のみを使用します。リストは `scripts/sync-hosts.mjs` が `scripts/hosts.mjs` から上記の管理ブロックへ生成します。
78
82
  - Node `^22.19.0 || >=24` と pnpm `11.7.0` が必要です。
79
83
  - プラグインは Harness の公開拡張 API のみを使用し、Harness コアは改変しません。非公式のコミュニティプロジェクトであり、DeepSeek とは提携・承認関係にありません。
80
84
 
package/README.ko.md CHANGED
@@ -14,6 +14,10 @@
14
14
  > [!IMPORTANT]
15
15
  > 이 프로젝트는 **DeepSeek 모델만** 지원합니다. 손실 없는 측정과 손실 압축은 번들된 DeepSeek 공식 토크나이저(`deepseek-v4-flash`, `deepseek-v4-pro`, `deepseek-v4-flash-vision-exp`)에 의존합니다. 그외의 경우 fail-open으로 동작하며 원본 도구 결과를 유지합니다. 전체 안전 모델은 [업스트림 README](https://github.com/WilliamShi666/dsh-context-compression-selector#model-support-and-safety)를 참고하세요.
16
16
 
17
+ <!-- host-compat:begin — generated by scripts/sync-hosts.mjs from scripts/hosts.mjs; DO NOT EDIT -->
18
+ - **지원하는 DSH 호스트:** `0.1.0-rc.2` `0.1.0-rc.3` `0.1.0-rc.6` `0.1.0-rc.7` `0.1.0-rc.8` `0.1.1-rc.1` `0.1.1-rc.2` `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` (0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 라인의 15개 rc)
19
+ <!-- host-compat:end -->
20
+
17
21
  ## 이것은 무엇인가
18
22
 
19
23
  장시간 실행되는 에이전트 작업은 대량의 도구 출력을 축적합니다. 이커뮤니티 플러그인은 DeepSeek Harness 코어를 수정하지 않고, 선택 가능하고 감사 가능한 도구 결과 컨텍스트 압축 정책을 제공합니다:
@@ -47,7 +51,7 @@
47
51
 
48
52
  ## 설치
49
53
 
50
- 소스에서 빌드하여 설치합니다 —— 이 포크는 npm에도 `dsh-context-compression-improved`로 게시되어 있습니다(0.2.0 라인은 dist-tag `dsh-0.2.0`, 0.1.7 라인은 `dsh-0.1.7`, 0.1.5 라인은 `dsh-0.1.5`). 내부 패키지 이름은 의도적으로 업스트림과 동일하게 유지됩니다:
54
+ 소스에서 빌드하여 설치합니다 —— 이 포크는 npm에도 `dsh-context-compression-improved`로 게시되어 있습니다(단일 버전이 모든 지원 라인을 커버: dist-tag `latest`가 15 rc 전체 열거 0.1.0-rc.2~0.2.0-rc.2를 담으며, 라인별 코드 경로는 런타임이 자동 선택). 내부 패키지 이름은 의도적으로 업스트림과 동일하게 유지됩니다:
51
55
 
52
56
  ```sh
53
57
  git clone https://github.com/drscrewdriver/dsh-context-compression-improved.git
@@ -74,7 +78,7 @@ pnpm verify:release
74
78
 
75
79
  ## 호환성
76
80
 
77
- - 공식 DeepSeek Harness `dsh-v0.2.0-rc.1` 릴리스 기준으로 빌드·테스트되었습니다. peers는 `>=0.2.0-rc.1 <0.2.1-0`를 선언하며 공개된 플러그인 및 프로파일 API만 사용합니다. 이전 Harness 라인은 각자의 dist-tag(`dsh-0.1.7`, `dsh-0.1.5`, `dsh-0.1.2`)로 계속 제공됩니다.
81
+ - 공식 DeepSeek Harness 릴리스 기준으로 빌드·테스트되었습니다. peers는 지원 대상 전체 열거(`0.1.0-rc.2`~`0.2.0-rc.2`, 6개 라인)를 선언하며 공개된 플러그인 및 프로파일 API만 사용합니다. 목록은 `scripts/sync-hosts.mjs`가 `scripts/hosts.mjs`에서 위의 관리 블록으로 생성합니다.
78
82
  - Node `^22.19.0 || >=24`와 pnpm `11.7.0`이 필요합니다.
79
83
  - 플러그인은 Harness의 공개 확장 API만 사용하며 Harness 코어를 수정하지 않습니다. 비공식 커뮤니티 프로젝트이며 DeepSeek과 제휴하거나 승인받지 않았습니다.
80
84
 
package/README.md CHANGED
@@ -1,98 +1,96 @@
1
- # dsh-context-compression-improved
2
-
3
- > An improved fork of [dsh-context-compression-selector](https://github.com/WilliamShi666/dsh-context-compression-selector) — an auditable tool-result context-compression selector for DeepSeek Harness — adding an orthogonal **code-skeleton compression gate**.
4
-
5
- [中文说明](README.zh.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Français](README.fr.md) · [Deutsch](README.de.md) · [Italiano](README.it.md) · [Русский](README.ru.md) · [Español](README.es.md) · [Changelog](CHANGELOG.md) · [Installation guide](docs/installation.md)
6
-
7
- > [!NOTE]
8
- > **What this fork adds on top of upstream 0.1.0:**
9
- >
10
- > - An orthogonal **code-skeleton compression gate** (`codeSkeleton.enabled`, default off): the first exposure of an oversized fresh source-code tool result can keep a skeleton of imports and declarations — bodies elided, error lines kept — before the regular reducers run.
11
- > - A settings toggle for that gate in the same selector settings section, independent of every compression profile.
12
- > - An ESLint baseline wired into CI, a `test:watch` TDD loop, and documentation in English, Simplified Chinese, Japanese, and Korean.
13
-
14
- > [!IMPORTANT]
15
- > This project supports **DeepSeek models only**. Lossless measurement and lossy compression depend on the bundled official DeepSeek tokenizers (`deepseek-v4-flash`, `deepseek-v4-pro`, `deepseek-v4-flash-vision-exp`). Everything else fails open and keeps original tool results. See the [upstream README](https://github.com/WilliamShi666/dsh-context-compression-selector#model-support-and-safety) for the full safety model.
16
-
17
- ## What it is
18
-
19
- Long-running agent tasks accumulate a large amount of tool output. This community plugin adds selectable, auditable policies for reducing that tool-result context without modifying DeepSeek Harness core:
20
-
21
- - **Fresh** pre-compresses a newly oversized tool-result segment before the model receives it.
22
- - **Aggregate** pre-compresses fresh material again when it still grows beyond its budget.
23
- - **History / micro-compact** replaces eligible old tool results while preserving recent working context.
24
- - **TailTrim** is an optional Custom-only tail reduction path.
25
- - **Native** preserves the Harness-style head/middle/tail trimming as one explicit profile.
26
- - **Code skeleton (new, orthogonal gate)** — see below.
27
-
28
- Every decision is recorded: stage, reducer, trigger, skip reason, and exact token counts where available.
29
-
30
- ## Code skeleton gate (new)
31
-
32
- When the gate is enabled, an oversized **fresh source-code tool result** (for example a large `read_file`) first tries a skeleton reduction: imports and type/function/class declarations are kept, function bodies are elided with a marker, and error lines inside elided bodies are preserved. If the skeleton cannot be produced or verified, the result falls back to the original head pruning — the gate can never make context worse.
33
-
34
- Properties:
35
-
36
- - **Orthogonal**: independent of the selected profile (`balanced`, `savings`, `cache-strict`, `adaptive`, `custom`, `off`, `native`). All profiles get the gate.
37
- - **Off by default**: `codeSkeleton: { enabled: false }` until you turn it on.
38
- - **Measurement-gated**: requires the exact DeepSeek tokenizer; without it the plugin fails open.
39
- - **Session-frozen**: like all selector settings, changes affect newly observed sessions only.
40
- - **Strictly parsed**: `codeSkeleton` must be exactly `{ enabled: boolean }`; malformed values throw on the runtime side and show as unreadable in the browser UI.
41
-
42
- ## Settings UI
43
-
44
- Choose a compression profile, set the Auto Compact trigger level, and toggle code-skeleton compression in the same settings section. The toggle saves on change and shows the saved state on reload.
45
-
46
- ![Context Compression Selector settings UI](docs/assets/context-compression-selector-settings.png)
47
-
48
- ## Install
49
-
50
- **Recommended: install from npm.** One dist-tag per Harness line — `dsh-0.2.0` for the 0.2.0 line (this branch), `dsh-0.1.7` for the 0.1.7 line, `dsh-0.1.5` for the 0.1.5 line, `dsh-0.1.2` for the 0.1.2 line.
51
-
52
- ```sh
53
- dsh plugin --profile web add dsh-context-compression-improved@dsh-0.2.0
54
- # DSH 0.1.7 line:
55
- # dsh plugin --profile web add dsh-context-compression-improved@dsh-0.1.7
56
- # DSH 0.1.5 line:
57
- # dsh plugin --profile web add dsh-context-compression-improved@dsh-0.1.5
58
- # DSH 0.1.2 line:
59
- # dsh plugin --profile web add dsh-context-compression-improved@dsh-0.1.2
60
- dsh --profile web --dump-config
61
- ```
62
-
63
- From source (alternative — the internal package names intentionally stay upstream's):
64
-
65
- ```sh
66
- git clone https://github.com/drscrewdriver/dsh-context-compression-improved.git
67
- cd dsh-context-compression-improved
68
- pnpm install --frozen-lockfile
69
- pnpm build
70
- ```
71
-
72
- Then pack the selector package and add it to a Harness profile — the full walkthrough, including verification and uninstall steps, is in the [installation guide](docs/installation.md).
73
-
74
- ## Development
75
-
76
- ```sh
77
- pnpm install --frozen-lockfile
78
- pnpm lint # ESLint baseline (also enforced in CI)
79
- pnpm typecheck # runtime + selector + tests tsc, plus the bundle step
80
- pnpm test # full vitest suite
81
- pnpm test:watch # TDD loop: write the failing regression first, then make it pass
82
- pnpm build
83
- pnpm verify:release
84
- ```
85
-
86
- Contributions follow the upstream discipline: add the failing regression first, keep every production change inside this repository, and explain “triggered”, “enabled but skipped”, and fail-open evidence separately. See [CONTRIBUTING.md](CONTRIBUTING.md).
87
-
88
- ## Compatibility
89
-
90
- - Built and tested against the official DeepSeek Harness `dsh-v0.2.0-rc.1` release; peers declare `>=0.2.0-rc.1 <0.2.1-0` and the plugin uses public plugin and profile APIs only. Earlier lines remain served from their own dist-tags (`dsh-0.1.7`, `dsh-0.1.5`, `dsh-0.1.2`).
91
- - Requires Node `^22.19.0 || >=24` and pnpm `11.7.0`.
92
- - The plugin uses only public Harness extension APIs and does not modify Harness core code. Unofficial community project, not affiliated with or endorsed by DeepSeek.
93
-
94
- ## Credits and license
95
-
96
- - Upstream project and all prior work: [WilliamShi666/dsh-context-compression-selector](https://github.com/WilliamShi666/dsh-context-compression-selector) by WilliamShi666 (MIT).
97
- - Fork additions (code-skeleton gate, tooling, localized docs): drscrewdriver.
98
- - MIT — see [LICENSE](LICENSE) (upstream copyright notice retained) and [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for bundled tokenizer provenance.
1
+ # dsh-context-compression-improved
2
+
3
+ > An improved fork of [dsh-context-compression-selector](https://github.com/WilliamShi666/dsh-context-compression-selector) — an auditable tool-result context-compression selector for DeepSeek Harness — adding an orthogonal **code-skeleton compression gate**.
4
+
5
+ [中文说明](README.zh.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Français](README.fr.md) · [Deutsch](README.de.md) · [Italiano](README.it.md) · [Русский](README.ru.md) · [Español](README.es.md) · [Changelog](CHANGELOG.md) · [Installation guide](docs/installation.md)
6
+
7
+ > [!NOTE]
8
+ > **What this fork adds on top of upstream 0.1.0:**
9
+ >
10
+ > - An orthogonal **code-skeleton compression gate** (`codeSkeleton.enabled`, default off): the first exposure of an oversized fresh source-code tool result can keep a skeleton of imports and declarations — bodies elided, error lines kept — before the regular reducers run.
11
+ > - A settings toggle for that gate in the same selector settings section, independent of every compression profile.
12
+ > - An ESLint baseline wired into CI, a `test:watch` TDD loop, and documentation in English, Simplified Chinese, Japanese, and Korean.
13
+
14
+ > [!IMPORTANT]
15
+ > This project supports **DeepSeek models only**. Lossless measurement and lossy compression depend on the bundled official DeepSeek tokenizers (`deepseek-v4-flash`, `deepseek-v4-pro`, `deepseek-v4-flash-vision-exp`). Everything else fails open and keeps original tool results. See the [upstream README](https://github.com/WilliamShi666/dsh-context-compression-selector#model-support-and-safety) for the full safety model.
16
+
17
+ <!-- host-compat:begin — generated by scripts/sync-hosts.mjs from scripts/hosts.mjs; DO NOT EDIT -->
18
+ - **Supported DSH hosts:** `0.1.0-rc.2` `0.1.0-rc.3` `0.1.0-rc.6` `0.1.0-rc.7` `0.1.0-rc.8` `0.1.1-rc.1` `0.1.1-rc.2` `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` (15 rc releases across lines 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0)
19
+ <!-- host-compat:end -->
20
+
21
+ ## What it is
22
+
23
+ Long-running agent tasks accumulate a large amount of tool output. This community plugin adds selectable, auditable policies for reducing that tool-result context without modifying DeepSeek Harness core:
24
+
25
+ - **Fresh** pre-compresses a newly oversized tool-result segment before the model receives it.
26
+ - **Aggregate** pre-compresses fresh material again when it still grows beyond its budget.
27
+ - **History / micro-compact** replaces eligible old tool results while preserving recent working context.
28
+ - **TailTrim** is an optional Custom-only tail reduction path.
29
+ - **Native** preserves the Harness-style head/middle/tail trimming as one explicit profile.
30
+ - **Code skeleton (new, orthogonal gate)** — see below.
31
+
32
+ Every decision is recorded: stage, reducer, trigger, skip reason, and exact token counts where available.
33
+
34
+ ## Code skeleton gate (new)
35
+
36
+ When the gate is enabled, an oversized **fresh source-code tool result** (for example a large `read_file`) first tries a skeleton reduction: imports and type/function/class declarations are kept, function bodies are elided with a marker, and error lines inside elided bodies are preserved. If the skeleton cannot be produced or verified, the result falls back to the original head pruning — the gate can never make context worse.
37
+
38
+ Properties:
39
+
40
+ - **Orthogonal**: independent of the selected profile (`balanced`, `savings`, `cache-strict`, `adaptive`, `custom`, `off`, `native`). All profiles get the gate.
41
+ - **Off by default**: `codeSkeleton: { enabled: false }` until you turn it on.
42
+ - **Measurement-gated**: requires the exact DeepSeek tokenizer; without it the plugin fails open.
43
+ - **Session-frozen**: like all selector settings, changes affect newly observed sessions only.
44
+ - **Strictly parsed**: `codeSkeleton` must be exactly `{ enabled: boolean }`; malformed values throw on the runtime side and show as unreadable in the browser UI.
45
+
46
+ ## Settings UI
47
+
48
+ Choose a compression profile, set the Auto Compact trigger level, and toggle code-skeleton compression in the same settings section. The toggle saves on change and shows the saved state on reload.
49
+
50
+ ![Context Compression Selector settings UI](docs/assets/context-compression-selector-settings.png)
51
+
52
+ ## Install
53
+
54
+ **Recommended: install from npm.** One version covers every supported Harness line — `latest` carries the full 15-rc enum (0.1.0-rc.2 → 0.2.0-rc.2); the runtime picks per-line code paths on its own.
55
+
56
+ ```sh
57
+ dsh plugin --profile web add dsh-context-compression-improved@latest
58
+ dsh --profile web --dump-config
59
+ ```
60
+
61
+ From source (alternative — the internal package names intentionally stay upstream's):
62
+
63
+ ```sh
64
+ git clone https://github.com/drscrewdriver/dsh-context-compression-improved.git
65
+ cd dsh-context-compression-improved
66
+ pnpm install --frozen-lockfile
67
+ pnpm build
68
+ ```
69
+
70
+ Then pack the selector package and add it to a Harness profile — the full walkthrough, including verification and uninstall steps, is in the [installation guide](docs/installation.md).
71
+
72
+ ## Development
73
+
74
+ ```sh
75
+ pnpm install --frozen-lockfile
76
+ pnpm lint # ESLint baseline (also enforced in CI)
77
+ pnpm typecheck # runtime + selector + tests tsc, plus the bundle step
78
+ pnpm test # full vitest suite
79
+ pnpm test:watch # TDD loop: write the failing regression first, then make it pass
80
+ pnpm build
81
+ pnpm verify:release
82
+ ```
83
+
84
+ Contributions follow the upstream discipline: add the failing regression first, keep every production change inside this repository, and explain “triggered”, “enabled but skipped”, and fail-open evidence separately. See [CONTRIBUTING.md](CONTRIBUTING.md).
85
+
86
+ ## Compatibility
87
+
88
+ - Built and tested against the official DeepSeek Harness releases; peers declare the full supported-hosts enum (`0.1.0-rc.2` → `0.2.0-rc.2`, six lines) and the plugin uses public plugin and profile APIs only. The supported list is generated into the managed block above by `scripts/sync-hosts.mjs` from `scripts/hosts.mjs`.
89
+ - Requires Node `^22.19.0 || >=24` and pnpm `11.7.0`.
90
+ - The plugin uses only public Harness extension APIs and does not modify Harness core code. Unofficial community project, not affiliated with or endorsed by DeepSeek.
91
+
92
+ ## Credits and license
93
+
94
+ - Upstream project and all prior work: [WilliamShi666/dsh-context-compression-selector](https://github.com/WilliamShi666/dsh-context-compression-selector) by WilliamShi666 (MIT).
95
+ - Fork additions (code-skeleton gate, tooling, localized docs): drscrewdriver.
96
+ - MIT — see [LICENSE](LICENSE) (upstream copyright notice retained) and [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for bundled tokenizer provenance.
package/README.ru.md CHANGED
@@ -14,6 +14,10 @@
14
14
  > [!IMPORTANT]
15
15
  > Этот проект поддерживает **только модели DeepSeek**. Измерение без потерь и сжатие с потерями опираются на входящие в поставку официальные токенизаторы DeepSeek (`deepseek-v4-flash`, `deepseek-v4-pro`, `deepseek-v4-flash-vision-exp`). Во всех остальных случаях плагин работает по принципу fail-open и сохраняет исходные результаты инструментов. Полную модель безопасности см. в [апстрим-README](https://github.com/WilliamShi666/dsh-context-compression-selector#model-support-and-safety).
16
16
 
17
+ <!-- host-compat:begin — generated by scripts/sync-hosts.mjs from scripts/hosts.mjs; DO NOT EDIT -->
18
+ - **Поддерживаемые хосты DSH:** `0.1.0-rc.2` `0.1.0-rc.3` `0.1.0-rc.6` `0.1.0-rc.7` `0.1.0-rc.8` `0.1.1-rc.1` `0.1.1-rc.2` `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` (15 rc по линиям 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0)
19
+ <!-- host-compat:end -->
20
+
17
21
  ## Что это такое
18
22
 
19
23
  Долгоживущие задачи агентов накапливают большой объём вывода инструментов. Этот плагин сообщества добавляет выбираемые и проверяемые политики сокращения контекста результатов инструментов без изменения ядра DeepSeek Harness:
@@ -47,16 +51,10 @@
47
51
 
48
52
  ## Установка
49
53
 
50
- **Рекомендуется: установка из npm.** Один dist-tag на линейку Harness — `dsh-0.2.0` для линейки 0.2.0 (эта ветка), `dsh-0.1.7` для линейки 0.1.7, `dsh-0.1.5` для линейки 0.1.5, `dsh-0.1.2` для линейки 0.1.2.
54
+ **Рекомендуется: установка из npm.** Одна версия обслуживает все поддерживаемые линейки Harness — `latest` несёт полный перечень из 15 rc (0.1.0-rc.2 → 0.2.0-rc.2); рантайм сам выбирает ветки кода для своей линейки.
51
55
 
52
56
  ```sh
53
- dsh plugin --profile web add dsh-context-compression-improved@dsh-0.2.0
54
- # DSH 0.1.7 line:
55
- # dsh plugin --profile web add dsh-context-compression-improved@dsh-0.1.7
56
- # DSH 0.1.5 line:
57
- # dsh plugin --profile web add dsh-context-compression-improved@dsh-0.1.5
58
- # DSH 0.1.2 line:
59
- # dsh plugin --profile web add dsh-context-compression-improved@dsh-0.1.2
57
+ dsh plugin --profile web add dsh-context-compression-improved@latest
60
58
  dsh --profile web --dump-config
61
59
  ```
62
60
 
@@ -87,7 +85,7 @@ pnpm verify:release
87
85
 
88
86
  ## Совместимость
89
87
 
90
- - Собрано и протестировано против официального релиза DeepSeek Harness `dsh-v0.2.0-rc.1`; peers объявляют `>=0.2.0-rc.1 <0.2.1-0`, и плагин использует только публичные API плагинов и профилей. Прежние линейки по-прежнему обслуживаются собственными dist-tag (`dsh-0.1.7`, `dsh-0.1.5`, `dsh-0.1.2`).
88
+ - Собрано и протестировано против официальных релизов DeepSeek Harness; peers перечисляют полный список поддержки (`0.1.0-rc.2` → `0.2.0-rc.2`, шесть линеек), и плагин использует только публичные API плагинов и профилей. Список генерируется `scripts/sync-hosts.mjs` из `scripts/hosts.mjs` в управляемый блок выше.
91
89
  - Требуются Node `^22.19.0 || >=24` и pnpm `11.7.0`.
92
90
  - Плагин использует только публичные API расширений Harness и не изменяет код ядра Harness. Неофициальный проект сообщества, не связан с DeepSeek и не одобрен им.
93
91