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

@foabo/pi-vision

v0.1.2

Published

Give non-vision pi models image understanding through a vision subagent

Readme

pi-vision

Give non-vision pi models image understanding through a private vision session.

When the active model cannot accept images, this extension creates a short-lived in-memory pi session and asks a vision-capable model to describe the image. The original image block remains intact; the parent receives a bounded, explicitly untrusted description.

Requirements

  • At least one vision-capable model in the current pi model scope, or a configured vision model that is in that scope

Install the extension:

pi install npm:@foabo/pi-vision

Then restart pi or run /reload.

Configuration

The optional global configuration file is:

~/.pi/agent/extensions/pi-vision/config.json

The path uses pi's configured agent directory. If PI_CODING_AGENT_DIR is set, replace ~/.pi/agent with that directory.

Example:

{
  "model": "your-provider/your-vision-model",
  "timeoutMs": 15000,
  "maxTurns": 3
}

visionModel is also accepted as an alias for model.

| Field | Default | Purpose | | --- | --- | --- | | model | auto-discover | Exact provider/model-id for the vision session | | timeoutMs | 15000 | Maximum time per image handoff | | maxTurns | 3 | Maximum child-session LLM turns |

A missing file uses automatic discovery and defaults. A present config file must be valid JSON; malformed JSON is reported instead of silently selecting another model.

When model is omitted, pi-vision selects the first model in the current session's model scope whose metadata contains input: ["image"]. A configured model must also be in that scope; configuration never bypasses --models or enabledModels restrictions.

The selected registry model is passed to the child session with "image" in its input list. This prevents pi from stripping image blocks when provider metadata is incomplete.

Behavior and safety boundary

The extension handles two official image paths:

  • images attached directly to a submitted prompt (before_agent_start)
  • image blocks returned by pi's built-in read tool (tool_result)

For a text-only active model:

  • the original image remains in the session and UI
  • one image is processed at a time, so an image batch cannot create an unbounded number of child sessions
  • the description body is at most 4,000 characters per image and is labelled as untrusted image data; instructions found in the image must not be followed
  • a failed handoff leaves the original pi flow unchanged and is not retried by a generic context hook

For an active model whose registry entry declares image input, the extension does nothing.

Child session

The child session is created through pi's public SDK (createAgentSession) and:

  • uses SessionManager.inMemory() and is disposed after the handoff
  • exposes a same-named, restricted read tool that can read only the staged temporary image, exactly once
  • cannot read any other path, even with an absolute path
  • loads no extensions, skills, prompt templates, themes, or context files
  • inherits no parent conversation

The extension does not cache completed descriptions. It retains only concurrent in-flight work, which is released once the handoff settles.

Development

npm install
npm run check

The tests cover config loading, model scope enforcement, direct attachments, read results, restricted child file access, sequential image processing, bounded untrusted output, and fail-open behavior.