@oh-my-pi/pi-catalog 16.2.11 → 16.2.13

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.
@@ -1,46 +0,0 @@
1
- import type { Api, Model } from "../types";
2
- export type CanonicalModelSource = "override" | "bundled" | "heuristic" | "fallback";
3
- export interface ModelEquivalenceConfig {
4
- overrides?: Record<string, string>;
5
- exclude?: string[];
6
- }
7
- export interface CanonicalModelVariant {
8
- canonicalId: string;
9
- selector: string;
10
- model: Model<Api>;
11
- source: CanonicalModelSource;
12
- }
13
- export interface CanonicalModelRecord {
14
- id: string;
15
- name: string;
16
- variants: CanonicalModelVariant[];
17
- }
18
- export interface CanonicalModelIndex {
19
- records: CanonicalModelRecord[];
20
- byId: Map<string, CanonicalModelRecord>;
21
- bySelector: Map<string, string>;
22
- }
23
- export interface CanonicalReferenceData {
24
- references: ReadonlyMap<string, Model<Api>>;
25
- officialIds: ReadonlySet<string>;
26
- suffixAliases: ReadonlyMap<string, string>;
27
- [kResolutionCaches]?: WeakMap<CompiledEquivalenceConfig, Map<string, ResolvedCanonicalModel>>;
28
- }
29
- interface CompiledEquivalenceConfig {
30
- overrides: Map<string, string>;
31
- exclude: Set<string>;
32
- }
33
- interface ResolvedCanonicalModel {
34
- id: string;
35
- source: CanonicalModelSource;
36
- }
37
- declare const kResolutionCaches: unique symbol;
38
- /**
39
- * Build canonical reference data from a model catalog (typically the bundled
40
- * models). Pure: callers are responsible for memoizing the result — the
41
- * canonical index keeps per-reference resolution caches internally.
42
- */
43
- export declare function buildCanonicalReferenceData(models: Iterable<Model<Api>>): CanonicalReferenceData;
44
- export declare function formatCanonicalVariantSelector(model: Model<Api>): string;
45
- export declare function buildCanonicalModelIndex(models: readonly Model<Api>[], reference: CanonicalReferenceData, equivalence?: ModelEquivalenceConfig): CanonicalModelIndex;
46
- export {};
@@ -1,20 +0,0 @@
1
- /**
2
- * Canonical-variant selection: pick the preferred variant of a canonical
3
- * model record given caller-supplied provider and candidate orderings.
4
- */
5
- import type { Api, Model } from "../types";
6
- import { type CanonicalModelVariant } from "./equivalence";
7
- export interface CanonicalVariantPreferences {
8
- /** Lowercased provider id → rank (lower wins). */
9
- providerRank: ReadonlyMap<string, number>;
10
- /** Variant selector (`provider/id`) → candidate-list position (lower wins). */
11
- modelOrder: ReadonlyMap<string, number>;
12
- }
13
- /** Selector → index map over an ordered candidate list, for `modelOrder` tiebreaks. */
14
- export declare function buildCanonicalModelOrder(candidates: readonly Model<Api>[]): Map<string, number>;
15
- /**
16
- * Pick the preferred variant. Sort order: configured provider rank →
17
- * exact-id match → variant source (override/bundled > heuristic > fallback)
18
- * → shorter id → candidate-list order.
19
- */
20
- export declare function resolveCanonicalVariant(variants: readonly CanonicalModelVariant[], preferences: CanonicalVariantPreferences): CanonicalModelVariant | undefined;