omp packages

@moguw/pi-image-preview0.1.0

Show images above the Pi editor as you type a path, and attach them to your message

moguw Published 12 days ago MIT ~232 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

@moguw/pi-image-preview

Show images above the editor as you type a path, and attach them to the message you send.

A UI extension, not a capability one. Recent models see images natively, so this adds nothing about how images are understood — it removes the friction of getting them in front of you while you type.

What it does

Type a path to an image in the editor. Three hundred milliseconds after you stop typing, the image appears above the editor with a metadata line. Send the message and the same bytes are attached, with the path replaced by a numbered marker.

┌──────────────────────────────────┐
│  (image)                         │   ← preview, above the editor
│  shot.png | 1080x2400 | ... | 2KB│
├──────────────────────────────────┤
│ compare `[Image-#1]` with the …  │   ← what you typed, path replaced
└──────────────────────────────────┘

Both axes of the preview are bounded. A tall screenshot is limited by height and shrinks; it does not push the editor off screen.

What it deliberately does not do

Pi already handles the rest, and a second copy of that logic would only disagree with the first:

Not here Because
Resizing or format conversion Pi normalizes every attachment against the active model's limits before sending
Checking whether the model takes images Pi reports its own note when the model cannot, and omits the image
Delegating to a second vision model The reason to attach natively is that the primary model can see the image
Caching, retries, fallbacks Nothing is being called
A separate "look at this image" command The preview already shows what such a command would
Configuration There is nothing worth choosing

Install

pi install npm:@moguw/pi-image-preview

Path detection

A token is only treated as an image when it has a path separator and ends in a supported extension, so screenshot.png in prose stays prose:

/tmp/shot.png     ~/Pictures/a.jpg     ./out.png     ../up/b.webp

Spaces are supported in the form a terminal produces when you drag a file in (/tmp/Screen\ Shot.png). Supported: png, jpg, jpeg, gif, webp, bmp.

Terminal support

Image rendering is Pi TUI's own, so it follows the terminal:

Terminal Rendering
Kitty, Ghostty, WezTerm, iTerm2 (standalone) Real graphics
tmux, VS Code, Alacritty, others Text fallback: the metadata line still appears

The fallback is honest: you see name, dimensions, format, and size, and know the image was found.

Licence

MIT. The preview component is derived from @getpipher/vision by RECTOR, also MIT.