@xynogen/pix-models 0.1.5 → 0.1.6

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.6",
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,9 @@ 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
+ const rankColor =
183
+ localRank <= 3 ? "success" : localRank <= 7 ? "warning" : "error";
184
+ rankPrefix = mute("#") + theme.fg(rankColor, rankStr);
179
185
  } else {
180
186
  rankPrefix = " ".repeat(maxRankWidth + 1);
181
187
  }
@@ -200,6 +206,7 @@ async function showEnhancedPicker(
200
206
  if (bench) {
201
207
  const score = bench.overallScore ?? "?";
202
208
  const s = bench.overallScore;
209
+ const scoreColor = benchScoreColor(s);
203
210
  let filled = 1;
204
211
  if (typeof s === "number") {
205
212
  if (s >= 90) filled = 5;
@@ -208,9 +215,9 @@ async function showEnhancedPicker(
208
215
  else if (s >= 50) filled = 2;
209
216
  }
210
217
  const starBar =
211
- theme.fg("warning", "★".repeat(filled)) +
218
+ theme.fg(scoreColor, "★".repeat(filled)) +
212
219
  mute("☆".repeat(5 - filled));
213
- benchSeg = `⚡${theme.fg("warning", String(score))} ${starBar}`;
220
+ benchSeg = `⚡${theme.fg(scoreColor, String(score))} ${starBar}`;
214
221
  }
215
222
  const desc = [ctxStr, costSeg, benchSeg].filter(Boolean).join(sep);
216
223