@xynogen/pix-data 0.2.0 → 0.2.1

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.1",
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
@@ -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,