@suluk/models 0.1.1 → 0.1.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": "@suluk/models",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "A weekly, PUBLIC-DATA-ONLY catalog of OpenRouter models + a selector: a suluk skill declares NEEDS (hard filters) + a small PREFERENCE (a named profile), and selectModel picks the best CURRENT model — never a hard-coded id. Decidable OpenRouter facts as numbers; noisy benchmarks as COARSE TIERS with {source, asOf}; no cross-axis composite (blending is the selector's job). CANDIDATE tooling — NOT official OAS.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -3,10 +3,13 @@
3
3
  * content-addressed artifact `src/openrouter-catalog.json`. Run: `bun scripts/refresh.ts [asOf]`. NETWORK.
4
4
  * The benchmark TIER overlay (Class B) is a separate, lower-cadence, human-reviewed step (see REFRESH.md).
5
5
  */
6
- import { fetchOpenRouterCatalog } from "../src/index";
6
+ import { fetchOpenRouterCatalog, applyTierOverlay, KNOWN_TIERS } from "../src/index";
7
7
 
8
8
  const asOf = process.argv[2] ?? new Date().toISOString().slice(0, 10);
9
- const cat = await fetchOpenRouterCatalog(asOf);
9
+ let cat = await fetchOpenRouterCatalog(asOf);
10
+ // Class-B bootstrap: overlay the small cited frontier-standings seed onto intel.* (the full curation is the TODO).
11
+ cat = applyTierOverlay(cat, KNOWN_TIERS, { source: "public-leaderboard-consensus", asOf });
12
+ const overlaid = cat.rows.filter((r) => r.intel.reasoning.value !== null).length;
10
13
  const out = new URL("../src/openrouter-catalog.json", import.meta.url);
11
14
  await Bun.write(out, JSON.stringify(cat) + "\n"); // compact — it ships in the npm package (transitively via @suluk/agents)
12
- console.log(`@suluk/models: wrote ${cat.rows.length} models · asOf ${asOf} · ${cat.snapshotHash}`);
15
+ console.log(`@suluk/models: wrote ${cat.rows.length} models (${overlaid} with intel tiers) · asOf ${asOf} · ${cat.snapshotHash}`);
package/src/index.ts CHANGED
@@ -21,3 +21,4 @@ export { selectModel, deriveRequirements } from "./select";
21
21
  export { BUCKETING_RULES, applyBucketing, type AxisRule } from "./bucketing";
22
22
  export { normalizeOpenRouter, normalizeOpenRouterModel, catalogFrom, snapshotHash, type ORModel } from "./normalize";
23
23
  export { fetchOpenRouterCatalog } from "./fetch";
24
+ export { applyTierOverlay, KNOWN_TIERS, type IntelAxis } from "./overlay";
package/src/normalize.ts CHANGED
@@ -68,9 +68,10 @@ export function normalizeOpenRouter(models: ORModel[], asOf: string): ModelRecor
68
68
  return models.map((m) => normalizeOpenRouterModel(m, asOf)).sort((a, b) => a.id.localeCompare(b.id));
69
69
  }
70
70
 
71
- /** A content-addressed hash over the rows' load-bearing FACT cells (reproducible pin; ties C027 contentHash). */
71
+ /** A content-addressed hash over the rows' load-bearing SELECTION inputs facts AND intel tiers (a re-pick under a
72
+ * different catalog must differ; reproducible pin; ties C027 contentHash). */
72
73
  export function snapshotHash(rows: ModelRecord[]): string {
73
- const facts = rows.map((r) => [r.id, r.cost.inputPerMtok.value, r.cost.outputPerMtok.value, r.context.maxWindow.value, r.caps.toolCalling.value]);
74
+ const facts = rows.map((r) => [r.id, r.cost.inputPerMtok.value, r.cost.outputPerMtok.value, r.context.maxWindow.value, r.caps.toolCalling.value, ...Object.values(r.intel).map((c) => c.value)]);
74
75
  return "sha256-" + createHash("sha256").update(JSON.stringify(facts), "utf8").digest("hex").slice(0, 16);
75
76
  }
76
77