@xynogen/pix-data 0.2.0 → 0.2.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xynogen/pix-data",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Pi extension — shared model data layer (models.dev + BenchLM), cached at ~/.cache/pi",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/src/data.ts CHANGED
@@ -277,7 +277,7 @@ export const CACHE_DIR = join(
277
277
 
278
278
  export const modelgrep = new DataSource<ModelGrepModel[]>({
279
279
  label: "modelgrep",
280
- url: `https://modelgrep.com/api/v1/models?benchmarked=1&sort=coding&order=desc&limit=${MODELGREP_PAGE}`,
280
+ url: `https://modelgrep.com/api/v1/models?sort=coding&order=desc&limit=${MODELGREP_PAGE}`,
281
281
  cachePath: join(CACHE_DIR, "modelgrep.json"),
282
282
  fetchRaw: fetchModelGrepAll,
283
283
  parse: (raw) => (raw as ModelGrepResponse).data ?? [],
@@ -466,6 +466,16 @@ function buildBenchIndex(): Map<string, BenchmarkEntry> {
466
466
  return index;
467
467
  }
468
468
 
469
+ /** Map a benchmark score (0–100) to a semantic color token. */
470
+ export function benchScoreColor(
471
+ score: number | null | undefined,
472
+ ): "success" | "warning" | "error" | "muted" {
473
+ if (score == null) return "muted";
474
+ if (score >= 80) return "success";
475
+ if (score >= 60) return "warning";
476
+ return "error";
477
+ }
478
+
469
479
  export function lookupBenchmark(modelName: string): BenchmarkEntry | undefined {
470
480
  return findInIndex(modelName, buildBenchIndex());
471
481
  }
package/src/index.ts CHANGED
@@ -20,6 +20,7 @@ export type {
20
20
  // Consumers (pix-core, pix-9router, …) import these instead of duplicating
21
21
  // the DataSource implementation and models.dev/BenchLM lookups.
22
22
  export {
23
+ benchScoreColor,
23
24
  buildModelsDevIndex,
24
25
  CACHE_DIR,
25
26
  DataSource,