dsh-vision-router 1.0.1 → 1.1.1
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 +98 -28
- package/README.zh.md +96 -28
- package/cordis.patch.yml +13 -7
- package/index.js +520 -26
- package/lib/client.js +341 -11
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<a href="https://awesome-dsh-plugin.com"><img src="https://awesome-dsh-plugin.com/badge.svg" alt="awesome · DSH plugin" /></a>
|
|
13
|
-
<a href="https://github.com/ysr666/dsh-vision-router/releases/tag/v1.
|
|
14
|
-
<a href="tests"><img src="https://img.shields.io/badge/verified-
|
|
13
|
+
<a href="https://github.com/ysr666/dsh-vision-router/releases/tag/v1.1.1"><img src="https://img.shields.io/badge/release-v1.1.1-5B4CF0?style=flat-square" alt="Release v1.1.1" /></a>
|
|
14
|
+
<a href="tests"><img src="https://img.shields.io/badge/verified-101%20tests-2EA44F?style=flat-square" alt="Verified: 101 tests" /></a>
|
|
15
15
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-2EA44F?style=flat-square" alt="License: MIT" /></a>
|
|
16
16
|
<a href="package.json"><img src="https://img.shields.io/badge/Node.js-%3E%3D22-339933?style=flat-square&logo=nodedotjs&logoColor=white" alt="Node.js >=22" /></a>
|
|
17
17
|
<img src="https://img.shields.io/badge/runtime-no%20Python-8A2BE2?style=flat-square" alt="No Python" />
|
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
|
|
21
21
|
<p align="center">English · <a href="README.zh.md">中文</a></p>
|
|
22
22
|
|
|
23
|
+
> [!WARNING]
|
|
24
|
+
> 📌 **Announcement (v1.1.1)**
|
|
25
|
+
>
|
|
26
|
+
> Existing DSH providers are now **auto-wrapped on install**: text-only routes gain paste-and-go vision automatically, while native multimodal models keep their original image input and use Vision Router tools only when useful. Windows sharp/libvips startup conflicts are fixed by sharing the host sharp; install/update docs now distinguish npm/npx from source-checkout pnpm usage.
|
|
27
|
+
|
|
23
28
|
<p align="center">
|
|
24
29
|
<img src="assets/vision-demo.gif" width="640" alt="Demo: paste an image, the agent locates the send button with vision_ground / vision_crop / vision_pixel_diff and answers with coordinates" />
|
|
25
30
|
</p>
|
|
@@ -28,7 +33,7 @@
|
|
|
28
33
|
|
|
29
34
|
Most DSH vision plugins bridge images to DeepSeek as *text descriptions* — lossy, one-shot, and blind to pixels. This plugin keeps the **original pixels on the vision model's side** and DeepSeek on the reasoning side, and makes looking at an image an **ordinary tool call**:
|
|
30
35
|
|
|
31
|
-
- **One command install
|
|
36
|
+
- **One command install.** The package ships its own composition patch (`dsh.bundle.patch`): `dsh plugin add` wires the row, the admission wrapper and the attachment limits automatically — zero manual file edits. Taking over the official DeepSeek route is an optional setting (stealth mode, off by default).
|
|
32
37
|
- **Free by default.** The vision chain starts with a built-in OVHcloud anonymous endpoint (`Qwen2.5-VL-72B-Instruct`, no account, no key, 2 req/min per IP). Paid chains (OpenRouter, Pi-AI providers, direct OpenAI-compatible endpoints) are optional upgrades.
|
|
33
38
|
- **No Python.** The whole pipeline — downscale, grounding, crop, pixel diff, palette, OCR, SVG trace, cutout, HTML screenshot — runs on sharp / potrace / tesseract / system Chrome.
|
|
34
39
|
- **Continuous multi-step image work.** An image turn is a text turn that calls tools: `vision_ground` → `vision_crop` → `vision_describe` → `vision_pixel_diff` → fix → screenshot again. The agent keeps iterating until the work is done.
|
|
@@ -37,30 +42,43 @@ Most DSH vision plugins bridge images to DeepSeek as *text descriptions* — los
|
|
|
37
42
|
|
|
38
43
|
## How it compares
|
|
39
44
|
|
|
40
|
-
|
|
45
|
+
The closest alternative is [@anionex/dsh-vision-toolkit](https://github.com/Anionex/dsh-vision-toolkit) (Anionex), a native DSH bundle of the well-known `agent-vision-toolkit` lineage. Both packages ship a `vision-tools` skill and a family of pixel-level tools; they differ in philosophy — **zero-config paste-and-go** versus **agent-driven visual engineering**:
|
|
41
46
|
|
|
42
|
-
| |
|
|
43
|
-
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
47
|
+
| | dsh-vision-router | @anionex/dsh-vision-toolkit |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| Image Q&A out of the box | ✅ Built-in free chain (anonymous OVHcloud endpoint) — no account, no key | Requires your own vision API key (local pixel tools work without one) |
|
|
50
|
+
| Runtime | ✅ Node only — no Python | Python 3.11+ managed runtime |
|
|
51
|
+
| Getting an image in | ✅ Paste it — the turn auto-routes to the vision chain and auto-mounts the tools | Workspace path + `/vision-tools` command, then explicit tool calls |
|
|
52
|
+
| Turn routing | ✅ Image turns switch to vision, text turns switch back to DeepSeek — optional stealth takeover keeps the model picker looking stock | Tool-driven; no whole-turn auto-routing |
|
|
53
|
+
| Profiles | Web | Web + Headless |
|
|
54
|
+
| Playbooks | The pixel loop: ground → crop → diff → fix → screenshot again | Richer case library (long-screenshot OCR, UI restoration, GUI automation) |
|
|
55
|
+
| Tests | 86 | 162 |
|
|
56
|
+
| Install | One command | One command (npm) |
|
|
51
57
|
|
|
52
|
-
|
|
58
|
+
Both are MIT-licensed and one command away. Pick this plugin when you want images to *just work* with zero setup; pick theirs when you need headless profiles or the extended playbook library. (Feature comparison reflects their README as of 2026-08.)
|
|
53
59
|
|
|
54
60
|
## Quick start
|
|
55
61
|
|
|
62
|
+
Recommended for normal npm/npx installs (the same launch style used by the DSH README):
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
npx @deepseek-ai/dsh plugin --profile web add dsh-vision-router
|
|
66
|
+
npx @deepseek-ai/dsh web
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
If you run DeepSeek Harness from a source checkout with pnpm, use the workspace script instead — `dsh` is not necessarily on your shell `PATH`:
|
|
70
|
+
|
|
56
71
|
```sh
|
|
57
|
-
|
|
72
|
+
cd deepseek-harness
|
|
73
|
+
pnpm dsh plugin --profile web add dsh-vision-router
|
|
74
|
+
pnpm dsh web
|
|
58
75
|
```
|
|
59
76
|
|
|
60
|
-
|
|
77
|
+
If you already installed the DSH CLI globally and `dsh` is on `PATH`, the shorter `dsh ...` form works too. Restart a long-lived Web profile after installation — done. Zero configuration:
|
|
61
78
|
|
|
62
|
-
- the plugin's bundle patch mounts the row
|
|
79
|
+
- the plugin's bundle patch mounts the row, adds the admission wrapper and relaxes attachment limits to 20 MB / 100 MP — pure-additive, it never touches the core rows; whether the official DeepSeek route is taken over is decided by the optional stealth setting (off by default);
|
|
63
80
|
- the default vision chain is the built-in free endpoint;
|
|
81
|
+
- custom/third-party routes (e.g. opencode) gain image input through **Extra vision wrappers**;
|
|
64
82
|
- every setting is editable live in **Settings → Plugins → Plugin config → 视觉路由(自动识图)**.
|
|
65
83
|
|
|
66
84
|
Then just paste an image into a conversation. The agent mounts the vision tools automatically and looks at it through `vision_describe` (and friends) — multi-step if needed.
|
|
@@ -119,6 +137,7 @@ All ten deep tools mount automatically on image turns (`autoActivateOnImage`); t
|
|
|
119
137
|
| `vision_trace` | SVG vectorization (potrace posterization; icons/logos) | SVG |
|
|
120
138
|
| `vision_extract_foreground` | Cutout via border flood fill (uniform backgrounds) | transparent PNG |
|
|
121
139
|
| `vision_html_screenshot` | Screenshot a local HTML file (headless system Chrome) | PNG |
|
|
140
|
+
| `vision_long_screenshot_ocr` | Long-screenshot transcription: overlapping chunks, tesseract first / vision model fallback, stitched Markdown | chunk PNGs + Markdown + manifest |
|
|
122
141
|
|
|
123
142
|
Formats are sniffed from magic bytes, so extensionless content-addressed attachment files work everywhere (no `.png` renaming needed).
|
|
124
143
|
|
|
@@ -135,6 +154,7 @@ vision_colors image="ref.png" top=8
|
|
|
135
154
|
vision_trace image="icon.png" steps=4
|
|
136
155
|
vision_extract_foreground image="logo.png"
|
|
137
156
|
vision_html_screenshot source="page.html" width=1200 height=720
|
|
157
|
+
vision_long_screenshot_ocr image="chat-log.png" chunkHeight=1200 overlap=120
|
|
138
158
|
```
|
|
139
159
|
|
|
140
160
|
## Provider fallback chain
|
|
@@ -151,7 +171,9 @@ Failures are classified (region / tos / quota / rate-limit / context / network)
|
|
|
151
171
|
|
|
152
172
|
## Stealth mode
|
|
153
173
|
|
|
154
|
-
|
|
174
|
+
Stealth mode is **off by default** (explicit opt-in since issue #34): with it off, the official `deepseek-official` route stays untouched and image turns go through the visible "DeepSeek + 自动识图" wrapper entry in the picker.
|
|
175
|
+
|
|
176
|
+
With stealth on, the plugin takes over the official `deepseek-official` route: the model picker looks exactly like stock (same DeepSeek group, same model names), but each entry is the auto-vision wrapper that declares image input and delegates text turns to a rebuilt native DeepSeek adapter (same `llm-deepseek` settings section and credentials). Old sessions keep working through the hidden `deepseek-vision` alias. The takeover requires the stock row to be absent — disable it in your profile patch layer (`~/.dsh/profiles/<profile>/cordis.patch.yml`):
|
|
155
177
|
|
|
156
178
|
```yaml
|
|
157
179
|
- id: llm-deepseek
|
|
@@ -159,16 +181,25 @@ Failures are classified (region / tos / quota / rate-limit / context / network)
|
|
|
159
181
|
disabled: true
|
|
160
182
|
```
|
|
161
183
|
|
|
162
|
-
|
|
184
|
+
With the stock row present, the plugin falls back to the visible wrapper entry. Conversely, with stealth off but the stock row still disabled, the plugin performs a keep-alive takeover so the DeepSeek models don't vanish (the settings card explains this); to restore the fully official route, flip the `disabled` above back to `false` and restart.
|
|
185
|
+
|
|
186
|
+
> Stealth mode **only affects the official DeepSeek route**. Custom/third-party routes like opencode are unrelated — use **Extra vision wrappers** below to give them image input.
|
|
187
|
+
|
|
188
|
+
## Extra vision wrappers
|
|
189
|
+
|
|
190
|
+
`wrappedProviders` registers an auto-vision twin for any third-party/custom text route: pick the twin in the model selector and send images; text turns delegate to the original route unchanged. The typical use case is a custom interface such as opencode — it only declares text input, and one wrapper row makes it image-ready. In the settings card, configure it with two dropdowns (provider + model); leaving the model empty wraps every model of that route.
|
|
163
191
|
|
|
164
192
|
## Web settings
|
|
165
193
|
|
|
166
194
|
The Web profile registers a **视觉路由(自动识图)** card under **Settings → Plugins → Plugin config**, styled like the built-in cards. It live-edits:
|
|
167
195
|
|
|
168
|
-
- switches: whole-turn legacy routing, vision tools, image-block rewriting, stealth;
|
|
196
|
+
- switches: whole-turn legacy routing, vision tools, image-block rewriting, stealth (official DeepSeek route only);
|
|
197
|
+
- **extra vision wrappers**: provider + model dropdowns that register image-capable twin entries for custom routes such as opencode;
|
|
169
198
|
- vision request timeout, wrapper/chain route names;
|
|
170
199
|
- the **vision chain** (one `provider/model` per line, top-down fallback) and the text model;
|
|
171
|
-
- every field shows an "overridden" badge with a one-click reset to the composition default, plus discard/save
|
|
200
|
+
- every field shows an "overridden" badge with a one-click reset to the composition default, plus discard/save;
|
|
201
|
+
- a **Test connection** button probes the first vision provider and reports latency inline;
|
|
202
|
+
- artifact-producing tools render dedicated call cards with result facts and open-file buttons.
|
|
172
203
|
|
|
173
204
|
<p align="center">
|
|
174
205
|
<img src="assets/vision-settings.png" width="72%" alt="The vision-router card in Settings > Plugins > Plugin config." />
|
|
@@ -184,12 +215,13 @@ Everything is optional; defaults work out of the box. Edit via the Web card or a
|
|
|
184
215
|
|---|---|---|
|
|
185
216
|
| `provider` / `model` | `vision-http` / `ovh/Qwen2.5-VL-72B-Instruct` | shorthand chain (adapter-backed provider + model) |
|
|
186
217
|
| `fallbacks` | `[]` | backup models for the shorthand provider |
|
|
187
|
-
| `providers` | `
|
|
218
|
+
| `providers` | built-in free `vision-http` pair | multi-provider chain `{ provider, model, fallbacks[] }`, tried in order; wins over the shorthand. The first row ships as the built-in free model |
|
|
188
219
|
| `httpProviders` | built-in OVH entry | direct OpenAI-compatible endpoints `{ name, baseURL, model, apiKeyEnv, maxTokens }` |
|
|
220
|
+
| `wrappedProviders` | `[{ provider: 'deepseek-official', models: [] }]` | extra text routes to wrap as image-capable twins: `{ provider, models[] }` — registers an auto-vision twin for any custom/third-party route (e.g. opencode); in the card, provider + model dropdowns, empty model = wrap all. The pre-filled deepseek-official row marks the built-in wrapper and is a no-op; changes apply live |
|
|
189
221
|
| `routing` | `false` | legacy whole-turn chain routing (one-shot answer). `false` = tools-first flow (recommended) |
|
|
190
222
|
| `reverseRouting` | `true` | with `routing: true`, route text turns back to `textProvider` |
|
|
191
223
|
| `wrapperRoute` / `chainRoute` | `deepseek-vision` / `vision-chain` | admission wrapper route name / fallback chain route name (empty disables) |
|
|
192
|
-
| `stealth` | `
|
|
224
|
+
| `stealth` | `false` | take over the official `deepseek-official` route (official row only; custom routes use `wrappedProviders`) |
|
|
193
225
|
| `textProvider` | `deepseek-official` / `deepseek-v4-pro` | the model that reasons (your daily model) |
|
|
194
226
|
| `tool` / `progressiveTools` / `autoActivateOnImage` | `true` ×3 | vision tools on / progressive mounting / auto-mount on image turns |
|
|
195
227
|
| `rewriteImages` | `true` | rewrite image blocks in the model input (cached description or tool-hint marker); the UI log keeps images |
|
|
@@ -201,7 +233,7 @@ Everything is optional; defaults work out of the box. Edit via the Web card or a
|
|
|
201
233
|
|
|
202
234
|
## Requirements
|
|
203
235
|
|
|
204
|
-
- DeepSeek Harness
|
|
236
|
+
- DeepSeek Harness Web profile. Normal installs can use `npx @deepseek-ai/dsh ...`; source checkouts use `pnpm dsh ...`. A bare `dsh ...` command only works when the CLI is already on your shell `PATH`.
|
|
205
237
|
- Node ≥ 22 (host side).
|
|
206
238
|
- No API key for the default free chain; a credential reference (`apiKeyEnv`) only for paid `httpProviders`.
|
|
207
239
|
- Chrome / Chromium / Edge only for `vision_html_screenshot`; every other tool works without a browser.
|
|
@@ -211,9 +243,18 @@ Everything is optional; defaults work out of the box. Edit via the Web card or a
|
|
|
211
243
|
|
|
212
244
|
### Install
|
|
213
245
|
|
|
246
|
+
Normal npm/npx install:
|
|
247
|
+
|
|
214
248
|
```sh
|
|
215
|
-
dsh plugin --profile web add dsh-vision-router
|
|
216
|
-
dsh --profile web --dump-config | grep vision-router
|
|
249
|
+
npx @deepseek-ai/dsh plugin --profile web add dsh-vision-router
|
|
250
|
+
npx @deepseek-ai/dsh --profile web --dump-config | grep vision-router
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
From a DeepSeek Harness source checkout:
|
|
254
|
+
|
|
255
|
+
```sh
|
|
256
|
+
pnpm dsh plugin --profile web add dsh-vision-router
|
|
257
|
+
pnpm dsh --profile web --dump-config | grep vision-router
|
|
217
258
|
```
|
|
218
259
|
|
|
219
260
|
Restart a long-lived Web profile. The host discovers the browser bundle through `dsh.client` at startup.
|
|
@@ -230,15 +271,44 @@ Set it back to `false` to re-enable. Unloading removes the wrapper routes, tools
|
|
|
230
271
|
### Upgrade
|
|
231
272
|
|
|
232
273
|
```sh
|
|
233
|
-
|
|
274
|
+
# normal npm/npx install
|
|
275
|
+
npx @deepseek-ai/dsh plugin --profile web update dsh-vision-router
|
|
276
|
+
|
|
277
|
+
# DeepSeek Harness source checkout
|
|
278
|
+
pnpm dsh plugin --profile web update dsh-vision-router
|
|
234
279
|
```
|
|
235
280
|
|
|
236
281
|
Settings live in the profile's settings provider and survive upgrades.
|
|
237
282
|
|
|
283
|
+
> **Upgrading from a pre-bundle-patch install (v0.x):** the package now mounts
|
|
284
|
+
> itself through its own bundle patch, so a leftover manual row in
|
|
285
|
+
> `~/.dsh/profiles/<profile>/cordis.patch.yml` duplicates it and `dsh web`
|
|
286
|
+
> fails at startup with `duplicate loader entry id: vision-router`. Delete the
|
|
287
|
+
> old block:
|
|
288
|
+
>
|
|
289
|
+
> ```yaml
|
|
290
|
+
> - insert: # remove this whole block
|
|
291
|
+
> - id: vision-router
|
|
292
|
+
> name: dsh-vision-router
|
|
293
|
+
> ```
|
|
294
|
+
>
|
|
295
|
+
> To keep custom settings, replace it with a plain by-id override (no
|
|
296
|
+
> `insert`):
|
|
297
|
+
>
|
|
298
|
+
> ```yaml
|
|
299
|
+
> - id: vision-router
|
|
300
|
+
> config:
|
|
301
|
+
> # your overrides …
|
|
302
|
+
> ```
|
|
303
|
+
|
|
238
304
|
### Uninstall
|
|
239
305
|
|
|
240
306
|
```sh
|
|
241
|
-
|
|
307
|
+
# normal npm/npx install
|
|
308
|
+
npx @deepseek-ai/dsh plugin --profile web remove dsh-vision-router
|
|
309
|
+
|
|
310
|
+
# DeepSeek Harness source checkout
|
|
311
|
+
pnpm dsh plugin --profile web remove dsh-vision-router
|
|
242
312
|
```
|
|
243
313
|
|
|
244
314
|
This removes the dependency and the bundle layer. If you disabled the stock DeepSeek row manually, re-enable it in your profile patch.
|
package/README.zh.md
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<a href="https://awesome-dsh-plugin.com"><img src="https://awesome-dsh-plugin.com/badge.svg" alt="awesome · DSH plugin" /></a>
|
|
13
|
-
<a href="https://github.com/ysr666/dsh-vision-router/releases/tag/v1.
|
|
14
|
-
<a href="tests"><img src="https://img.shields.io/badge/verified-
|
|
13
|
+
<a href="https://github.com/ysr666/dsh-vision-router/releases/tag/v1.1.1"><img src="https://img.shields.io/badge/release-v1.1.1-5B4CF0?style=flat-square" alt="Release v1.1.1" /></a>
|
|
14
|
+
<a href="tests"><img src="https://img.shields.io/badge/verified-101%20tests-2EA44F?style=flat-square" alt="Verified: 101 tests" /></a>
|
|
15
15
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-2EA44F?style=flat-square" alt="License: MIT" /></a>
|
|
16
16
|
<a href="package.json"><img src="https://img.shields.io/badge/Node.js-%3E%3D22-339933?style=flat-square&logo=nodedotjs&logoColor=white" alt="Node.js >=22" /></a>
|
|
17
17
|
<img src="https://img.shields.io/badge/runtime-no%20Python-8A2BE2?style=flat-square" alt="No Python" />
|
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
|
|
21
21
|
<p align="center"><a href="README.md">English</a> · 中文</p>
|
|
22
22
|
|
|
23
|
+
> [!WARNING]
|
|
24
|
+
> 📌 **公告(v1.1.1)**
|
|
25
|
+
>
|
|
26
|
+
> 现在安装后会**自动包装 DSH 已有模型**:纯文本路由自动获得粘贴即用的识图入口,原生多模态模型保留原图直传,仅在需要精确定位 / OCR / 像素验证时按需使用 Vision Router 工具。另修复 Windows sharp/libvips 启动冲突,并补齐 npm/npx 与源码 pnpm 两套安装/升级指引。
|
|
27
|
+
|
|
23
28
|
<p align="center">
|
|
24
29
|
<img src="assets/vision-demo.gif" width="640" alt="演示:粘贴图片,Agent 用 vision_ground / vision_crop / vision_pixel_diff 定位发送按钮并给出坐标" />
|
|
25
30
|
</p>
|
|
@@ -28,7 +33,7 @@
|
|
|
28
33
|
|
|
29
34
|
大多数 DSH 视觉插件把图片“翻译”成一段文字描述再喂给 DeepSeek——有损、一次性、看不见像素。本插件把**原图像素留在视觉模型侧**、把推理留在 DeepSeek 侧,并把“看图”变成一次**普通的工具调用**:
|
|
30
35
|
|
|
31
|
-
-
|
|
36
|
+
- **一条命令安装。** 包自带组合补丁(`dsh.bundle.patch`):`dsh plugin add` 自动完成插件行挂载、准入包装与附件限制放宽——不用手改任何文件。是否接管官方 DeepSeek 路由由「隐身模式」开关决定(默认关)。
|
|
32
37
|
- **默认免费。** 视觉链内置 OVHcloud 匿名端点(`Qwen2.5-VL-72B-Instruct`,免注册、免 Key,每 IP 2 次/分钟)。付费链路(OpenRouter、Pi-AI 供应商、任意 OpenAI 兼容直连端点)是可选升级。
|
|
33
38
|
- **无 Python。** 整条管线——缩放、定位、裁剪、像素对比、取色、OCR、SVG 矢量化、抠图、HTML 截图——全部基于 sharp / potrace / tesseract / 系统 Chrome。
|
|
34
39
|
- **可连续多步看图。** 图片轮 = 调用工具的文本轮:`vision_ground` → `vision_crop` → `vision_describe` → `vision_pixel_diff` → 修复 → 再截图,Agent 可以一直迭代到任务完成。
|
|
@@ -37,30 +42,43 @@
|
|
|
37
42
|
|
|
38
43
|
## 对比同类插件
|
|
39
44
|
|
|
40
|
-
|
|
45
|
+
最接近的同类是 [@anionex/dsh-vision-toolkit](https://github.com/Anionex/dsh-vision-toolkit)(Anionex),它是知名 `agent-vision-toolkit` 系列的 DSH 原生版。两者都提供 `vision-tools` 技能和一组像素级工具,区别在理念:**零配置粘贴即用** vs **Agent 主导的视觉工程**:
|
|
41
46
|
|
|
42
|
-
| |
|
|
43
|
-
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
47
|
+
| | dsh-vision-router | @anionex/dsh-vision-toolkit |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| 开箱图片问答 | ✅ 内置免费视觉链(OVHcloud 匿名端点),免注册免 Key | 远程工具需自备视觉 API Key(本地像素工具免 Key) |
|
|
50
|
+
| 运行时 | ✅ 纯 Node,无需 Python | 需要 Python 3.11+ 受管运行时 |
|
|
51
|
+
| 图片怎么进来 | ✅ 直接粘贴——轮次自动切视觉链并自动挂载工具 | 工作区路径 + `/vision-tools` 命令,再显式调用工具 |
|
|
52
|
+
| 轮次路由 | ✅ 图片轮切视觉、文本轮切回 DeepSeek——可选隐身接管,模型选择器与官方一致 | 工具驱动,无整轮自动路由 |
|
|
53
|
+
| 支持 profile | Web | Web + Headless |
|
|
54
|
+
| 玩法库 | 像素循环:定位 → 裁剪 → 对比 → 修复 → 再截图 | 更丰富的案例库(长截图 OCR、UI 还原、GUI 自动化) |
|
|
55
|
+
| 测试 | 86 | 162 |
|
|
56
|
+
| 安装 | 一条命令 | 一条命令(npm) |
|
|
51
57
|
|
|
52
|
-
|
|
58
|
+
两者都是 MIT 许可、一条命令安装。想要图片**粘贴即用**、零配置就选本插件;需要 Headless 部署或更丰富的案例库,可以看 @anionex/dsh-vision-toolkit。(功能对比以其 README 2026-08 状态为准。)
|
|
53
59
|
|
|
54
60
|
## 快速开始
|
|
55
61
|
|
|
62
|
+
普通 npm / npx 安装方式推荐这样用(与 DSH 官方 README 的启动方式一致):
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
npx @deepseek-ai/dsh plugin --profile web add dsh-vision-router
|
|
66
|
+
npx @deepseek-ai/dsh web
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
如果你是从 DeepSeek Harness 源码仓库通过 pnpm 运行,`dsh` 不一定在系统 `PATH` 里,请改用工作区脚本:
|
|
70
|
+
|
|
56
71
|
```sh
|
|
57
|
-
|
|
72
|
+
cd deepseek-harness
|
|
73
|
+
pnpm dsh plugin --profile web add dsh-vision-router
|
|
74
|
+
pnpm dsh web
|
|
58
75
|
```
|
|
59
76
|
|
|
60
|
-
|
|
77
|
+
如果你已经全局安装 DSH CLI,并且终端里能直接执行 `dsh`,也可以继续使用较短的 `dsh ...` 写法。长期运行的 Web profile 安装后重启——完成,零配置:
|
|
61
78
|
|
|
62
|
-
- 插件的 bundle
|
|
79
|
+
- 插件的 bundle 补丁自动挂载插件行、挂上准入包装并放宽附件限制到 20MB / 1 亿像素——纯增量、不碰核心行;是否接管官方 DeepSeek 路由由「隐身模式」开关决定(默认关);
|
|
63
80
|
- 默认视觉链就是内置免费端点;
|
|
81
|
+
- opencode 等自定义/第三方路由用「额外识图包装」获得发图能力;
|
|
64
82
|
- 全部配置可在 **设置 → 插件 → 插件配置 → 视觉路由(自动识图)** 实时修改。
|
|
65
83
|
|
|
66
84
|
然后直接往对话里贴一张图。Agent 自动挂载视觉工具,通过 `vision_describe`(以及其余 8 个工具)看图,需要时连续多步。
|
|
@@ -119,6 +137,7 @@ Agent 仅根据参考图复刻 UI,再用 `vision_pixel_diff` 验证最终结
|
|
|
119
137
|
| `vision_trace` | SVG 矢量化(potrace 分色;图标/logo) | SVG |
|
|
120
138
|
| `vision_extract_foreground` | 边界洪泛抠图(纯色背景) | 透明 PNG |
|
|
121
139
|
| `vision_html_screenshot` | 给本地 HTML 文件截图(无头系统 Chrome) | PNG |
|
|
140
|
+
| `vision_long_screenshot_ocr` | 长截图转写:重叠分片,tesseract 优先 / 视觉模型回退,按序拼接 Markdown | 分片 PNG + Markdown + manifest |
|
|
122
141
|
|
|
123
142
|
图片格式按**魔数识别**,无扩展名的内容寻址附件文件也能直接用(不用再复制成 `.png`)。
|
|
124
143
|
|
|
@@ -135,6 +154,7 @@ vision_colors image="ref.png" top=8
|
|
|
135
154
|
vision_trace image="icon.png" steps=4
|
|
136
155
|
vision_extract_foreground image="logo.png"
|
|
137
156
|
vision_html_screenshot source="page.html" width=1200 height=720
|
|
157
|
+
vision_long_screenshot_ocr image="chat-log.png" chunkHeight=1200 overlap=120
|
|
138
158
|
```
|
|
139
159
|
|
|
140
160
|
## 供应商降级链
|
|
@@ -151,7 +171,9 @@ vision_html_screenshot source="page.html" width=1200 height=720
|
|
|
151
171
|
|
|
152
172
|
## 隐身模式
|
|
153
173
|
|
|
154
|
-
|
|
174
|
+
隐身模式默认**关闭**(issue #34 起显式 opt-in):关闭时官方 `deepseek-official` 路由原样保留,发图走选择器里可见的「DeepSeek + 自动识图」包装入口。
|
|
175
|
+
|
|
176
|
+
开启隐身模式后,插件接管官方 `deepseek-official` 路由:模型选择器看起来和原版完全一样(同一个 DeepSeek 组、同样的模型名),但每个条目背后都是声明了图片输入的自动识图包装;文字轮交给插件重建的原生 DeepSeek 适配器(读取同一个 `llm-deepseek` 设置段与凭据)。老会话通过隐藏的 `deepseek-vision` 别名继续工作。接管的前提是官方行不在场——在你的 profile 补丁层(`~/.dsh/profiles/<profile>/cordis.patch.yml`)禁用即可:
|
|
155
177
|
|
|
156
178
|
```yaml
|
|
157
179
|
- id: llm-deepseek
|
|
@@ -159,16 +181,25 @@ vision_html_screenshot source="page.html" width=1200 height=720
|
|
|
159
181
|
disabled: true
|
|
160
182
|
```
|
|
161
183
|
|
|
162
|
-
|
|
184
|
+
官方行在场时,插件自动回退为可见包装入口。反过来,隐身模式关闭但官方行仍被禁用时,插件会做 keep-alive 兜底接管,保住 DeepSeek 模型(设置卡片会给出提示);想完全恢复官方原生行,把上面的 `disabled` 改回 `false` 再重启即可。
|
|
185
|
+
|
|
186
|
+
> 隐身模式**只作用于官方 DeepSeek 路由**。opencode 等自定义/第三方文本路由与隐身模式无关——用「额外识图包装」让它们支持发图。
|
|
187
|
+
|
|
188
|
+
## 额外识图包装
|
|
189
|
+
|
|
190
|
+
`wrappedProviders` 给任意第三方/自定义文本路由注册「自动识图」孪生条目:模型选择器里选中它就能发图,文字轮原样交给原路由处理。典型用法是 opencode 等接入的自定义接口——它们默认只声明文本输入,加一行包装即可直接发图。设置卡片里用两个下拉(provider + 模型)配置;模型留空 = 包装该路由的全部模型,同一 provider 要包装多个模型就添加多行。
|
|
163
191
|
|
|
164
192
|
## Web 设置
|
|
165
193
|
|
|
166
194
|
Web 配置页在 **设置 → 插件 → 插件配置** 下注册「视觉路由(自动识图)」卡片,样式与内置卡片一致,可实时修改:
|
|
167
195
|
|
|
168
|
-
-
|
|
196
|
+
- 开关:整轮自动路由(旧模式)、识图工具、图片块改写、隐身模式(仅官方 DeepSeek 路由);
|
|
197
|
+
- **额外识图包装**:provider + 模型双下拉,给 opencode 等自定义路由注册可发图的孪生条目;
|
|
169
198
|
- 视觉请求超时、包装/链路由名;
|
|
170
199
|
- **视觉模型链**(每行一个 `provider/model`,自上而下降级)与文本模型;
|
|
171
|
-
-
|
|
200
|
+
- 每个字段都有「已覆盖」徽标与一键恢复组合默认,以及放弃/保存;
|
|
201
|
+
- 「测试连接」按钮探测第一个视觉提供方并内联显示延迟/失败原因;
|
|
202
|
+
- 产出制品的工具在对话里渲染专用调用卡(关键字段 + 打开文件按钮)。
|
|
172
203
|
|
|
173
204
|
<p align="center">
|
|
174
205
|
<img src="assets/vision-settings.png" width="72%" alt="设置 → 插件 → 插件配置 里的视觉路由卡片。" />
|
|
@@ -184,12 +215,13 @@ Web 配置页在 **设置 → 插件 → 插件配置** 下注册「视觉路由
|
|
|
184
215
|
|---|---|---|
|
|
185
216
|
| `provider` / `model` | `vision-http` / `ovh/Qwen2.5-VL-72B-Instruct` | 简写链路(有适配器的供应商 + 模型) |
|
|
186
217
|
| `fallbacks` | `[]` | 简写供应商的备用模型 |
|
|
187
|
-
| `providers` | `
|
|
218
|
+
| `providers` | 内置免费 `vision-http` 条目 | 多供应商链路 `{ provider, model, fallbacks[] }`,按序尝试;优先于简写形式。第一行开箱预置内置免费模型 |
|
|
188
219
|
| `httpProviders` | 内置 OVH 条目 | OpenAI 兼容直连端点 `{ name, baseURL, model, apiKeyEnv, maxTokens }` |
|
|
220
|
+
| `wrappedProviders` | `[{ provider: 'deepseek-official', models: [] }]` | 额外识图包装:`{ provider, models[] }`,给 opencode 等任意第三方/自定义文本路由注册可发图的孪生条目(卡片里 provider + 模型双下拉;模型留空 = 包装全部)。预置的 deepseek-official 条目标记内置包装、无副作用;改动即时生效 |
|
|
189
221
|
| `routing` | `false` | 旧版整轮链路由(一次性整轮回答)。`false` = 工具优先流程(推荐) |
|
|
190
222
|
| `reverseRouting` | `true` | 开启 `routing` 时,文字轮路由回 `textProvider` |
|
|
191
223
|
| `wrapperRoute` / `chainRoute` | `deepseek-vision` / `vision-chain` | 准入包装路由名 / 降级链路由名(置空关闭) |
|
|
192
|
-
| `stealth` | `
|
|
224
|
+
| `stealth` | `false` | 接管官方 `deepseek-official` 路由(仅官方行;自定义路由用 `wrappedProviders`) |
|
|
193
225
|
| `textProvider` | `deepseek-official` / `deepseek-v4-pro` | 负责思考的模型(你的日常模型) |
|
|
194
226
|
| `tool` / `progressiveTools` / `autoActivateOnImage` | `true` ×3 | 视觉工具开关 / 渐进式挂载 / 图片轮自动挂载 |
|
|
195
227
|
| `rewriteImages` | `true` | 模型输入层改写图片块(缓存描述或工具提示标记);界面日志保留图片 |
|
|
@@ -201,7 +233,7 @@ Web 配置页在 **设置 → 插件 → 插件配置** 下注册「视觉路由
|
|
|
201
233
|
|
|
202
234
|
## 环境要求
|
|
203
235
|
|
|
204
|
-
- DeepSeek Harness 的 Web profile
|
|
236
|
+
- DeepSeek Harness 的 Web profile。普通安装可用 `npx @deepseek-ai/dsh ...`;从源码仓库运行时用 `pnpm dsh ...`。只有 CLI 已经进入系统 `PATH` 时才能直接写 `dsh ...`。
|
|
205
237
|
- Node ≥ 22(宿主侧)。
|
|
206
238
|
- 默认免费链路无需 API Key;付费 `httpProviders` 只需一个凭据引用(`apiKeyEnv`)。
|
|
207
239
|
- `vision_html_screenshot` 才需要 Chrome / Chromium / Edge;其余工具无浏览器也能用。
|
|
@@ -211,9 +243,18 @@ Web 配置页在 **设置 → 插件 → 插件配置** 下注册「视觉路由
|
|
|
211
243
|
|
|
212
244
|
### 安装
|
|
213
245
|
|
|
246
|
+
普通 npm / npx 安装:
|
|
247
|
+
|
|
214
248
|
```sh
|
|
215
|
-
dsh plugin --profile web add dsh-vision-router
|
|
216
|
-
dsh --profile web --dump-config | grep vision-router
|
|
249
|
+
npx @deepseek-ai/dsh plugin --profile web add dsh-vision-router
|
|
250
|
+
npx @deepseek-ai/dsh --profile web --dump-config | grep vision-router
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
从 DeepSeek Harness 源码仓库运行:
|
|
254
|
+
|
|
255
|
+
```sh
|
|
256
|
+
pnpm dsh plugin --profile web add dsh-vision-router
|
|
257
|
+
pnpm dsh --profile web --dump-config | grep vision-router
|
|
217
258
|
```
|
|
218
259
|
|
|
219
260
|
长期运行的 Web profile 需重启。宿主在启动时通过 `dsh.client` 声明发现浏览器端包。
|
|
@@ -230,15 +271,42 @@ dsh --profile web --dump-config | grep vision-router # 一行,由 bundle 补
|
|
|
230
271
|
### 升级
|
|
231
272
|
|
|
232
273
|
```sh
|
|
233
|
-
|
|
274
|
+
# 普通 npm / npx 安装
|
|
275
|
+
npx @deepseek-ai/dsh plugin --profile web update dsh-vision-router
|
|
276
|
+
|
|
277
|
+
# DeepSeek Harness 源码仓库
|
|
278
|
+
pnpm dsh plugin --profile web update dsh-vision-router
|
|
234
279
|
```
|
|
235
280
|
|
|
236
281
|
设置存放在 profile 的设置提供方里,升级不丢失。
|
|
237
282
|
|
|
283
|
+
> **从 bundle 补丁之前(v0.x)升级:** 现在插件由自带的 bundle 补丁自动挂载,
|
|
284
|
+
> 若 `~/.dsh/profiles/<profile>/cordis.patch.yml` 里还残留旧版手动行,会与之
|
|
285
|
+
> 重复,`dsh web` 启动即报 `duplicate loader entry id: vision-router`。删除
|
|
286
|
+
> 旧块:
|
|
287
|
+
>
|
|
288
|
+
> ```yaml
|
|
289
|
+
> - insert: # 删除整块
|
|
290
|
+
> - id: vision-router
|
|
291
|
+
> name: dsh-vision-router
|
|
292
|
+
> ```
|
|
293
|
+
>
|
|
294
|
+
> 若要保留自定义配置,改为不带 insert 的按 id 覆盖行:
|
|
295
|
+
>
|
|
296
|
+
> ```yaml
|
|
297
|
+
> - id: vision-router
|
|
298
|
+
> config:
|
|
299
|
+
> # 你的配置…
|
|
300
|
+
> ```
|
|
301
|
+
|
|
238
302
|
### 卸载
|
|
239
303
|
|
|
240
304
|
```sh
|
|
241
|
-
|
|
305
|
+
# 普通 npm / npx 安装
|
|
306
|
+
npx @deepseek-ai/dsh plugin --profile web remove dsh-vision-router
|
|
307
|
+
|
|
308
|
+
# DeepSeek Harness 源码仓库
|
|
309
|
+
pnpm dsh plugin --profile web remove dsh-vision-router
|
|
242
310
|
```
|
|
243
311
|
|
|
244
312
|
同时移除依赖与 bundle 层。若你曾手动禁用官方 DeepSeek 行,记得在 profile 补丁里恢复。
|
package/cordis.patch.yml
CHANGED
|
@@ -4,13 +4,19 @@
|
|
|
4
4
|
# without any manual cordis.patch.yml edits. Later layers (the profile's own
|
|
5
5
|
# cordis.patch.yml, --patch overlays) override these rows by id.
|
|
6
6
|
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
# 自动替用户禁用核心行(issue #34)。
|
|
7
|
+
# 纯增量补丁(issue #34):不碰核心行。官方 llm-deepseek 行保持原样,插件
|
|
8
|
+
# 挂载后是否接管官方 deepseek-official 路由由设置里的「隐身模式」开关决定
|
|
9
|
+
# (默认关;开启后需自行在 profile 补丁层禁用 llm-deepseek 行)。
|
|
10
|
+
|
|
11
|
+
# 挂载插件行。配置全部可选(默认即内置免费视觉端点 + 工具优先的图片流程),
|
|
12
|
+
# 可在 Web 设置 > 插件 > 插件配置 的「视觉路由」卡片里实时修改。
|
|
14
13
|
- insert:
|
|
15
14
|
- id: vision-router
|
|
16
15
|
name: dsh-vision-router
|
|
16
|
+
|
|
17
|
+
# 放宽附件图片限制(部署默认 5MB / 4000 万像素 → 20MB / 1 亿像素),
|
|
18
|
+
# 大尺寸设计稿/扫描图可过审。字段可选,不需要可在 profile 补丁层覆写。
|
|
19
|
+
- id: attachment-local
|
|
20
|
+
config:
|
|
21
|
+
maxImageBytes: 20971520
|
|
22
|
+
maxImagePixels: 100000000
|