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

@zicolasjac-ai/jensen-opencode-vision

v0.1.3

Published

OpenCode plugin that lets non-vision models read pasted/attached images by routing them through an external vision model at chat-messages-transform time.

Readme

jensen-opencode-vision

OpenCode 插件:让不支持图片输入的模型(deepseek-v4-flash、opencode/deepseek-v4-flash-free 等)通过外部视觉模型读取用户拖拽/附加的图片。

工作原理

experimental.chat.messages.transform 钩子里:

  1. 找到当前轮次的 user 消息,对其图片附件调用外部视觉模型(默认 MiniMax-M3),把分析结果以 [Image analysis result] 注入文本,删除原图片 part。
  2. 关键:把所有历史 user 消息中的图片附件也一并删除(上一轮的分析文本已经注入历史,图片本体无需再发给模型)。如果不删,第二轮起 opencode 会因模型不支持图片而触发 unsupportedParts() 降级为 ERROR: Cannot read "image.png" (this model does not support image input). Inform the user.,表现为"第一次能看,第二次就报错"。
  3. 视觉 API 失败时自动重试 2 次(瞬时 5xx/网络抖动自愈);仍失败则提示用户重新发送图片。

安装

npm install -g @zicolasjac-ai/jensen-opencode-vision
# 或者装到 opencode 用户目录:
cd ~/.config/opencode && npm install @zicolasjac-ai/jensen-opencode-vision

~/.config/opencode/opencode.jsonplugin 数组中加入:

"plugin": [
  "@zicolasjac-ai/jensen-opencode-vision"
]

配置

配置文件查找顺序(找到第一个存在的就用,不会合并):

  1. ~/.config/opencode/plugins/jensen-opencode-vision/config.json推荐,独立于 npm 包,npm install 不会覆盖
  2. <包安装目录>/config.json ← 包自带的兜底(npm 包通常不带)

第 1 个文件示例:

{
  "models": [
    "opencode/deepseek-v4-flash-free",
    "opencode/deepseek-v4-flash",
    "opencode-go/deepseek-v4-flash"
  ],
  "vision": {
    "baseURL": "https://api.minimaxi.com/v1",
    "apiKey": "<your-key>",
    "model": "MiniMax-M3",
    "prompt": "你是纯视觉转录助手..."
  }
}

字段含义:

  • models:精确白名单。只有列在这里的模型才会被插件劫持转图片为文本;未列出的模型走原生的图片处理路径(自带视觉的不会被劫持)。不要用 * 通配 provider,否则会把该 provider 下所有模型都劫持。
  • vision.baseURL:OpenAI 兼容 chat completions 端点
  • vision.apiKey:Bearer Token
  • vision.model:视觉模型标识
  • vision.prompt:发给视觉模型的系统提示。推荐写"只做客观转录、不替用户回答问题",把决策权留给主模型。

启用验证

重启 opencode,日志里看到 jensen-opencode-vision plugin initialized 即生效。

已知限制

  • 视觉 API 重试后仍失败时,历史里那张图会被删除,且无法补救——靠提示用户重发图片来恢复。
  • 历史消息中的图片 part 直接删除(不调用视觉 API),避免对每张图重复调用视觉接口。

License

MIT