dsh-tool-eyes:为 DeepSeek Harness 增加本地视觉工具

前言

在 DeepSeek Harness(DSH)中,如果希望 agent 能读取屏幕内容或描述图片,可以把视觉能力作为工具挂入现有会话。下面介绍的 dsh-tool-eyes 就是这类本地视觉“眼睛”插件。

它提供两个工具:screen 用于视觉描述,ocr 用于文字提取。

这是什么

dsh-tool-eyesgo-farther-and-farther 维护的 DSH 插件,许可证为 MIT。

它解决的核心问题是:在 Windows 环境下,让 DSH agent 能调用本地视觉端点描述屏幕或图片,或调用 Windows 内置 OCR 引擎逐字提取文本。

核心功能

screen

screen 捕获屏幕或描述已有图片文件,经本地 OpenAI-compatible 视觉端点返回文字描述。

它接受可选 image 路径;不提供时捕获屏幕。

screen 的提示词要求视觉模型只描述可见内容,降低小模型名称幻觉。

本地优先方面,screen 可指向本地端点,使图片不出本机。

ocr

ocr 使用 Windows 内置 OCR 引擎逐字提取文本,零模型、零 GPU、零云端。

它也接受可选 image 路径;不提供时捕获屏幕。

ocr 完全本地,无网络。

安装与启用

先确认环境要求:

  • Windows 10/11
  • Node.js >= 22.19
  • DeepSeek Harness >= 0.1.0-rc.6
  • screen 需要任一 OpenAI-compatible VLM endpoint,例如 llama.cppLM StudioOllama 或任意网关

该包仅发布在 GitHub,不在 npm。安装命令如下:

dsh plugin --profile web add https://github.com/go-farther-and-farther/dsh-tool-eyes

安装后重启 dsh webscreenocr 工具会自动出现在 agent toolkit。

配置

如果需要指定 screen 使用的视觉端点,可以在 profile 的 cordis.patch.yml 中按 id tool-eyes 配置 baseUrlmodeltimeoutMs

结构示例如下:

- id: tool-eyes
  name: 'dsh-tool-eyes'
  config:
    baseUrl: <baseUrl>
    model: <model>
    timeoutMs: <timeoutMs>

其中 baseUrl 指向 OpenAI-compatible 视觉端点,model 用于指定模型,timeoutMs 用于指定超时参数。

典型用法

在对话中,可以这样使用:

  • screen 回答 what is on my screen?describe this image file,并可加 prompt 聚焦区域或细节。
  • ocr 执行 read all the text on screentranscribe this error dialog

两者都可传 image 路径;不传则截图。

插件捆绑了 lib/capture.ps1lib/ocr.ps1,也可独立运行:

powershell -NoProfile -ExecutionPolicy Bypass -File lib\capture.ps1 -Prompt "<focus>" -BaseUrl <baseUrl>
powershell -NoProfile -ExecutionPolicy Bypass -File lib\ocr.ps1 -Image <image path>

capture.ps1 可带 -Prompt-BaseUrl 参数,ocr.ps1 可带 -Image 参数。

适用场景与注意

适合以下情况:

  • 在 Windows 10/11 上使用 DSH,并想让 agent 读取屏幕文字或描述图片。
  • 希望 ocr 完全本地、无网络。
  • 希望 screen 指向本地端点,使图片不出本机。

注意:

  • screen 会将捕获图片发送到配置的 baseUrl
  • 插件以当前 dsh 进程权限运行。安装前应检查源码与许可证;当前许可证为 MIT。

结尾

经过上面的步骤,dsh-tool-eyes 可以给 DSH agent 增加两个本地视觉工具:screen 负责描述,ocr 负责逐字提取。

GitHub:https://github.com/go-farther-and-farther/dsh-tool-eyes
目录页:当前未提供可确认链接。

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜