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

@jingoz/pi-image-input

v0.2.0

Published

Pi TUI clipboard image attachment bridge

Readme

@jingoz/pi-image-input

Pi TUI Clipboard Image Attachment Bridge for Pi 0.84.3 and newer.

Install

pi install npm:@jingoz/pi-image-input

Behavior

  • Pi's native TUI editor remains the editor; this extension does not call setEditorComponent() or replace pi-fff.
  • Pi continues to own clipboard access and writes the pasted image path into the editor. The original path remains visible until submission.
  • On an idle, native steer, or native followUp interactive TUI input event, every canonical clipboard image path is read, validated by content signature, normalized with Pi's public resizeImage() defaults, replaced in place by a backtick-wrapped [Image] marker, and appended as a flat image attachment in occurrence order.
  • Existing event.images are preserved first; plugin images follow in occurrence order.
  • Repeated paths produce repeated markers and attachments. Their normalized data may be reused within the submission, but attachments are not deduplicated.
  • The selected model must support image input. Any read, signature, normalization, cancellation, or model-capability failure blocks the whole prompt, restores the original path-bearing draft, and reports an error.
  • Clipboard image drafts are accepted while Pi is idle and through Pi's native streaming steer and followUp paths. Image preparation completes before Pi accepts the input; the extension does not track, reorder, deduplicate, or persist queued messages.
  • Active compaction still blocks image-bearing submit and follow-up actions before they enter Pi's text-only compaction queue, while text-only input retains Pi's normal behavior.
  • The compaction submit guard uses current Pi keybindings and is installed and removed with the TUI session lifecycle.
  • GIF paths, ordinary paths, noncanonical paths, and handwritten [Image] text pass through unchanged.
  • RPC, extension-source, JSON, print, and CLI-style inputs retain Pi's existing behavior.
  • The extension does not delete Pi-owned temporary files or persist paths, counters, provenance, or historical image mappings.

The backtick-wrapped [Image] marker records text position only. It does not provide a stable image identity and does not prevent a model from choosing to call tools for other reasons. Successful conversion means the image is already included in the same user message as native image content.

Queued image recovery follows Pi's native behavior. Dequeue, Esc, or abort can restore only the transformed backtick-wrapped [Image] text and lose the queued Image Attachments. Switching to a text-only model after queueing can cause Pi to replace an Image Attachment with its unsupported-image placeholder before the upstream provider request. This extension does not add recovery or model-switch state.

Path Contract

The recognized path must be directly under os.tmpdir() with basename:

pi-clipboard-<uuid>.png
pi-clipboard-<uuid>.jpg
pi-clipboard-<uuid>.jpeg
pi-clipboard-<uuid>.webp

The path must have safe textual boundaries: it is not converted when embedded in a longer path-like token, URI-like prefix, Windows alternate data stream, or filename suffix.

Runtime Guard

Pi versions below 0.84.3 keep the extension inert. In TUI mode the extension emits one concise warning.

Local Development

pnpm --filter @jingoz/pi-image-input check
pnpm --filter @jingoz/pi-image-input test
pnpm install --frozen-lockfile --offline
pi -e ./packages/image-input --list-models
pi --no-extensions -e ./packages/image-input --list-models

Automated coverage currently runs on Windows with Pi 0.84.3 and covers PNG, JPEG, WebP, idle/steer/follow-up transforms, multi-image order, duplicate occurrences, GIF passthrough, failure restoration, unsupported models, aborts, compaction lifecycle, and non-TUI isolation. A 2501x1 PNG regression proves that the bridge calls Pi's default resizeImage() path: the delivered attachment is 2000x1 and differs from the source bytes.

Normal installed-extension and isolated package loading were verified. Manual Windows TUI smoke passed in the normal installed-extension environment, including pi-fff. It covered idle and streaming steer/followUp delivery, multiple queued messages, Image Marker plus flat ImageContent session shape, accepted lossy dequeue behavior, active-compaction blocking, the unsupported-current-model guard, and the post-queue text-only-model boundary. WSL, X11/Wayland, macOS, and providers outside the tested Windows environment were not tested.