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

opencode-assist

v0.2.0

Published

OpenCode image understanding helper with shared TUI and GUI model selection

Downloads

401

Readme

OpenCode Assist:图片理解路由

这个版本集中提供图片辅助模型选择与自动路由:纯文本主模型收到图片时,交给选定的图片模型理解,再把带来源的文字交回主模型。主模型本身支持图片时保留原始媒体,不切换主模型。浏览器功能在0.2版停用,源码保留,但入口、编译输出和生产依赖均不包含浏览器。

安装

发布到 npm 后,可以直接使用 OpenCode 安装:

opencode plugin add opencode-assist

然后在 ~/.config/opencode/cli.json 加载终端入口:

{ "plugins": ["opencode-assist"] }

源码或本地安装包仍可使用下面的方式:

npm install
npm run build
npm pack

将项目OpenCode配置的 plugins 指向构建后的绝对目录,见 服务端示例。也可以在另一目录 npm install /absolute/path/opencode-assist-0.2.0.tgz,将 package 指向其中的 node_modules/opencode-assist。无需安装浏览器。SDK/schema固定2.2.5;本机使用Node 25.8.1。

在终端或桌面选择模型

服务端从OpenCode原生模型目录、provider记录及公开连接状态查询候选;两个界面使用同一个RPC和插件持久化存储,不读取密钥来判断模型。列表显示provider、模型、输入能力、可用性及不可用原因。能力未知不当作支持;宿主只列出模型、未提供独立连接状态时会明确显示“未提供独立连接状态”,不承诺真实API凭据有效。没有在线探测或付费测试。

终端:除服务端 plugins 外,OpenCode 2.2.x的终端还需要在自己的 cli.json 中加载同一包,见 终端示例。实际CLI支持 OPENCODE_CLI_CONFIG_CONTENT 覆盖该内容。打开会话后,右侧原有信息下方会显示当前图片辅助模型;点击模型行、输入 /assist-image,或从命令面板选择图片理解命令,即可打开原生可搜索列表。不可用项仍可查看原因,但不能保存成选择。

桌面:服务端包提供官方 ./gui-experimental CommonJS入口、命令面板入口与图片辅助模型原生设置页;按钮打开桌面自己的选择对话框。使用当前项目/会话对应服务器;没有已连接服务器时给出提示。桌面入口通过官方SDK与共享RPC实现。本机未安装OpenCode桌面App,尚未完成真实桌面窗口点击验证;不要把终端与RPC验证等同于桌面实测。

选择图片模型后立即影响后续路由,另一个界面重新打开选择器即可读取同一状态,服务端重启仍保留。也可以单独停用图片辅助。存储范围跟随OpenCode插件存储和服务器,客户端不会各自写另一份模型配置。旧 vision.model 作为首次图片选择的默认值;一旦保存选择,持久化值优先。未选模型时需要转交的内容会返回明确提示。

支持范围

  • 图片:本地文件、合法data URI、公网HTTP(S)地址;支持PNG/JPEG/GIF/WebP,默认10MiB。用户附件、原生read与工具媒体自动路由;tools.vision_inspect({image,question})可主动识别。MCP 或技能返回的截图以图片内容或可读取的图片文件附件进入会话时,会结合对应轮次最近的用户请求分析,并保留工具返回的文字和调用信息。仅在工具输出文字中提到截图路径时,需要读取图片或调用 vision_inspect;不会扫描任意工具文本或自动打开本地路径。
  • 原始会话历史保持不变;已压缩或移出窗口的图片不会重新挂到当前问题。有限内容缓存与并发共享避免重复辅助调用;单个调用取消不误取消其他共享调用。
  • 辅助会话禁用工具与递归,完成后删除。主会话中断/删除会取消辅助请求;插件显式中断辅助会话,并独立限制清理等待时间。默认请求超时60秒、缓存64条。取消不会变成错误识别结果。

音频、视频、实时语音、音频生成与格式转码不在本版本范围内。真实模型识别质量和远端服务兼容性尚未调用验证;模型目录的能力声明不能代替实际provider格式约束。

验证

npm run typecheck
npm test
npm run build
OPENCODE_BIN=/path/to/opencode-2.2.5 npm run smoke
OPENCODE_EXPECT_VERSION=2.2.6 OPENCODE_BIN=/path/to/opencode npm run smoke
npm pack --dry-run --cache /private/tmp/opencode-plugin-npm-cache

smoke真实打包、临时解包并独立离线安装生产依赖,再加载包exports。需要 /private/tmp/opencode-plugin-npm-cache 预先缓存依赖;可通过npm正常填充缓存。所有宿主使用临时XDG目录、环境白名单、禁更新/禁模型抓取/禁免费模型,本地mock provider核对实际图片字节、文本主请求隔离、能力直通、工具/文件、取消、共享选择与重启恢复。测试不读取用户auth,不调用付费模型,不修改全局配置、HOME或用户profile。终端实机选择使用同样隔离的fixture服务。

本轮只读审计:固定SDK生产传递链有24 moderate、0 high/critical;开发esbuild另有1 low。没有audit fix或擅自升级SDK。严格2.0.x及其他版本未验证。安装包不包含profile、Cookie、node_modules、测试日志或完整系统prompt。