dsh-context-compression-improved 0.9.5 → 0.9.7

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/README.de.md CHANGED
@@ -15,7 +15,7 @@
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
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)
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` `0.2.1-rc.1` (16 RC über die Linien 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1)
19
19
  <!-- host-compat:end -->
20
20
 
21
21
  ## Was es ist
@@ -51,7 +51,7 @@ Wählen Sie ein Kompressionsprofil, stellen Sie den Auto-Compact-Auslösepegel e
51
51
 
52
52
  ## Installation
53
53
 
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.
54
+ **Empfohlen: Installation über npm.** Eine einzige Version deckt alle unterstützten Harness-Linien ab — `latest` trägt die vollständige 16-rc-Aufzählung (0.1.0-rc.2 → 0.2.1-rc.1); die Runtime wählt die linien­spezifischen Codepfade selbst.
55
55
 
56
56
  ```sh
57
57
  dsh plugin --profile web add dsh-context-compression-improved@latest
@@ -85,7 +85,7 @@ Beiträge folgen der Upstream-Disziplin: zuerst die fehlgeschlagene Regression h
85
85
 
86
86
  ## Kompatibilität
87
87
 
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.
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.1-rc.1`, sieben 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.
89
89
  - Erfordert Node `^22.19.0 || >=24` und pnpm `11.7.0`.
90
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.
91
91
 
package/README.es.md CHANGED
@@ -15,7 +15,7 @@
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
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)
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` `0.2.1-rc.1` (16 rc en las líneas 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1)
19
19
  <!-- host-compat:end -->
20
20
 
21
21
  ## Qué es
@@ -51,7 +51,7 @@ Elija un perfil de compresión, configure el nivel de disparo de Auto Compact y
51
51
 
52
52
  ## Instalación
53
53
 
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.
54
+ **Recomendado: instalar desde npm.** Una única versión cubre todas las líneas de Harness compatibles — `latest` lleva la enumeración completa de 16 rc (0.1.0-rc.2 → 0.2.1-rc.1); el runtime elige por sí solo las rutas de código de cada línea.
55
55
 
56
56
  ```sh
57
57
  dsh plugin --profile web add dsh-context-compression-improved@latest
@@ -85,7 +85,7 @@ Las contribuciones siguen la disciplina del upstream: añadir primero la regresi
85
85
 
86
86
  ## Compatibilidad
87
87
 
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.
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.1-rc.1`, siete 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.
89
89
  - Requiere Node `^22.19.0 || >=24` y pnpm `11.7.0`.
90
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.
91
91
 
package/README.fr.md CHANGED
@@ -15,7 +15,7 @@
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
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)
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` `0.2.1-rc.1` (16 rc sur les lignes 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1)
19
19
  <!-- host-compat:end -->
20
20
 
21
21
  ## Qu'est-ce que c'est
@@ -51,7 +51,7 @@ Choisissez un profil de compression, réglez le niveau de déclenchement de l'Au
51
51
 
52
52
  ## Installation
53
53
 
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.
54
+ **Recommandé : installer depuis npm.** Une seule version couvre toutes les lignes Harness prises en charge — `latest` porte l'énumération complète des 16 rc (0.1.0-rc.2 → 0.2.1-rc.1) ; le runtime choisit lui-même les chemins de code propres à chaque ligne.
55
55
 
56
56
  ```sh
57
57
  dsh plugin --profile web add dsh-context-compression-improved@latest
@@ -85,7 +85,7 @@ Les contributions suivent la discipline de l'amont : ajouter d'abord la régress
85
85
 
86
86
  ## Compatibilité
87
87
 
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.
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.1-rc.1`, sept 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.
89
89
  - Nécessite Node `^22.19.0 || >=24` et pnpm `11.7.0`.
90
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.
91
91
 
package/README.it.md CHANGED
@@ -15,7 +15,7 @@
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
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)
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` `0.2.1-rc.1` (16 rc attraverso le linee 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1)
19
19
  <!-- host-compat:end -->
20
20
 
21
21
  ## Che cos'è
@@ -51,7 +51,7 @@ Scegliere un profilo di compressione, impostare il livello di attivazione dell'A
51
51
 
52
52
  ## Installazione
53
53
 
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.
54
+ **Consigliato: installare da npm.** Un'unica versione copre tutte le linee Harness supportate — `latest` porta l'enumerazione completa dei 16 rc (0.1.0-rc.2 → 0.2.1-rc.1); il runtime sceglie da solo i percorsi di codice di ciascuna linea.
55
55
 
56
56
  ```sh
57
57
  dsh plugin --profile web add dsh-context-compression-improved@latest
@@ -85,7 +85,7 @@ I contributi seguono la disciplina upstream: aggiungere prima la regressione che
85
85
 
86
86
  ## Compatibilità
87
87
 
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.
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.1-rc.1`, sette 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.
89
89
  - Richiede Node `^22.19.0 || >=24` e pnpm `11.7.0`.
90
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.
91
91
 
package/README.ja.md CHANGED
@@ -14,8 +14,11 @@
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
+ > [!TIP]
18
+ > **推奨の接続方法:API-key で DeepSeek をカスタム Responses API 経由に接続する。** 公式アカウントの Messages API ルートではなく、カスタムの OpenAI 互換エンドポイント(`/v1/responses`)の利用を推奨します。Anthropic 形式のメッセージ・シリアライズを経由しないためメッセージ形式に起因する問題が発生せず、`tool_use`/`tool_result` のペアリング検証(公式ルートの resume-replay 400 はプラグイン側では修復不可)を回避できます。また、時間に応じてエンドポイントノードを切り替えてもセッションを継続できます。
19
+
17
20
  <!-- 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)
21
+ - **対応する 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.2.1-rc.1`(0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1 の 16 rc)
19
22
  <!-- host-compat:end -->
20
23
 
21
24
  ## これは何か
@@ -49,9 +52,19 @@
49
52
 
50
53
  ![Context Compression Selector 設定 UI](docs/assets/context-compression-selector-settings.png)
51
54
 
55
+ ## モニタリング UI
56
+
57
+ 圧縮の実行中、プラグインは節約量のライブビューを提供します:**圧縮モニター**パネル(純節約/総節約、相殺、コンテキスト占有、キャッシュヒット率、コスト見積もり、ターン末尾の意図サマリー状態を表示し、パネル内で現在のセッションの再開/無効化を上書き可能)と、セッションのコンテキストトレンドチャート。
58
+
59
+ ![圧縮モニターパネル](assets/board.png)
60
+
61
+ 圧縮中のセッションのコンテキストトレンド:ステップ/ターン別のトークン構成とタイミングオーバーレイ。ハサミマーカーは削減の着地点を示します。
62
+
63
+ ![コンテキストトレンドチャート](assets/context.png)
64
+
52
65
  ## インストール
53
66
 
54
- ソースからビルドしてインストールします —— 本フォークは npm にも `dsh-context-compression-improved` として公開済みです(単一バージョンが全サポートラインをカバー:dist-tag `latest` が 15 rc 完全列挙 0.1.0-rc.2〜0.2.0-rc.2 を携え、ライン別コードパスはランタイムが自動選択)。内部パッケージ名は意図的にアップストリームのままです:
67
+ ソースからビルドしてインストールします —— 本フォークは npm にも `dsh-context-compression-improved` として公開済みです(単一バージョンが全サポートラインをカバー:dist-tag `latest` が 16 rc 完全列挙 0.1.0-rc.2〜0.2.1-rc.1 を携え、ライン別コードパスはランタイムが自動選択)。内部パッケージ名は意図的にアップストリームのままです:
55
68
 
56
69
  ```sh
57
70
  git clone https://github.com/drscrewdriver/dsh-context-compression-improved.git
@@ -78,7 +91,7 @@ pnpm verify:release
78
91
 
79
92
  ## 互換性
80
93
 
81
- - 公式 DeepSeek Harness リリースに対してビルド・テスト済み。peers はサポート対象の完全列挙(`0.1.0-rc.2`〜`0.2.0-rc.2`、6 ライン)を宣言し、公開されているプラグインおよびプロファイル API のみを使用します。リストは `scripts/sync-hosts.mjs` が `scripts/hosts.mjs` から上記の管理ブロックへ生成します。
94
+ - 公式 DeepSeek Harness リリースに対してビルド・テスト済み。peers はサポート対象の完全列挙(`0.1.0-rc.2`〜`0.2.1-rc.1`、7 ライン)を宣言し、公開されているプラグインおよびプロファイル API のみを使用します。リストは `scripts/sync-hosts.mjs` が `scripts/hosts.mjs` から上記の管理ブロックへ生成します。
82
95
  - Node `^22.19.0 || >=24` と pnpm `11.7.0` が必要です。
83
96
  - プラグインは Harness の公開拡張 API のみを使用し、Harness コアは改変しません。非公式のコミュニティプロジェクトであり、DeepSeek とは提携・承認関係にありません。
84
97
 
package/README.ko.md CHANGED
@@ -14,8 +14,11 @@
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
+ > [!TIP]
18
+ > **추천 연결 방식: API-key로 DeepSeek을 사용자 정의 Responses API에 연결하세요.** 공식 계정 Messages API 라우트 대신 사용자 정의 OpenAI 호환 엔드포인트(`/v1/responses`)를 사용하세요. Anthropic 스타일 메시지 직렬화를 거치지 않으므로 메시지 형식으로 인한 문제가 발생하지 않고, `tool_use`/`tool_result` 짝 검증 제한(공식 라우트의 resume-replay 400은 플러그인 쪽에서 수리 불가)을 회피할 수 있습니다. 또한 시간에 따라 엔드포인트 노드를 전환해도 세션을 이어서 사용할 수 있습니다.
19
+
17
20
  <!-- 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)
21
+ - **지원하는 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.2.1-rc.1` (0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1 라인의 16개 rc)
19
22
  <!-- host-compat:end -->
20
23
 
21
24
  ## 이것은 무엇인가
@@ -49,9 +52,19 @@
49
52
 
50
53
  ![Context Compression Selector 설정 UI](docs/assets/context-compression-selector-settings.png)
51
54
 
55
+ ## 모니터링 UI
56
+
57
+ 압축 실행 중 플러그인은 절약량의 라이브 뷰를 제공합니다: **압축 모니터링** 패널(순/총 절약, 상계, 컨텍스트 점유, 캐시 적중률, 비용 추정, 턴 말미 의도 요약 상태를 표시하며 패널에서 현재 세션의 복구/비활성화 직접 가능)과 세션의 컨텍스트 추세 차트.
58
+
59
+ ![압축 모니터링 패널](assets/board.png)
60
+
61
+ 압축 중인 세션의 컨텍스트 추세: 단계/턴별 토큰 구성과 시간 오버레이. 가위 마커는 절감 착지점을 표시합니다.
62
+
63
+ ![컨텍스트 추세 차트](assets/context.png)
64
+
52
65
  ## 설치
53
66
 
54
- 소스에서 빌드하여 설치합니다 —— 이 포크는 npm에도 `dsh-context-compression-improved`로 게시되어 있습니다(단일 버전이 모든 지원 라인을 커버: dist-tag `latest`가 15 rc 전체 열거 0.1.0-rc.2~0.2.0-rc.2를 담으며, 라인별 코드 경로는 런타임이 자동 선택). 내부 패키지 이름은 의도적으로 업스트림과 동일하게 유지됩니다:
67
+ 소스에서 빌드하여 설치합니다 —— 이 포크는 npm에도 `dsh-context-compression-improved`로 게시되어 있습니다(단일 버전이 모든 지원 라인을 커버: dist-tag `latest`가 16 rc 전체 열거 0.1.0-rc.2~0.2.1-rc.1를 담으며, 라인별 코드 경로는 런타임이 자동 선택). 내부 패키지 이름은 의도적으로 업스트림과 동일하게 유지됩니다:
55
68
 
56
69
  ```sh
57
70
  git clone https://github.com/drscrewdriver/dsh-context-compression-improved.git
@@ -78,7 +91,7 @@ pnpm verify:release
78
91
 
79
92
  ## 호환성
80
93
 
81
- - 공식 DeepSeek Harness 릴리스 기준으로 빌드·테스트되었습니다. peers는 지원 대상 전체 열거(`0.1.0-rc.2`~`0.2.0-rc.2`, 6개 라인)를 선언하며 공개된 플러그인 및 프로파일 API만 사용합니다. 목록은 `scripts/sync-hosts.mjs`가 `scripts/hosts.mjs`에서 위의 관리 블록으로 생성합니다.
94
+ - 공식 DeepSeek Harness 릴리스 기준으로 빌드·테스트되었습니다. peers는 지원 대상 전체 열거(`0.1.0-rc.2`~`0.2.1-rc.1`, 7개 라인)를 선언하며 공개된 플러그인 및 프로파일 API만 사용합니다. 목록은 `scripts/sync-hosts.mjs`가 `scripts/hosts.mjs`에서 위의 관리 블록으로 생성합니다.
82
95
  - Node `^22.19.0 || >=24`와 pnpm `11.7.0`이 필요합니다.
83
96
  - 플러그인은 Harness의 공개 확장 API만 사용하며 Harness 코어를 수정하지 않습니다. 비공식 커뮤니티 프로젝트이며 DeepSeek과 제휴하거나 승인받지 않았습니다.
84
97
 
package/README.md CHANGED
@@ -14,8 +14,11 @@
14
14
  > [!IMPORTANT]
15
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
16
 
17
+ > [!TIP]
18
+ > **Recommended: connect DeepSeek with your own API key via a custom Responses API endpoint.** Prefer a custom OpenAI-compatible endpoint (`/v1/responses`) over the official-account Messages API route: it does not go through the Anthropic-style message serialization, so requests never trip message-format issues or `tool_use`/`tool_result` pairing validation (the official route's resume-replay 400s cannot be repaired from the plugin side), and you can switch endpoint nodes over time and keep existing sessions running.
19
+
17
20
  <!-- 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)
21
+ - **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` `0.2.1-rc.1` (16 rc releases across lines 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1)
19
22
  <!-- host-compat:end -->
20
23
 
21
24
  ## What it is
@@ -49,9 +52,19 @@ Choose a compression profile, set the Auto Compact trigger level, and toggle cod
49
52
 
50
53
  ![Context Compression Selector settings UI](docs/assets/context-compression-selector-settings.png)
51
54
 
55
+ ## Monitoring UI
56
+
57
+ While compression runs, the plugin gives you a live view of what it saves: a **compression monitor** panel — net/gross savings, offsets, context usage, cache-hit rate, cost estimate, and the turn-tail intent-summary state, with a per-session resume/disable override right in the panel — next to the session's context trend chart.
58
+
59
+ ![Compression monitor panel](assets/board.png)
60
+
61
+ Context trend for a session under compression: per-step / per-turn token composition with a timing overlay; the scissors mark where reductions landed.
62
+
63
+ ![Context trend chart](assets/context.png)
64
+
52
65
  ## Install
53
66
 
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.
67
+ **Recommended: install from npm.** One version covers every supported Harness line — `latest` carries the full 16-rc enum (0.1.0-rc.2 → 0.2.1-rc.1); the runtime picks per-line code paths on its own.
55
68
 
56
69
  ```sh
57
70
  dsh plugin --profile web add dsh-context-compression-improved@latest
@@ -85,7 +98,7 @@ Contributions follow the upstream discipline: add the failing regression first,
85
98
 
86
99
  ## Compatibility
87
100
 
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`.
101
+ - Built and tested against the official DeepSeek Harness releases; peers declare the full supported-hosts enum (`0.1.0-rc.2` → `0.2.1-rc.1`, seven 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
102
  - Requires Node `^22.19.0 || >=24` and pnpm `11.7.0`.
90
103
  - 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
104
 
package/README.ru.md CHANGED
@@ -15,7 +15,7 @@
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
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)
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.2.1-rc.1` (16 rc по линиям 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1)
19
19
  <!-- host-compat:end -->
20
20
 
21
21
  ## Что это такое
@@ -51,7 +51,7 @@
51
51
 
52
52
  ## Установка
53
53
 
54
- **Рекомендуется: установка из npm.** Одна версия обслуживает все поддерживаемые линейки Harness — `latest` несёт полный перечень из 15 rc (0.1.0-rc.2 → 0.2.0-rc.2); рантайм сам выбирает ветки кода для своей линейки.
54
+ **Рекомендуется: установка из npm.** Одна версия обслуживает все поддерживаемые линейки Harness — `latest` несёт полный перечень из 16 rc (0.1.0-rc.2 → 0.2.1-rc.1); рантайм сам выбирает ветки кода для своей линейки.
55
55
 
56
56
  ```sh
57
57
  dsh plugin --profile web add dsh-context-compression-improved@latest
@@ -85,7 +85,7 @@ pnpm verify:release
85
85
 
86
86
  ## Совместимость
87
87
 
88
- - Собрано и протестировано против официальных релизов DeepSeek Harness; peers перечисляют полный список поддержки (`0.1.0-rc.2` → `0.2.0-rc.2`, шесть линеек), и плагин использует только публичные API плагинов и профилей. Список генерируется `scripts/sync-hosts.mjs` из `scripts/hosts.mjs` в управляемый блок выше.
88
+ - Собрано и протестировано против официальных релизов DeepSeek Harness; peers перечисляют полный список поддержки (`0.1.0-rc.2` → `0.2.1-rc.1`, семь линеек), и плагин использует только публичные API плагинов и профилей. Список генерируется `scripts/sync-hosts.mjs` из `scripts/hosts.mjs` в управляемый блок выше.
89
89
  - Требуются Node `^22.19.0 || >=24` и pnpm `11.7.0`.
90
90
  - Плагин использует только публичные API расширений Harness и не изменяет код ядра Harness. Неофициальный проект сообщества, не связан с DeepSeek и не одобрен им.
91
91
 
package/README.zh.md CHANGED
@@ -14,8 +14,11 @@
14
14
  > [!IMPORTANT]
15
15
  > 本项目仅支持 **DeepSeek 模型**。无损测量与有损压缩依赖内置的 DeepSeek 官方 tokenizer(`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
+ > [!TIP]
18
+ > **推荐接入方式:用 API key 以自定义 Responses API 连接 DeepSeek。** 建议走自定义 OpenAI 兼容端点(`/v1/responses`)而不是官方账号的 Messages API 路由:前者不经过 Anthropic 风格的消息序列化,不会因为 message 格式而出现问题,可避开 `tool_use`/`tool_result` 配对校验限制(官方路由 resume-replay 时的 400 插件侧无法修复);也便于按时间切换节点后接续会话。
19
+
17
20
  <!-- 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)
21
+ - **支持的 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.2.1-rc.1`(覆盖 0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1 七条线共 16 个 rc)
19
22
  <!-- host-compat:end -->
20
23
 
21
24
  ## 它是什么
@@ -49,9 +52,19 @@
49
52
 
50
53
  ![Context Compression Selector 设置界面](docs/assets/context-compression-selector-settings.png)
51
54
 
55
+ ## 监控界面
56
+
57
+ 压缩运行时,插件提供节省量的实时视图:**压缩监控**悬浮面板——净节省/毛节省/抵消/上下文占用/缓存命中率/成本估算/回合末意图摘要状态,面板内可直接对当前会话恢复或停用——以及会话的上下文趋势图。
58
+
59
+ ![压缩监控面板](assets/board.png)
60
+
61
+ 压缩会话的上下文趋势:逐步骤/轮次的 token 组成与耗时叠加,剪刀标记指示裁剪/折叠落点。
62
+
63
+ ![上下文趋势图](assets/context.png)
64
+
52
65
  ## 安装
53
66
 
54
- 从源码构建并安装 —— 本 fork 亦已发布到 npm,包名为 `dsh-context-compression-improved`(单版本覆盖全部支持线:`latest` 携带 15 个 rc 的完整枚举 0.1.0-rc.2 → 0.2.0-rc.2,分线代码路径由运行时自行选择);内部包名有意保持与上游一致:
67
+ 从源码构建并安装 —— 本 fork 亦已发布到 npm,包名为 `dsh-context-compression-improved`(单版本覆盖全部支持线:`latest` 携带 16 个 rc 的完整枚举 0.1.0-rc.2 → 0.2.1-rc.1,分线代码路径由运行时自行选择);内部包名有意保持与上游一致:
55
68
 
56
69
  ```sh
57
70
  git clone https://github.com/drscrewdriver/dsh-context-compression-improved.git
@@ -78,7 +91,7 @@ pnpm verify:release
78
91
 
79
92
  ## 兼容性
80
93
 
81
- - 基于官方 DeepSeek Harness 发布版构建并测试;peers 声明完整支持清单枚举(`0.1.0-rc.2` → `0.2.0-rc.2` 六条线),仅使用公开的插件与 Profile API。支持清单由 `scripts/sync-hosts.mjs` 从 `scripts/hosts.mjs` 生成到上方管理块。
94
+ - 基于官方 DeepSeek Harness 发布版构建并测试;peers 声明完整支持清单枚举(`0.1.0-rc.2` → `0.2.1-rc.1` 七条线),仅使用公开的插件与 Profile API。支持清单由 `scripts/sync-hosts.mjs` 从 `scripts/hosts.mjs` 生成到上方管理块。
82
95
  - 需要 Node `^22.19.0 || >=24` 与 pnpm `11.7.0`。
83
96
  - 插件只使用 Harness 公开扩展 API,不修改 Harness 核心代码。非官方社区项目,与 DeepSeek 无隶属或背书关系。
84
97
 
Binary file
Binary file
@@ -3,14 +3,14 @@
3
3
  > [English](installation.md) · [中文](installation.zh.md) · [日本語](installation.ja.md) · [한국어](installation.ko.md) · [Français](installation.fr.md) · [Deutsch](installation.de.md) · [Italiano](installation.it.md) · [Русский](installation.ru.md) · [Español](installation.es.md)
4
4
 
5
5
  Diese Anleitung installiert den Fork aus dem Quellcode. Der Fork ist außerdem auf npm als
6
- `dsh-context-compression-improved` unter dem Dist-Tag `latest` — eine einzige Version deckt alle unterstützten Harness-Linien ab (0.1.0-rc.2 bis 0.2.0-rc.2) veröffentlicht; der Paketname
6
+ `dsh-context-compression-improved` unter dem Dist-Tag `latest` — eine einzige Version deckt alle unterstützten Harness-Linien ab (0.1.0-rc.2 bis 0.2.1-rc.1) veröffentlicht; der Paketname
7
7
  bleibt absichtlich der des Upstreams. Die Runtime, die früher ein zweites Paket war, ist jetzt
8
8
  Teil davon — eine Installation bringt den gesamten Stapel mit.
9
9
 
10
10
  ## Voraussetzungen
11
11
 
12
12
  - Node `^22.19.0 || >=24` und pnpm `11.7.0` (`corepack enable` übernimmt die fixierte Version aus `packageManager`).
13
- - Eine DeepSeek-Harness-Installation innerhalb der 15-rc-Peer-Aufzählung des Plugins (`0.1.0-rc.2` bis `0.2.0-rc.2`).
13
+ - Eine DeepSeek-Harness-Installation innerhalb der 16-rc-Peer-Aufzählung des Plugins (`0.1.0-rc.2` bis `0.2.1-rc.1`).
14
14
  - Eine DeepSeek-Modellroute. Verlustbehaftete Kompression — einschließlich des Code-Skelett-Gates — entscheidet auf Zeichenbasis, daher verbleibt keine Anforderung an eine Route mit mitgeliefertem Tokenizer; wenn ein mitgelieferter Tokenizer existiert, werden seine exakten Zählungen als Telemetrie erfasst, und andere Routen fallen offen aus (fail-open) und behalten die ursprünglichen Tool-Ergebnisse.
15
15
  - Git.
16
16
 
@@ -3,14 +3,14 @@
3
3
  > [English](installation.md) · [中文](installation.zh.md) · [日本語](installation.ja.md) · [한국어](installation.ko.md) · [Français](installation.fr.md) · [Deutsch](installation.de.md) · [Italiano](installation.it.md) · [Русский](installation.ru.md) · [Español](installation.es.md)
4
4
 
5
5
  Esta guía instala el fork desde el código fuente. El fork también está publicado en npm como
6
- `dsh-context-compression-improved` bajo el dist-tag `latest`: una única versión cubre todas las líneas de Harness compatibles (0.1.0-rc.2 a 0.2.0-rc.2); el nombre del paquete
6
+ `dsh-context-compression-improved` bajo el dist-tag `latest`: una única versión cubre todas las líneas de Harness compatibles (0.1.0-rc.2 a 0.2.1-rc.1); el nombre del paquete
7
7
  permanece deliberadamente como el del upstream. El runtime, que antes era un segundo paquete,
8
8
  ahora forma parte de él, de modo que una sola instalación trae toda la pila.
9
9
 
10
10
  ## Requisitos previos
11
11
 
12
12
  - Node `^22.19.0 || >=24` y pnpm `11.7.0` (`corepack enable` toma la versión fijada del campo `packageManager`).
13
- - Una instalación de DeepSeek Harness dentro de la enumeración peer de 15 rc del plugin (`0.1.0-rc.2` a `0.2.0-rc.2`).
13
+ - Una instalación de DeepSeek Harness dentro de la enumeración peer de 16 rc del plugin (`0.1.0-rc.2` a `0.2.1-rc.1`).
14
14
  - Una ruta de modelo DeepSeek. La compresión con pérdida — incluida la puerta de esqueleto de código — decide sobre la base de caracteres, de modo que ya no queda ningún requisito de ruta con tokenizer incluido; cuando existe un tokenizer incluido, sus recuentos exactos se registran como telemetría, y las demás rutas fallan de forma abierta (fail-open) y conservan los resultados de herramientas originales.
15
15
  - Git.
16
16
 
@@ -3,14 +3,14 @@
3
3
  > [English](installation.md) · [中文](installation.zh.md) · [日本語](installation.ja.md) · [한국어](installation.ko.md) · [Français](installation.fr.md) · [Deutsch](installation.de.md) · [Italiano](installation.it.md) · [Русский](installation.ru.md) · [Español](installation.es.md)
4
4
 
5
5
  Ce guide installe le fork depuis les sources. Le fork est aussi publié sur npm sous le
6
- nom `dsh-context-compression-improved` avec le dist-tag `latest` — une seule version couvre toutes les lignes Harness prises en charge (0.1.0-rc.2 à 0.2.0-rc.2) ; le nom du package
6
+ nom `dsh-context-compression-improved` avec le dist-tag `latest` — une seule version couvre toutes les lignes Harness prises en charge (0.1.0-rc.2 à 0.2.1-rc.1) ; le nom du package
7
7
  reste volontairement celui de l'amont. Le runtime, qui constituait autrefois un second
8
8
  package, en fait désormais partie : une seule installation apporte toute la pile.
9
9
 
10
10
  ## Prérequis
11
11
 
12
12
  - Node `^22.19.0 || >=24` et pnpm `11.7.0` (`corepack enable` retient la version épinglée du champ `packageManager`).
13
- - Une installation de DeepSeek Harness dans l'énumération peer 15-rc du plugin (`0.1.0-rc.2` à `0.2.0-rc.2`).
13
+ - Une installation de DeepSeek Harness dans l'énumération peer 16-rc du plugin (`0.1.0-rc.2` à `0.2.1-rc.1`).
14
14
  - Une route de modèle DeepSeek. La compression avec perte — y compris la porte squelette de code — décide sur la base de caractères, de sorte qu'aucune exigence de route avec tokenizer fourni ne subsiste ; lorsqu'un tokenizer fourni existe, ses comptages exacts sont enregistrés comme télémétrie, et les autres routes échouent en mode ouvert (fail-open) et conservent les résultats d'outils originaux.
15
15
  - Git.
16
16
 
@@ -3,14 +3,14 @@
3
3
  > [English](installation.md) · [中文](installation.zh.md) · [日本語](installation.ja.md) · [한국어](installation.ko.md) · [Français](installation.fr.md) · [Deutsch](installation.de.md) · [Italiano](installation.it.md) · [Русский](installation.ru.md) · [Español](installation.es.md)
4
4
 
5
5
  Questa guida installa il fork dai sorgenti. Il fork è pubblicato anche su npm come
6
- `dsh-context-compression-improved` con il dist-tag `latest`: un'unica versione copre tutte le linee Harness supportate (0.1.0-rc.2 a 0.2.0-rc.2); il nome del pacchetto
6
+ `dsh-context-compression-improved` con il dist-tag `latest`: un'unica versione copre tutte le linee Harness supportate (0.1.0-rc.2 a 0.2.1-rc.1); il nome del pacchetto
7
7
  resta volutamente quello dell'upstream. Il runtime, che un tempo era un secondo pacchetto,
8
8
  ora ne fa parte, quindi una sola installazione porta con sé l'intera pila.
9
9
 
10
10
  ## Prerequisiti
11
11
 
12
12
  - Node `^22.19.0 || >=24` e pnpm `11.7.0` (`corepack enable` adotta la versione bloccata dal campo `packageManager`).
13
- - Un'installazione di DeepSeek Harness entro l'enumerazione peer a 15 rc del plugin (`0.1.0-rc.2` a `0.2.0-rc.2`).
13
+ - Un'installazione di DeepSeek Harness entro l'enumerazione peer a 16 rc del plugin (`0.1.0-rc.2` a `0.2.1-rc.1`).
14
14
  - Una rotta di modello DeepSeek. La compressione con perdita — incluso il gate dello scheletro di codice — decide sulla base dei caratteri, quindi non resta alcun requisito di rotta con tokenizer incluso; quando esiste un tokenizer incluso i suoi conteggi esatti vengono registrati come telemetria, e le altre rotte falliscono in modo aperto (fail-open) conservando i risultati degli strumenti originali.
15
15
  - Git.
16
16
 
@@ -3,13 +3,13 @@
3
3
  > [English](installation.md) · [中文](installation.zh.md) · [日本語](installation.ja.md) · [한국어](installation.ko.md) · [Français](installation.fr.md) · [Deutsch](installation.de.md) · [Italiano](installation.it.md) · [Русский](installation.ru.md) · [Español](installation.es.md)
4
4
 
5
5
  このガイドではソースからフォークをインストールします。フォークは npm にも公開済みです(dist-tag
6
- `latest`(単一バージョンがサポート対象の全 Harness ライン 0.1.0-rc.2〜0.2.0-rc.2 をカバー))。パッケージ名は意図的に上流と同一です(`dsh-context-compression-improved` の単一パッケージで、
6
+ `latest`(単一バージョンがサポート対象の全 Harness ライン 0.1.0-rc.2〜0.2.1-rc.1 をカバー))。パッケージ名は意図的に上流と同一です(`dsh-context-compression-improved` の単一パッケージで、
7
7
  以前は別パッケージだった runtime も同梱されます)。
8
8
 
9
9
  ## 前提条件
10
10
 
11
11
  - Node `^22.19.0 || >=24` と pnpm `11.7.0`(`corepack enable` で `packageManager` の固定バージョンが使われます)。
12
- - プラグインの 15-rc peer 列挙に含まれる DeepSeek Harness(`0.1.0-rc.2`〜`0.2.0-rc.2` のいずれか)。
12
+ - プラグインの 16-rc peer 列挙に含まれる DeepSeek Harness(`0.1.0-rc.2`〜`0.2.1-rc.1` のいずれか)。
13
13
  - DeepSeek V4 モデルルート(`deepseek-v4-flash`、`deepseek-v4-pro`、`deepseek-v4-flash-vision-exp`)。コードスケルトンゲートを含む非可逆圧縮には同梱の正確なトークナイザーが必要で、その他のルートは fail-open で元のツール結果を保持します。
14
14
  - Git。
15
15
 
@@ -3,13 +3,13 @@
3
3
  > [English](installation.md) · [中文](installation.zh.md) · [日本語](installation.ja.md) · [한국어](installation.ko.md) · [Français](installation.fr.md) · [Deutsch](installation.de.md) · [Italiano](installation.it.md) · [Русский](installation.ru.md) · [Español](installation.es.md)
4
4
 
5
5
  이 가이드는 소스에서 포크를 설치합니다. 포크는 npm에도 게시되어 있습니다(dist-tag
6
- `latest`(단일 버전이 지원되는 모든 Harness 라인 0.1.0-rc.2~0.2.0-rc.2를 커버)). 패키지 이름은 의도적으로 업스트림과 동일합니다(`dsh-context-compression-improved` 단일 패키지이며,
6
+ `latest`(단일 버전이 지원되는 모든 Harness 라인 0.1.0-rc.2~0.2.1-rc.1를 커버)). 패키지 이름은 의도적으로 업스트림과 동일합니다(`dsh-context-compression-improved` 단일 패키지이며,
7
7
  예전에 별도 패키지였던 runtime이 함께 포함됩니다).
8
8
 
9
9
  ## 사전 요구 사항
10
10
 
11
11
  - Node `^22.19.0 || >=24` 및 pnpm `11.7.0`(`corepack enable`은 `packageManager`의 고정 버전을 사용합니다).
12
- - 플러그인의 15-rc peer 열거에 포함되는 DeepSeek Harness 설치(`0.1.0-rc.2`~`0.2.0-rc.2`).
12
+ - 플러그인의 16-rc peer 열거에 포함되는 DeepSeek Harness 설치(`0.1.0-rc.2`~`0.2.1-rc.1`).
13
13
  - DeepSeek V4 모델 경로(`deepseek-v4-flash`, `deepseek-v4-pro`, `deepseek-v4-flash-vision-exp`). 코드 스켈레톤 게이트를 포함한 손실 압축은 번들된 정확한 토크나이저가 필요하며, 그 외의 경로는 fail-open으로 원본 도구 결과를 유지합니다.
14
14
  - Git.
15
15
 
@@ -3,14 +3,14 @@
3
3
  > [English](installation.md) · [中文](installation.zh.md) · [日本語](installation.ja.md) · [한국어](installation.ko.md) · [Français](installation.fr.md) · [Deutsch](installation.de.md) · [Italiano](installation.it.md) · [Русский](installation.ru.md) · [Español](installation.es.md)
4
4
 
5
5
  This guide installs the fork from source. The fork is published to npm as
6
- `dsh-context-compression-improved` under the `latest` — one version serves every supported Harness line, `0.1.0-rc.2` through `0.2.0-rc.2` dist-tag; the package name
6
+ `dsh-context-compression-improved` under the `latest` — one version serves every supported Harness line, `0.1.0-rc.2` through `0.2.1-rc.1` dist-tag; the package name
7
7
  intentionally stays upstream's. The runtime that used to be a second package is now part of
8
8
  it, so one install brings the whole stack.
9
9
 
10
10
  ## Prerequisites
11
11
 
12
12
  - Node `^22.19.0 || >=24` and pnpm `11.7.0` (`corepack enable` picks the pinned version from `packageManager`).
13
- - A DeepSeek Harness installation within the plugin's 15-rc peer enum (any of `0.1.0-rc.2` through `0.2.0-rc.2`).
13
+ - A DeepSeek Harness installation within the plugin's 16-rc peer enum (any of `0.1.0-rc.2` through `0.2.1-rc.1`).
14
14
  - A DeepSeek model route. Lossy compression — including the code-skeleton gate — decides on the character basis, so no bundled-tokenizer route requirement remains; when a bundled tokenizer exists its exact counts are recorded as telemetry, and other routes fail open and keep original tool results.
15
15
  - Git.
16
16
 
@@ -3,14 +3,14 @@
3
3
  > [English](installation.md) · [中文](installation.zh.md) · [日本語](installation.ja.md) · [한국어](installation.ko.md) · [Français](installation.fr.md) · [Deutsch](installation.de.md) · [Italiano](installation.it.md) · [Русский](installation.ru.md) · [Español](installation.es.md)
4
4
 
5
5
  Это руководство описывает установку форка из исходников. Форк также опубликован в npm как
6
- `dsh-context-compression-improved` под dist-tag `latest` — одна версия обслуживает все поддерживаемые линии Harness (0.1.0-rc.2 — 0.2.0-rc.2); имя пакета намеренно совпадает
6
+ `dsh-context-compression-improved` под dist-tag `latest` — одна версия обслуживает все поддерживаемые линии Harness (0.1.0-rc.2 — 0.2.1-rc.1); имя пакета намеренно совпадает
7
7
  с апстримовским. Рантайм, который раньше был отдельным вторым пакетом, теперь входит в его
8
8
  состав, поэтому одна установка приносит весь стек целиком.
9
9
 
10
10
  ## Предварительные требования
11
11
 
12
12
  - Node `^22.19.0 || >=24` и pnpm `11.7.0` (`corepack enable` берёт зафиксированную версию из поля `packageManager`).
13
- - Установка DeepSeek Harness из 15-rc peer-перечня плагина (`0.1.0-rc.2` — `0.2.0-rc.2`).
13
+ - Установка DeepSeek Harness из 16-rc peer-перечня плагина (`0.1.0-rc.2` — `0.2.1-rc.1`).
14
14
  - Маршрут модели DeepSeek. Сжатие с потерями — включая гейт скелетов кода — принимает решения на символьной основе, поэтому требование к маршруту со встроенным токенизатором больше не действует; если встроенный токенизатор есть, его точные подсчёты записываются как телеметрия, а остальные маршруты работают по принципу fail-open и сохраняют исходные результаты инструментов.
15
15
  - Git.
16
16
 
@@ -2,13 +2,13 @@
2
2
 
3
3
  > [English](installation.md) · [中文](installation.zh.md) · [日本語](installation.ja.md) · [한국어](installation.ko.md) · [Français](installation.fr.md) · [Deutsch](installation.de.md) · [Italiano](installation.it.md) · [Русский](installation.ru.md) · [Español](installation.es.md)
4
4
 
5
- 本教程从源码安装 fork。fork 亦已发布到 npm,dist-tag 为 `latest`(单一版本通吃全部受支持的 Harness 线:0.1.0-rc.2 至 0.2.0-rc.2);包名有意与上游保持一致:
5
+ 本教程从源码安装 fork。fork 亦已发布到 npm,dist-tag 为 `latest`(单一版本通吃全部受支持的 Harness 线:0.1.0-rc.2 至 0.2.1-rc.1);包名有意与上游保持一致:
6
6
  `dsh-context-compression-improved`(单一包 —— 原先独立发布的 runtime 包已并入其中)。
7
7
 
8
8
  ## 前置条件
9
9
 
10
10
  - Node `^22.19.0 || >=24` 与 pnpm `11.7.0`(`corepack enable` 会按 `packageManager` 字段使用固定版本)。
11
- - 处于插件 15-rc peer 枚举范围内的 DeepSeek Harness 安装(`0.1.0-rc.2` 至 `0.2.0-rc.2` 任意一版)。
11
+ - 处于插件 16-rc peer 枚举范围内的 DeepSeek Harness 安装(`0.1.0-rc.2` 至 `0.2.1-rc.1` 任意一版)。
12
12
  - DeepSeek 模型路由。有损压缩——包括代码骨架门——按字符基准决策,不再要求内建精确 tokenizer;存在内建 tokenizer 时其 exact 计数仅作遥测记录,其他路由 fail-open 并保留原始工具结果。
13
13
  - Git。
14
14
 
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "dsh-context-compression-improved",
3
- "version": "0.9.5",
3
+ "version": "0.9.7",
4
4
  "publishConfig": {
5
+ "registry": "https://registry.npmjs.org",
5
6
  "tag": "latest"
6
7
  },
7
8
  "type": "module",
@@ -53,7 +54,7 @@
53
54
  "packageManager": "pnpm@11.7.0",
54
55
  "engines": {
55
56
  "node": "^22.19.0 || >=24.0.0",
56
- "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"
57
+ "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.2.1-rc.1"
57
58
  },
58
59
  "scripts": {
59
60
  "build": "pnpm -r --if-present run bundle",
@@ -71,10 +72,10 @@
71
72
  "pack:dry-run": "pnpm -r --if-present run pack:dry-run"
72
73
  },
73
74
  "peerDependencies": {
74
- "@deepseek-ai/dsh-client-locale": "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",
75
- "@deepseek-ai/dsh-client-ui-primitives": "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",
76
- "@deepseek-ai/dsh-client-ui-settings": "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",
77
- "@deepseek-ai/dsh-client-ui-slots": "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"
75
+ "@deepseek-ai/dsh-client-locale": "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.2.1-rc.1",
76
+ "@deepseek-ai/dsh-client-ui-primitives": "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.2.1-rc.1",
77
+ "@deepseek-ai/dsh-client-ui-settings": "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.2.1-rc.1",
78
+ "@deepseek-ai/dsh-client-ui-slots": "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.2.1-rc.1"
78
79
  },
79
80
  "peerDependenciesMeta": {
80
81
  "@deepseek-ai/dsh-client-locale": {
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "id": "dsh-external/dsh-context-compression-improved",
3
- "version": "0.9.5",
3
+ "version": "0.9.7",
4
4
  "main": "./lib/index.js",
5
5
  "description": "Auditable tool-result context-compression selector with code-skeleton gate for DeepSeek Harness",
6
6
  "engines": {
7
- "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"
7
+ "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.2.1-rc.1"
8
8
  },
9
9
  "contributes": {
10
10
  "tools": [],
@@ -1030,6 +1030,16 @@ function asWebServer(value) {
1030
1030
  return typeof value.register === "function" ? value : void 0;
1031
1031
  }
1032
1032
  /**
1033
+ * `webServer.register` throws `duplicate exact route` when the same lib is
1034
+ * mounted twice by the host (two plugin ids resolving to one module: the
1035
+ * package-root manifest and the nested selector manifest). The other mount
1036
+ * already owns every path in the batch, so the collision is a success from
1037
+ * the plugin's point of view — without this, the losing arm logs a stack-
1038
+ * heavy warn pair on every boot (observed 0.9.5 on 0.2.0-rc.2, savings and
1039
+ * monitor).
1040
+ */
1041
+ const isDuplicateRouteError = (error) => String(error?.message ?? error).includes("duplicate exact route");
1042
+ /**
1033
1043
  * Serve `GET /api/dsh-context-compression-improved/estimator-catalog` — the
1034
1044
  * settings card's host-route dropdowns (live provider/model groups from the DSH
1035
1045
  * `llm` service plus the effective selection). Best effort: without the
@@ -1099,6 +1109,11 @@ function registerEstimatorCatalogRoute(ctx) {
1099
1109
  }, "contextCompressionSelector.estimator-catalog route");
1100
1110
  log("info", "context-compression estimator catalog route registered (%s): %s", channel, ESTIMATOR_CATALOG_ROUTES.join(", "));
1101
1111
  } catch (error) {
1112
+ if (isDuplicateRouteError(error)) {
1113
+ registered = true;
1114
+ log("info", "context-compression estimator catalog route already registered by another mount (%s)", channel);
1115
+ return;
1116
+ }
1102
1117
  log("warn", "context-compression estimator catalog route registration failed (%s): %o", channel, error);
1103
1118
  }
1104
1119
  };
@@ -1170,6 +1185,11 @@ function registerSavingsRoute(ctx) {
1170
1185
  }, "contextCompressionSelector.savings route");
1171
1186
  log("info", "context-compression savings route registered (%s): %s", channel, SAVINGS_ROUTES.join(", "));
1172
1187
  } catch (error) {
1188
+ if (isDuplicateRouteError(error)) {
1189
+ registered = true;
1190
+ log("info", "context-compression savings route already registered by another mount (%s)", channel);
1191
+ return;
1192
+ }
1173
1193
  log("warn", "context-compression savings route registration failed (%s): %o", channel, error);
1174
1194
  }
1175
1195
  };
@@ -1296,6 +1316,11 @@ function registerMonitorRoute(ctx) {
1296
1316
  }, "contextCompressionSelector.monitor route");
1297
1317
  log("info", "context-compression monitor route registered (%s): %s", channel, MONITOR_ROUTES.join(", "));
1298
1318
  } catch (error) {
1319
+ if (isDuplicateRouteError(error)) {
1320
+ registered = true;
1321
+ log("info", "context-compression monitor route already registered by another mount (%s)", channel);
1322
+ return;
1323
+ }
1299
1324
  log("warn", "context-compression monitor route registration failed (%s): %o", channel, error);
1300
1325
  }
1301
1326
  };
@@ -1,7 +1,7 @@
1
1
  import z from "@deepseek-ai/schemastery";
2
2
  import { Context, Service } from "@deepseek-ai/cordis";
3
- import { ContentBlock, ToolCallId } from "@deepseek-ai/dsh-llm";
4
3
  import { Session, SessionEvent } from "@deepseek-ai/dsh-session";
4
+ import { ContentBlock, ToolCallId } from "@deepseek-ai/dsh-llm";
5
5
  import { TokenMeasurement } from "@deepseek-ai/dsh-token-meter";
6
6
  //#region src/runtime/tokenpilot/dedup.d.ts
7
7
  /** Entry stored per first-seen content hash. */
@@ -1,9 +1,8 @@
1
1
  import { B as decimalRateNanoUnits, F as recordIntentFold, H as resolveOfficialDeepSeekPrice, I as recordRecertified, L as recordScore, M as getSummaryOverride, N as invalidateOnTaskChange, O as evaluateIntentGate, P as observeIntentEnabled, T as observeContextUsage, U as getSavingsLedger, V as priceOfficialDeepSeekUsage, W as savingsHash, _ as resolveCustomPolicy, b as COMPRESSION_PROFILES, c as charsToTokens, d as isValidAutoCompactThresholdPercent, f as parseContextCompressionSettings, g as DEFAULT_CUSTOM_COMPRESSION_POLICY, h as CustomCompressionPolicySchema, i as DEFAULTS, k as getAdvisorState, l as codePointLength, m as resolvePolicy, n as CONTEXT_COMPRESSION_SETTINGS_NAMESPACE, o as PRUNE_MARKER, p as resolveConfig, r as ContextCompressionSettingsSchema, s as charsForTokens, t as AUTO_COMPACT_THRESHOLD_LIMITS, u as isCompressionProfile, v as assertNever, y as deepFreeze, z as DEEPSEEK_OFFICIAL_PRICE_CATALOG_VERSION } from "./config.js";
2
- import { a as validatePublishedTailTrim, c as eventBySeq, i as tailTrimStub, l as sessionEvents, n as tailTrimMessage, o as compressionMessageSource, r as tailTrimRef, s as viewToolResult, t as parseTailTrimRef } from "./tail-trim.js";
2
+ import { a as validatePublishedTailTrim, c as eventBySeq, d as freezeMessage, i as tailTrimStub, l as sessionEvents, n as tailTrimMessage, o as compressionMessageSource, r as tailTrimRef, s as viewToolResult, t as parseTailTrimRef, u as createUserMessage } from "./tail-trim.js";
3
3
  import z from "@deepseek-ai/schemastery";
4
4
  import { createHash } from "node:crypto";
5
5
  import { Service } from "@deepseek-ai/cordis";
6
- import { createUserMessage, freezeMessage } from "@deepseek-ai/dsh-llm";
7
6
  import * as dshSessionNamespace from "@deepseek-ai/dsh-session";
8
7
  import { readFileSync } from "node:fs";
9
8
  import { Tokenizer } from "@huggingface/tokenizers";
@@ -1,5 +1,28 @@
1
1
  import { r as hostGenerationSnapshot } from "./host-generation.js";
2
- import { createUserMessage } from "@deepseek-ai/dsh-llm";
2
+ //#region src/compat/llm-messages.ts
3
+ /** Recursive `Object.freeze` over own enumerable properties (arrays included). */
4
+ function deepFreeze(value) {
5
+ if (value !== null && typeof value === "object" && !Object.isFrozen(value)) {
6
+ Object.freeze(value);
7
+ for (const nested of Object.values(value)) deepFreeze(nested);
8
+ }
9
+ return value;
10
+ }
11
+ /**
12
+ * Detach and deep-freeze a message whose identity already exists — the host
13
+ * factory is `deepFreeze(structuredClone(message))`, byte-for-byte.
14
+ */
15
+ function freezeMessage(message) {
16
+ return deepFreeze(structuredClone(message));
17
+ }
18
+ function createUserMessage(input) {
19
+ return deepFreeze(structuredClone({
20
+ ...input,
21
+ role: "user",
22
+ id: crypto.randomUUID()
23
+ }));
24
+ }
25
+ //#endregion
3
26
  //#region src/runtime/session-events.ts
4
27
  /**
5
28
  * Read one immutable Session event snapshot.
@@ -208,4 +231,4 @@ function sameNumbers(left, right) {
208
231
  return left !== void 0 && left.length === right.length && left.every((value, index) => value === right[index]);
209
232
  }
210
233
  //#endregion
211
- export { validatePublishedTailTrim as a, eventBySeq as c, tailTrimStub as i, sessionEvents as l, tailTrimMessage as n, compressionMessageSource as o, tailTrimRef as r, viewToolResult as s, parseTailTrimRef as t };
234
+ export { validatePublishedTailTrim as a, eventBySeq as c, freezeMessage as d, tailTrimStub as i, sessionEvents as l, tailTrimMessage as n, compressionMessageSource as o, tailTrimRef as r, viewToolResult as s, parseTailTrimRef as t, createUserMessage as u };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-context-compression-improved",
3
- "version": "0.9.5",
3
+ "version": "0.9.7",
4
4
  "description": "One-install context-compression selector bundle for DeepSeek Harness",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -67,7 +67,7 @@
67
67
  "author": "WilliamShi666",
68
68
  "engines": {
69
69
  "node": "^22.19.0 || >=24.0.0",
70
- "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"
70
+ "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.2.1-rc.1"
71
71
  },
72
72
  "keywords": [
73
73
  "deepseek",
@@ -79,6 +79,7 @@
79
79
  "license": "MIT",
80
80
  "publishConfig": {
81
81
  "access": "public",
82
+ "registry": "https://registry.npmjs.org",
82
83
  "tag": "latest"
83
84
  },
84
85
  "dependencies": {
@@ -90,25 +91,25 @@
90
91
  "@deepseek-ai/cordis": ">=4.0.1 <5",
91
92
  "@deepseek-ai/cordis-plugin-include": ">=1.0.6 <2",
92
93
  "@deepseek-ai/cordis-plugin-loader": ">=1.0.2 <2",
93
- "@deepseek-ai/dsh-agent": "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",
94
- "@deepseek-ai/dsh-agent-presets": "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",
95
- "@deepseek-ai/dsh-client-locale": "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",
96
- "@deepseek-ai/dsh-client-store": "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",
97
- "@deepseek-ai/dsh-client-ui-primitives": "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",
98
- "@deepseek-ai/dsh-client-ui-session": "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",
99
- "@deepseek-ai/dsh-client-ui-settings": "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",
100
- "@deepseek-ai/dsh-client-ui-slots": "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",
101
- "@deepseek-ai/dsh-client-ui-workspace": "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",
102
- "@deepseek-ai/dsh-command-compact": "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",
103
- "@deepseek-ai/dsh-compaction": "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",
104
- "@deepseek-ai/dsh-compaction-basic": "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",
105
- "@deepseek-ai/dsh-invariants": "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",
106
- "@deepseek-ai/dsh-llm": "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",
107
- "@deepseek-ai/dsh-session": "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",
108
- "@deepseek-ai/dsh-settings": "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",
109
- "@deepseek-ai/dsh-system-prompt": "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",
110
- "@deepseek-ai/dsh-token-meter": "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",
111
- "@deepseek-ai/dsh-tools": "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",
94
+ "@deepseek-ai/dsh-agent": "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.2.1-rc.1",
95
+ "@deepseek-ai/dsh-agent-presets": "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.2.1-rc.1",
96
+ "@deepseek-ai/dsh-client-locale": "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.2.1-rc.1",
97
+ "@deepseek-ai/dsh-client-store": "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.2.1-rc.1",
98
+ "@deepseek-ai/dsh-client-ui-primitives": "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.2.1-rc.1",
99
+ "@deepseek-ai/dsh-client-ui-session": "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.2.1-rc.1",
100
+ "@deepseek-ai/dsh-client-ui-settings": "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.2.1-rc.1",
101
+ "@deepseek-ai/dsh-client-ui-slots": "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.2.1-rc.1",
102
+ "@deepseek-ai/dsh-client-ui-workspace": "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.2.1-rc.1",
103
+ "@deepseek-ai/dsh-command-compact": "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.2.1-rc.1",
104
+ "@deepseek-ai/dsh-compaction": "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.2.1-rc.1",
105
+ "@deepseek-ai/dsh-compaction-basic": "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.2.1-rc.1",
106
+ "@deepseek-ai/dsh-invariants": "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.2.1-rc.1",
107
+ "@deepseek-ai/dsh-llm": "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.2.1-rc.1",
108
+ "@deepseek-ai/dsh-session": "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.2.1-rc.1",
109
+ "@deepseek-ai/dsh-settings": "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.2.1-rc.1",
110
+ "@deepseek-ai/dsh-system-prompt": "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.2.1-rc.1",
111
+ "@deepseek-ai/dsh-token-meter": "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.2.1-rc.1",
112
+ "@deepseek-ai/dsh-tools": "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.2.1-rc.1",
112
113
  "react": ">=18 <19"
113
114
  },
114
115
  "peerDependenciesMeta": {
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Local stand-ins for the two `@deepseek-ai/dsh-llm` message factories the
3
+ * pruner and TailTrim hot paths need. The package is an OPTIONAL peer — the
4
+ * official-clone profile in the packed-install e2e (and any host line that
5
+ * stops shipping it into a plugin's module graph) does not resolve it, and a
6
+ * static value import then crashes the whole plugin at module-load time with
7
+ * ERR_MODULE_NOT_FOUND. This mirrors the 0.9.3 pruner soft-import decision:
8
+ * the semantics are deliberately tiny and stable (deep clone → brand a fresh
9
+ * id → deep freeze), so the plugin carries its own copy instead of importing
10
+ * the host's.
11
+ */
12
+ import type { UserMessage } from '@deepseek-ai/dsh-llm'
13
+
14
+ /** Recursive `Object.freeze` over own enumerable properties (arrays included). */
15
+ function deepFreeze<T>(value: T): T {
16
+ if (value !== null && typeof value === 'object' && !Object.isFrozen(value)) {
17
+ Object.freeze(value)
18
+ for (const nested of Object.values(value as Record<string, unknown>)) {
19
+ deepFreeze(nested)
20
+ }
21
+ }
22
+ return value
23
+ }
24
+
25
+ /**
26
+ * Detach and deep-freeze a message whose identity already exists — the host
27
+ * factory is `deepFreeze(structuredClone(message))`, byte-for-byte.
28
+ */
29
+ export function freezeMessage<T>(message: T): T {
30
+ return deepFreeze(structuredClone(message))
31
+ }
32
+
33
+ /**
34
+ * Create one identified user-role message and freeze it before publication —
35
+ * the host factory spreads the input, stamps `role: 'user'` and a fresh UUID
36
+ * id, clones and freezes. The signature mirrors the host's generic form so
37
+ * call sites keep their excess-property discipline; `id`/`role` stay
38
+ * unconstructible via the `never` guards, exactly like the host's d.ts.
39
+ */
40
+ type NewUserMessage = Omit<UserMessage, 'id' | 'role'>
41
+
42
+ export function createUserMessage<T extends NewUserMessage>(
43
+ input: T & { readonly id?: never, readonly role?: never },
44
+ ): UserMessage {
45
+ return deepFreeze(structuredClone({
46
+ ...input,
47
+ role: 'user' as const,
48
+ id: crypto.randomUUID(),
49
+ })) as unknown as UserMessage
50
+ }
@@ -208,6 +208,18 @@ function asWebServer(value: unknown): WebServerLike | undefined {
208
208
  return typeof candidate.register === 'function' ? (value as WebServerLike) : undefined
209
209
  }
210
210
 
211
+ /**
212
+ * `webServer.register` throws `duplicate exact route` when the same lib is
213
+ * mounted twice by the host (two plugin ids resolving to one module: the
214
+ * package-root manifest and the nested selector manifest). The other mount
215
+ * already owns every path in the batch, so the collision is a success from
216
+ * the plugin's point of view — without this, the losing arm logs a stack-
217
+ * heavy warn pair on every boot (observed 0.9.5 on 0.2.0-rc.2, savings and
218
+ * monitor).
219
+ */
220
+ const isDuplicateRouteError = (error: unknown): boolean =>
221
+ String((error as Error)?.message ?? error).includes('duplicate exact route')
222
+
211
223
  /**
212
224
  * Serve `GET /api/dsh-context-compression-improved/estimator-catalog` — the
213
225
  * settings card's host-route dropdowns (live provider/model groups from the DSH
@@ -285,6 +297,11 @@ function registerEstimatorCatalogRoute(ctx: Context): void {
285
297
  )
286
298
  log('info', 'context-compression estimator catalog route registered (%s): %s', channel, ESTIMATOR_CATALOG_ROUTES.join(', '))
287
299
  } catch (error) {
300
+ if (isDuplicateRouteError(error)) {
301
+ registered = true
302
+ log('info', 'context-compression estimator catalog route already registered by another mount (%s)', channel)
303
+ return
304
+ }
288
305
  log('warn', 'context-compression estimator catalog route registration failed (%s): %o', channel, error)
289
306
  }
290
307
  }
@@ -359,6 +376,11 @@ function registerSavingsRoute(ctx: Context): void {
359
376
  )
360
377
  log('info', 'context-compression savings route registered (%s): %s', channel, SAVINGS_ROUTES.join(', '))
361
378
  } catch (error) {
379
+ if (isDuplicateRouteError(error)) {
380
+ registered = true
381
+ log('info', 'context-compression savings route already registered by another mount (%s)', channel)
382
+ return
383
+ }
362
384
  log('warn', 'context-compression savings route registration failed (%s): %o', channel, error)
363
385
  }
364
386
  }
@@ -472,6 +494,11 @@ export function registerMonitorRoute(ctx: Context): void {
472
494
  )
473
495
  log('info', 'context-compression monitor route registered (%s): %s', channel, MONITOR_ROUTES.join(', '))
474
496
  } catch (error) {
497
+ if (isDuplicateRouteError(error)) {
498
+ registered = true
499
+ log('info', 'context-compression monitor route already registered by another mount (%s)', channel)
500
+ return
501
+ }
475
502
  log('warn', 'context-compression monitor route registration failed (%s): %o', channel, error)
476
503
  }
477
504
  }
@@ -11,7 +11,11 @@
11
11
  import { Service } from '@deepseek-ai/cordis'
12
12
  import type { Context } from '@deepseek-ai/cordis'
13
13
  import z from '@deepseek-ai/schemastery'
14
- import { createUserMessage, freezeMessage } from '@deepseek-ai/dsh-llm'
14
+ // dsh-llm 是 optional peer:official-clone profile 的模块图解析不到它,静态
15
+ // value import 在 ESM 链接期直接 ERR_MODULE_NOT_FOUND 拖死整个插件挂载(
16
+ // packed-install e2e seedSettings 实证,2026-10-16)。工厂语义极小且稳定
17
+ // (clone → brand id → deepFreeze),携带本地副本,与 0.9.3 SessionSeq 软取同族。
18
+ import { createUserMessage, freezeMessage } from './compat/llm-messages.ts'
15
19
  import type { ContentBlock, ToolCallId, UserMessage } from '@deepseek-ai/dsh-llm'
16
20
  // ≤0.1.1 宿主 loader 模块表的 dsh-session 没有 SessionSeq 运行时导出——静态
17
21
  // named import 在 ESM 链接期即炸,loader entry(tool-result-pruner)mount 失败
@@ -1,6 +1,7 @@
1
1
  /** Plugin-owned TailTrim publication protocol over official Session events. */
2
2
 
3
- import { createUserMessage } from '@deepseek-ai/dsh-llm'
3
+ // 本地消息工厂,理由同 pruner.ts 头部注释(optional peer 静态导入会炸 ESM 链接期)。
4
+ import { createUserMessage } from '../compat/llm-messages.ts'
4
5
  import type { ContentBlock, UserMessage } from '@deepseek-ai/dsh-llm'
5
6
  import type { Session, SessionEvent } from '@deepseek-ai/dsh-session'
6
7
  import { sessionEvents } from './session-events.ts'
@@ -23,8 +23,8 @@ describe('standalone package contract', () => {
23
23
  .toBe(selector.engines?.dsh)
24
24
  expect(selector.peerDependencies?.['@deepseek-ai/dsh-command-compact'])
25
25
  .toBe(selector.engines?.dsh)
26
- // compat-legacy 单版本:dsh-* peer 与 engines.dsh 同为 15rc 枚举(hosts.mjs 口径)。
27
- expect(selector.engines?.dsh?.split(' || ')).toHaveLength(15)
26
+ // compat-legacy 七线:dsh-* peer 与 engines.dsh 同为 16rc 枚举(hosts.mjs 口径)。
27
+ expect(selector.engines?.dsh?.split(' || ')).toHaveLength(16)
28
28
  expect(selector.publishConfig?.tag).toBe('latest')
29
29
  expect(existsSync(resolve(root, '../runtime/package.json'))).toBe(false)
30
30
  })
@@ -51,8 +51,8 @@ describe('standalone package contract', () => {
51
51
  '@deepseek-ai/dsh-client-ui-slots',
52
52
  '@deepseek-ai/dsh-client-ui-settings',
53
53
  ])
54
- // compat-legacy 单版本:root=安装面,engines 与全部 peer 同为 15rc 枚举(闸门口径)。
55
- expect(rootManifest.engines?.dsh?.split(' || ')).toHaveLength(15)
54
+ // compat-legacy 七线:root=安装面,engines 与全部 peer 同为 16rc 枚举(闸门口径)。
55
+ expect(rootManifest.engines?.dsh?.split(' || ')).toHaveLength(16)
56
56
  for (const range of Object.values(rootManifest.peerDependencies ?? {})) {
57
57
  expect(range).toBe(rootManifest.engines?.dsh)
58
58
  }
@@ -12,6 +12,12 @@ allowBuilds:
12
12
  "@huggingface/tokenizers": true
13
13
 
14
14
  overrides:
15
+ # dev-toolchain security floors (GHSA-68fv-2mgg-jv7q source-map-js event-loop
16
+ # DoS via @tsdown/css/jsdom>css-tree; GHSA-93q8-gq69-wqmw ansi-regex ReDoS via
17
+ # pretty-format). Both are build/test-time only — never shipped in the plugin
18
+ # tarball — but `pnpm audit --audit-level high` gates CI on the full graph.
19
+ source-map-js: '>=1.2.2'
20
+ ansi-regex@5: '^5.0.1'
15
21
  '@deepseek-ai/cordis': '4.0.1'
16
22
  '@deepseek-ai/cordis-plugin-group': '1.0.1'
17
23
  '@deepseek-ai/cordis-plugin-include': '1.0.6'
@@ -0,0 +1,6 @@
1
+ {
2
+ "screenshots": [
3
+ "assets/board.png",
4
+ "assets/context.png"
5
+ ]
6
+ }
package/scripts/hosts.mjs CHANGED
@@ -2,8 +2,10 @@
2
2
  * hosts.mjs —— 宿主声明唯一事实源(enum-peer 家族范式,见
3
3
  * improve-dsh-plugins/enum-peer-migration/INDEX.md §A)。
4
4
  *
5
- * 15 rc 全量六线(0.1.0-rc.2 → 0.2.0-rc.2)。compat-legacy 单版本计划
6
- * (.agents/plans/cci-compat-legacy-15rc/)的 Gate 0 实跑结论:
5
+ * 16 rc 全量七线(0.1.0-rc.2 → 0.2.1-rc.1)。0.1.0→0.2.0 六线口径沿用
6
+ * compat-legacy 单版本计划(.agents/plans/cci-compat-legacy-15rc/)Gate 0 实跑结论;
7
+ * 0.2.1-rc.1 为七线补票(dsh-021-rc1-adapt),闸门只读 engines.dsh、peers 为
8
+ * 一致性面(optional),逐包存在域核对见适配计划 findings。
7
9
  * - 0.1.0-rc.2 格 cci 0.8.0 + 探针 boot 绿(findings B2.3)——无 0.1.0 降级依据;
8
10
  * - 三干净格证据目录 _tmp-audit/spike-cells/。
9
11
  *
@@ -27,6 +29,7 @@ export const supportedHosts = Object.freeze([
27
29
  '0.1.7-rc.2',
28
30
  '0.2.0-rc.1',
29
31
  '0.2.0-rc.2',
32
+ '0.2.1-rc.1',
30
33
  ])
31
34
  export const peerRange = supportedHosts.join(' || ')
32
35
  /** 显式偏离:devDeps 钉 rc.1(见文件头)。 */
@@ -1,5 +1,5 @@
1
1
  import { createHash } from 'node:crypto'
2
- import { selectorDshPeers } from './hosts.mjs'
2
+ import { selectorDshPeers, supportedHosts } from './hosts.mjs'
3
3
  import { spawn } from 'node:child_process'
4
4
  import { createReadStream } from 'node:fs'
5
5
  import { copyFile, mkdir, mkdtemp, readFile, readdir, realpath, rm, stat, writeFile } from 'node:fs/promises'
@@ -829,6 +829,22 @@ async function runOfficialCloneCliSmoke(referenceRoot, registry, upgradeFrom, ca
829
829
  if (upgradeFrom === undefined) throw new Error('release gate requires the previous published release for the official lifecycle')
830
830
  await dsh('plugin', '--profile', 'web', 'add',
831
831
  `dsh-context-compression-improved@${upgradeFrom}`, '--registry', registry)
832
+ // The published 0.9.x line statically imports OPTIONAL host peers from
833
+ // its host-plane runtime (dsh-llm/dsh-session/dsh-tools, and their own
834
+ // peer closure pulls in more — dsh-scope etc.; the candidate no longer
835
+ // imports any of them — local compat factories since the
836
+ // ERR_MODULE_NOT_FOUND fix). Boot probes resolve peers through the host
837
+ // loader, but the raw-node seed below resolves through the PROFILE tree,
838
+ // where optional peers never land (pnpm auto-installs non-optional peers
839
+ // only). Mirror the consumer leg's proven pattern: install the full
840
+ // pinned @deepseek-ai/* host closure into the profile so the previous
841
+ // release can link. cordis rides along because this add reifies the tree
842
+ // from the manifest and would otherwise prune the CLI's auto-installed
843
+ // peer phantom (the plugin's own up re-adds it for the post-up proofs).
844
+ await run('pnpm', ['add', ...officialHostPackages, '--registry', registry], {
845
+ cwd: join(dshHome, 'profiles/web'),
846
+ env: { ...environment, npm_config_frozen_lockfile: 'false' },
847
+ })
832
848
  const beforeUp = profilePackages()
833
849
  if (beforeUp.selector.version !== upgradeFrom) {
834
850
  throw new Error(`official lifecycle started on ${String(beforeUp.selector.version)}, expected ${upgradeFrom}`)
@@ -1171,8 +1187,8 @@ try {
1171
1187
  throw new Error(`packed selector has an invalid ${peer} peer range (expected the supportedHosts enum)`)
1172
1188
  }
1173
1189
  }
1174
- if (selector.engines?.dsh?.split(' || ').length !== 15) {
1175
- throw new Error('packed selector engines.dsh must carry the 15-rc supportedHosts enum')
1190
+ if (selector.engines?.dsh?.split(' || ').length !== supportedHosts.length) {
1191
+ throw new Error(`packed selector engines.dsh must carry the ${supportedHosts.length}-rc supportedHosts enum`)
1176
1192
  }
1177
1193
  for (const directory of [selectorDir]) {
1178
1194
  const notice = await readFile(join(directory, 'THIRD_PARTY_NOTICES.md'), 'utf8')
@@ -76,10 +76,10 @@ const manifestExpected = JSON.stringify(manifest, null, 2) + '\n'
76
76
  const BEGIN = '<!-- host-compat:begin — generated by scripts/sync-hosts.mjs from scripts/hosts.mjs; DO NOT EDIT -->'
77
77
  const END = '<!-- host-compat:end -->'
78
78
  const versionList = supportedHosts.map((v) => `\`${v}\``).join(' ')
79
- const LINES = '0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0'
79
+ const LINES = '0.1.0 / 0.1.1 / 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1'
80
80
  const linesPerLang = {
81
81
  'README.md': [`- **Supported DSH hosts:** ${versionList} (${supportedHosts.length} rc releases across lines ${LINES})`],
82
- 'README.zh.md': [`- **支持的 DSH 宿主:** ${versionList}(覆盖 ${LINES} 六条线共 ${supportedHosts.length} 个 rc)`],
82
+ 'README.zh.md': [`- **支持的 DSH 宿主:** ${versionList}(覆盖 ${LINES} 七条线共 ${supportedHosts.length} 个 rc)`],
83
83
  'README.de.md': [`- **Unterstützte DSH-Hosts:** ${versionList} (${supportedHosts.length} RC über die Linien ${LINES})`],
84
84
  'README.es.md': [`- **Hosts DSH compatibles:** ${versionList} (${supportedHosts.length} rc en las líneas ${LINES})`],
85
85
  'README.fr.md': [`- **Hôtes DSH pris en charge :** ${versionList} (${supportedHosts.length} rc sur les lignes ${LINES})`],
@@ -2,7 +2,7 @@ import { createHash } from 'node:crypto'
2
2
  import { readdir, readFile, stat } from 'node:fs/promises'
3
3
  import { join, relative } from 'node:path'
4
4
  import { fileURLToPath } from 'node:url'
5
- import { selectorDshPeers } from './hosts.mjs'
5
+ import { selectorDshPeers, supportedHosts } from './hosts.mjs'
6
6
 
7
7
  const root = fileURLToPath(new URL('..', import.meta.url))
8
8
 
@@ -148,17 +148,17 @@ if (selectorPackage.files?.some((entry) => entry.endsWith('.css'))) {
148
148
  if (selectorPackage.name !== 'dsh-context-compression-improved') fail('unexpected selector package name')
149
149
  if (selectorPackage.publishConfig?.access !== 'public') fail('selector publish access is not public')
150
150
  if (selectorPackage.publishConfig?.tag !== 'latest') fail('selector publish tag is not latest')
151
- // compat-legacy 单版本:dsh-* peer 走 hosts.mjs 的 15rc 枚举(同一口径)。
151
+ // compat-legacy 七线:dsh-* peer 走 hosts.mjs 的 16rc 枚举(同一口径)。
152
152
  for (const peer of selectorDshPeers) {
153
153
  if (selectorPackage.peerDependencies?.[peer] !== selectorPackage.engines?.dsh) {
154
154
  fail(`selector peer ${peer} is missing or outside the supportedHosts enum`)
155
155
  }
156
156
  }
157
- if (selectorPackage.engines?.dsh?.split(' || ').length !== 15) {
158
- fail('selector engines.dsh must carry the 15-rc supportedHosts enum')
157
+ if (selectorPackage.engines?.dsh?.split(' || ').length !== supportedHosts.length) {
158
+ fail(`selector engines.dsh must carry the ${supportedHosts.length}-rc supportedHosts enum`)
159
159
  }
160
- if (rootPackage.engines?.dsh?.split(' || ').length !== 15) {
161
- fail('root engines.dsh must carry the 15-rc supportedHosts enum (install-surface gate)')
160
+ if (rootPackage.engines?.dsh?.split(' || ').length !== supportedHosts.length) {
161
+ fail(`root engines.dsh must carry the ${supportedHosts.length}-rc supportedHosts enum (install-surface gate)`)
162
162
  }
163
163
  for (const peer of Object.keys(rootPackage.peerDependencies ?? {})) {
164
164
  if (rootPackage.peerDependencies[peer] !== rootPackage.engines.dsh) {