@agentproto/model-catalog 0.5.0 → 0.7.0

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.
Files changed (38) hide show
  1. package/dist/access/index.d.ts +5 -5
  2. package/dist/audio/index.d.ts +1 -1
  3. package/dist/{audio-BbeLA_4x.d.ts → audio-DR0g_ZH_.d.ts} +1 -0
  4. package/dist/{base-C4kz9Dxc.d.ts → base-B8IIoaqg.d.ts} +2 -0
  5. package/dist/{catalog-BPDMuxzf.d.ts → catalog-BbfjJxKT.d.ts} +31 -2
  6. package/dist/{chunk-VIVKDMAT.mjs → chunk-6AXCZGQY.mjs} +3 -3
  7. package/dist/{chunk-VIVKDMAT.mjs.map → chunk-6AXCZGQY.mjs.map} +1 -1
  8. package/dist/{chunk-FCPS2VGK.mjs → chunk-6VDWPE62.mjs} +735 -525
  9. package/dist/chunk-6VDWPE62.mjs.map +1 -0
  10. package/dist/chunk-DW45X6XT.mjs +70 -0
  11. package/dist/chunk-DW45X6XT.mjs.map +1 -0
  12. package/dist/{chunk-TQSSXYY5.mjs → chunk-HL2G36MT.mjs} +4 -62
  13. package/dist/chunk-HL2G36MT.mjs.map +1 -0
  14. package/dist/{chunk-S74S3Q7Z.mjs → chunk-OWNEHUFQ.mjs} +3 -3
  15. package/dist/{chunk-S74S3Q7Z.mjs.map → chunk-OWNEHUFQ.mjs.map} +1 -1
  16. package/dist/{chunk-GCDMRPDR.mjs → chunk-QLFNCLH2.mjs} +4 -4
  17. package/dist/{chunk-GCDMRPDR.mjs.map → chunk-QLFNCLH2.mjs.map} +1 -1
  18. package/dist/cost/index.mjs +3 -3
  19. package/dist/curation/index.d.ts +4 -4
  20. package/dist/curation/index.mjs +3 -3
  21. package/dist/{evaluate-CVzfLCd0.d.ts → evaluate-BKCR5Huz.d.ts} +2 -2
  22. package/dist/{index-CgOxudo5.d.ts → index-DpeiyVjg.d.ts} +3 -3
  23. package/dist/{index-DSgqNd3Z.d.ts → index-avZZsCtQ.d.ts} +1 -1
  24. package/dist/index.d.ts +7 -7
  25. package/dist/index.mjs +7 -6
  26. package/dist/index.mjs.map +1 -1
  27. package/dist/llm/index.d.ts +2 -2
  28. package/dist/llm/index.mjs +1 -1
  29. package/dist/overlay/index.d.ts +3 -3
  30. package/dist/picker/index.d.ts +6 -6
  31. package/dist/route-identity/index.d.ts +153 -14
  32. package/dist/route-identity/index.mjs +3078 -28
  33. package/dist/route-identity/index.mjs.map +1 -1
  34. package/dist/schema/index.d.ts +9 -2
  35. package/dist/schema/index.mjs +2 -1
  36. package/package.json +1 -1
  37. package/dist/chunk-FCPS2VGK.mjs.map +0 -1
  38. package/dist/chunk-TQSSXYY5.mjs.map +0 -1
@@ -1,12 +1,12 @@
1
- export { A as AccessDecision, a as AccessEffect, b as AccessEvalInput, c as AccessRule, d as AccessTarget, e as AppScope, f as evaluateAccess } from '../evaluate-CVzfLCd0.js';
2
- import { R as ResolvedModel } from '../index-DSgqNd3Z.js';
3
- import '../base-C4kz9Dxc.js';
1
+ export { A as AccessDecision, a as AccessEffect, b as AccessEvalInput, c as AccessRule, d as AccessTarget, e as AppScope, f as evaluateAccess } from '../evaluate-BKCR5Huz.js';
2
+ import { R as ResolvedModel } from '../index-avZZsCtQ.js';
3
+ import '../base-B8IIoaqg.js';
4
4
  import 'zod';
5
- import '../catalog-BPDMuxzf.js';
5
+ import '../catalog-BbfjJxKT.js';
6
6
  import '../image/index.js';
7
7
  import '../video/index.js';
8
8
  import '../audio/index.js';
9
- import '../audio-BbeLA_4x.js';
9
+ import '../audio-DR0g_ZH_.js';
10
10
  import '../schema/voice.js';
11
11
 
12
12
  /**
@@ -1,4 +1,4 @@
1
- import { A as AudioCapabilities } from '../audio-BbeLA_4x.js';
1
+ import { A as AudioCapabilities } from '../audio-DR0g_ZH_.js';
2
2
  import 'zod';
3
3
 
4
4
  /**
@@ -57,6 +57,7 @@ declare const AudioEntrySchema: z.ZodObject<{
57
57
  elevenlabs: "elevenlabs";
58
58
  "gemini-live": "gemini-live";
59
59
  google: "google";
60
+ huggingface: "huggingface";
60
61
  minimax: "minimax";
61
62
  mistral: "mistral";
62
63
  moonshot: "moonshot";
@@ -55,6 +55,7 @@ declare const CatalogProviderSchema: z.ZodEnum<{
55
55
  elevenlabs: "elevenlabs";
56
56
  "gemini-live": "gemini-live";
57
57
  google: "google";
58
+ huggingface: "huggingface";
58
59
  minimax: "minimax";
59
60
  mistral: "mistral";
60
61
  moonshot: "moonshot";
@@ -137,6 +138,7 @@ declare const baseEntryShape: {
137
138
  elevenlabs: "elevenlabs";
138
139
  "gemini-live": "gemini-live";
139
140
  google: "google";
141
+ huggingface: "huggingface";
140
142
  minimax: "minimax";
141
143
  mistral: "mistral";
142
144
  moonshot: "moonshot";
@@ -1,4 +1,4 @@
1
- import { b as CatalogProvider } from './base-C4kz9Dxc.js';
1
+ import { b as CatalogProvider } from './base-B8IIoaqg.js';
2
2
 
3
3
  interface ContextWindowEntry {
4
4
  contextWindow: number;
@@ -503,6 +503,20 @@ declare const LLM_PRICING_CATALOG: {
503
503
  vendor: string;
504
504
  provider: "minimax";
505
505
  };
506
+ "kimi-k3": {
507
+ inputPer1M: number;
508
+ outputPer1M: number;
509
+ cacheReadMultiplier: number;
510
+ vendor: string;
511
+ provider: "moonshot";
512
+ };
513
+ "kimi-k2.7-code": {
514
+ inputPer1M: number;
515
+ outputPer1M: number;
516
+ cacheReadMultiplier: number;
517
+ vendor: string;
518
+ provider: "moonshot";
519
+ };
506
520
  "kimi-k2.6": {
507
521
  inputPer1M: number;
508
522
  outputPer1M: number;
@@ -654,6 +668,8 @@ declare const MODEL_ALIASES: {
654
668
  "kimi-k2": string;
655
669
  "moonshotai/kimi-k2.5": string;
656
670
  "moonshotai/kimi-k2.6": string;
671
+ "moonshotai/kimi-k2.7-code": string;
672
+ "moonshotai/kimi-k3": string;
657
673
  "mistralai/mistral-large-latest": string;
658
674
  "mistralai/mistral-small-latest": string;
659
675
  "grok-latest": string;
@@ -668,6 +684,19 @@ type KnownLlmId = LlmModelId | LlmModelAlias;
668
684
  * accounting; semantics are load-bearing for migration.
669
685
  */
670
686
  declare function resolvePricing(modelId: string): LLMPricing | undefined;
687
+ /**
688
+ * Like {@link resolvePricing} but WITHOUT the substring/partial-prefix
689
+ * fallback — an id resolves ONLY on an exact catalog key or an exact alias.
690
+ * The substring scan in `resolvePricing` (intended for dated snapshots like
691
+ * `claude-sonnet-4-6-20260301` → `claude-sonnet-4`) also over-fires for
692
+ * unrelated cross-product siblings (`gemini-2.5-flash-image` substring-hits
693
+ * the `gemini-2.5-flash` row), so any caller that must PROVE a verbatim
694
+ * first-party identity — e.g. the direct-vendor route restore in
695
+ * `serviceableModelRoutes` — needs this exact form instead. Semantics of
696
+ * `resolvePricing`/`resolveAlias` are intentionally left unchanged for their
697
+ * existing callers.
698
+ */
699
+ declare function resolvePricingExact(modelId: string): LLMPricing | undefined;
671
700
  /**
672
701
  * Resolves a model id to its canonical catalog key (or the original id if no
673
702
  * match). Public surface for consumers that need the canonical id without
@@ -834,4 +863,4 @@ interface CacheStats {
834
863
  */
835
864
  declare function getCacheStats(modelId: string, usage: LLMUsageBreakdown, opts?: CalculateLLMCreditCostOptions): CacheStats;
836
865
 
837
- export { type CacheStats as C, DEFAULT_PRICING as D, type KnownLlmId as K, type LLMCreditCostResult as L, MODEL_ALIASES as M, type CalculateLLMCreditCostOptions as a, type ContextWindowEntry as b, type LLMPricing as c, type LLMUsageBreakdown as d, LLM_PRICING_CATALOG as e, type LlmModelAlias as f, type LlmModelId as g, type ModelRoute as h, calculateLLMCreditCost as i, getCacheStats as j, getModelProvider as k, resolveContextWindow as l, resolveModelRoute as m, resolvePricing as n, resolveAlias as r };
866
+ export { type CacheStats as C, DEFAULT_PRICING as D, type KnownLlmId as K, type LLMCreditCostResult as L, MODEL_ALIASES as M, type CalculateLLMCreditCostOptions as a, type ContextWindowEntry as b, type LLMPricing as c, type LLMUsageBreakdown as d, LLM_PRICING_CATALOG as e, type LlmModelAlias as f, type LlmModelId as g, type ModelRoute as h, calculateLLMCreditCost as i, getCacheStats as j, getModelProvider as k, resolveContextWindow as l, resolveModelRoute as m, resolvePricing as n, resolvePricingExact as o, resolveAlias as r };
@@ -1,4 +1,4 @@
1
- import { listModels } from './chunk-S74S3Q7Z.mjs';
1
+ import { listModels } from './chunk-OWNEHUFQ.mjs';
2
2
  import { modelHasTag } from './chunk-WTHHXXIK.mjs';
3
3
 
4
4
  /**
@@ -130,5 +130,5 @@ function filterVoicesByProviders(voices, providerTokens) {
130
130
  }
131
131
 
132
132
  export { applyProfile, expandProviders, filterVoicesByProviders, getProviderGroup, getSurfaceProfile, groupForProvider, listProviderGroups, listSurfaceProfiles, listSurfaced, modelMatchesProfile };
133
- //# sourceMappingURL=chunk-VIVKDMAT.mjs.map
134
- //# sourceMappingURL=chunk-VIVKDMAT.mjs.map
133
+ //# sourceMappingURL=chunk-6AXCZGQY.mjs.map
134
+ //# sourceMappingURL=chunk-6AXCZGQY.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/curation/index.ts"],"names":[],"mappings":";;;;;;;;;;AAgDA,IAAM,eAAA,GAA4C;AAAA,EAChD,EAAE,IAAI,QAAA,EAAU,KAAA,EAAO,UAAU,SAAA,EAAW,CAAC,QAAA,EAAU,iBAAiB,CAAA,EAAE;AAAA,EAC1E,EAAE,IAAI,QAAA,EAAU,KAAA,EAAO,UAAU,SAAA,EAAW,CAAC,QAAA,EAAU,aAAa,CAAA,EAAE;AAAA,EACtE,EAAE,IAAI,WAAA,EAAa,KAAA,EAAO,aAAa,SAAA,EAAW,CAAC,WAAW,CAAA,EAAE;AAAA,EAChE,EAAE,IAAI,SAAA,EAAW,KAAA,EAAO,WAAW,SAAA,EAAW,CAAC,SAAS,CAAA,EAAE;AAAA,EAC1D,EAAE,IAAI,YAAA,EAAc,KAAA,EAAO,cAAc,SAAA,EAAW,CAAC,YAAY,CAAA,EAAE;AAAA,EACnE,EAAE,IAAI,WAAA,EAAa,KAAA,EA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AA,EAClE;AACA,EAAA,OAAO,IAAA;AACT;AAGO,SAAS,YAAA,CACd,QACA,OAAA,EACiB;AACjB,EAAA,OAAO,OAAO,MAAA,CAAO,CAAA,KAAA,KAAS,mBAAA,CAAoB,KAAA,EAAO,OAAO,CAAC,CAAA;AACnE;AAMO,SAAS,aAAa,OAAA,EAA0C;AACrE,EAAA,OAAO,YAAA,CAAa,UAAA,EAAW,EAAG,OAAO,CAAA;AAC3C;AASO,SAAS,uBAAA,CACd,QACA,cAAA,EACgB;AAChB,EAAA,IAAI,cAAA,CAAe,MAAA,KAAW,CAAA,EAAG,OAAO,MAAA;AACxC,EAAA,MAAM,IAAA,GAAO,IAAI,GAAA,CAAI,eAAA,CAAgB,cAAc,CAAC,CAAA;AACpD,EAAA,OAAO,OAAO,MAAA,CAAO,CAAA,CAAA,KAAK,KAAK,GAAA,CAAI,CAAA,CAAE,QAAQ,CAAC,CAAA;AAChD","file":"chunk-VIVKDMAT.mjs","sourcesContent":["/**\n * Curation — what an app SURFACES from the catalog, distinct from\n * model-access (who MAY use a model: tier/scope policy). Curation is the\n * \"feature/provider catalog\" layer: an app composes views over the one\n * registry (\"all s2s voices from OpenAI OR Google\", \"images only\", …)\n * without touching the underlying data.\n *\n * Two registries, both following the canonical profile-registry shape\n * (`listX()` / `getX(id)` throwing with the known-id list):\n *\n * 1. PROVIDER GROUPS — a company (`openai`) maps to every provider tag\n * it owns across kinds (`openai` for the LLM/audio company tag,\n * `openai-realtime` for its voice engine). This is what reconciles\n * the two provider vocabularies in the registry: audio MODELS are\n * tagged by company, voices by engine. Curating by group spans both.\n *\n * 2. SURFACE PROFILES — named presets (`voice-s2s`, `images`, …) an app\n * selects from. Permissive by default (`all`); apps narrow only when\n * a picker should diverge.\n *\n * Selection precedence (caller's job): per-call arg → per-app/guild\n * config → env → `all` fallback.\n */\n\nimport {\n listModels,\n type CatalogKind,\n type ResolvedModel,\n} from \"../registry/index.js\"\nimport { modelHasTag } from \"../enrichment/index.js\"\nimport type { CatalogVoice } from \"../schema/voice.js\"\n\n// ───────────────────────────────────────────────────────────────────────\n// Provider groups — company → provider tags across kinds\n// ───────────────────────────────────────────────────────────────────────\n\nexport interface ProviderGroup {\n /** Canonical company id, e.g. \"openai\", \"google\". */\n id: string\n /** Display label. */\n label: string\n /**\n * Every provider tag this company owns across kinds. Audio/image/LLM use\n * the company tag (`openai`); the voice engine uses its own (`openai-realtime`).\n */\n providers: readonly string[]\n}\n\nconst PROVIDER_GROUPS: readonly ProviderGroup[] = [\n { id: \"openai\", label: \"OpenAI\", providers: [\"openai\", \"openai-realtime\"] },\n { id: \"google\", label: \"Google\", providers: [\"google\", \"gemini-live\"] },\n { id: \"anthropic\", label: \"Anthropic\", providers: [\"anthropic\"] },\n { id: \"minimax\", label: \"MiniMax\", providers: [\"minimax\"] },\n { id: \"elevenlabs\", label: \"ElevenLabs\", providers: [\"elevenlabs\"] },\n { id: \"replicate\", label: \"Replicate\", providers: [\"replicate\"] },\n { id: \"deepgram\", label: \"Deepgram\", providers: [\"deepgram\"] },\n { id: \"assemblyai\", label: \"AssemblyAI\", providers: [\"assemblyai\"] },\n]\n\nexport function listProviderGroups(): readonly ProviderGroup[] {\n return PROVIDER_GROUPS\n}\n\nexport function getProviderGroup(id: string): ProviderGroup {\n const group = PROVIDER_GROUPS.find(g => g.id === id)\n if (!group) {\n const known = PROVIDER_GROUPS.map(g => g.id).join(\", \")\n throw new Error(`curation: unknown provider group \"${id}\". Known: ${known}`)\n }\n return group\n}\n\n/** The group that owns a raw provider tag, if any. */\nexport function groupForProvider(\n providerTag: string\n): ProviderGroup | undefined {\n return PROVIDER_GROUPS.find(g => g.providers.includes(providerTag))\n}\n\n/**\n * Expand a mixed list of provider-group ids and raw provider tags into the\n * flat set of provider tags to match against. A token that is a known\n * group id expands to its members; anything else passes through as a raw\n * tag (so callers can target an engine directly, e.g. `gemini-live`).\n */\nexport function expandProviders(tokens: readonly string[]): string[] {\n const out = new Set<string>()\n for (const token of tokens) {\n const group = PROVIDER_GROUPS.find(g => g.id === token)\n if (group) {\n for (const p of group.providers) out.add(p)\n } else {\n out.add(token)\n }\n }\n return [...out]\n}\n\n// ───────────────────────────────────────────────────────────────────────\n// Surface profiles — named views an app surfaces\n// ───────────────────────────────────────────────────────────────────────\n\nexport interface SurfaceProfile {\n id: string\n description: string\n /** Restrict to these kinds. Undefined/empty = every kind. */\n kinds?: readonly CatalogKind[]\n /**\n * Restrict to these provider GROUP ids or raw provider tags (OR-set).\n * Expanded via `expandProviders`, so `[\"openai\"]` covers both the\n * `openai` company tag and the `openai-realtime` voice engine.\n */\n providers?: readonly string[]\n /** Require all of these capability tags (AND-set): `s2s`, `tts`, `edit`, … */\n capabilities?: readonly string[]\n /** Require all of these arbitrary tags (AND-set). */\n tags?: readonly string[]\n}\n\nconst SURFACE_PROFILES: readonly SurfaceProfile[] = [\n {\n id: \"all\",\n description: \"Everything the catalog offers — the permissive default\",\n },\n {\n id: \"text\",\n description: \"Text models (LLMs) only\",\n kinds: [\"llm\"],\n },\n {\n id: \"images\",\n description: \"Image models only\",\n kinds: [\"image\"],\n },\n {\n id: \"video\",\n description: \"Video models only\",\n kinds: [\"video\"],\n },\n {\n id: \"audio\",\n description: \"Audio models (TTS / STT / s2s) only\",\n kinds: [\"audio\"],\n },\n {\n id: \"voice\",\n description: \"Every curated voice, any provider\",\n kinds: [\"voice\"],\n },\n {\n id: \"voice-s2s\",\n description:\n \"Speech-to-speech voice engines (OpenAI Realtime, Gemini Live)\",\n kinds: [\"voice\"],\n capabilities: [\"s2s\"],\n },\n {\n id: \"voice-tts\",\n description: \"Sequential TTS voices (MiniMax, ElevenLabs)\",\n kinds: [\"voice\"],\n capabilities: [\"tts\"],\n },\n]\n\nexport function listSurfaceProfiles(): readonly SurfaceProfile[] {\n return SURFACE_PROFILES\n}\n\nexport function getSurfaceProfile(id: string): SurfaceProfile {\n const profile = SURFACE_PROFILES.find(p => p.id === id)\n if (!profile) {\n const known = SURFACE_PROFILES.map(p => p.id).join(\", \")\n throw new Error(\n `curation: unknown surface profile \"${id}\". Known: ${known}`\n )\n }\n return profile\n}\n\n// ───────────────────────────────────────────────────────────────────────\n// Filters\n// ───────────────────────────────────────────────────────────────────────\n\n/**\n * True iff a model passes a surface profile. Provider membership, like\n * capability/tag membership, is checked against the enrichment tag\n * vocabulary (every kind emits its provider as a tag), so this is uniform\n * across kinds and naturally spans the company/engine provider split.\n */\nexport function modelMatchesProfile(\n model: ResolvedModel,\n profile: SurfaceProfile\n): boolean {\n if (profile.kinds && profile.kinds.length > 0) {\n if (!profile.kinds.includes(model.kind)) return false\n }\n if (profile.providers && profile.providers.length > 0) {\n const tags = expandProviders(profile.providers)\n if (!tags.some(tag => modelHasTag(model, tag))) return false\n }\n if (profile.capabilities) {\n if (!profile.capabilities.every(cap => modelHasTag(model, cap)))\n return false\n }\n if (profile.tags) {\n if (!profile.tags.every(tag => modelHasTag(model, tag))) return false\n }\n return true\n}\n\n/** Filter a model list down to what a surface profile exposes. */\nexport function applyProfile(\n models: ResolvedModel[],\n profile: SurfaceProfile\n): ResolvedModel[] {\n return models.filter(model => modelMatchesProfile(model, profile))\n}\n\n/**\n * The catalog as a surface profile exposes it — `applyProfile` over the\n * full registry. The composable entry point for \"show me this view\".\n */\nexport function listSurfaced(profile: SurfaceProfile): ResolvedModel[] {\n return applyProfile(listModels(), profile)\n}\n\n/**\n * Voice-list curation. The merged voice catalog (curated + live\n * ElevenLabs) is `CatalogVoice[]`, not `ResolvedModel[]`, so it gets its\n * own provider filter — same group-expansion semantics. Only the provider\n * facet of a profile applies to a raw voice list (kind is implicitly\n * voice; capability/tag live on the registry projection).\n */\nexport function filterVoicesByProviders(\n voices: CatalogVoice[],\n providerTokens: readonly string[]\n): CatalogVoice[] {\n if (providerTokens.length === 0) return voices\n const tags = new Set(expandProviders(providerTokens))\n return voices.filter(v => tags.has(v.provider))\n}\n"]}
1
+ {"version":3,"sources":["../src/curation/index.ts"],"names":[],"mappings":";;;;;;;;;;AAgDA,IAA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D,IAAA,MAAM,IAAA,GAAO,eAAA,CAAgB,OAAA,CAAQ,SAAS,CAAA;AAC9C,IAAA,IAAI,CAAC,KAAK,IAAA,CAAK,CAAA,GAAA,KAAO,YAAY,KAAA,EAAO,GAAG,CAAC,CAAA,EAAG,OAAO,KAAA;AAAA,EACzD;AACA,EAAA,IAAI,QAAQ,YAAA,EAAc;AACxB,IAAA,IAAI,CAAC,QAAQ,YAAA,CAAa,KAAA,CAAM,SAAO,WAAA,CAAY,KAAA,EAAO,GAAG,CAAC,CAAA;AAC5D,MAAA,OAAO,KAAA;AAAA,EACX;AACA,EAAA,IAAI,QAAQ,IAAA,EAAM;AAChB,IAAA,IAAI,CAAC,OAAA,CAAQ,IAAA,CAAK,KAAA,CAAM,CAAA,GAAA,KAAO,YAAY,KAAA,EAAO,GAAG,CAAC,CAAA,EAAG,OAAO,KAAA;AAAA,EAClE;AACA,EAAA,OAAO,IAAA;AACT;AAGO,SAAS,YAAA,CACd,QACA,OAAA,EACiB;AACjB,EAAA,OAAO,OAAO,MAAA,CAAO,CAAA,KAAA,KAAS,mBAAA,CAAoB,KAAA,EAAO,OAAO,CAAC,CAAA;AACnE;AAMO,SAAS,aAAa,OAAA,EAA0C;AACrE,EAAA,OAAO,YAAA,CAAa,UAAA,EAAW,EAAG,OAAO,CAAA;AAC3C;AASO,SAAS,uBAAA,CACd,QACA,cAAA,EACgB;AAChB,EAAA,IAAI,cAAA,CAAe,MAAA,KAAW,CAAA,EAAG,OAAO,MAAA;AACxC,EAAA,MAAM,IAAA,GAAO,IAAI,GAAA,CAAI,eAAA,CAAgB,cAAc,CAAC,CAAA;AACpD,EAAA,OAAO,OAAO,MAAA,CAAO,CAAA,CAAA,KAAK,KAAK,GAAA,CAAI,CAAA,CAAE,QAAQ,CAAC,CAAA;AAChD","file":"chunk-6AXCZGQY.mjs","sourcesContent":["/**\n * Curation — what an app SURFACES from the catalog, distinct from\n * model-access (who MAY use a model: tier/scope policy). Curation is the\n * \"feature/provider catalog\" layer: an app composes views over the one\n * registry (\"all s2s voices from OpenAI OR Google\", \"images only\", …)\n * without touching the underlying data.\n *\n * Two registries, both following the canonical profile-registry shape\n * (`listX()` / `getX(id)` throwing with the known-id list):\n *\n * 1. PROVIDER GROUPS — a company (`openai`) maps to every provider tag\n * it owns across kinds (`openai` for the LLM/audio company tag,\n * `openai-realtime` for its voice engine). This is what reconciles\n * the two provider vocabularies in the registry: audio MODELS are\n * tagged by company, voices by engine. Curating by group spans both.\n *\n * 2. SURFACE PROFILES — named presets (`voice-s2s`, `images`, …) an app\n * selects from. Permissive by default (`all`); apps narrow only when\n * a picker should diverge.\n *\n * Selection precedence (caller's job): per-call arg → per-app/guild\n * config → env → `all` fallback.\n */\n\nimport {\n listModels,\n type CatalogKind,\n type ResolvedModel,\n} from \"../registry/index.js\"\nimport { modelHasTag } from \"../enrichment/index.js\"\nimport type { CatalogVoice } from \"../schema/voice.js\"\n\n// ───────────────────────────────────────────────────────────────────────\n// Provider groups — company → provider tags across kinds\n// ───────────────────────────────────────────────────────────────────────\n\nexport interface ProviderGroup {\n /** Canonical company id, e.g. \"openai\", \"google\". */\n id: string\n /** Display label. */\n label: string\n /**\n * Every provider tag this company owns across kinds. Audio/image/LLM use\n * the company tag (`openai`); the voice engine uses its own (`openai-realtime`).\n */\n providers: readonly string[]\n}\n\nconst PROVIDER_GROUPS: readonly ProviderGroup[] = [\n { id: \"openai\", label: \"OpenAI\", providers: [\"openai\", \"openai-realtime\"] },\n { id: \"google\", label: \"Google\", providers: [\"google\", \"gemini-live\"] },\n { id: \"anthropic\", label: \"Anthropic\", providers: [\"anthropic\"] },\n { id: \"minimax\", label: \"MiniMax\", providers: [\"minimax\"] },\n { id: \"elevenlabs\", label: \"ElevenLabs\", providers: [\"elevenlabs\"] },\n { id: \"replicate\", label: \"Replicate\", providers: [\"replicate\"] },\n { id: \"deepgram\", label: \"Deepgram\", providers: [\"deepgram\"] },\n { id: \"assemblyai\", label: \"AssemblyAI\", providers: [\"assemblyai\"] },\n]\n\nexport function listProviderGroups(): readonly ProviderGroup[] {\n return PROVIDER_GROUPS\n}\n\nexport function getProviderGroup(id: string): ProviderGroup {\n const group = PROVIDER_GROUPS.find(g => g.id === id)\n if (!group) {\n const known = PROVIDER_GROUPS.map(g => g.id).join(\", \")\n throw new Error(`curation: unknown provider group \"${id}\". Known: ${known}`)\n }\n return group\n}\n\n/** The group that owns a raw provider tag, if any. */\nexport function groupForProvider(\n providerTag: string\n): ProviderGroup | undefined {\n return PROVIDER_GROUPS.find(g => g.providers.includes(providerTag))\n}\n\n/**\n * Expand a mixed list of provider-group ids and raw provider tags into the\n * flat set of provider tags to match against. A token that is a known\n * group id expands to its members; anything else passes through as a raw\n * tag (so callers can target an engine directly, e.g. `gemini-live`).\n */\nexport function expandProviders(tokens: readonly string[]): string[] {\n const out = new Set<string>()\n for (const token of tokens) {\n const group = PROVIDER_GROUPS.find(g => g.id === token)\n if (group) {\n for (const p of group.providers) out.add(p)\n } else {\n out.add(token)\n }\n }\n return [...out]\n}\n\n// ───────────────────────────────────────────────────────────────────────\n// Surface profiles — named views an app surfaces\n// ───────────────────────────────────────────────────────────────────────\n\nexport interface SurfaceProfile {\n id: string\n description: string\n /** Restrict to these kinds. Undefined/empty = every kind. */\n kinds?: readonly CatalogKind[]\n /**\n * Restrict to these provider GROUP ids or raw provider tags (OR-set).\n * Expanded via `expandProviders`, so `[\"openai\"]` covers both the\n * `openai` company tag and the `openai-realtime` voice engine.\n */\n providers?: readonly string[]\n /** Require all of these capability tags (AND-set): `s2s`, `tts`, `edit`, … */\n capabilities?: readonly string[]\n /** Require all of these arbitrary tags (AND-set). */\n tags?: readonly string[]\n}\n\nconst SURFACE_PROFILES: readonly SurfaceProfile[] = [\n {\n id: \"all\",\n description: \"Everything the catalog offers — the permissive default\",\n },\n {\n id: \"text\",\n description: \"Text models (LLMs) only\",\n kinds: [\"llm\"],\n },\n {\n id: \"images\",\n description: \"Image models only\",\n kinds: [\"image\"],\n },\n {\n id: \"video\",\n description: \"Video models only\",\n kinds: [\"video\"],\n },\n {\n id: \"audio\",\n description: \"Audio models (TTS / STT / s2s) only\",\n kinds: [\"audio\"],\n },\n {\n id: \"voice\",\n description: \"Every curated voice, any provider\",\n kinds: [\"voice\"],\n },\n {\n id: \"voice-s2s\",\n description:\n \"Speech-to-speech voice engines (OpenAI Realtime, Gemini Live)\",\n kinds: [\"voice\"],\n capabilities: [\"s2s\"],\n },\n {\n id: \"voice-tts\",\n description: \"Sequential TTS voices (MiniMax, ElevenLabs)\",\n kinds: [\"voice\"],\n capabilities: [\"tts\"],\n },\n]\n\nexport function listSurfaceProfiles(): readonly SurfaceProfile[] {\n return SURFACE_PROFILES\n}\n\nexport function getSurfaceProfile(id: string): SurfaceProfile {\n const profile = SURFACE_PROFILES.find(p => p.id === id)\n if (!profile) {\n const known = SURFACE_PROFILES.map(p => p.id).join(\", \")\n throw new Error(\n `curation: unknown surface profile \"${id}\". Known: ${known}`\n )\n }\n return profile\n}\n\n// ───────────────────────────────────────────────────────────────────────\n// Filters\n// ───────────────────────────────────────────────────────────────────────\n\n/**\n * True iff a model passes a surface profile. Provider membership, like\n * capability/tag membership, is checked against the enrichment tag\n * vocabulary (every kind emits its provider as a tag), so this is uniform\n * across kinds and naturally spans the company/engine provider split.\n */\nexport function modelMatchesProfile(\n model: ResolvedModel,\n profile: SurfaceProfile\n): boolean {\n if (profile.kinds && profile.kinds.length > 0) {\n if (!profile.kinds.includes(model.kind)) return false\n }\n if (profile.providers && profile.providers.length > 0) {\n const tags = expandProviders(profile.providers)\n if (!tags.some(tag => modelHasTag(model, tag))) return false\n }\n if (profile.capabilities) {\n if (!profile.capabilities.every(cap => modelHasTag(model, cap)))\n return false\n }\n if (profile.tags) {\n if (!profile.tags.every(tag => modelHasTag(model, tag))) return false\n }\n return true\n}\n\n/** Filter a model list down to what a surface profile exposes. */\nexport function applyProfile(\n models: ResolvedModel[],\n profile: SurfaceProfile\n): ResolvedModel[] {\n return models.filter(model => modelMatchesProfile(model, profile))\n}\n\n/**\n * The catalog as a surface profile exposes it — `applyProfile` over the\n * full registry. The composable entry point for \"show me this view\".\n */\nexport function listSurfaced(profile: SurfaceProfile): ResolvedModel[] {\n return applyProfile(listModels(), profile)\n}\n\n/**\n * Voice-list curation. The merged voice catalog (curated + live\n * ElevenLabs) is `CatalogVoice[]`, not `ResolvedModel[]`, so it gets its\n * own provider filter — same group-expansion semantics. Only the provider\n * facet of a profile applies to a raw voice list (kind is implicitly\n * voice; capability/tag live on the registry projection).\n */\nexport function filterVoicesByProviders(\n voices: CatalogVoice[],\n providerTokens: readonly string[]\n): CatalogVoice[] {\n if (providerTokens.length === 0) return voices\n const tags = new Set(expandProviders(providerTokens))\n return voices.filter(v => tags.has(v.provider))\n}\n"]}