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

@hank-warren/pi-permission-selector

v0.1.0

Published

Numbered approval options and Tab-to-comment for Pi's extension select dialogs, including pi-auto-permissions command approval prompts.

Readme

permission-selector

Numbered approval options + Tab-to-comment for pi's extension select dialogs — the UI behind ctx.ui.select, which is what pi-auto-permissions uses for its command approval prompts.

What it does

Numbered options + digit hotkeys (all extension select dialogs)

Options render as 1. Allow, 2. Block, … and pressing 19 selects that option instantly. Existing ↑↓/j/k navigation and Enter/Esc behavior is untouched. Options beyond the ninth are un-numbered (arrow-only). ctx.ui.confirm (Yes/No) dialogs share the same component and get numbering for free.

Tab-to-comment (approval prompts only)

With an option highlighted, press Tab to pin it and type a note inline:

→ 1. Allow, after this command runs, we should check the logs▌
  2. Block
  enter submit · esc discard note · tab back
  • Enter submits: the calling extension receives the original option string ("Allow"/"Block" — required because pi-auto-permissions does an exact string compare), and the note is sent to the agent verbatim as a steering user message (pi.sendUserMessage(note, { deliverAs: "steer" })).
  • Esc discards the note and returns to normal navigation (Esc again cancels the dialog as usual).
  • Tab toggles back to navigation, preserving the typed text.
  • While typing, digits are literal text and arrow keys are inert.
  • Pasting works (bracketed paste, including multi-chunk pastes); pasted newlines/tabs are flattened to spaces since the note is a single line.
  • Key handling is encoding-aware via pi-tui's matchesKey, so terminals using the Kitty keyboard protocol (Esc = \x1b[27u, CSI-u printables) work the same as legacy encodings.
  • An empty/whitespace note submits the option without sending anything.

This works for both directions: Allow + note runs the command and steers the next model turn ("check the logs after"); Block + note blocks with the normal reason plus your steer ("do X instead").

Scope and configuration

  • Approval prompts are detected by title regex. Default: /needs approval/i (matches pi-auto-permissions' "<label> — Auto Permissions needs approval"). Override with the PI_PERMISSION_SELECTOR_MATCH env var (compiled case-insensitive; invalid patterns fall back to the default).
  • When auto-permissions is disabled, pi core shows no approval prompts (it is YOLO by default), so this extension has nothing to enhance — by design.
  • Non-TUI modes (rpc/print/json) never instantiate the component; the patch is inert there.

Known coupling

This extension monkey-patches ExtensionSelectorComponent.prototype (updateList/handleInput) from @earendil-works/pi-coding-agent, relying on pi's extension loader aliasing that package to the running instance. If a future pi version changes the component shape, the patch refuses to apply, the selectors stay stock, and a warning notification is shown at session start — it never crashes.