dsh-think-translate 1.2.13 → 1.2.16

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.md CHANGED
@@ -1,127 +1,217 @@
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
- [![npm version](https://img.shields.io/npm/v/dsh-think-translate?color=4D6BFE&label=npm)](https://www.npmjs.com/package/dsh-think-translate)
8
- [![license](https://img.shields.io/npm/l/dsh-think-translate?color=4D6BFE)](LICENSE)
9
- [![dsh](https://img.shields.io/badge/powered_by-dsh-4D6BFE?style=flat-square&logo=deepseek&logoColor=white)](https://github.com/deepseek-ai/deepseek-harness)
10
-
11
- <img src="demo/demo.gif?v=2" width="46%" alt="dsh-think-translate demo" style="border:1px solid #4D6BFE;border-radius:8px;margin:4px" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="demo/demo2.gif?v=2" width="41%" alt="dsh-think-translate demo 2" style="border:1px solid #4D6BFE;border-radius:8px;margin:4px" />
12
-
13
- </div>
14
-
15
- ---
16
-
17
- 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**.
18
-
19
- ## ✨ Why dsh-think-translate
20
-
21
- 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.
22
-
23
- - **🕵️ Read any thinking chain** — reasoning, chain-of-thought, task cards and answers translated in real time, streamed batch by batch
24
- - **🌍 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
25
- - **🔗 Dynamic provider chain** — order providers by drag-and-drop and enable/disable each one. Built-ins (google gtx, bing, local Ollama) plus any number of custom providers; the chain already ends with the free providers, so a second fallback pass is a config-file option, not a UI one
26
- - **🔌 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
27
- - **🪄 DSH provider discovery** — providers already configured in DSH's `profiles/<profile>/cordis.patch.yml` / legacy `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, and **one button in settings rescans and adds them all at once**; keys are resolved from `.credentials.yaml` at runtime and never written to the plugin's config. The harness's own default route counts too: when `default-model` / `agent-default-model` points at `deepseek-official`, DeepSeek's API is offered as one more DSH entry
28
- - **🔒 Local Ollama** — reuse an existing installation and model. When enabled Ollama is first in priority, or you click Test, the plugin starts the service and loads the model as needed. Missing software/models require the setup button before installation/download, with live progress
29
- - **🧠 Zero context cost** — pure display layer: the model still sees the original text, and translated text never consumes the context window
30
- - **☁️ 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)
31
- - **🛡️ Code-safe** — file paths, commands, URLs, regexes and pure-code lines are never translated
32
- - **🚨 Auto-review reasons** — when Auto review denies a tool call, the approval card appends the reviewer's reason in your target language, so the decision prompt is readable before choosing Reject / Allow once
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** — failed translations are cached in memory for 30 seconds to prevent retry storms, then retried automatically; each provider has its own Test button
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
- For DSH **0.2.0-rc.2**, use **dsh-think-translate 1.2.5 or later**. Version 1.2.5 fixes the `todo_write` slot collision and declares the 0.2 peer range. Run `dsh plugin --profile web add dsh-think-translate@latest`, then restart DSH; no version exemption is needed.
69
-
70
- Version **1.2.6** fixes duplicated thinking and answer text in DSH 0.2: the assistant renderer now respects the separate reasoning/response groups, including its original-text error fallback.
71
-
72
- **1.2.7 local setup:** enabled Ollama in first priority, or its Test button, finds an existing installation and starts/loads it automatically. Missing software/models require the labelled setup action, with staged download/install/load progress. Automatic software installation supports Windows; other systems link to the official guide. “In use” follows the first enabled, verified provider in priority order; testing a lower row does not override a verified higher row.
73
-
74
- **1.2.8 transport and recovery:** ordinary HTTP/HTTPS translation requests use native Node networking instead of spawning curl per text batch; SOCKS proxies and the Ollama installer retain curl compatibility. Failures stay in memory for 30 seconds, then reasoning and answer translation resume automatically. Request deadlines allow time for local-model loading and provider fallback.
75
-
76
- **1.2.13:** Auto review rejection cards retain the original reason and asynchronously append its translation. An independent, default-on switch controls this feature. Disabling it, changing the target language or removing the card discards stale results; non-English reasons translate correctly to English. Thanks to [llg1634](https://github.com/llg1634) for the report, initial patch and tests in [#13](https://github.com/UncleK/dsh-think-translate/issues/13). Fully restart DSH Web or Desktop after upgrading.
77
-
78
- **1.2.12:** provider switches are authoritative: the browser no longer sends direct Google requests after Host failure. Fenced, indented and inline code is excluded from translation payloads and restored exactly, including unfinished streaming spans. Old translation caches are discarded; preferences are retained. After upgrading, fully restart DSH Web or Desktop; a page refresh alone may still reference old client resources.
79
-
80
- **1.2.11 Bing fixes:** the free Bing provider is retained. Translation requests use the session page's final origin, preventing the mainland China `www.bing.com` → `cn.bing.com` redirect from dropping the POST body. SOCKS/curl now shares the native browser headers to fix HTTP 401; empty and non-JSON responses report clear errors.
81
-
82
- **1.2.10 DSH profile compatibility:** discovery follows the running Desktop/Web profile and reads `profiles/<profile>/cordis.patch.yml` (`id` + `config`), with home patches and launcher overlays applied afterward. Legacy `settings.yaml` is still supported. Default model rows use `default-model`; credentials remain in the DSH home `.credentials.yaml` and stay in memory. Rescan diagnostics show the file actually read.
83
-
84
- **1.2.9 language fixes:** Japanese vocabulary hints now apply only to Japanese targets; OpenAI/Anthropic requests include a full language name. Bing uses `auto-detect` and maps Chinese targets to `zh-Hans`/`zh-Hant`. Chinese detection examines prose after removing paths, code and JSON: already-Simplified prose is skipped, common Traditional script cues request conversion, and Japanese/Korean prose is translated. Old persisted translation results are cleared once; settings remain intact.
85
-
86
- ## 🚀 Usage
87
-
88
- 1. Open **Settings → Think Translation**
89
- 2. Pick the **target language** (e.g. 日本語) — the settings panel, thinking rows and task cards all switch to it
90
- 3. **Manage the provider chain** — the list below it *is* the delivery order; drag rows to reorder, and the checkbox is the on/off switch:
91
- - Built-ins: **google gtx / bing** (free, via the system proxy) and **local Ollama** — existing software/models are reused; missing components require the setup button (qwen2.5:7b / 14b or custom), with progress displayed. Built-ins are permanent: uncheck one to stop using it, there is nothing to delete
92
- - **DSH providers**: endpoints already configured in DSH (`llm-pi-ai.providers`) appear automatically as read-only entries (badge "DSH"); their checkbox adds/removes them from the chain. The **Import from DSH config** button right below the list rescans on click and adds all of them in one go — there is no base URL and no key to retype, because the key is resolved from DSH's own credentials at request time
93
- - **Custom providers**: "Add custom provider" registers any **OpenAI-compatible** or **Anthropic Messages** endpoint; the form offers **presets** for common low-cost models (DeepSeek, OpenAI, Qwen, GLM, Kimi, SiliconFlow, OpenRouter, Anthropic) that fill base URL + model + env name, all still editable; the model lists were checked against the vendors' documentation in September 2026 and are suggestions only — any model id can be typed in. Each row has a **test** button, an edit form and a **×** to delete it (a DSH row cannot be deleted — it is managed by the harness)
94
- - A provider can name an **environment variable** (`apiKeyEnv`) instead of carrying the key: presets fill that in, and a DSH row brings its own. The key is resolved per request and never written to `config.json`, and such a row shows an `env:NAME` badge. The edit form has no env field (the value survives an edit untouched), but emptying a field really removes it — the field is sent as an explicit delete
95
- - The former **fallback chain** option is gone: it was redundant once the chain itself ends with the free providers, and unchecking a provider is how you opt out of it. `fallback` still exists in `config.json` for anyone who wants it (off by default)
96
- 4. Send a message that makes the model think, then expand the **Think row** to read the translation and compare with the original
97
-
98
- ## ⚙️ How it works
99
-
100
- ```
101
- browser → POST /_xlate/translate (same-origin, no CORS)
102
- → host provider chain (fail-open, user-ordered):
103
- chain: [provider1, provider2, ...] ← drag-reordered in settings
104
- each provider is one of:
105
- google (gtx via native Node HTTP/HTTPS and the system proxy)
106
- bing (ttranslatev3 via native Node HTTP/HTTPS)
107
- openai (OpenAI-compatible /chat/completions — Ollama local or any gateway)
108
- anthropic(Anthropic Messages API /v1/messages)
109
- fallback chain (config-only, off by default) tried when the primary chain fails entirely
110
- → original text if all enabled providers fail
111
- ```
112
-
113
- - **Provider config** lives in `config.json` (runtime, gitignored): `chain` (ordered ids), `fallback` (enabled + chain, config-only), `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`. A `null` field in a config patch deletes that field, which is how the UI clears one.
114
- - **DSH discovery** reads the harness `profiles/<profile>/cordis.patch.yml` / legacy `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.
115
- - **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)
116
- - **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)
117
- - Pure display layer: originals remain in the transcript and model context
118
-
119
- ## 🛠 Development
120
-
121
- - No build step: `lib/client.js` is the browser bundle (source = artifact), `lib/index.js` is the host ESM
122
- - Client changes apply on page refresh; host changes need a web restart
123
- - The 8-language strings live in the `UI_TEXT` dictionary in `lib/client.js`
124
-
125
- ## 📄 License
126
-
127
- MIT
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/hero.en.png?v=1.2.16" alt="dsh-think-translate — AI thinking, in your language" width="100%" />
3
+ </p>
4
+
5
+ <p align="center">
6
+ <b>Display-layer translation for DeepSeek Harness.</b><br />
7
+ Read the reasoning, follow the tasks, and understand the answers. Originals are preserved; translations stay out of model context.
8
+ </p>
9
+
10
+ <p align="center">
11
+ <img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/badge-mit.en.svg?v=1.2.16" alt="MIT License" />
12
+ <img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/badge-local.en.svg?v=1.2.16" alt="Local Ollama" />
13
+ <img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/badge-original.en.svg?v=1.2.16" alt="Originals preserved" />
14
+ </p>
15
+
16
+ <p align="center">
17
+ <a href="README.zh-CN.md">中文</a> · <b>English</b> · <a href="README.ja.md">日本語</a> · <a href="README.ko.md">한국어</a> · <a href="README.es.md">Español</a> · <a href="README.fr.md">Français</a> · <a href="README.de.md">Deutsch</a> · <a href="README.ru.md">Русский</a> · <a href="README.pt.md">Português</a>
18
+ </p>
19
+
20
+ <p align="center">
21
+ <a href="#quick-start"><img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/nav-quick-start.en.svg?v=1.2.16" alt="Quick install" height="24" /></a> &nbsp;·&nbsp; <a href="#demo"><img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/nav-demo.en.svg?v=1.2.16" alt="Live demos" height="24" /></a> &nbsp;·&nbsp; <a href="#features"><img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/nav-features.en.svg?v=1.2.16" alt="Features" height="24" /></a> &nbsp;·&nbsp; <a href="#comparison"><img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/nav-comparison.en.svg?v=1.2.16" alt="Official comparison" height="24" /></a> &nbsp;·&nbsp; <a href="#faq"><img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/nav-faq.en.svg?v=1.2.16" alt="FAQ" height="24" /></a>
22
+ </p>
23
+
24
+ ---
25
+
26
+ <a id="demo"></a>
27
+ ## See thinking unfold
28
+
29
+ <table>
30
+ <tr>
31
+ <td width="50%" align="center" valign="bottom">
32
+ <img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/demo/demo.gif?v=1.2.16" alt="Demo 1 · Reasoning and answers" width="100%" />
33
+ </td>
34
+ <td width="50%" align="center" valign="bottom">
35
+ <img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/demo/demo2.gif?v=1.2.16" alt="Demo 2 · More live operations" width="100%" />
36
+ </td>
37
+ </tr>
38
+ <tr>
39
+ <td align="center" valign="top"><sub>Demo 1 · Reasoning and answers</sub></td>
40
+ <td align="center" valign="top"><sub>Demo 2 · More live operations</sub></td>
41
+ </tr>
42
+ </table>
43
+
44
+ <a id="comparison"></a>
45
+ ## Comparison with the official translation plugin
46
+
47
+ <p align="center">
48
+ <img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/translation-comparison.en.png?v=1.2.16" alt="Comparison with the official translation plugin" width="100%" />
49
+ </p>
50
+
51
+ Enable either this plugin or the official reasoning translator. Both take over the reasoning interface.
52
+
53
+ <a id="quick-start"></a>
54
+ ## One command to get started
55
+
56
+ ```bash
57
+ dsh plugin --profile web add dsh-think-translate
58
+ ```
59
+
60
+ After installation, fully restart DSH Web. Open **Settings → Think Translation**, then choose the target language and providers.
61
+
62
+ <details>
63
+ <summary><b>GitHub installation, updates and other methods</b></summary>
64
+
65
+ Install from GitHub:
66
+
67
+ ```bash
68
+ dsh plugin --profile web add github:UncleK/dsh-think-translate
69
+ ```
70
+
71
+ Update from npm:
72
+
73
+ ```bash
74
+ dsh plugin --profile web add dsh-think-translate@latest
75
+ ```
76
+
77
+ Fully restart DSH after installing or updating. For manual deployment, link the package into the profile and add its entry to `cordis.patch.yml`; the commands above are recommended for everyday use.
78
+
79
+ </details>
80
+
81
+ <a id="features"></a>
82
+ ## More than reasoning to understand
83
+
84
+ <table>
85
+ <tr>
86
+ <td width="50%" valign="top">
87
+ <h3>Reasoning, as it happens</h3>
88
+ <p>Pre-translate all, lazy-load history, or translate only when expanded</p>
89
+ </td>
90
+ <td width="50%" valign="top">
91
+ <h3>Tasks and answers, together</h3>
92
+ <p>Reasoning, task cards and composer task lists; optional answers and auto-review denial reasons</p>
93
+ </td>
94
+ </tr>
95
+ <tr>
96
+ <td width="50%" valign="top">
97
+ <h3>Understand review decisions</h3>
98
+ <p>When auto-review rejects a tool call, its reason is translated alongside the original. The existing decision buttons remain available.</p>
99
+ </td>
100
+ <td width="50%" valign="top">
101
+ <h3>Preserve originals and code</h3>
102
+ <p>Originals preserved; translations stay out of model context. Reuses Markdown rendering; protects code, paths and commands before translation.</p>
103
+ </td>
104
+ </tr>
105
+ <tr>
106
+ <td width="50%" valign="top">
107
+ <h3>Local models, loaded on demand</h3>
108
+ <p>Manual release, release when unchecked, idle auto-release; reloads on the next translation</p>
109
+ </td>
110
+ <td width="50%" valign="top">
111
+ <h3>Providers in your preferred order</h3>
112
+ <p>Automatic fallback in enabled order; clearly wrong-language output tries the next provider; retry after cooldown</p>
113
+ </td>
114
+ </tr>
115
+ </table>
116
+
117
+ ### Connect providers you already use
118
+
119
+ **Ollama · Google · Bing · OpenAI · Anthropic Messages API**
120
+
121
+ Discover providers already configured in DSH without entering endpoints and keys again. Test each provider separately; list order controls the order of attempts.
122
+
123
+ ```text
124
+ Your first choice → next enabled provider → … → originals if all fail
125
+ ```
126
+
127
+ <details>
128
+ <summary><b>Custom endpoints, credentials and recovery</b></summary>
129
+
130
+ - Custom endpoints support OpenAI-compatible `/v1/chat/completions` and the native Anthropic Messages API.
131
+ - Discovery reads the current DSH profile and overrides. Rescan and add discovered providers to the translation chain.
132
+ - An `apiKeyEnv` key is resolved at request time; resolved credentials are never written back to plugin configuration.
133
+ - Failures cool down in host memory for 30 seconds, then subsequent translation requests can retry. Clearly wrong-language results try the next provider.
134
+ - Language detection skips text already recognized as the target language; explicit provider tests still make a real request.
135
+
136
+ </details>
137
+
138
+ ### Local translation models: load and release on demand
139
+
140
+ | Your action | Plugin behavior |
141
+ |---|---|
142
+ | Translate or test | Start the service and load the selected model on demand |
143
+ | Release model memory | Wait for active translations, then unload; preserve files, switches and order |
144
+ | Uncheck the local provider | Disable it and unload the selected model |
145
+ | Re-enable it or open settings | No preload; load on the next actual translation |
146
+ | Set idle release | 5 minutes by default; choose 1 / 5 / 10 / 30 / 60 minutes or off |
147
+
148
+ Idle timing applies from the next use. Ollama tracks the selected model; global environment variables are unchanged. Missing software or models are installed or downloaded only after you click the preparation button, with progress shown.
149
+
150
+ <a id="languages"></a>
151
+ ### Language settings that follow you
152
+
153
+ 中文 · English · 日本語 · 한국어 · Español · Français · Deutsch · Русский · Português
154
+
155
+ Nine target languages, settings translations and task labels, including Portuguese. Your selection survives a page refresh.
156
+
157
+ <a id="faq"></a>
158
+ ## Answers to common questions
159
+
160
+ <details>
161
+ <summary><b>No translation entry after installing or updating</b></summary>
162
+
163
+ Fully restart `dsh web`. The client module graph is assembled at process start; refreshing the page alone may not load a new plugin. The settings footer shows the installed package version.
164
+
165
+ </details>
166
+
167
+ <details>
168
+ <summary><b>The local model list is empty</b></summary>
169
+
170
+ Check `ollama list` or `/api/tags`, the active model directory, and the service’s `OLLAMA_MODELS`. Existing model files do not need to be downloaded again.
171
+
172
+ </details>
173
+
174
+ <details>
175
+ <summary><b>Source startup reports client bundles not found after a DSH update</b></summary>
176
+
177
+ Run `pnpm run build` in the DeepSeek Harness repository, then restart DSH Web.
178
+
179
+ </details>
180
+
181
+ <details>
182
+ <summary><b>Does a translation failure affect the conversation?</b></summary>
183
+
184
+ When all enabled providers fail, the original remains. Test individual providers and inspect the latest error in settings. Translation requests can retry after cooldown.
185
+
186
+ </details>
187
+
188
+ <details>
189
+ <summary><b>Recent changes and compatibility</b></summary>
190
+
191
+ **1.2.16** adds Portuguese throughout the translation target and UI, refreshes all nine READMEs and localized comparison images, and declares three marketplace images.
192
+
193
+ **1.2.15** adds local model memory management and adapts to DSH `0.2.2-alpha.2` image rendering, grouped reasoning collapse and original text selection.
194
+
195
+ **1.2.13** adds auto-review denial-reason translation. Thanks to [llg1634](https://github.com/llg1634) for the report, initial patch and testing.
196
+
197
+ Earlier versions and details: [GitHub Releases](https://github.com/UncleK/dsh-think-translate/releases).
198
+
199
+ </details>
200
+
201
+ <details>
202
+ <summary><b>Development and internals</b></summary>
203
+
204
+ - `lib/index.js`: host routes, providers, configuration, memory cache and local model lifecycle.
205
+ - `lib/client.js`: settings, display-layer translation, streaming batches and browser cache.
206
+ - `lib/config.json`: runtime configuration, excluded from Git and npm.
207
+ - No extra build step: source files are the deliverable. Restart DSH after changing host code.
208
+ - Run checks with `npm test`. Discovery and credential handling are documented in the [maintenance notes](https://github.com/UncleK/dsh-think-translate/blob/main/docs/maintenance-notes.md).
209
+
210
+ </details>
211
+
212
+ ---
213
+
214
+ <p align="center">
215
+ <b>dsh-think-translate</b><br />
216
+ <a href="https://github.com/UncleK/dsh-think-translate/issues">Report an issue</a> &nbsp;·&nbsp; <a href="https://github.com/UncleK/dsh-think-translate/releases">Releases</a> &nbsp;·&nbsp; <a href="https://github.com/UncleK/dsh-think-translate/blob/main/LICENSE">MIT License</a>
217
+ </p>
package/README.pt.md ADDED
@@ -0,0 +1,217 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/hero.pt.png?v=1.2.16" alt="dsh-think-translate — O pensamento da IA, no seu idioma" width="100%" />
3
+ </p>
4
+
5
+ <p align="center">
6
+ <b>Tradução da camada de exibição do DeepSeek Harness.</b><br />
7
+ Leia o raciocínio, acompanhe as tarefas e entenda as respostas. Os originais são preservados; as traduções ficam fora do contexto do modelo.
8
+ </p>
9
+
10
+ <p align="center">
11
+ <img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/badge-mit.pt.svg?v=1.2.16" alt="Licença MIT" />
12
+ <img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/badge-local.pt.svg?v=1.2.16" alt="Ollama local" />
13
+ <img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/badge-original.pt.svg?v=1.2.16" alt="Originais preservados" />
14
+ </p>
15
+
16
+ <p align="center">
17
+ <a href="README.zh-CN.md">中文</a> · <a href="README.md">English</a> · <a href="README.ja.md">日本語</a> · <a href="README.ko.md">한국어</a> · <a href="README.es.md">Español</a> · <a href="README.fr.md">Français</a> · <a href="README.de.md">Deutsch</a> · <a href="README.ru.md">Русский</a> · <b>Português</b>
18
+ </p>
19
+
20
+ <p align="center">
21
+ <a href="#quick-start"><img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/nav-quick-start.pt.svg?v=1.2.16" alt="Instalação" height="24" /></a> &nbsp;·&nbsp; <a href="#demo"><img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/nav-demo.pt.svg?v=1.2.16" alt="Demonstrações" height="24" /></a> &nbsp;·&nbsp; <a href="#features"><img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/nav-features.pt.svg?v=1.2.16" alt="Recursos" height="24" /></a> &nbsp;·&nbsp; <a href="#comparison"><img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/nav-comparison.pt.svg?v=1.2.16" alt="Comparação" height="24" /></a> &nbsp;·&nbsp; <a href="#faq"><img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/nav-faq.pt.svg?v=1.2.16" alt="Perguntas" height="24" /></a>
22
+ </p>
23
+
24
+ ---
25
+
26
+ <a id="demo"></a>
27
+ ## Veja o pensamento acontecer
28
+
29
+ <table>
30
+ <tr>
31
+ <td width="50%" align="center" valign="bottom">
32
+ <img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/demo/demo.gif?v=1.2.16" alt="Demo 1 · Raciocínio e respostas" width="100%" />
33
+ </td>
34
+ <td width="50%" align="center" valign="bottom">
35
+ <img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/demo/demo2.gif?v=1.2.16" alt="Demo 2 · Mais operações" width="100%" />
36
+ </td>
37
+ </tr>
38
+ <tr>
39
+ <td align="center" valign="top"><sub>Demo 1 · Raciocínio e respostas</sub></td>
40
+ <td align="center" valign="top"><sub>Demo 2 · Mais operações</sub></td>
41
+ </tr>
42
+ </table>
43
+
44
+ <a id="comparison"></a>
45
+ ## Comparação com o plugin oficial de tradução
46
+
47
+ <p align="center">
48
+ <img src="https://raw.githubusercontent.com/UncleK/dsh-think-translate/main/docs/assets/translation-comparison.pt.png?v=1.2.16" alt="Comparação com o plugin oficial de tradução" width="100%" />
49
+ </p>
50
+
51
+ Ative este plugin ou o tradutor oficial de raciocínio. Ambos controlam a interface de raciocínio.
52
+
53
+ <a id="quick-start"></a>
54
+ ## Um comando para começar
55
+
56
+ ```bash
57
+ dsh plugin --profile web add dsh-think-translate
58
+ ```
59
+
60
+ Após instalar, reinicie completamente o DSH Web. Abra **Configurações → Tradução do pensamento** e escolha o idioma de destino e os provedores.
61
+
62
+ <details>
63
+ <summary><b>Instalação pelo GitHub, atualizações e outros métodos</b></summary>
64
+
65
+ Instalar pelo GitHub:
66
+
67
+ ```bash
68
+ dsh plugin --profile web add github:UncleK/dsh-think-translate
69
+ ```
70
+
71
+ Atualizar pelo npm:
72
+
73
+ ```bash
74
+ dsh plugin --profile web add dsh-think-translate@latest
75
+ ```
76
+
77
+ Reinicie o DSH completamente após instalar ou atualizar. Na implantação manual, vincule o pacote ao perfil e adicione sua entrada em `cordis.patch.yml`. Para uso normal, recomendamos os comandos acima.
78
+
79
+ </details>
80
+
81
+ <a id="features"></a>
82
+ ## Há mais que raciocínio para entender
83
+
84
+ <table>
85
+ <tr>
86
+ <td width="50%" valign="top">
87
+ <h3>Raciocínio em tempo real</h3>
88
+ <p>Pré-traduzir tudo, carregar histórico sob demanda ou traduzir apenas ao expandir</p>
89
+ </td>
90
+ <td width="50%" valign="top">
91
+ <h3>Tarefas e respostas juntas</h3>
92
+ <p>Raciocínio, cartões e lista de tarefas da área de entrada; respostas e motivos de recusa da revisão automática opcionais</p>
93
+ </td>
94
+ </tr>
95
+ <tr>
96
+ <td width="50%" valign="top">
97
+ <h3>Entenda as decisões de revisão</h3>
98
+ <p>Quando a revisão automática recusa uma chamada de ferramenta, o motivo aparece traduzido ao lado do original. Os botões de decisão existentes continuam disponíveis.</p>
99
+ </td>
100
+ <td width="50%" valign="top">
101
+ <h3>Preserve originais e código</h3>
102
+ <p>Originais preservados; traduções fora do contexto do modelo. Reutiliza componentes Markdown; protege código, caminhos e comandos antes de traduzir.</p>
103
+ </td>
104
+ </tr>
105
+ <tr>
106
+ <td width="50%" valign="top">
107
+ <h3>Modelos locais sob demanda</h3>
108
+ <p>Liberação manual, ao desmarcar ou após inatividade; recarga na próxima tradução</p>
109
+ </td>
110
+ <td width="50%" valign="top">
111
+ <h3>Provedores na sua ordem</h3>
112
+ <p>Alternativa automática na ordem ativada; idioma claramente errado tenta o próximo provedor; nova tentativa após intervalo</p>
113
+ </td>
114
+ </tr>
115
+ </table>
116
+
117
+ ### Conecte os provedores que você já usa
118
+
119
+ **Ollama · Google · Bing · OpenAI · Anthropic Messages API**
120
+
121
+ Descubra provedores configurados no DSH sem digitar endpoints e chaves novamente. Teste cada linha separadamente; a ordem da lista define a sequência de tentativas.
122
+
123
+ ```text
124
+ Sua primeira opção → próximo provedor ativado → … → original se todos falharem
125
+ ```
126
+
127
+ <details>
128
+ <summary><b>Endpoints personalizados, credenciais e recuperação</b></summary>
129
+
130
+ - Suporta `/v1/chat/completions` compatível com OpenAI e a API nativa Anthropic Messages.
131
+ - A descoberta lê o perfil DSH atual e suas substituições. Verifique novamente e adicione provedores à sequência de tradução.
132
+ - `apiKeyEnv` é resolvido no momento da requisição; as credenciais resolvidas nunca são gravadas na configuração do plugin.
133
+ - Falhas aguardam 30 segundos na memória do host antes de novas tentativas. Um idioma claramente errado aciona o próximo provedor.
134
+ - A detecção ignora textos reconhecidos no idioma de destino; testes de provedor sempre enviam uma requisição real.
135
+
136
+ </details>
137
+
138
+ ### Modelos locais de tradução: carregar e liberar sob demanda
139
+
140
+ | Sua ação | Comportamento do plugin |
141
+ |---|---|
142
+ | Traduzir ou testar | Inicia o serviço e carrega o modelo selecionado sob demanda |
143
+ | Liberar memória do modelo | Aguarda traduções ativas e libera; mantém arquivos, opções e ordem |
144
+ | Desmarcar o provedor local | Desativa e libera o modelo selecionado |
145
+ | Reativar ou abrir configurações | Sem pré-carregamento; carrega na próxima tradução real |
146
+ | Configurar liberação por inatividade | 5 minutos por padrão; 1 / 5 / 10 / 30 / 60 minutos ou desativada |
147
+
148
+ O prazo vale a partir do próximo uso. O Ollama acompanha o modelo selecionado sem alterar variáveis globais. Softwares ou modelos ausentes só são instalados ou baixados após clicar em preparar, com progresso visível.
149
+
150
+ <a id="languages"></a>
151
+ ### Seu idioma acompanha você
152
+
153
+ 中文 · English · 日本語 · 한국어 · Español · Français · Deutsch · Русский · Português
154
+
155
+ Nove idiomas de destino, configurações e tarefas, incluindo português. A seleção é preservada ao atualizar a página.
156
+
157
+ <a id="faq"></a>
158
+ ## Respostas às perguntas frequentes
159
+
160
+ <details>
161
+ <summary><b>A opção de tradução não aparece após instalar ou atualizar</b></summary>
162
+
163
+ Reinicie completamente `dsh web`. O grafo de módulos é montado no início do processo; atualizar só a página pode não bastar. O rodapé das configurações mostra a versão instalada.
164
+
165
+ </details>
166
+
167
+ <details>
168
+ <summary><b>A lista de modelos locais está vazia</b></summary>
169
+
170
+ Confira `ollama list` ou `/api/tags`, o diretório ativo e `OLLAMA_MODELS` do serviço. Não é necessário baixar novamente arquivos existentes.
171
+
172
+ </details>
173
+
174
+ <details>
175
+ <summary><b>Client bundles not found após atualizar o DSH</b></summary>
176
+
177
+ Execute `pnpm run build` no repositório DeepSeek Harness e reinicie o DSH Web.
178
+
179
+ </details>
180
+
181
+ <details>
182
+ <summary><b>Uma falha de tradução afeta a conversa?</b></summary>
183
+
184
+ Se todos os provedores ativados falharem, o original permanece. Teste cada provedor e consulte o último erro nas configurações. As próximas requisições podem tentar novamente após o intervalo.
185
+
186
+ </details>
187
+
188
+ <details>
189
+ <summary><b>Atualizações e compatibilidade</b></summary>
190
+
191
+ **1.2.16** adiciona português ao destino e à interface, renova os nove README e imagens localizadas, e declara três imagens para o mercado.
192
+
193
+ **1.2.15** adiciona gestão de memória local e adapta imagens, recolhimento agrupado do raciocínio e seleção do original ao DSH `0.2.2-alpha.2`.
194
+
195
+ **1.2.13** traduz motivos de recusa da revisão automática. Obrigado a [llg1634](https://github.com/llg1634) pelo relato, patch inicial e testes.
196
+
197
+ Versões anteriores: [GitHub Releases](https://github.com/UncleK/dsh-think-translate/releases).
198
+
199
+ </details>
200
+
201
+ <details>
202
+ <summary><b>Desenvolvimento e funcionamento</b></summary>
203
+
204
+ - `lib/index.js`: rotas do host, provedores, configuração, cache e modelos locais.
205
+ - `lib/client.js`: configurações, tradução da exibição, lotes em streaming e cache do navegador.
206
+ - `lib/config.json`: configuração de execução, excluída do Git e npm.
207
+ - Sem compilação extra: os fontes são o produto. Reinicie o DSH após mudar o host.
208
+ - Verifique com `npm test`. Descoberta e credenciais: [notas de manutenção](https://github.com/UncleK/dsh-think-translate/blob/main/docs/maintenance-notes.md).
209
+
210
+ </details>
211
+
212
+ ---
213
+
214
+ <p align="center">
215
+ <b>dsh-think-translate</b><br />
216
+ <a href="https://github.com/UncleK/dsh-think-translate/issues">Relatar um problema</a> &nbsp;·&nbsp; <a href="https://github.com/UncleK/dsh-think-translate/releases">Versões</a> &nbsp;·&nbsp; <a href="https://github.com/UncleK/dsh-think-translate/blob/main/LICENSE">Licença MIT</a>
217
+ </p>