npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-plugin-image-input

v0.1.1

Published

图片转文字输入插件:给无视觉能力的纯文本 LLM(DeepSeek 等)提供图片输入接管。输入框粘贴/拖拽图片后一键转为结构化文字描述;视觉 API 配置在设置页填写,支持任意 OpenAI 兼容视觉模型(qwen-vl / gpt-4o / glm-4v 等)。多模态模型下自动让位,不劫持原生图片通道。

Readme

dsh-plugin-image-input

没有视觉能力的纯文本 LLM(DeepSeek、GPT-4 base 等)提供图片输入接管

  • 在对话输入框里照常粘贴 / 拖拽图片(出现缩略预览)
  • 直接按 Enter 或点发送——插件会自动把图片转成文字描述,与你的文字一起发出
  • 会话里收到的就是"你的文字 + 图片识别上下文"(画布/元素/百分比坐标,K线图、截图、图表都适用),模型不会再因为图片拒绝消息

当前模型支持图片时(如 qwen-vl / gpt-4o),插件完全放行,走原生图片通道。

也可以先点输入框左侧的 🖼️ 图片转文字 按钮,只把描述插入输入框(不发),自己修改后再发送。

安装(每台 PC 一次)

# 方式 A:从本地目录安装(拿到插件目录后)
dsh plugin --profile web add D:\path\to\dsh-plugin-image-input

# 方式 B:从 npm / GitHub 安装(发布后)
dsh plugin --profile web add dsh-plugin-image-input

然后重启 DSH web

配置视觉 API(设置页填写,一次搞定)

重启后打开 设置 → 图片转文字,填写:

| 字段 | 说明 | 示例 | | --- | --- | --- | | baseUrl | OpenAI 兼容接口地址(不含 /chat/completions) | https://dashscope.aliyuncs.com/compatible-mode/v1 | | model | 视觉模型名 | qwen-vl-max / gpt-4o / glm-4v | | apiKey | 你的 API Key(留空 = 保持不变) | sk-... | | maxTokens | 最大输出 token | 2048 |

保存即生效(无需重启)。配置存于 ~/.config/mm-vision/config.json

不填设置页也可以:插件会回退读取同路径配置文件或环境变量 MM_VISION_API_KEY / DASHSCOPE_API_KEY / QWEN_API_KEY / OPENAI_API_KEY / GEMINI_API_KEY

使用

  1. 粘贴 / 拖拽一张图片到输入框(出现缩略预览)
  2. 直接按 Enter 或点发送(或先点 🖼️ 按钮只转文字)
  3. 等约 1 分钟(思考型视觉模型对复杂图较慢),自动转为文字描述并发送
  4. 模型就能"看"到图了

转换期间输入框显示"正在把图片转为文字后发送…";失败会提示并保留图片,不会丢内容。 多张图片逐张转换、一起发送。

原理

  • 发送接管:Enter / 发送按钮(捕获阶段)→ 输入框有图片草稿且模型非多模态 → 阻止原生提交
  • 页面读取 blob 图片(浏览器内存,模型拿不到)→ base64 → 本地路由 /plugins/mmv/analyze
  • host 以 danger-full-access 策略运行固定内容的 node 子进程,直连你配置的视觉 API (OpenAI 兼容协议)——不依赖本机沙箱后端(Windows ACL / Linux bubblewrap / macOS sandbox-exec), 任何平台都能跑;仅限本机页面调用(Origin 校验),请求只发往你自己配置的地址

插件不依赖 DSH 的任何模型适配器,任何 OpenAI 兼容视觉端点都能用。

开发

lib/index.js   # host 半:本地路由(capability/config/analyze)+ node 子进程视觉调用
lib/client.js  # client 半:发送接管 + 输入框按钮 + 设置页配置表单(浏览器 bundle)

License

MIT