dsh-image-router

visiontested: passnpmMIT

Digests the images in a prompt with a vision model before admission, so any model — a text-only one included — can read them without the session ever switching models, and adds a describe_image tool for image paths.

下载量 / Downloads
2,028
依赖体积 / node_modules
0.22 MB
测试时间 / Tested
2026-11-06
DSH 版本 / Version
0.2.2-rc.1

Install

dsh plugin --profile web add dsh-image-router

Sandbox test results

StageResult
1 install✓
2 list✓
3 mount✓
4 boot—

Four stages run in an isolated sandbox: install (network on) → list → mount → boot (last three with no network).

README

dsh-image-router

[!IMPORTANT]
当前版本 0.6.3,已发布到 npm。从 0.6.0 起它是「带左侧栏入口」的 DSH 插件:侧栏多一行「图片路由」,点开是独立配置页(0.2.1 的 main keyed 槽 + sidebar.panellist list 槽契约),同时保留原来的设置卡片。适配 DSH 0.1.5-rc.1+ 与 0.2.x:0.1.5-rc.1、dsh-desktop 0.2.0-rc.2 为真机验证线;0.2.1-rc.5 是当前桌面线 —— 0.6.2 修掉了 0.2.1 在桌面端最致命的一处不适配:设置节的命名空间是 loader 条目 id**(bundle 插入的行是 include:image-router),而卡片此前只认真名 image-router,于是配置页永远是「没有找到设置节」。0.6.2 改为按条目 id 解析(真名 → 后缀 → schema 形状),并同时认领 0.2.1 新增的 plugins.row.config 行配置页、补上 locale/*.json 标题/描述与 icon.svg。另修掉一个更阴的 0.2.x 陷阱:卡片不再把没填的 instruction 写成空串(那会让宿主校验拒绝整个条目、插件自我禁用),宿主也把空串视为「用内置指令」—— 已中招的 profile 重启即恢复。0.6.2 同步支持桌面 0.2.1-rc.5:12 个契约包逐文件比对,除 CSS 类名哈希 / 构建路径 / 提交号外零变更,并在真实 rc.5 运行时上冷启动取证(apply-entered → tool-registered → mounted,boot manifest 里 dsh-image-router 与三条 inject 照旧)。**
若你装到的是更早的 0.1.0,那是本插件的第一个(已废弃的)构建,会让「设置 → 模型」页加载失败 —— 用 dsh plugin --profile web add dsh-image-router@latest 直接装最新版即可。
0.4.4 及更早的版本装不进 0.2.x:插件的浏览器半边声明了 0.2.x 已删除的 settingsScope 服务,条目永久 pending,web boot 会以 1 entry did not activate 中止整次启动(详见〈0.2.x 与 0.1.x 的差异〉)。

<div align="center">

<b style="font-size: 1.15em;">让纯文本模型也能「看图」</b><br />

图片在进入会话之前,先由你指定的视觉模型转成文字 —— <b>你的会话模型自始至终不变</b>,模型选择器也不会跳。<br /><br />

<a href="https://www.npmjs.com/package/dsh-image-router"><img alt="npm version" src="https://img.shields.io/npm/v/dsh-image-router" /></a>

<a href="https://www.npmjs.com/package/dsh-image-router"><img alt="npm downloads" src="https://img.shields.io/npm/dm/dsh-image-router" /></a>

<a href="https://github.com/zhiwuli0228/dsh-image-router/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/zhiwuli0228/dsh-image-router/actions/workflows/ci.yml/badge.svg" /></a>

<a href="https://github.com/zhiwuli0228/dsh-image-router/actions/workflows/release.yml"><img alt="release" src="https://github.com/zhiwuli0228/dsh-image-router/actions/workflows/release.yml/badge.svg" /></a>

<a href="https://opensource.org/licenses/MIT"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" /></a>

<a href="https://github.com/zhiwuli0228/dsh-image-router/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/zhiwuli0228/dsh-image-router" /></a><br /><br />

<a href="https://www.npmjs.com/package/@deepseek-ai/dsh?activeTab=versions"><img alt="适配的 DSH:0.2.1-rc.3 侧栏槽位契约 + 0.1.5-rc.1 兼容" src="https://img.shields.io/badge/DSH-0.2.1--rc.3_contract_%2B_0.1.5--rc.1-4d6bfe" /></a>

<a href="#测试"><img alt="tests" src="https://img.shields.io/badge/tests-74_passing-brightgreen" /></a>

<a href="#-一分钟安装"><img alt="install" src="https://img.shields.io/badge/install-one_command-4d6bfe" /></a><br /><br />

<img alt="图片旁路识别" src="https://img.shields.io/badge/-图片旁路识别-4d6bfe" />

<img alt="会话模型不变" src="https://img.shields.io/badge/-会话模型不变-4d6bfe" />

<img alt="describe_image 工具" src="https://img.shields.io/badge/-describe__image-4d6bfe" />

<img alt="自定义端点" src="https://img.shields.io/badge/-自定义端点-4d6bfe" />

<img alt="图形界面配置" src="https://img.shields.io/badge/-图形界面配置-4d6bfe" />

<img alt="密钥只写不落盘" src="https://img.shields.io/badge/-密钥只写不落盘-4d6bfe" />

</div>

你贴一张截图,问「这个报错怎么修」
      ↓  插件在「提示词准入」之前拦下这次提示词
qwen-token-plan-cn / qwen3.8-flash   ← 一次旁路调用(不改会话路由、不写 model/selection)
      ↓  分析结果替换掉图片,成为提示词里的一段文字
你原本选定的模型(GUI 里显示的那个)继续作答

📑 目录

  • [⚡ 一分钟安装](#-一分钟安装)
  • [✨ 功能一览](#-功能一览)
  • [🖼️ 它长什么样](#️-它长什么样)
  • [🧭 给视觉模型的两种方式](#-给视觉模型的两种方式)
  • [🔐 安全](#-安全) · [⚠️ 已知限制](#️-已知限制) · [🖥️ 兼容性](#️-兼容性)
  • [🛠️ 开发与测试](#️-开发与测试) · [🤝 参与贡献](#-参与贡献)
  • [🔍 审计与排查](#-审计与排查)(折叠) · [⚙️ 配置项](#-配置项)(折叠) · [🧩 工作原理](#-工作原理)(折叠)

⚡ 一分钟安装

先选目标:装到 web 版 还是 桌面版。两者是不同的 profile、不同的 CLI,插件得分别装;装错了就是“装完没反应”。

目标 · profile 目录 · 用哪个 CLI · 装完怎么生效

web 版(dsh web) · $DSH_HOME/profiles/web · PATH 上的 dsh(npm i -g @deepseek-ai/dsh) · 重启 dsh web,浏览器硬刷新

桌面版(DeepSeek Harness App) · $DSH_HOME/profiles/desktop · App 自带的那个(…\resources\runtime\cli\bin\dsh.cmd) · 完全退出 App(含托盘)再重新打开

前置:Node.js ≥ 20;桌面版还需要 App 至少完整启动过一次(profile 由 App 初始化)。

方式一:命令行一条 —— 按目标二选一

# 有 web 版:装进 web profile,然后重启 dsh web
dsh plugin --profile web add dsh-image-router && dsh web
# 有桌面版(Windows):先完全退出 App,再用 App 自带的 CLI
& "$env:LOCALAPPDATA\Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add dsh-image-router

macOS 是 /Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh,Linux 见下方〈桌面版装在哪〉。

方式一·五:用仓库里的安装器(自动挑 CLI / profile) —— 仅源码克隆里有(npm 包不含 tools/),但正因如此它知道两个目标各自该用哪个 CLI:

node tools/install.mjs desktop          # 装桌面版(自动找 App 内置 CLI,检查 App 是否已退出)
node tools/install.mjs web              # 装 web 版(用 PATH 上的 dsh)
node tools/install.mjs desktop --source # 从本地克隆装(file:<repo>)
node tools/install.mjs desktop --dry-run # 只预检 + 打印将执行的命令,不写任何东西
# 等价:pnpm run install:desktop / pnpm run install:web

它会先打印 target / profile / cli / spec / current 再动手,并在桌面版上拒绝在 App 运行时写入(--force 可跳过)。--home 会同时作为 DSH_HOME 传给 CLI —— 否则 CLI 会按自己的默认家目录装到别处去(这个坑实测踩过一次)。

就这一条。 dsh plugin 是 pnpm 的薄封装:它把包装进 profile,并自动把声明了 dsh.bundle 的依赖加进 dsh.profile.bundles(按已安装状态 reconcile),不需要手动编辑 package.json。卸载同理,把 add 换成 remove,--profile 换成对应目标。

不想走 npm?把 dsh-image-router 换成 github:zhiwuli0228/dsh-image-router 即为等价形态(前沿代码、未经 registry 校验)。

<details>

<summary><b>桌面版装在哪 / 为什么不能用 PATH 上的 dsh</b></summary>

桌面 App 不复用 npm 全局安装的 dsh:它把整套运行时(Node + pnpm + harness)放在安装目录里,CLI 是

<App>\resources\runtime\cli\bin\dsh.cmd          # Windows
/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh   # macOS

两个版本可能并不相同(例如本机 npm 全局是 0.1.5-rc.1,App 内是 0.2.1-rc.3)。用错 CLI 的后果:

  • 用旧 CLI 装桌面 profile → 写进去的插件 bundle 由旧运行时解释,App 读不到 / 读错;
  • 用任何 CLI 在 App 运行时写 desktop profile → dsh plugin 自己就会拒绝:`Open DeepSeek Harness Desktop once to initialize its profile, then fully quit it before runni

…(truncated)

Rendered from the README published on npm. Formatted only, not edited.

Versions

Published on npm::8,最后更新 2026-10-30

Links

GitHub · Homepage · npm

Same category