@xynogen/pix-models 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # pix-models
2
2
 
3
- Pi extension — enhanced `/models` picker with BenchLM ranks.
3
+ Pi extension — enhanced `/models` picker with coding score/rank.
4
4
 
5
5
  ## What it does
6
6
 
7
- Registers a `/models` slash command that replaces Pi's built-in `/model` selector with a richer TUI picker. Each row shows model name, provider, context window, cost per million tokens, and BenchLM rank/score when available. The list is sorted by BenchLM rank (best first), then alphabetically for unranked models. Fuzzy search filters the list as you type. Selecting a model switches the active model for the session. Model metadata is sourced from `~/.cache/pi/` via `pix-data`; BenchLM data is fetched and cached at startup. Requires `@xynogen/pix-data` as a dependency.
7
+ Registers a `/models` slash command that replaces Pi's built-in `/model` selector with a richer TUI picker. Each row shows model name, provider, context window, cost per million tokens, and a coding-focused score/rank when available. The list is sorted by coding score (best first), then alphabetically for unscored models. Fuzzy search filters the list as you type. Selecting a model switches the active model for the session. Model metadata is sourced from `~/.cache/pi/` via `pix-data`; the coding score/rank is computed locally from the modelgrep catalog (best = #1). Requires `@xynogen/pix-data` as a dependency.
8
8
 
9
9
  ## Install
10
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xynogen/pix-models",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Pi extension — enhanced /models picker with BenchLM ranks",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/src/models.ts CHANGED
@@ -23,7 +23,11 @@ import {
23
23
  Text,
24
24
  visibleWidth,
25
25
  } from "@earendil-works/pi-tui";
26
- import { lookupBenchmark, lookupModelsDev } from "@xynogen/pix-data";
26
+ import {
27
+ benchScoreColor,
28
+ lookupBenchmark,
29
+ lookupModelsDev,
30
+ } from "@xynogen/pix-data";
27
31
  import { patchOutBuiltinModelCommand } from "./patch-builtin";
28
32
 
29
33
  // ─── Pure logic (exported for tests) ─────────────────────────────────────────
@@ -175,7 +179,10 @@ async function showEnhancedPicker(
175
179
  let rankPrefix: string;
176
180
  if (localRank) {
177
181
  const rankStr = String(localRank).padEnd(maxRankWidth);
178
- rankPrefix = mute("#") + theme.fg("warning", rankStr);
182
+ // Color rank by the model's bench score (same scale as ⚡score),
183
+ // not by list position — keeps the two colors consistent.
184
+ const rankColor = benchScoreColor(bench?.overallScore);
185
+ rankPrefix = mute("#") + theme.fg(rankColor, rankStr);
179
186
  } else {
180
187
  rankPrefix = " ".repeat(maxRankWidth + 1);
181
188
  }
@@ -200,6 +207,7 @@ async function showEnhancedPicker(
200
207
  if (bench) {
201
208
  const score = bench.overallScore ?? "?";
202
209
  const s = bench.overallScore;
210
+ const scoreColor = benchScoreColor(s);
203
211
  let filled = 1;
204
212
  if (typeof s === "number") {
205
213
  if (s >= 90) filled = 5;
@@ -208,9 +216,9 @@ async function showEnhancedPicker(
208
216
  else if (s >= 50) filled = 2;
209
217
  }
210
218
  const starBar =
211
- theme.fg("warning", "★".repeat(filled)) +
219
+ theme.fg(scoreColor, "★".repeat(filled)) +
212
220
  mute("☆".repeat(5 - filled));
213
- benchSeg = `⚡${theme.fg("warning", String(score))} ${starBar}`;
221
+ benchSeg = `⚡${theme.fg(scoreColor, String(score))} ${starBar}`;
214
222
  }
215
223
  const desc = [ctxStr, costSeg, benchSeg].filter(Boolean).join(sep);
216
224