dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
为 DeepSeek Harness(dsh)纯文本主模型补上「眼睛」和「思考旋钮」:
understand_image,把图片交给配置好的小参数多模态模型(OpenAI 兼容 /chat/completions)理解,返回文字证据给主模型。reasoning_effort(关闭/低/高/最大),全局默认 + 输入框工具行 chip 会话覆盖,下一轮请求生效。understand_image 调用指引),纯文本 API 永远收不到图片。settings.yaml 热生效,全程无需手改配置文件。兼容 dsh 0.1.5-rc.2(基线)/ 0.1.6-alpha.1(适配)。所有宿主接缝均以两版实测源码为锚点(官方 model-selection、image-offload、settings 服务同缝),插件加载失败不影响 dsh 其余部分。
# 1. 构建(或直接使用仓库已提交的 lib/)
pnpm install && pnpm -r run build
# 2. 挂载到 web profile(dsh web 即 --profile web,插件必须挂进该 profile 才会被
# Web 宿主与浏览器 roster 加载;TUI 使用者把 <profile> 换成对应名字)
dsh plugin --profile web add /path/to/packages/dsh-eyebrain
dsh plugin --profile web add /path/to/packages/dsh-eyebrain-client # Web 设置卡片 + 思考强度 chip(自挂载层,add 即激活)
# 3. 重启
dsh web
understand_image 深析。思考接管是清单开启制,与官方控制互补:dsh 内置提供方(DeepSeek 等)不碰, 走官方 model-selection 的档位选择;自定义提供方加入清单并勾选「接管思考」后, 全局/会话档位才注入该端点。图片处理保持安全侧默认。
| 清单命中 | 图片处理 | 思考注入 |
|---|---|---|
| 未命中(含清单为空) | 剥离(安全侧默认) | 不注入(官方行为原样透传) |
text-only | 剥离 | 按条目 takeThinking |
multimodal | 直发(模型不吃图时兜底剥离) | 按条目 takeThinking |
模型能力护栏:注入前插件经 llm.resolveModelInfo 探测目标模型——未声明
思考能力(reasoningEfforts)的模型一律跳过注入(注入会被 dsh-llm 以
UNSUPPORTED_REASONING_EFFORT 拒绝、整轮对话失败;跳过则对话不受影响,档位
旋钮在该模型上静默失效);已声明的模型把四档钳制到其声明集合。自定义 GLM
提供方(bigmodel 等)需在模型条目上声明 reasoningEfforts 旋钮才生效,例如:
llm-pi-ai:
providers:
my-glm:
models:
- id: glm-4.5-air
reasoningEfforts:
off: # 留空 = 关闭思考(zai 格式发 thinking.disabled)
low: low
high: high
dsh web
├─ dsh-eyebrain(后台插件,bundle;inject: tools/settings/attachments/credentials/llm)
│ ├─ config.ts schemastery Config(三总开关)+ 命名空间文档 schema + 归一化
│ ├─ state.ts 运行时文档状态:档位解析、端点判定、识图提供方
│ ├─ takeover.ts 图片块→文本指针纯改写(dsh 会话消息形状)
│ ├─ pipeline.ts agent/request 档位注入(prepend 最外层,注入前能力探测+钳制)+ agent/pre-step 指针改写
│ ├─ vision-tool.ts understand_image(defineTool;路径/URL/附件引用 sha256:)
│ └─ vision-client.ts OpenAI 兼容多模态调用(超时/凭证/数组 content 兼容)
└─ dsh-eyebrain-client(Web 客户端,window.__ModuleLoader__ 工厂格式)
├─ index.ts 后台入口(命名空间由主包注册,此处无逻辑)
└─ client.tsx 可折叠设置卡片(官方 PluginCard 同构)+ composer 工具行思考强度 chip(官方 Menu/Switch/设计令牌);settingsScope.bind 读写
| 能力 | 接缝 | 官方先例 |
|---|---|---|
| 思考档位注入 | agent/request 瀑布 resolved call config 的 reasoningEffort(prepend)+ llm.resolveModelInfo 能力探测/钳制 | dsh-agent model-selection |
| 图片→文本指针 | agent/pre-step 瀑布 decision.messages | dsh-agent model-switch 通知 |
| 附件路径 | attachments.imageHostPath(ref) | dsh-attachment-local |
| 工具注册 | ctx.tools.register(defineTool(def)) | dsh-tool-* |
| Web 配置 | settings.register('dsh-eyebrain', schema) + scope.watch | dsh-settings |
| Web 客户端 | window.__ModuleLoader__ 工厂 + 模块级 inject: ['slots','settingsScope'](dsh 内置 cordis 禁止未声明服务访问)+ settingsScope.bind 读写契约(与官方卡片同构);思考 chip 挂 conversation.input.left(composer 工具行官方席位) | dsh-client-ui-settings-plugins / dsh-client-ui-conversation |
档位值域 off|low|high|max 与 dsh 适配器 reasoningEffort 完全一致;线上格式(reasoning_effort/thinking.type)由 dsh 适配器自行转换,插件不碰请求体。
两个子包均零生产依赖(peer 由 dsh 宿主提供),打包产物天然自包含,可直接进 dsh-admin 插件市场分发:
# 在 DSH Web 中对 AI 说(本地来源,逐包执行):
请把 F:\project\dsh-eyebrain\packages\dsh-eyebrain 打包为离线安装包
请把 F:\project\dsh-eyebrain\packages\dsh-eyebrain-client 打包为离线安装包
子包 files 白名单齐全(lib / cordis.patch.yml / README.md / LICENSE),仓库已提交 lib/,packager 不会在 stage 内触发重建。离线安装端注意 pnpm ≥ 11 minimumReleaseAge 与 Windows 路径空格问题,见 packager README《离线安装必读》。
pnpm install && pnpm -r run typecheck && pnpm -r run test # 冒烟测试 25 用例
冒烟锚点全部来自真实 dsh 源码:瀑布改写(reasoningEffort 注入 / prepend 语义 / 图片指针)、defineTool 注册与参数校验、settings 命名空间注册、bundle 契约、离线打包前提。实机双版本矩阵步骤见 packages/dsh-eyebrain/P7-INTEGRATION.md。
MIT