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-choices

v0.1.4

Published

Pi extension — structured interactive question forms (radio, checkbox, free-text input) for collecting user decisions inside a Pi agent session.

Readme

pi-choices

A Pi extension that presents structured question forms inside a Pi agent session — letting the agent collect user decisions before continuing.

Why

When an agent needs multiple decisions from you (feature flags, configuration choices, design options), the normal back-and-forth conversation is slow and easy to lose track of. pi-choices pops up a focused TUI form, collects all answers, then returns structured data so the agent can proceed.

Question types

Radio — single choice

Which DELETE scope should be protected?
  ● All DELETE statements
  ○ Only DELETE without WHERE clause

Checkbox — multiple choice (space to toggle, enter to confirm)

Which features do you want to include?
  ☑ Session Library
  ☑ Diagram Gallery
  ☐ Translation Studio
  ☑ MCP Browser

Input — free text

What should the default target language be?
  > Chinese _

All three types support an "Other…" option (allowOther: true) that expands into a free-text field when selected.

Questions are shown one at a time with a Question N / Total progress indicator.

Usage — agent tool call

The extension registers a pi_choices tool. The agent calls it like:

{
  "questions": [
    {
      "type": "radio",
      "id": "delete_scope",
      "question": "Which DELETE scope should be protected?",
      "options": ["All DELETE statements", "Only DELETE without WHERE clause"]
    },
    {
      "type": "checkbox",
      "id": "features",
      "question": "Which features do you want to include?",
      "options": ["Session Library", "Diagram Gallery", "Translation Studio", "MCP Browser"]
    },
    {
      "type": "input",
      "id": "default_lang",
      "question": "What should the default target language be?",
      "placeholder": "e.g. Chinese"
    }
  ]
}

Returns:

{
  "delete_scope": "All DELETE statements",
  "features": ["Session Library", "Diagram Gallery", "MCP Browser"],
  "default_lang": "Chinese"
}

If the user presses Esc at any point, the tool returns "User cancelled the choices form.".

Usage — other extensions (bridge)

pi-choices exports a bridge so other packages can use it without import coupling:

import type { ChoicesBridge } from "pi-choices/lib/choices.ts";

const CHOICES_BRIDGE_KEY = Symbol.for("pi-choices.bridge.v1");
const bridge = (globalThis as any)[CHOICES_BRIDGE_KEY] as ChoicesBridge | undefined;

if (bridge) {
  const answers = await bridge.ask(ctx, [
    { type: "radio", id: "confirm", question: "Proceed?", options: ["Yes", "No"] },
  ]);
}

Keyboard shortcuts

| Key | Action | |-----|--------| | ↑ / ↓ | Navigate options | | Space | Toggle checkbox item | | Enter | Confirm selection / submit input | | Esc | Cancel and abort the entire form |

Installation

pi install npm:pi-choices

Or from GitHub:

pi install git:github.com/SeiyunSky/pi-choice

Requirements

  • Pi >= 0.85.0
  • Node.js >= 18

License

MIT