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

@petechu/pi-answer-studio

v0.1.3

Published

Interactive Q&A extraction extension for pi

Downloads

34

Readme

Answer

Extracts questions from the last assistant message, lets you answer them in a terminal UI, and compiles the responses back into the chat. Trigger with /answer.

Install

pi install npm:@petechu/pi-answer-studio
/reload

Usage

  1. Run /answer after an assistant message that contains questions.
  2. Answer each question in the UI.
  3. Press Ctrl+R or finish the last question to enter review.
  4. Press Enter on the review screen to submit.

Keys

| Key | Action | | -------------------------- | ----------------------------------- | | ← / → | switch questions | | Enter | commit answer, move to next | | Ctrl+R | review / submit | | ↑ / ↓ | select an option / move cursor | | 1 – 9 | jump to option number / toggle | | type while option selected | switch to custom text input | | Shift+Enter | newline in custom input | | Ctrl+T | apply next answer template | | Ctrl+M | toggle single-select / multi-select | | Space (multi-select) | toggle option at cursor | | Ctrl+C | cancel | | Esc (on review) | back to editing |

Answer modes

Each question defaults to single-select (radio buttons). Press Ctrl+M to switch the current question to multi-select (checkboxes) and vice versa. The mode indicator [S] or [M] is shown next to the choices label.

  • Single-select: ↑/↓ changes the selection, Enter commits
  • Multi-select: ↑/↓ moves the cursor (▸), Space or a number key toggles the option at cursor, selected options are joined with , in the answer

The compiled submission omits unanswered questions and context lines.

Design & workflow

The extension has three layers: extraction, answering, and submission.

Extraction

When /answer runs, the extension walks the current session branch from newest to oldest and uses the latest completed assistant text message as the source. It then selects the first configured extraction model that exists in Pi's model registry and has working authentication, falling back to the current chat model if none is usable.

A configured model can include a thinking-level suffix. The suffix is removed for registry lookup and applied only to the extraction request; /answer does not change Pi's active model or thinking level. Existing unsuffixed model IDs remain supported and run without a reasoning override.

The assistant message is sent to the extraction model with a structured extract_questions tool when supported. If that tool path fails, the extension retries with the plain JSON system prompt using the same selected model and thinking level. Extracted questions are normalized before display: ids are stabilized, empty questions are dropped, optional headers/context are trimmed, and choices are kept only when they have usable labels.

Answering

Questions are shown in a custom terminal UI called Answer Studio. The UI keeps the extracted order, shows optional context and choices, and always offers an "Other / custom answer" path for choice-based questions. You can move between questions, select numbered options, type free-form responses, cycle configured templates, and enter a review screen before submitting.

Answer templates are applied locally in the TUI using {{question}}, {{context}}, {{answer}}, {{index}}, and {{total}} placeholders. They only change the current draft text; they do not re-run extraction or call another model.

Drafts and submission

Drafts are stored as custom session entries tied to the assistant message id and the normalized question list. While enabled, answer changes are autosaved after the configured debounce interval, restored only when the same questions are extracted again, and cleared after a successful submission.

When you submit from the review screen, the extension sends one new chat message that starts with I answered your questions in the following way: followed by the compiled Q/A text, then triggers the next assistant turn. Cancelling keeps or flushes the current draft depending on where you exit; submitting clears it.

Configuration

The extension reads answer settings from Pi's global agent settings and project .pi/settings.json (project overrides global):

{
  "answer": {
    "systemPrompt": "Custom extraction prompt...",
    "extractionModels": [
      { "provider": "openai-codex", "id": "gpt-5.6-luna:low" },
      { "provider": "github-copilot", "id": "gpt-5.4-mini:off" },
      { "provider": "github-copilot", "id": "gemini-3-flash-preview" },
      { "provider": "anthropic", "id": "claude-haiku-4-5" }
    ],
    "answerTemplates": [
      { "label": "Brief", "template": "{{answer}}" },
      { "label": "Need info", "template": "I need more details about: " }
    ],
    "drafts": {
      "enabled": true,
      "autosaveMs": 1000,
      "promptOnRestore": true
    }
  }
}

Append an optional thinking level to a model id after its final colon. Valid suffixes are off, minimal, low, medium, high, and xhigh. For example, gpt-5.6-luna:low looks up gpt-5.6-luna and requests low reasoning. The off suffix explicitly selects the base model without passing a reasoning level.

Unsuffixed IDs continue to work as before and do not pass a reasoning override. An unrecognized final suffix is treated as part of the full legacy model ID. If no configured model can be resolved and authenticated, /answer uses Pi's current model without a reasoning override. These settings affect only question extraction, including its structured-tool and plain-JSON attempts.

Template placeholders: {{question}}, {{context}}, {{answer}}, {{index}}, {{total}}.