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

pi-aux-vision

v0.3.0

Published

Registers a describe_image tool that routes image analysis to a configured vision model through pi's official pipeline.

Readme

pi-aux-vision

中文

Registers a describe_image native tool for Pi: the main model (e.g. deepseek-v4-flash, which has no image input) decides when to call it, passes an image path and a specific question, and the extension routes the request through pi's official pipeline to a configured vision model. The result comes back as a tool_result in the conversation context.

Install

pi install npm:pi-aux-vision

Or to try it without installing:

pi -e npm:pi-aux-vision

Manual install: drop the pi-aux-vision/ directory under ~/.pi/agent/extensions/, then run /reload in Pi.

How it works

  • On startup, reads ~/.pi/agent/aux-vision.json; with no config, auto-discovers the first available (authenticated, image-capable) vision model and writes it to the config. Falls back automatically when the configured model becomes unavailable.
  • Auth, protocol serialization, and retries all go through pi's official pipeline (ctx.modelRegistry.complete), supporting google-generative-ai, openai-completions, and anthropic-messages protocols.
  • Every result begins with an exhaustive transcription base (image type, verbatim transcription of all visible text, layout/order), then answers the question and ends with a completeness attestation — so a main model without image input can reason from the base, not just from a narrow answer. When the output hits the token cap, the tool prepends an explicit truncation notice instead of silently returning a partial base.
  • Image limit is 10 MB (the intersection of the three providers' limits); oversized images are compressed with pi's official resizeImage before failing.
  • After the first describe_image call or /vision test of a session (success or failure), the TUI footer shows vision: provider/model until the session ends — dim vision: prefix, accent model name, and a ! in error color after a failed call. New sessions start hidden; toggle with showInFooter.

Compatibility

Verified against pi 0.86.0 (2026-09-19). The peer dependency range stays "*"; the source type-checks against the current SDK via npm run typecheck.

Configuration

~/.pi/agent/aux-vision.json:

{
  "enabled": true,
  "provider": "google",
  "model": "gemini-2.5-flash",
  "maxOutputTokens": 8192,
  "maxRetries": 2,
  "maxRetryDelayMs": 5000,
  "showInFooter": true
}
  • maxOutputTokens: output token cap for the vision model. Every result begins with an exhaustive transcription base (image type + verbatim transcription of all visible text), so dense screenshots need a larger budget; when the cap is hit, the tool prepends an explicit truncation notice instead of silently returning a partial base
  • maxRetries: retry count (initial + N attempts; 4xx is not retried, handled by the official pipeline)
  • maxRetryDelayMs: backoff ceiling, in milliseconds
  • showInFooter: show the vision: provider/model status in the TUI footer after the first describe_image call or /vision test of a session (default true)

Commands

| Command | Description | |---|---| | /vision status | Current provider/model, protocol, enabled state, footer switch | | /vision set <provider> <model> | Set a vision model explicitly and enable it, writes to config | | /vision list | List available (authenticated) image models, mark the current one | | /vision enable / /vision disable | Toggle; when disabled, describe_image is hidden from the main model | | /vision test [path] | Verify the full pipeline with an auto-generated test image; optional custom path |

Tool

describe_image(image_path, question) — read from disk → encode → single vision-model call → text result.

  • image_path: absolute path or path relative to the working directory; supports png / jpeg / gif / webp / bmp
  • question: a specific question, e.g. "extract the stack trace shown in line 4 of the error message" or "why is the button shifted 10px to the right?"

The vision model answers in the language of the question. Errors (file not found, unsupported format, call failure) return as structured text for the main model to handle; no confirmation dialogs.

Test

npm test

or directly:

node .test/build.js && node .test/test-run.mjs

Type compatibility against the current pi SDK is verified with npm run typecheck.

.test/ bundles the extension modules with mocked pi dependencies via esbuild and covers config read/write, model discovery, describe_image success/failure paths, test-image generation, and the footer state machine + wiring.

License

MIT