zcXie777/dsh-image-reader

为DeepSeek Harness代理提供原生图像读取能力:一个由任意兼容OpenAI视觉接口支持的read_image工具。

项目介绍Project Overview

dsh-image-reader 是为 DeepSeek Harness 文本代理增加视觉能力的插件,提供一个模型可调用的 read_image 工具,按工作区路径向任意 OpenAI 兼容视觉端点发起多模态请求。在需要让代理解读截图、图表或照片时使用。需要 baseUrl、model 与 VISION_API_KEY 环境变量;目前尚未对真实视觉端点做过端到端验证,建议先用真实密钥冒烟测试一次。

dsh-image-reader is a DeepSeek Harness plugin that adds image understanding to a text-only agent by exposing a single read_image tool, which sends a workspace-path image to any OpenAI-compatible vision endpoint. Use it when the agent must answer questions about screenshots, diagrams, or photos instead of plain text. It requires provider baseUrl, model, and a VISION_API_KEY environment variable. End-to-end testing against a live vision model has not yet been performed, so run a smoke test with a real key before depending on it.

或使用命令行安装(适合开发者)Or use CLI install (for developers)

命令行安装CLI Install

dsh plugin --profile web add "$PWD/dsh-image-reader"

zcXie777/dsh-image-reader 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-image-reader

Give a text-only DeepSeek Harness agent the ability to read images directly: one model-facing read_image tool that asks any OpenAI-compatible vision endpoint about an image by its workspace path.

Why

DeepSeek Harness is "everything is a plugin". This bundle mounts a single tool so the model can look at a screenshot, diagram, or photograph and answer questions about it, instead of only ever reasoning over text.

Verification status

  • Verified locally: npm run typecheck, npm run build, and npm test (16 tests) all pass.
  • Not yet verified: a real end-to-end read against a live vision endpoint. The request/response logic is covered by a mocked-fetch unit test, but the plugin has not been smoke-tested inside a running dsh profile against a real multimodal model. Do that once with a real VISION_API_KEY before relying on it.

Install

git clone https://github.com/zcXie777/dsh-image-reader.git
cd dsh-image-reader
npm install
npm run build          # lib/ is not committed; build once after cloning
cd ..
dsh plugin --profile web add "$PWD/dsh-image-reader"
dsh plugin --profile headless add "$PWD/dsh-image-reader"
dsh --profile web --dump-config | grep image-reader

Restart a running Web profile after installing.

Configure

provider.baseUrl and provider.model are required; the plugin never assumes a vendor. Override them in the profile patch row with the same id:

- id: image-reader
  config:
    provider:
      baseUrl: https://api.openai.com/v1
      model: gpt-4o-mini
      apiKeyEnv: VISION_API_KEY
    lang: zh
    timeoutMs: 60000
    maxImageBytes: 10485760
    allowedDirs: []

Set the key in the environment before starting the profile:

export VISION_API_KEY=sk-...

Use

In a conversation, point the model at an image path and ask:

read_image image="screenshot.png" query="What error is shown in this dialog?"
read_image image="diagram.png"

Configuration fields

Field Default Contract
provider.baseUrl — (required) OpenAI-compatible chat/completions base URL
provider.model — (required) Multimodal model name
provider.apiKeyEnv VISION_API_KEY Environment variable holding the API key
lang zh Answer language: zh or en
timeoutMs 60000 Whole-request deadline, 1000–600000 ms
maxImageBytes 10485760 Encoded-byte limit per image
allowedDirs [] Extra realpath-resolved input roots; the workspace is always allowed

Security

  • Inputs resolve against the workspace and allowedDirs through realpath, so a symlink cannot escape the fence.
  • Images are size-limited and extension-checked before upload.
  • The key is read from the environment per call, never stored in config.

Development

npm install
npm run typecheck
npm run build

Publish

Tag the repo with the dsh-plugin topic so it is discoverable, and publish to npm when ready.

License

MIT

上一个 Prev dsh-discovery 下一个 Next dsh-more-session-operations