dsh-think-translate 1.0.12 → 1.1.0
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/LICENSE +21 -0
- package/README.de.md +10 -0
- package/README.es.md +10 -0
- package/README.fr.md +10 -0
- package/README.ja.md +10 -0
- package/README.ko.md +10 -0
- package/README.md +108 -87
- package/README.ru.md +10 -0
- package/README.zh-CN.md +10 -0
- package/lib/client.js +685 -33
- package/lib/index.js +527 -33
- package/package.json +52 -41
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 UncleK and dsh-think-translate contributors
|
|
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
|
@@ -54,6 +54,16 @@ New-Item -ItemType Junction -Path "$HOME\.dsh\profiles\node_modules\dsh-think-tr
|
|
|
54
54
|
# 3. web neu starten
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
+
## 🧯 Nach einem DSH-Upgrade
|
|
58
|
+
|
|
59
|
+
Client-Plugins von Drittanbietern werden über den Client-Modulgraphen von DSH geladen, und dieser Graph wird **pro Prozess nur einmal** zusammengesetzt – eine fehlgeschlagene Komposition bleibt bis zum Neustart im Speicher. Deshalb passieren direkt nach einem Upgrade meist diese drei Dinge.
|
|
60
|
+
|
|
61
|
+
- **Der Start aus einem Source-Checkout schlägt fehl** mit `client bundles not found; run \`pnpm run build\` before launch` —— die neuen Client-Pakete sind nicht gebaut: führe `pnpm run build` im Harness-Checkout aus und starte `dsh web` erneut.
|
|
62
|
+
- **Die Plugin-Oberfläche ist verschwunden** (keine übersetzte Think-Zeile, kein Abschnitt *Übersetzung der Gedankenkette* in den Einstellungen) —— **starte `dsh web` einmal neu**; ein bloßes Neuladen der Seite reicht manchmal nicht.
|
|
63
|
+
- **Die Liste der lokalen Modelle ist leer** —— der `ollama`-Dienst bedient dieses Modellverzeichnis nicht: prüfe `ollama list` (oder `GET /api/tags`) und das `OLLAMA_MODELS`, das der laufende Dienst tatsächlich verwendet. Liegen die Modelldateien auf einem anderen Laufwerk, kann ein Verzeichnis-Junction das Standardverzeichnis des Dienstes dorthin zeigen lassen.
|
|
64
|
+
|
|
65
|
+
Am Plugin ist nichts zu konfigurieren: Es deklariert keine Reihenfolge-Abhängigkeit zu DSH-Interna (es bindet nur den `slots`-Dienst und optional `@deepseek-ai/dsh-client-ui-primitives`) und läuft daher sowohl auf älterem DSH (≤ 0.1.1-rc) als auch auf der aktuellen Linie (≥ 0.1.2-alpha.1, inklusive 0.1.5-rc.1).
|
|
66
|
+
|
|
57
67
|
## 🚀 Verwendung
|
|
58
68
|
|
|
59
69
|
1. **Einstellungen → Übersetzung der Gedankenkette** öffnen
|
package/README.es.md
CHANGED
|
@@ -54,6 +54,16 @@ New-Item -ItemType Junction -Path "$HOME\.dsh\profiles\node_modules\dsh-think-tr
|
|
|
54
54
|
# 3. reinicia web
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
+
## 🧯 Después de actualizar DSH
|
|
58
|
+
|
|
59
|
+
Los plugins de cliente de terceros se cargan a través del grafo de módulos de cliente de DSH, y ese grafo se compone **una sola vez por proceso**: una composición fallida permanece en memoria hasta reiniciar. Por eso, justo después de actualizar suelen aparecer estas tres cosas.
|
|
60
|
+
|
|
61
|
+
- **Arrancar desde un checkout del código falla** con `client bundles not found; run \`pnpm run build\` before launch` —— los paquetes de cliente nuevos vienen sin compilar: ejecuta `pnpm run build` en el checkout del harness y vuelve a iniciar `dsh web`.
|
|
62
|
+
- **La interfaz del plugin desaparece** (la fila Think sin traducción, sin la sección *Traducción de cadena de pensamiento* en Ajustes) —— **reinicia `dsh web`**; a veces no basta con recargar la página.
|
|
63
|
+
- **La lista de modelos locales está vacía** —— el servicio `ollama` no está sirviendo ese directorio de modelos: revisa `ollama list` (o `GET /api/tags`) y el `OLLAMA_MODELS` que usa realmente el servicio en ejecución. Si los modelos están en otra unidad, un enlace de directorio (junction) puede apuntar el directorio predeterminado del servicio hacia ellos.
|
|
64
|
+
|
|
65
|
+
No hay nada que configurar en el plugin: no declara dependencia de orden con los paquetes internos de DSH (solo se enlaza al servicio `slots` y, opcionalmente, a `@deepseek-ai/dsh-client-ui-primitives`), así que funciona tanto en DSH antiguo (≤ 0.1.1-rc) como en la línea actual (≥ 0.1.2-alpha.1, incluida 0.1.5-rc.1).
|
|
66
|
+
|
|
57
67
|
## 🚀 Uso
|
|
58
68
|
|
|
59
69
|
1. Abre **Ajustes → Traducción de cadena de pensamiento**
|
package/README.fr.md
CHANGED
|
@@ -54,6 +54,16 @@ New-Item -ItemType Junction -Path "$HOME\.dsh\profiles\node_modules\dsh-think-tr
|
|
|
54
54
|
# 3. redémarrez web
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
+
## 🧯 Après une mise à jour de DSH
|
|
58
|
+
|
|
59
|
+
Les plugins clients tiers sont chargés via le graphe de modules client de DSH, et ce graphe n'est composé **qu'une seule fois par processus** : une composition en échec reste en mémoire jusqu'au redémarrage. D'où ces trois écueils juste après une mise à jour.
|
|
60
|
+
|
|
61
|
+
- **Le démarrage depuis un checkout source échoue** avec `client bundles not found; run \`pnpm run build\` before launch` —— les nouveaux paquets clients ne sont pas compilés : lancez `pnpm run build` dans le checkout du harness, puis redémarrez `dsh web`.
|
|
62
|
+
- **L'interface du plugin a disparu** (pas de ligne Think traduite, pas de section *Traduction de chaîne de réflexion* dans les Réglages) —— **redémarrez `dsh web`** ; un simple rafraîchissement de la page ne suffit pas toujours.
|
|
63
|
+
- **La liste des modèles locaux est vide** —— le service `ollama` ne sert pas ce répertoire de modèles : vérifiez `ollama list` (ou `GET /api/tags`) et l'`OLLAMA_MODELS` réellement utilisé par le service en cours. Si les modèles sont sur un autre disque, une jonction de répertoire peut pointer le répertoire par défaut du service vers eux.
|
|
64
|
+
|
|
65
|
+
Rien à configurer côté plugin : il ne déclare aucune dépendance d'ordre vis-à-vis des paquets internes de DSH (il ne se lie qu'au service `slots`, et éventuellement à `@deepseek-ai/dsh-client-ui-primitives`), et fonctionne donc aussi bien sur un DSH ancien (≤ 0.1.1-rc) que sur la ligne actuelle (≥ 0.1.2-alpha.1, 0.1.5-rc.1 incluse).
|
|
66
|
+
|
|
57
67
|
## 🚀 Utilisation
|
|
58
68
|
|
|
59
69
|
1. Ouvrez **Réglages → Traduction de chaîne de réflexion**
|
package/README.ja.md
CHANGED
|
@@ -54,6 +54,16 @@ New-Item -ItemType Junction -Path "$HOME\.dsh\profiles\node_modules\dsh-think-tr
|
|
|
54
54
|
# 3. web を再起動
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
+
## 🧯 DSH アップグレード後
|
|
58
|
+
|
|
59
|
+
サードパーティのクライアントプラグインは DSH のクライアントモジュールグラフ経由で読み込まれ、このグラフは**プロセス起動時に一度だけ**構成されます。失敗した構成は再起動までメモリに残ります。そのため、アップグレード直後は次の 3 つがよく起きます。
|
|
60
|
+
|
|
61
|
+
- **ソースからの起動が失敗する**:`client bundles not found; run \`pnpm run build\` before launch` —— 新しいクライアントパッケージは未ビルドです。harness のチェックアウトで `pnpm run build` を実行してから、`dsh web` を起動し直してください。
|
|
62
|
+
- **プラグインの UI が消える**(Think 行に訳文がない、設定に「思考チェーン翻訳」がない)—— **`dsh web` を一度再起動**してください。ページを再読み込みするだけでは足りないことがあります。
|
|
63
|
+
- **ローカルモデルの一覧が空** —— `ollama` サービスがそのモデルディレクトリを見ていません:`ollama list`(または `GET /api/tags`)と、実行中のサービスが実際に使っている `OLLAMA_MODELS` を確認してください。モデルが別ドライブにある場合は、ディレクトリジャンクションで既定ディレクトリをそちらへ向けられます。
|
|
64
|
+
|
|
65
|
+
プラグイン側の設定は不要です。DSH 内部パッケージの読み込み順に依存せず(`slots` サービスだけを利用し、`@deepseek-ai/dsh-client-ui-primitives` は任意)、旧バージョン(≤ 0.1.1-rc)でも現行ライン(≥ 0.1.2-alpha.1、0.1.5-rc.1 を含む)でも動作します。
|
|
66
|
+
|
|
57
67
|
## 🚀 使い方
|
|
58
68
|
|
|
59
69
|
1. **設定 → 思考チェーン翻訳** を開く
|
package/README.ko.md
CHANGED
|
@@ -54,6 +54,16 @@ New-Item -ItemType Junction -Path "$HOME\.dsh\profiles\node_modules\dsh-think-tr
|
|
|
54
54
|
# 3. web 재시작
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
+
## 🧯 DSH 업그레이드 후
|
|
58
|
+
|
|
59
|
+
서드파티 클라이언트 플러그인은 DSH의 클라이언트 모듈 그래프를 통해 로드되며, 이 그래프는 **프로세스 시작 시 한 번만** 구성됩니다. 실패한 구성은 재시작 전까지 메모리에 남습니다. 그래서 업그레이드 직후에는 보통 다음 세 가지가 발생합니다.
|
|
60
|
+
|
|
61
|
+
- **소스에서 시작하면 실패**: `client bundles not found; run \`pnpm run build\` before launch` —— 새 클라이언트 패키지가 아직 빌드되지 않은 상태입니다. harness 체크아웃에서 `pnpm run build`를 실행한 뒤 `dsh web`을 다시 시작하세요.
|
|
62
|
+
- **플러그인 UI가 사라짐** (Think 행에 번역이 없고, 설정에 "사고 체인 번역"이 없음) —— **`dsh web`을 한 번 재시작**하세요. 페이지를 새로고침하는 것만으로는 부족할 때가 있습니다.
|
|
63
|
+
- **로컬 모델 목록이 비어 있음** —— `ollama` 서비스가 해당 모델 디렉터리를 보고 있지 않습니다: `ollama list`(또는 `GET /api/tags`)와 실행 중인 서비스가 실제로 사용하는 `OLLAMA_MODELS`를 확인하세요. 모델 파일이 다른 드라이브에 있다면 디렉터리 정션으로 기본 디렉터리를 그쪽으로 연결할 수 있습니다.
|
|
64
|
+
|
|
65
|
+
플러그인 쪽에서 설정할 것은 없습니다. DSH 내부 패키지의 로드 순서에 의존하지 않고(`slots` 서비스만 사용하며 `@deepseek-ai/dsh-client-ui-primitives`는 선택 사항), 구버전(≤ 0.1.1-rc)과 현재 라인(≥ 0.1.2-alpha.1, 0.1.5-rc.1 포함) 모두에서 동작합니다.
|
|
66
|
+
|
|
57
67
|
## 🚀 사용법
|
|
58
68
|
|
|
59
69
|
1. **설정 → 사고 체인 번역** 열기
|
package/README.md
CHANGED
|
@@ -1,87 +1,108 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
|
|
3
|
-
# 🐋 dsh-think-translate
|
|
4
|
-
|
|
5
|
-
**Languages:** [English](README.md) · [中文](README.zh-CN.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Español](README.es.md) · [Français](README.fr.md) · [Deutsch](README.de.md) · [Русский](README.ru.md)
|
|
6
|
-
|
|
7
|
-
[](https://www.npmjs.com/package/dsh-think-translate)
|
|
8
|
-
[](LICENSE)
|
|
9
|
-
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
10
|
-
|
|
11
|
-
<img src="demo/demo.gif" width="46%" alt="dsh-think-translate demo" style="border:1px solid #4D6BFE;border-radius:8px;margin:4px" />
|
|
12
|
-
<img src="demo/demo2.gif" width="46%" alt="dsh-think-translate demo 2" style="border:1px solid #4D6BFE;border-radius:8px;margin:4px" />
|
|
13
|
-
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
Translate the **reasoning / thinking chain (chain-of-thought), task cards and answers** of the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) Web UI into one of **8 target languages** — in real time, on the display layer only. The originals stay untouched in the transcript, and the translated text **never enters the model context**.
|
|
19
|
-
|
|
20
|
-
## ✨ Why dsh-think-translate
|
|
21
|
-
|
|
22
|
-
DeepSeek-class models often reason in Chinese — or in whatever language they happen to think in. dsh-think-translate renders the **Think row, task cards and answer** in *your* language while you watch, like subtitles for the model's thinking.
|
|
23
|
-
|
|
24
|
-
- **🕵️ Read any thinking chain** — reasoning, chain-of-thought, task cards and answers translated in real time, streamed batch by batch
|
|
25
|
-
- **🌍 8 languages, one consistent UI** — 中文 / English / 日本語 / 한국어 / Español / Français / Deutsch / Русский; the settings panel, thinking rows and task cards all follow your choice, and it persists across reloads
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
# Option
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
#
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
- **
|
|
76
|
-
- **
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
##
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# 🐋 dsh-think-translate
|
|
4
|
+
|
|
5
|
+
**Languages:** [English](README.md) · [中文](README.zh-CN.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Español](README.es.md) · [Français](README.fr.md) · [Deutsch](README.de.md) · [Русский](README.ru.md)
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/dsh-think-translate)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
10
|
+
|
|
11
|
+
<img src="demo/demo.gif" width="46%" alt="dsh-think-translate demo" style="border:1px solid #4D6BFE;border-radius:8px;margin:4px" />
|
|
12
|
+
<img src="demo/demo2.gif" width="46%" alt="dsh-think-translate demo 2" style="border:1px solid #4D6BFE;border-radius:8px;margin:4px" />
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
Translate the **reasoning / thinking chain (chain-of-thought), task cards and answers** of the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) Web UI into one of **8 target languages** — in real time, on the display layer only. The originals stay untouched in the transcript, and the translated text **never enters the model context**.
|
|
19
|
+
|
|
20
|
+
## ✨ Why dsh-think-translate
|
|
21
|
+
|
|
22
|
+
DeepSeek-class models often reason in Chinese — or in whatever language they happen to think in. dsh-think-translate renders the **Think row, task cards and answer** in *your* language while you watch, like subtitles for the model's thinking.
|
|
23
|
+
|
|
24
|
+
- **🕵️ Read any thinking chain** — reasoning, chain-of-thought, task cards and answers translated in real time, streamed batch by batch
|
|
25
|
+
- **🌍 8 languages, one consistent UI** — 中文 / English / 日本語 / 한국어 / Español / Français / Deutsch / Русский; the settings panel, thinking rows and task cards all follow your choice, and it persists across reloads
|
|
26
|
+
- **🔗 Dynamic provider chain** — order providers by drag-and-drop, enable/disable each one, and set an independent fallback chain. Built-ins (google gtx, bing, local Ollama) plus any number of custom providers
|
|
27
|
+
- **🔌 Custom providers (OpenAI & Anthropic)** — add arbitrary OpenAI-compatible endpoints (any `/v1/chat/completions` gateway) or native **Anthropic Messages API** endpoints (Claude) from the settings panel: name, type, base URL, API key, model
|
|
28
|
+
- **🪄 DSH provider discovery** — providers already configured in DSH's `settings.yaml` (`llm-pi-ai.providers`, e.g. linuxdo-hub, coding-hub) are auto-discovered and appear in the chain as read-only "DSH" entries; keys are resolved from `.credentials.yaml` at runtime and never written to the plugin's config
|
|
29
|
+
- **🔒 Private & offline-first** — local Ollama (qwen2.5:7b / 14b or custom) is a first-class provider: free, unlimited, nothing leaves your machine. First local-model selection **auto-downloads** the model with a live progress bar and enables it when done
|
|
30
|
+
- **🧠 Zero context cost** — pure display layer: the model still sees the original text, and translated text never consumes the context window
|
|
31
|
+
- **☁️ Google / Bing fallback** — automatic switch when other providers are unavailable (google goes through a Node CONNECT tunnel using the system proxy, bypassing anti-bot blocks)
|
|
32
|
+
- **🛡️ Code-safe** — file paths, commands, URLs, regexes and pure-code lines are never translated
|
|
33
|
+
- **🧩 Paragraph & sentence-aware chunking** — long thinking chains are split on blank lines (paragraph structure preserved) and further batched by sentence, so even a small local model keeps quality
|
|
34
|
+
- **⏱️ Resilient** — 3× backoff retries, per-provider test buttons, failed results never cached
|
|
35
|
+
- **🎚️ Adjustable translation timing** — pre-translate everything, lazy-load historical chains (default), or translate only the expanded chain
|
|
36
|
+
|
|
37
|
+
## 📦 Installation
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Option 1: npm (recommended)
|
|
41
|
+
dsh plugin --profile web add dsh-think-translate
|
|
42
|
+
# then restart web
|
|
43
|
+
|
|
44
|
+
# Option 2: GitHub
|
|
45
|
+
dsh plugin --profile web add github:UncleK/dsh-think-translate
|
|
46
|
+
|
|
47
|
+
# Option 3: manual (junction + patch)
|
|
48
|
+
# 1. link the package into the profile's node_modules
|
|
49
|
+
New-Item -ItemType Junction -Path "$HOME\.dsh\profiles\node_modules\dsh-think-translate" `
|
|
50
|
+
-Target "<repo path>"
|
|
51
|
+
# 2. add to "$HOME\.dsh\profiles\web\cordis.patch.yml":
|
|
52
|
+
# - insert:
|
|
53
|
+
# - id: dsh-think-translate
|
|
54
|
+
# name: dsh-think-translate
|
|
55
|
+
# 3. restart web
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## 🧯 After a DSH upgrade
|
|
59
|
+
|
|
60
|
+
Third-party client plugins load through DSH's client module graph, and that graph is composed **once per process** — a composition that failed is remembered in memory until the process restarts. So these three things commonly bite right after an upgrade:
|
|
61
|
+
|
|
62
|
+
- **Starting from a source checkout fails with** `client bundles not found; run \`pnpm run build\` before launch` — the new client packages ship unbuilt: run `pnpm run build` in the harness checkout, then start `dsh web` again.
|
|
63
|
+
- **The plugin's UI is gone** (no translated Think row, no *Think Translation* section in Settings) — **restart `dsh web`**; refreshing the page alone is sometimes not enough.
|
|
64
|
+
- **The local model list is empty** — the `ollama` service is not serving that model directory: check `ollama list` (or `GET /api/tags`) and the `OLLAMA_MODELS` the running service actually uses. When the model files live on another drive, a directory junction can point the service's default directory at them.
|
|
65
|
+
|
|
66
|
+
Nothing to configure on the plugin side: it declares no ordering dependency on DSH internals (it binds only to the `slots` service, plus an optional `@deepseek-ai/dsh-client-ui-primitives`), so it runs on both older DSH (≤ 0.1.1-rc) and the current line (≥ 0.1.2-alpha.1, 0.1.5-rc.1 included).
|
|
67
|
+
|
|
68
|
+
## 🚀 Usage
|
|
69
|
+
|
|
70
|
+
1. Open **Settings → Think Translation**
|
|
71
|
+
2. Pick the **target language** (e.g. 日本語) — the settings panel, thinking rows and task cards all switch to it
|
|
72
|
+
3. **Manage the provider chain** (drag to reorder):
|
|
73
|
+
- Built-ins: **google gtx / bing** (free, works out of the box via system proxy) and **local Ollama** — on first local-model selection a download prompt appears (qwen2.5:7b / 14b or custom); it auto-enables when finished
|
|
74
|
+
- **DSH providers**: endpoints already configured in DSH (`llm-pi-ai.providers`) appear automatically as read-only entries (badge "DSH"); enable them to route translation through your existing gateway accounts
|
|
75
|
+
- **Custom providers**: click "Add custom provider" to register any OpenAI-compatible endpoint or a native Anthropic Messages endpoint (base URL, API key, model); each row has a **test** button to verify it live. Instead of typing the key you can name an **environment variable** (`apiKeyEnv`) — the key is then read from the environment at request time and never written to `config.json`; a row using one shows an `env:NAME` badge
|
|
76
|
+
- Use the **fallback chain** toggle to keep a backup set (e.g. google/bing) when the primary chain fails
|
|
77
|
+
4. Send a message that makes the model think, then expand the **Think row** to read the translation and compare with the original
|
|
78
|
+
|
|
79
|
+
## ⚙️ How it works
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
browser → POST /_xlate/translate (same-origin, no CORS)
|
|
83
|
+
→ host provider chain (fail-open, user-ordered):
|
|
84
|
+
chain: [provider1, provider2, ...] ← drag-reordered in settings
|
|
85
|
+
each provider is one of:
|
|
86
|
+
google (gtx via Node CONNECT tunnel / curl through system proxy)
|
|
87
|
+
bing (ttranslatev3 via curl)
|
|
88
|
+
openai (OpenAI-compatible /chat/completions — Ollama local or any gateway)
|
|
89
|
+
anthropic(Anthropic Messages API /v1/messages)
|
|
90
|
+
fallback chain (independent, e.g. google/bing) tried when the primary chain fails
|
|
91
|
+
→ browser-direct fallback
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
- **Provider config** lives in `config.json` (runtime, gitignored): `chain` (ordered ids), `fallback` (enabled + chain), `providers` (per-provider `type`/`enabled`/`baseURL`/`apiKey`/`apiKeyEnv`/`model`). Old `priority`-based configs auto-migrate. A provider that declares `apiKeyEnv` resolves its key from that environment variable at request time (the literal `apiKey` stays as the fallback), and no env-resolved key is ever written back to `config.json`.
|
|
95
|
+
- **DSH discovery** reads the harness `settings.yaml` (`llm-pi-ai.providers`) and `.credentials.yaml` (`refs`) on load; discovered providers are marked `source: "dsh"`, resolved keys stay in memory (never written to `config.json`), and a `/_xlate/dsh-scan` route re-reads them on demand.
|
|
96
|
+
- **Host half** (`lib/index.js`): provider adapters, ordered chain + fallback execution, LRU cache (600), per-provider override for tests, `/_xlate/models` listing, `/_xlate/model/pull` + `pull-status` model download management (auto-configures on completion)
|
|
97
|
+
- **Client half** (`lib/client.js`): 8-language UI, drag-reorderable provider list, add/edit/delete custom providers, per-provider test buttons, sentence/paragraph-batched translation, streaming Think rows, localStorage persistence (settings + translation cache)
|
|
98
|
+
- Pure display layer: originals remain in the transcript and model context
|
|
99
|
+
|
|
100
|
+
## 🛠 Development
|
|
101
|
+
|
|
102
|
+
- No build step: `lib/client.js` is the browser bundle (source = artifact), `lib/index.js` is the host ESM
|
|
103
|
+
- Client changes apply on page refresh; host changes need a web restart
|
|
104
|
+
- The 8-language strings live in the `UI_TEXT` dictionary in `lib/client.js`
|
|
105
|
+
|
|
106
|
+
## 📄 License
|
|
107
|
+
|
|
108
|
+
MIT
|
package/README.ru.md
CHANGED
|
@@ -54,6 +54,16 @@ New-Item -ItemType Junction -Path "$HOME\.dsh\profiles\node_modules\dsh-think-tr
|
|
|
54
54
|
# 3. перезапустите web
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
+
## 🧯 После обновления DSH
|
|
58
|
+
|
|
59
|
+
Сторонние клиентские плагины загружаются через граф клиентских модулей DSH, а этот граф собирается **один раз на процесс** — неудачная сборка остаётся в памяти до перезапуска. Поэтому сразу после обновления обычно случаются три вещи.
|
|
60
|
+
|
|
61
|
+
- **Запуск из исходного чекаута падает** с `client bundles not found; run \`pnpm run build\` before launch` —— новые клиентские пакеты не собраны: выполните `pnpm run build` в чекауте harness и снова запустите `dsh web`.
|
|
62
|
+
- **Интерфейс плагина пропал** (нет перевода в строке Think, нет раздела «Перевод цепочки размышлений» в настройках) —— **перезапустите `dsh web`**; простого обновления страницы иногда недостаточно.
|
|
63
|
+
- **Список локальных моделей пуст** —— служба `ollama` не использует этот каталог моделей: проверьте `ollama list` (или `GET /api/tags`) и `OLLAMA_MODELS`, который реально применяет запущенная служба. Если файлы моделей лежат на другом диске, каталог по умолчанию можно направить туда через junction.
|
|
64
|
+
|
|
65
|
+
На стороне плагина настраивать нечего: он не объявляет зависимостей от порядка загрузки внутренних пакетов DSH (использует только службу `slots` и, опционально, `@deepseek-ai/dsh-client-ui-primitives`), поэтому работает и на старых DSH (≤ 0.1.1-rc), и на текущей линии (≥ 0.1.2-alpha.1, включая 0.1.5-rc.1).
|
|
66
|
+
|
|
57
67
|
## 🚀 Использование
|
|
58
68
|
|
|
59
69
|
1. Откройте **Настройки → Перевод цепочки размышлений**
|
package/README.zh-CN.md
CHANGED
|
@@ -54,6 +54,16 @@ New-Item -ItemType Junction -Path "$HOME\.dsh\profiles\node_modules\dsh-think-tr
|
|
|
54
54
|
# 3. 重启 web
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
+
## 🧯 DSH 升级之后
|
|
58
|
+
|
|
59
|
+
第三方客户端插件走 DSH 的客户端模块图,而这张图**每个进程只在启动时组合一次**,一次失败的组合会被记在内存里直到重启。于是升级 DSH 后常撞到这三件事:
|
|
60
|
+
|
|
61
|
+
- **从源码启动失败**:`client bundles not found; run \`pnpm run build\` before launch` —— 新版客户端包需要先构建:在 harness 仓库根目录跑 `pnpm run build`,再重新启动 `dsh web`。
|
|
62
|
+
- **插件 UI 不见了**(Think 行没有译文、设置里没有“思考链翻译”)—— **重启一次 `dsh web`**;只刷新页面有时不够。
|
|
63
|
+
- **本地模型列表是空的** —— `ollama` 服务当前用的模型目录里没有模型:查 `ollama list`(或 `GET /api/tags`)以及该服务实际生效的 `OLLAMA_MODELS`;模型文件在别的盘时,可用目录联接把服务的默认目录指过去。
|
|
64
|
+
|
|
65
|
+
插件侧无需任何配置:它不依赖 DSH 内部包的加载顺序(只绑定 `slots` 服务,可选使用 `@deepseek-ai/dsh-client-ui-primitives`),因此老版本(≤ 0.1.1-rc)与当前版本线(≥ 0.1.2-alpha.1,含 0.1.5-rc.1)都能直接跑。
|
|
66
|
+
|
|
57
67
|
## 🚀 使用
|
|
58
68
|
|
|
59
69
|
1. 打开 **设置 → 思考链翻译**
|