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-image-relay

v0.0.3

Published

OpenCode plugin that relays pasted images to any image-capable MCP tool, so text-only models (e.g. GLM-5.2) can still analyze images.

Readme

opencode-image-relay

An OpenCode plugin that lets text-only models (e.g. GLM-5.2) handle images you paste, by relaying each image to any image-capable MCP tool you already have installed.

No tool names are hard-coded, no external vision API is required — it just turns a pasted image into a file path the model can hand to whatever image MCP tool is available (e.g. zai-mcp-server, GLM-4V, Gemini, etc.).

Why

When you paste an image into OpenCode with a model whose modalities.input does not include image, OpenCode drops it with an error like:

Cannot read "x.png" (this model does not support image input). Inform the user.

…and the model dutifully tells you it can't see images. MCP image tools can analyze the image, but they need a file path, and a pasted image is inline base64 with no path.

This plugin bridges that gap.

How it works

user pastes image
  → experimental.chat.messages.transform hook fires
     (only when the active model lacks native image input)
  → image bytes are saved to a temp file
  → the image part is REMOVED from the outgoing message, so opencode has no
     unsupported part to flag — its "does not support image input" error is
     never generated in the first place
  → a minimal hint is injected: "[image-relay] ... saved: <abs path>"
     (+ a one-line steer to use an image-analysis tool, not `read`)
  → the model analyzes the path with an available image MCP tool
  • Vision-capable models are left untouched — the original image part reaches them natively. Activation is purely capability-based, no config needed.
  • No system prompt is injected. The image part is stripped only from the outgoing request; the original inline image stays in the conversation record, so nothing is lost. The temp file is an ephemeral handle, regenerated from the persisted base64 whenever it's needed again.

Install

Option A — from npm (recommended)

Add to opencode.json (global: ~/.config/opencode/opencode.json):

{
  "plugin": ["opencode-image-relay"]
}

OpenCode installs it automatically with Bun on startup.

Option B — local (development)

OpenCode auto-loads *.ts from its plugin directory, so copy or symlink src/index.ts there:

mkdir -p ~/.config/opencode/plugins
ln -s "$PWD/src/index.ts" ~/.config/opencode/plugins/image-relay.ts

Then restart OpenCode (plugins load at startup).

Configure

| Env var | Default | Meaning | | --- | --- | --- | | IMAGE_RELAY_MAX_IMAGES | 200 | LRU cap on saved temp images (oldest evicted past this). |

Temp images live in os.tmpdir()/opencode-image-relay/image{N}/<hash>.<ext> (purged on reboot, regenerated on demand).

Requirements

  • OpenCode (runs on Bun, so .ts plugins load natively — no build step).
  • At least one image-capable MCP tool installed (e.g. zai-mcp-server with analyze_image).

License

MIT