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

@alexleekt/pi-shared

v0.1.3

Published

The glue that holds the monorepo together. Shared types and utilities for Pi extensions.

Readme

@alexleekt/pi-shared

npm License: MIT

The glue that holds the monorepo together.

Shared types and utilities for Pi extensions in this monorepo.

Exports

| Path | Description | |------|-------------| | @alexleekt/pi-shared/session | manageSessionSubscription() — per-session subscription lifecycle helper | | @alexleekt/pi-shared/types | Shared Pi extension type definitions | | @alexleekt/pi-shared/prompt-eval | Generalized prompt evaluation framework |

@alexleekt/pi-shared/prompt-eval

A reusable framework for evaluating LLM prompts against test cases. Extracted from pi-heading's duplicated prompt-eval-*.ts scripts.

Core types

export interface EvalSuite<T extends TestCase = TestCase> {
  name: string;
  testCases: T[];
  promptBuilder: (testCase: T) => PromptMessage;   // { system, user, maxTokens }
  extractMode: "json" | "raw";
  scorers: Scorer<T>[];
  modelConfig?: ModelConfig;
}

export type Scorer<T extends TestCase = TestCase> = (params: {
  text: string;      // extracted result
  raw: string;       // raw LLM output
  testCase: T;
}) => ScoreResult;

Key functions

| Function | Purpose | |----------|---------| | runSuite(suite, model) | Evaluate all test cases, score outputs, print progress | | generateReport(results, suite, model) | Build markdown report string | | callLLM(system, user, model, config?) | Call local proxy with retry | | extractResult(raw) | Parse {"result": "..."} or fall back to raw | | optimizeSuite(factory, promptPath, config) | Iterative prompt optimization loop |

Built-in scorers

scorers.wordCount(max)
scorers.withinLimit(max)
scorers.noMetaCommentary()
scorers.noQuotes()
scorers.noMarkdown()
scorers.validJson()
scorers.presentContinuous()
scorers.pastTense()
scorers.noTrailingPeriod()
scorers.concise(threshold)
scorers.alignsWithExpected(field, threshold)
scorers.echoesGoal(goalField, threshold)
scorers.specificConcrete()
scorers.noVagueFiller()

Iterative optimization

import { optimizeSuite } from "@alexleekt/pi-shared/prompt-eval";

const result = await optimizeSuite(
  (promptText) => mySuiteFactory(promptText),   // factory builds EvalSuite from prompt text
  "/path/to/prompt.md",                         // file to mutate in-place
  {
    desirableOutcome: "Concise past-tense summaries under 12 words, no meta-commentary",
    targetPassRate: 85,
    maxIterations: 5,
    evalModel: "firepass",
    criticModel: "firepass",
  }
);

The optimization loop:

  1. Load prompt from file
  2. Run suite → check pass rate
  3. If below target, collect top N failing cases
  4. Call critic LLM with failures + desirable outcome description
  5. Write revised prompt back to file
  6. Repeat until target met or max iterations

License

MIT