@agentproto/model-catalog 0.8.4 → 0.9.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.
Files changed (40) hide show
  1. package/dist/access/index.d.ts +3 -3
  2. package/dist/access/index.mjs +5 -2
  3. package/dist/catalog-Cg0AJJZ7.d.ts +1608 -0
  4. package/dist/{chunk-WTHHXXIK.mjs → chunk-BZ7O32GA.mjs} +6 -4
  5. package/dist/chunk-BZ7O32GA.mjs.map +1 -0
  6. package/dist/{chunk-K5Z4VDIW.mjs → chunk-LE7NKYLT.mjs} +4 -4
  7. package/dist/{chunk-K5Z4VDIW.mjs.map → chunk-LE7NKYLT.mjs.map} +1 -1
  8. package/dist/{chunk-TF7JGPTO.mjs → chunk-MR5ZPIUN.mjs} +1127 -945
  9. package/dist/chunk-MR5ZPIUN.mjs.map +1 -0
  10. package/dist/{chunk-C7NB3TTG.mjs → chunk-O7ZJEMH6.mjs} +4 -4
  11. package/dist/{chunk-C7NB3TTG.mjs.map → chunk-O7ZJEMH6.mjs.map} +1 -1
  12. package/dist/{chunk-HRRG2RZO.mjs → chunk-PUIEZ3G4.mjs} +3 -3
  13. package/dist/{chunk-HRRG2RZO.mjs.map → chunk-PUIEZ3G4.mjs.map} +1 -1
  14. package/dist/{chunk-6DLCFYAL.mjs → chunk-RK6MHEIS.mjs} +2026 -474
  15. package/dist/chunk-RK6MHEIS.mjs.map +1 -0
  16. package/dist/{chunk-HP6XQD3U.mjs → chunk-RKG52ASE.mjs} +21 -10
  17. package/dist/chunk-RKG52ASE.mjs.map +1 -0
  18. package/dist/{chunk-O7TXHU5W.mjs → chunk-ZTTWZ7PL.mjs} +19 -3
  19. package/dist/chunk-ZTTWZ7PL.mjs.map +1 -0
  20. package/dist/cost/index.mjs +6 -6
  21. package/dist/curation/index.d.ts +2 -2
  22. package/dist/curation/index.mjs +6 -6
  23. package/dist/{evaluate-CvrdzuYW.d.ts → evaluate-D3gXrAg-.d.ts} +1 -1
  24. package/dist/{index-CpxCXwo_.d.ts → index-BZfxAdXA.d.ts} +10 -2
  25. package/dist/{index-Bk5U4gcS.d.ts → index-DC8jecem.d.ts} +2 -2
  26. package/dist/index.d.ts +5 -5
  27. package/dist/index.mjs +10 -10
  28. package/dist/llm/index.d.ts +12 -2
  29. package/dist/llm/index.mjs +2 -2
  30. package/dist/overlay/index.d.ts +1 -1
  31. package/dist/picker/index.d.ts +4 -4
  32. package/dist/route-identity/index.d.ts +1 -1
  33. package/dist/route-identity/index.mjs +2 -2
  34. package/package.json +2 -2
  35. package/dist/catalog-IWd755ti.d.ts +0 -969
  36. package/dist/chunk-6DLCFYAL.mjs.map +0 -1
  37. package/dist/chunk-HP6XQD3U.mjs.map +0 -1
  38. package/dist/chunk-O7TXHU5W.mjs.map +0 -1
  39. package/dist/chunk-TF7JGPTO.mjs.map +0 -1
  40. package/dist/chunk-WTHHXXIK.mjs.map +0 -1
@@ -1,7 +1,7 @@
1
- import { listRouterLlmRoutes, formatModelRef } from './chunk-6DLCFYAL.mjs';
2
- import { modelHasTag } from './chunk-WTHHXXIK.mjs';
1
+ import { listRouterLlmRoutes, formatModelRef } from './chunk-RK6MHEIS.mjs';
2
+ import { modelHasTag } from './chunk-BZ7O32GA.mjs';
3
3
  import { getMergedOverlay } from './chunk-H6JUTF3U.mjs';
4
- import { resolvePricing, resolveAlias, LLM_PRICING_CATALOG } from './chunk-TF7JGPTO.mjs';
4
+ import { resolvePricing, resolveAlias, isKnownLlmId, getModelProvider, LLM_PRICING_CATALOG, listUnpricedKnownLlmIds } from './chunk-MR5ZPIUN.mjs';
5
5
  import { IMAGE_MODEL_CATALOG } from './chunk-2LWYZOWB.mjs';
6
6
  import { VIDEO_MODEL_CATALOG } from './chunk-IJZ4XPO2.mjs';
7
7
  import { AUDIO_MODEL_CATALOG } from './chunk-WRUWNKDB.mjs';
@@ -45,7 +45,10 @@ function getModel(id) {
45
45
  if (ov.audio[key]) return { kind: "audio", id, def: ov.audio[key] };
46
46
  const ovVoice = overlayVoice(ov, key);
47
47
  if (ovVoice) return { kind: "voice", id, voice: ovVoice };
48
- if (ov.llm[key]) return { kind: "llm", id, canonicalId: key, pricing: ov.llm[key] };
48
+ if (ov.llm[key]) {
49
+ const pricing = ov.llm[key];
50
+ return { kind: "llm", id, canonicalId: key, pricing, provider: pricing.provider };
51
+ }
49
52
  const imageDef = IMAGE_MODEL_CATALOG[key];
50
53
  if (imageDef) return { kind: "image", id, def: imageDef };
51
54
  const videoDef = VIDEO_MODEL_CATALOG[key];
@@ -57,7 +60,10 @@ function getModel(id) {
57
60
  const llmPricing = resolvePricing(key);
58
61
  if (llmPricing) {
59
62
  const canonicalId = resolveAlias(key);
60
- return { kind: "llm", id, canonicalId, pricing: llmPricing };
63
+ return { kind: "llm", id, canonicalId, pricing: llmPricing, provider: llmPricing.provider };
64
+ }
65
+ if (isKnownLlmId(key)) {
66
+ return { kind: "llm", id, canonicalId: key, pricing: void 0, provider: getModelProvider(key) };
61
67
  }
62
68
  return void 0;
63
69
  }
@@ -140,11 +146,16 @@ function listModels(filter = {}) {
140
146
  for (const [id, pricing] of Object.entries(ov.llm)) {
141
147
  if (!providerMatches(pricing.provider)) continue;
142
148
  seen.llm.add(id);
143
- out.push({ kind: "llm", id, canonicalId: id, pricing });
149
+ out.push({ kind: "llm", id, canonicalId: id, pricing, provider: pricing.provider });
144
150
  }
145
151
  for (const [id, pricing] of Object.entries(LLM_PRICING_CATALOG)) {
146
152
  if (seen.llm.has(id) || !providerMatches(pricing.provider)) continue;
147
- out.push({ kind: "llm", id, canonicalId: id, pricing });
153
+ seen.llm.add(id);
154
+ out.push({ kind: "llm", id, canonicalId: id, pricing, provider: pricing.provider });
155
+ }
156
+ for (const { id, provider } of listUnpricedKnownLlmIds()) {
157
+ if (seen.llm.has(id) || !providerMatches(provider)) continue;
158
+ out.push({ kind: "llm", id, canonicalId: id, pricing: void 0, provider });
148
159
  }
149
160
  }
150
161
  const required = [...filter.capabilities ?? [], ...filter.tags ?? []];
@@ -161,7 +172,7 @@ function getModelsByProvider(provider) {
161
172
  const bareId = `${route.vendor}/${route.product}`;
162
173
  if (existingIds.has(bareId)) continue;
163
174
  const id = formatModelRef(route.ref);
164
- routed.push({ kind: "llm", id, canonicalId: id, pricing: route.pricing });
175
+ routed.push({ kind: "llm", id, canonicalId: id, pricing: route.pricing, provider: route.pricing.provider });
165
176
  }
166
177
  return [...models, ...routed];
167
178
  }
@@ -191,5 +202,5 @@ function resolveAlias2(id) {
191
202
  }
192
203
 
193
204
  export { getModel, getModelsByProvider, getStaticModelProvider, isAgentVisible, listModels, resolveAlias2 as resolveAlias };
194
- //# sourceMappingURL=chunk-HP6XQD3U.mjs.map
195
- //# sourceMappingURL=chunk-HP6XQD3U.mjs.map
205
+ //# sourceMappingURL=chunk-RKG52ASE.mjs.map
206
+ //# sourceMappingURL=chunk-RKG52ASE.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/registry/index.ts"],"names":["resolveAlias"],"mappings":";;;;;;;;;;;;;;;;AAsCA,SAAS,WAAA,CAAY,IAAY,EAAA,EAA2B;AAC1D,EAAA,IAAI,GAAA,GAAM,EAAA;AACV,EAAA,MAAM,IAAA,uBAAW,GAAA,EAAY;AAC7B,EAAA,WAAS;AACP,IAAA,MAAM,IAAA,GAAO,EAAA,CAAG,OAAA,CAAQ,GAAG,CAAA;AAC3B,IAAA,IAAI,IAAA,KAAS,MAAA,IAAa,IAAA,CAAK,GAAA,CAAI,GAAG,CAAA,EAAG;AACzC,IAAA,IAAA,CAAK,IAAI,GAAG,CAAA;AACZ,IAAA,GAAA,GAAM,IAAA;AAAA,EACR;AACA,EAAA,OAAO,GAAA;AACT;AAGA,SAAS,YAAA,CAAa,IAAmB,GAAA,EAAuC;AAC9E,EAAA,OAAO,GAAG,KAAA,CAAM,IAAA;AAAA,IACd,CAAA,CAAA,KACE,CAAA,CAAE,SAAA,KAAc,GAAA,IAChB,CAAA,CAAE,eAAA,KAAoB,GAAA,IAA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;AAAA,IACrB,KAAK,KAAA;AAEH,MAAA,OAAO,MAAA;AAAA;AAEb;AAOO,SAASA,cAAa,EAAA,EAAoB;AAC/C,EAAA,MAAM,KAAK,gBAAA,EAAiB;AAC5B,EAAA,MAAM,GAAA,GAAM,WAAA,CAAY,EAAA,EAAI,EAAE,CAAA;AAC9B,EAAA,IAAI,EAAA,CAAG,KAAA,CAAM,GAAG,CAAA,IAAK,EAAA,CAAG,KAAA,CAAM,GAAG,CAAA,IAAK,EAAA,CAAG,KAAA,CAAM,GAAG,CAAA,EAAG,OAAO,GAAA;AAC5D,EAAA,IAAI,YAAA,CAAa,EAAA,EAAI,GAAG,CAAA,EAAG,OAAO,GAAA;AAClC,EAAA,IAAI,EAAA,CAAG,GAAA,CAAI,GAAG,CAAA,EAAG,OAAO,GAAA;AACxB,EAAA,IAAI,mBAAA,CAAoB,GAAG,CAAA,EAAG,OAAO,GAAA;AACrC,EAAA,IAAI,mBAAA,CAAoB,GAAG,CAAA,EAAG,OAAO,GAAA;AACrC,EAAA,IAAI,mBAAA,CAAoB,GAAG,CAAA,EAAG,OAAO,GAAA;AACrC,EAAA,IAAI,WAAA,CAAY,GAAA,CAAI,GAAG,CAAA,EAAG,OAAO,GAAA;AACjC,EAAA,OAAO,aAAgB,GAAG,CAAA;AAC5B","file":"chunk-RKG52ASE.mjs","sourcesContent":["/**\n * Cross-kind registry. Resolves a model id against every catalog (LLM,\n * image, video, audio) and returns a discriminated `ResolvedModel`.\n *\n * v1 returns the legacy per-kind data shapes verbatim — image/video keep\n * `*ModelDefinition`, LLM keeps `LLMPricing`, audio surfaces voices.\n * Callers (cost dispatcher, access evaluator) match on `.kind` and dig\n * into the per-kind payload as needed.\n */\n\nimport {\n LLM_PRICING_CATALOG,\n resolveAlias as resolveLlmAlias,\n resolvePricing,\n isKnownLlmId,\n listUnpricedKnownLlmIds,\n getModelProvider,\n type LLMPricing,\n} from \"../llm/index.js\"\nimport {\n IMAGE_MODEL_CATALOG,\n type ImageModelDefinition,\n} from \"../image/index.js\"\nimport {\n VIDEO_MODEL_CATALOG,\n type VideoModelDefinition,\n} from \"../video/index.js\"\nimport {\n AUDIO_MODEL_CATALOG,\n type AudioModelDefinition,\n} from \"../audio/index.js\"\nimport { VOICE_CATALOG, type CatalogVoice } from \"../voice/index.js\"\nimport { modelHasTag } from \"../enrichment/index.js\"\nimport { getMergedOverlay, type MergedOverlay } from \"../overlay/index.js\"\nimport { listRouterLlmRoutes, formatModelRef } from \"../route-identity/index.js\"\n\n/** Follow consumer-overlay alias hops to a concrete id (cycle-guarded).\n * Ids with no overlay alias pass through unchanged. */\nfunction followAlias(id: string, ov: MergedOverlay): string {\n let cur = id\n const seen = new Set<string>()\n for (;;) {\n const next = ov.aliases[cur]\n if (next === undefined || seen.has(cur)) break\n seen.add(cur)\n cur = next\n }\n return cur\n}\n\n/** Find an overlay voice by catalogId / providerVoiceId / alias. */\nfunction overlayVoice(ov: MergedOverlay, key: string): CatalogVoice | undefined {\n return ov.voice.find(\n v =>\n v.catalogId === key ||\n v.providerVoiceId === key ||\n (v.aliases ?? []).includes(key),\n )\n}\n\n/**\n * `audio` resolves to either an audio MODEL (priced TTS/STT) or a\n * voice (downstream metadata). Most call sites care about the model\n * (pricing, capabilities); a few (voice pickers) want the voice. They\n * share the resolver but discriminate on the inner payload.\n */\nexport type ResolvedModel =\n | {\n kind: \"llm\"\n id: string\n canonicalId: string\n /** Undefined for a real, known id with no pricing row yet — existence\n * and pricing are independent, see `LlmModelId`'s doc comment in\n * `llm/catalog.ts`. Every reader MUST handle the absent case; never\n * assume a `kind: \"llm\"` result is priced. */\n pricing: LLMPricing | undefined\n /** Best-effort provider even when `pricing` is absent (falls back to\n * `CONTEXT_WINDOWS`'s own provider field — see `getModelProvider`).\n * Prefer this over `pricing?.provider` when you only need routing. */\n provider: string | undefined\n }\n | { kind: \"image\"; id: string; def: ImageModelDefinition }\n | { kind: \"video\"; id: string; def: VideoModelDefinition }\n | { kind: \"audio\"; id: string; def: AudioModelDefinition }\n | { kind: \"voice\"; id: string; voice: CatalogVoice }\n\n/**\n * Every kind the registry can resolve. Broader than the catalog\n * `ModelKind` (llm/image/video/audio) because voices are a first-class\n * registry kind but not a priced model family. Derived from\n * `ResolvedModel` so it can never drift.\n */\nexport type CatalogKind = ResolvedModel[\"kind\"]\n\n// Voices resolve by canonical id (\"minimax-french-female-anchor\"), native\n// provider id (\"French_FemaleAnchor\"), or a consumer-overlay alias — index\n// all three so new slugs, native ids, and persisted operator rows all hit.\nconst VOICE_INDEX: Map<string, CatalogVoice> = new Map([\n ...VOICE_CATALOG.map(v => [v.providerVoiceId, v] as const),\n ...VOICE_CATALOG.map(v => [v.catalogId, v] as const),\n ...VOICE_CATALOG.flatMap((v: CatalogVoice) =>\n (v.aliases ?? []).map(a => [a, v] as const)\n ),\n])\n\n/**\n * Resolves a model id across every catalog.\n *\n * Lookup order: image → video → audio → LLM (last because LLM has the\n * partial-prefix fallback that can match other strings if probed first).\n *\n * Returns `undefined` for unknown ids — callers decide whether to throw\n * or fall back. LLM uses fallback pricing inside its own dispatcher\n * (preserves existing behavior at the orchestrator).\n */\nexport function getModel(id: string): ResolvedModel | undefined {\n // Consumer overlays first: resolve any overlay alias to a concrete id,\n // then let overlay entries override/extend the generated catalogs. The\n // returned `id` echoes what the caller asked for (alias-preserving), as\n // the legacy voice-alias path already did.\n const ov = getMergedOverlay()\n const key = followAlias(id, ov)\n\n if (ov.image[key]) return { kind: \"image\", id, def: ov.image[key]! }\n if (ov.video[key]) return { kind: \"video\", id, def: ov.video[key]! }\n if (ov.audio[key]) return { kind: \"audio\", id, def: ov.audio[key]! }\n const ovVoice = overlayVoice(ov, key)\n if (ovVoice) return { kind: \"voice\", id, voice: ovVoice }\n if (ov.llm[key]) {\n const pricing = ov.llm[key]!\n return { kind: \"llm\", id, canonicalId: key, pricing, provider: pricing.provider }\n }\n\n const imageDef = IMAGE_MODEL_CATALOG[key]\n if (imageDef) return { kind: \"image\", id, def: imageDef }\n\n const videoDef = VIDEO_MODEL_CATALOG[key]\n if (videoDef) return { kind: \"video\", id, def: videoDef }\n\n // Audio MODEL (priced TTS/STT) — checked before voice lookup so an\n // id that exists in both maps lands on the priced entry.\n const audioDef = AUDIO_MODEL_CATALOG[key]\n if (audioDef) return { kind: \"audio\", id, def: audioDef }\n\n const voice = VOICE_INDEX.get(key)\n if (voice) return { kind: \"voice\", id, voice }\n\n const llmPricing = resolvePricing(key)\n if (llmPricing) {\n const canonicalId = resolveLlmAlias(key)\n return { kind: \"llm\", id, canonicalId, pricing: llmPricing, provider: llmPricing.provider }\n }\n // Known id, no pricing row yet (see `LlmModelId`'s doc comment in\n // llm/catalog.ts) — still resolves, just unpriced. This is the case that\n // used to make a real, live, provider-published model (e.g. a brand-new\n // Anthropic release the day it ships, before the next pricing sync)\n // disappear from every downstream surface instead of showing up unpriced.\n if (isKnownLlmId(key)) {\n return { kind: \"llm\", id, canonicalId: key, pricing: undefined, provider: getModelProvider(key) }\n }\n\n return undefined\n}\n\n/**\n * Returns true iff the id is exposed to agents.\n *\n * - LLM: every entry in `LLM_PRICING_CATALOG` is considered visible\n * (legacy convention; refine in v2 with per-entry `agentVisible`).\n * - Image / Video: respects the `agentVisible` flag.\n * - Audio voices: all voices are visible (catalog itself is curated).\n */\nexport function isAgentVisible(id: string): boolean {\n const m = getModel(id)\n if (!m) return false\n switch (m.kind) {\n case \"image\":\n return m.def.agentVisible\n case \"video\":\n return m.def.agentVisible\n case \"audio\":\n return m.def.agentVisible\n case \"llm\":\n return (\n id in LLM_PRICING_CATALOG || resolveLlmAlias(id) in LLM_PRICING_CATALOG\n )\n case \"voice\":\n return true\n }\n}\n\nexport interface ListModelsFilter {\n kind?: CatalogKind\n /** Single provider (back-compat). Folded into `providers` internally. */\n provider?: string\n /** Provider OR-set — a model matches if its provider is any of these. */\n providers?: string[]\n /**\n * Capability tags a model must carry (ALL of them). Capabilities are\n * emitted as tags by enrichment — audio `tts`/`stt`/`s2s`, image\n * `edit`/`upscale`, video `i2v`/`t2v` — so this filters on the same\n * vocabulary `listModels({capabilities:[\"s2s\"]})` would expect.\n */\n capabilities?: string[]\n /** Arbitrary tags a model must carry (ALL of them). */\n tags?: string[]\n agentVisibleOnly?: boolean\n}\n\n/**\n * Cross-kind listing. Useful for catalog browsers and capability search.\n * Returns `ResolvedModel[]` (discriminated by kind).\n *\n * Provider is an OR-set (`providers` ∪ the singular `provider`); capability\n * and tag filters are AND-sets (a model must carry every listed value).\n * Composed: `listModels({ kind:\"audio\", capabilities:[\"s2s\"],\n * providers:[\"gemini-live\",\"openai-realtime\"] })` → all s2s models from\n * Gemini OR OpenAI.\n */\nexport function listModels(filter: ListModelsFilter = {}): ResolvedModel[] {\n const providerSet =\n filter.provider || filter.providers\n ? new Set([\n ...(filter.provider ? [filter.provider] : []),\n ...(filter.providers ?? []),\n ])\n : undefined\n const providerMatches = (provider: string | undefined): boolean =>\n !providerSet || (provider !== undefined && providerSet.has(provider))\n\n const ov = getMergedOverlay()\n const out: ResolvedModel[] = []\n // Overlay entries override core ones with the same id, so collect ids the\n // overlay has already supplied per kind and skip the core duplicate.\n const seen = { image: new Set<string>(), video: new Set<string>(), audio: new Set<string>(), voice: new Set<string>(), llm: new Set<string>() }\n\n if (!filter.kind || filter.kind === \"image\") {\n for (const [id, def] of Object.entries(ov.image)) {\n if (!providerMatches(def.provider)) continue\n if (filter.agentVisibleOnly && !def.agentVisible) continue\n seen.image.add(id)\n out.push({ kind: \"image\", id, def })\n }\n for (const [id, def] of Object.entries(IMAGE_MODEL_CATALOG)) {\n if (seen.image.has(id) || !providerMatches(def.provider)) continue\n if (filter.agentVisibleOnly && !def.agentVisible) continue\n out.push({ kind: \"image\", id, def })\n }\n }\n if (!filter.kind || filter.kind === \"video\") {\n for (const [id, def] of Object.entries(ov.video)) {\n if (!providerMatches(def.provider)) continue\n if (filter.agentVisibleOnly && !def.agentVisible) continue\n seen.video.add(id)\n out.push({ kind: \"video\", id, def })\n }\n for (const [id, def] of Object.entries(VIDEO_MODEL_CATALOG)) {\n if (seen.video.has(id) || !providerMatches(def.provider)) continue\n if (filter.agentVisibleOnly && !def.agentVisible) continue\n out.push({ kind: \"video\", id, def })\n }\n }\n if (!filter.kind || filter.kind === \"audio\") {\n for (const [id, def] of Object.entries(ov.audio)) {\n if (!providerMatches(def.provider)) continue\n if (filter.agentVisibleOnly && !def.agentVisible) continue\n seen.audio.add(id)\n out.push({ kind: \"audio\", id, def })\n }\n for (const [id, def] of Object.entries(AUDIO_MODEL_CATALOG)) {\n if (seen.audio.has(id) || !providerMatches(def.provider)) continue\n if (filter.agentVisibleOnly && !def.agentVisible) continue\n out.push({ kind: \"audio\", id, def })\n }\n }\n if (!filter.kind || filter.kind === \"voice\") {\n for (const v of ov.voice) {\n if (!providerMatches(v.provider)) continue\n seen.voice.add(v.catalogId)\n out.push({ kind: \"voice\", id: v.catalogId, voice: v })\n }\n for (const v of VOICE_CATALOG) {\n if (seen.voice.has(v.catalogId) || !providerMatches(v.provider)) continue\n out.push({ kind: \"voice\", id: v.catalogId, voice: v })\n }\n }\n if (!filter.kind || filter.kind === \"llm\") {\n for (const [id, pricing] of Object.entries(ov.llm)) {\n if (!providerMatches(pricing.provider)) continue\n seen.llm.add(id)\n out.push({ kind: \"llm\", id, canonicalId: id, pricing, provider: pricing.provider })\n }\n for (const [id, pricing] of Object.entries(LLM_PRICING_CATALOG)) {\n if (seen.llm.has(id) || !providerMatches(pricing.provider)) continue\n seen.llm.add(id)\n out.push({ kind: \"llm\", id, canonicalId: id, pricing, provider: pricing.provider })\n }\n // Known ids with no pricing row yet (see `LlmModelId`'s doc comment in\n // llm/catalog.ts) — surfaced unpriced rather than silently dropped.\n for (const { id, provider } of listUnpricedKnownLlmIds()) {\n if (seen.llm.has(id) || !providerMatches(provider)) continue\n out.push({ kind: \"llm\", id, canonicalId: id, pricing: undefined, provider })\n }\n }\n\n // Capability + tag filters are AND-sets, applied over the enrichment tag\n // vocabulary (capabilities are emitted as tags). Skipped entirely when\n // unset so the common path stays allocation-free.\n const required = [...(filter.capabilities ?? []), ...(filter.tags ?? [])]\n if (required.length === 0) return out\n return out.filter(model => required.every(tag => modelHasTag(model, tag)))\n}\n\n/**\n * Provider-centric view — every model a provider offers across all kinds\n * (llm / image / video / audio incl. tts/stt/s2s). This is the \"provider\n * catalog\" (openai, google, anthropic, replicate, openrouter, …): a\n * derived query over the kind-organized catalogs, NOT a parallel store.\n *\n * When `provider` names a router (openrouter, requesty, huggingface),\n * this also folds in that router's generated route table\n * (`listRouterLlmRoutes`), emitting `vendor/product@router` ids — the\n * router's full surface, not just what happens to be curated into\n * `LLM_PRICING_CATALOG`. OpenRouter's routes are already spread into that\n * catalog (bare `vendor/product` ids, `llm/catalog.ts`), so its router-table\n * entries are deduped against the bare ids `listModels` already returned;\n * Requesty and HuggingFace have no such overlap today, so their route table\n * entries are added in full. Deliberately NOT achieved by spreading\n * `REQUESTY_ROUTES`/`HUGGINGFACE_ROUTES` into `LLM_PRICING_CATALOG` itself —\n * that catalog is the legacy bare-id path, and a bare id must keep meaning\n * direct-vendor pricing (`route-identity/index.ts`).\n */\nexport function getModelsByProvider(provider: string): ResolvedModel[] {\n const models = listModels({ provider })\n const routerRoutes = listRouterLlmRoutes(provider)\n if (routerRoutes.length === 0) return models\n\n const existingIds = new Set(models.map(m => m.id))\n const routed: ResolvedModel[] = []\n for (const route of routerRoutes) {\n const bareId = `${route.vendor}/${route.product}`\n if (existingIds.has(bareId)) continue\n const id = formatModelRef(route.ref)\n routed.push({ kind: \"llm\", id, canonicalId: id, pricing: route.pricing, provider: route.pricing.provider })\n }\n return [...models, ...routed]\n}\n\n/**\n * Returns the platform a model's adapter is **statically pinned** to,\n * if known. ONLY meaningful for image / video / audio — those adapters\n * are constructed per-platform (Replicate adapter, MiniMax adapter…),\n * so the model's `def.provider` IS the runtime connector.\n *\n * For LLM, returns `undefined` — the runtime connector is determined\n * at call time by `pickLlmConnector(connectors, parseModelId(id).provider)`\n * against the guild's installed connectors, NOT by the model id alone.\n * The same `anthropic/claude-sonnet-4-5` can route through OpenRouter\n * OR direct Anthropic depending on which connectors the guild has\n * installed. Recording call sites MUST pass the actual `connectorUsed`\n * they invoked; do not infer from id.\n *\n * Use case: image/video workflow steps fetch `model.def.provider`\n * directly (no ambiguity). LLM call sites use the runtime resolver.\n */\nexport function getStaticModelProvider(\n model: ResolvedModel\n): string | undefined {\n switch (model.kind) {\n case \"image\":\n case \"video\":\n case \"audio\":\n return model.def.provider\n case \"voice\":\n return model.voice.provider\n case \"llm\":\n // Runtime routing — caller knows, we don't.\n return undefined\n }\n}\n\n/**\n * Resolves an id to its canonical catalog key across kinds. For ids that\n * have no alias, returns the id unchanged. Used by callers that want to\n * normalize before persisting (e.g., `byok_usage` rows).\n */\nexport function resolveAlias(id: string): string {\n const ov = getMergedOverlay()\n const key = followAlias(id, ov)\n if (ov.image[key] || ov.video[key] || ov.audio[key]) return key\n if (overlayVoice(ov, key)) return key\n if (ov.llm[key]) return key\n if (IMAGE_MODEL_CATALOG[key]) return key\n if (VIDEO_MODEL_CATALOG[key]) return key\n if (AUDIO_MODEL_CATALOG[key]) return key\n if (VOICE_INDEX.has(key)) return key\n return resolveLlmAlias(key)\n}\n"]}
@@ -4,6 +4,22 @@
4
4
  * Zod-only OSS core; @agstudio/model-catalog layers billing/access/BYOK on top.
5
5
  */
6
6
 
7
+ // src/llm/tokens.ts
8
+ function formatTokens(n) {
9
+ if (typeof n !== "number" || n <= 0) return null;
10
+ if (n >= 1e6) {
11
+ const m = n / 1e6;
12
+ const text = Number.isInteger(m) ? String(m) : m.toFixed(1);
13
+ return `${text}M`;
14
+ }
15
+ if (n >= 1e3) {
16
+ const k = n / 1e3;
17
+ const text = Number.isInteger(k) ? String(k) : k.toFixed(1);
18
+ return `${text}k`;
19
+ }
20
+ return String(n);
21
+ }
22
+
7
23
  // src/llm/defaults.ts
8
24
  var WORKFLOW_FAST_MODEL = "claude-sonnet-4-6";
9
25
  var WORKFLOW_PREMIUM_MODEL = "claude-opus-4-6";
@@ -47,6 +63,6 @@ var LLM_TIERS = {
47
63
  ]
48
64
  };
49
65
 
50
- export { LLM_TIERS, OPERATOR_AGENT_MODELS, OPERATOR_DEFAULT_GEMINI, OPERATOR_DEFAULT_PREMIUM, OPERATOR_DEFAULT_STANDARD, WORKFLOW_FAST_MODEL, WORKFLOW_PREMIUM_MODEL, WORKFLOW_TINY_MODEL };
51
- //# sourceMappingURL=chunk-O7TXHU5W.mjs.map
52
- //# sourceMappingURL=chunk-O7TXHU5W.mjs.map
66
+ export { LLM_TIERS, OPERATOR_AGENT_MODELS, OPERATOR_DEFAULT_GEMINI, OPERATOR_DEFAULT_PREMIUM, OPERATOR_DEFAULT_STANDARD, WORKFLOW_FAST_MODEL, WORKFLOW_PREMIUM_MODEL, WORKFLOW_TINY_MODEL, formatTokens };
67
+ //# sourceMappingURL=chunk-ZTTWZ7PL.mjs.map
68
+ //# sourceMappingURL=chunk-ZTTWZ7PL.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/llm/tokens.ts","../src/llm/defaults.ts"],"names":[],"mappings":";;;;;;;AASO,SAAS,aAAa,CAAA,EAAsC;AACjE,EAAA,IAAI,OAAO,CAAA,KAAM,QAAA,IAAY,CAAA,IAAK,GAAG,OAAO,IAAA;AAC5C,EAAA,IAAI,KAAK,GAAA,EAAW;AAClB,IAAA,MAAM,IAAI,CAAA,GAAI,GAAA;AACd,IAAA,MAAM,IAAA,GAAO,MAAA,CAAO,SAAA,CAAU,CAAC,CAAA,GAAI,OAAO,CAAC,CAAA,GAAI,CAAA,CAAE,OAAA,CAAQ,CAAC,CAAA;AAC1D,IAAA,OAAO,GAAG,IAAI,CAAA,CAAA,CAAA;AAAA,EAChB;AACA,EAAA,IAAI,KAAK,GAAA,EAAO;AACd,IAAA,MAAM,IAAI,CAAA,GAAI,GAAA;AACd,IAAA,MAAM,IAAA,GAAO,MAAA,CAAO,SAAA,CAAU,CAAC,CAAA,GAAI,OAAO,CAAC,CAAA,GAAI,CAAA,CAAE,OAAA,CAAQ,CAAC,CAAA;AAC1D,IAAA,OAAO,GAAG,IAAI,CAAA,CAAA,CAAA;AAAA,EAChB;AACA,EAAA,OAAO,OAAO,CAAC,CAAA;AACjB;;;ACRO,IAAM,mBAAA,GAAsB;AAG5B,IAAM,sBAAA,GAAyB;AAG/B,IAAM,mBAAA,GAAsB;AAO5B,IAAM,qBAAA,GAAwB;AAAA,EACnC,iBAAA;AAAA,EACA,mBAAA;AAAA,EACA;AACF;AAKO,IAAM,wBAAA,GAA+C;AACrD,IAAM,yBAAA,GAAgD;AACtD,IAAM,uBAAA,GACX;AAcK,IAAM,SAAA,GAAY;AAAA;AAAA,EAEvB,IAAA,EAAM,CAAC,+BAA+B,CAAA;AAAA;AAAA,EAEtC,IAAA,EAAM;AAAA,IACJ,cAAA;AAAA,IACA,cAAA;AAAA,IACA,YAAA;AAAA,IACA;AAAA,GACF;AAAA;AAAA,EAEA,IAAA,EAAM;AAAA,IACJ,kBAAA;AAAA,IACA,sBAAA;AAAA,IACA;AAAA,GACF;AAAA;AAAA,EAEA,IAAA,EAAM;AAAA,IACJ,mBAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACF;AAAA;AAAA,EAEA,GAAA,EAAK;AAAA,IACH,iBAAA;AAAA,IACA,+BAAA;AAAA,IACA;AAAA;AAEJ","file":"chunk-ZTTWZ7PL.mjs","sourcesContent":["/**\n * Shared human-readable token formatting, so the `agentproto models` CLI and\n * the `catalog_models` MCP tool render the same `1M`/`200k` shapes instead of\n * raw integers. Lives next to `resolveContextWindow` (its data source) — one\n * formatter per concept, both output surfaces consume it.\n */\n\n/** Format a token count compactly — `1M`, `500k`, `2k`, `448`. Undefined ⇒\n * null so JSON output omits rather than fabricates a value. */\nexport function formatTokens(n: number | undefined): string | null {\n if (typeof n !== \"number\" || n <= 0) return null\n if (n >= 1_000_000) {\n const m = n / 1_000_000\n const text = Number.isInteger(m) ? String(m) : m.toFixed(1)\n return `${text}M`\n }\n if (n >= 1_000) {\n const k = n / 1_000\n const text = Number.isInteger(k) ? String(k) : k.toFixed(1)\n return `${text}k`\n }\n return String(n)\n}\n","/**\n * Curated, SDK-ready LLM model ids.\n *\n * Centralizes the version-specific provider ids used at runtime so call\n * sites stop carrying string literals. Pricing for each is resolved\n * automatically through `MODEL_ALIASES` in `catalog.ts` (e.g.\n * `claude-sonnet-4-6` → `claude-sonnet-4-5`).\n *\n * Update one constant here when bumping the platform-wide default —\n * every workflow step and operator config picks up the new id with a\n * single rebuild.\n */\n\n/** Fast workhorse for content workflows (outline, post, sections). */\nexport const WORKFLOW_FAST_MODEL = \"claude-sonnet-4-6\" as const\n\n/** Premium tier for high-stakes generation (rarely used in workflows). */\nexport const WORKFLOW_PREMIUM_MODEL = \"claude-opus-4-6\" as const\n\n/** Cheap-and-quick for short outputs like titles. */\nexport const WORKFLOW_TINY_MODEL = \"claude-haiku-4-5-20251001\" as const\n\n/**\n * Models eligible for operator agents (an app). Keep in sync with the\n * agent-framework's model-provider config. The literal tuple drives the\n * `OperatorAgentModel` union type below.\n */\nexport const OPERATOR_AGENT_MODELS = [\n \"claude-opus-4-5\",\n \"claude-sonnet-4-5\",\n \"gemini-3.1-pro-preview\",\n] as const\n\nexport type OperatorAgentModel = (typeof OPERATOR_AGENT_MODELS)[number]\n\n/** Default operator model when no explicit choice is made. */\nexport const OPERATOR_DEFAULT_PREMIUM: OperatorAgentModel = \"claude-opus-4-5\"\nexport const OPERATOR_DEFAULT_STANDARD: OperatorAgentModel = \"claude-sonnet-4-5\"\nexport const OPERATOR_DEFAULT_GEMINI: OperatorAgentModel =\n \"gemini-3.1-pro-preview\"\n\n// ── Plan-tier → model lists ─────────────────────────────────────────────\n//\n// Catalog-canonical equivalent of agent-framework's `MODEL_TIERS`. Used\n// by per-app `AppPlanRegistry` files as the source list when a plan\n// surfaces \"all of the X tier\". Keeping this in the catalog keeps the\n// app registries declarative — they pick from `LLM_TIERS.plus` rather\n// than re-specifying ids.\n//\n// All ids resolve through `resolvePricing` (direct match → alias →\n// partial-prefix). Names are app-vocabulary-neutral; per-app registries\n// re-key as needed (`PaygoTier.nano` → `LLM_TIERS.nano`, etc.).\n\nexport const LLM_TIERS = {\n /** Cheap-and-quick. Single-model fallback. */\n nano: [\"mistral-small-creative-latest\"] as const,\n /** Low-cost, agentic-capable. Direct alt-providers. */\n mini: [\n \"MiniMax-M2.5\",\n \"MiniMax-M2.1\",\n \"MiniMax-M2\",\n \"mistral-large-latest\",\n ] as const,\n /** Medium cost, fast inference + good general perf. OpenRouter-routed. */\n lite: [\n \"x-ai/grok-4-fast\",\n \"xiaomi/mimo-v2-flash\",\n \"google/gemini-3-flash-preview\",\n ] as const,\n /** High quality, premium features. Mix of direct + OpenRouter. */\n plus: [\n \"claude-sonnet-4-5\",\n \"gpt-4o\",\n \"kimi-k2.5\",\n \"deepseek/deepseek-v3.2\",\n ] as const,\n /** Top-tier, best performance. */\n pro: [\n \"claude-opus-4-5\",\n \"google/gemini-3.1-pro-preview\",\n \"kimi-k2-thinking\",\n ] as const,\n} as const\n\nexport type LlmTierName = keyof typeof LLM_TIERS\n"]}
@@ -1,11 +1,11 @@
1
- export { CostUsageKindMismatchError, UnknownModelError, calculateAudioCost, calculateCost, calculateImageCost, calculateLLMCost, calculateVideoCost } from '../chunk-K5Z4VDIW.mjs';
2
- import '../chunk-HP6XQD3U.mjs';
3
- import '../chunk-6DLCFYAL.mjs';
4
- import '../chunk-WTHHXXIK.mjs';
1
+ export { CostUsageKindMismatchError, UnknownModelError, calculateAudioCost, calculateCost, calculateImageCost, calculateLLMCost, calculateVideoCost } from '../chunk-LE7NKYLT.mjs';
2
+ import '../chunk-RKG52ASE.mjs';
3
+ import '../chunk-RK6MHEIS.mjs';
4
+ import '../chunk-BZ7O32GA.mjs';
5
5
  import '../chunk-H6JUTF3U.mjs';
6
6
  import '../chunk-DW45X6XT.mjs';
7
- import '../chunk-O7TXHU5W.mjs';
8
- import '../chunk-TF7JGPTO.mjs';
7
+ import '../chunk-ZTTWZ7PL.mjs';
8
+ import '../chunk-MR5ZPIUN.mjs';
9
9
  import '../chunk-QHELXPSL.mjs';
10
10
  import '../chunk-2LWYZOWB.mjs';
11
11
  import '../chunk-IJZ4XPO2.mjs';
@@ -1,6 +1,6 @@
1
- import { C as CatalogKind, R as ResolvedModel } from '../index-CpxCXwo_.js';
1
+ import { C as CatalogKind, R as ResolvedModel } from '../index-BZfxAdXA.js';
2
2
  import { CatalogVoice } from '../schema/voice.js';
3
- import '../catalog-IWd755ti.js';
3
+ import '../catalog-Cg0AJJZ7.js';
4
4
  import '../base-B8IIoaqg.js';
5
5
  import 'zod';
6
6
  import '../image/index.js';
@@ -1,11 +1,11 @@
1
- export { applyProfile, expandProviders, filterVoicesByProviders, getProviderGroup, getSurfaceProfile, groupForProvider, listProviderGroups, listSurfaceProfiles, listSurfaced, modelMatchesProfile } from '../chunk-C7NB3TTG.mjs';
2
- import '../chunk-HP6XQD3U.mjs';
3
- import '../chunk-6DLCFYAL.mjs';
4
- import '../chunk-WTHHXXIK.mjs';
1
+ export { applyProfile, expandProviders, filterVoicesByProviders, getProviderGroup, getSurfaceProfile, groupForProvider, listProviderGroups, listSurfaceProfiles, listSurfaced, modelMatchesProfile } from '../chunk-O7ZJEMH6.mjs';
2
+ import '../chunk-RKG52ASE.mjs';
3
+ import '../chunk-RK6MHEIS.mjs';
4
+ import '../chunk-BZ7O32GA.mjs';
5
5
  import '../chunk-H6JUTF3U.mjs';
6
6
  import '../chunk-DW45X6XT.mjs';
7
- import '../chunk-O7TXHU5W.mjs';
8
- import '../chunk-TF7JGPTO.mjs';
7
+ import '../chunk-ZTTWZ7PL.mjs';
8
+ import '../chunk-MR5ZPIUN.mjs';
9
9
  import '../chunk-QHELXPSL.mjs';
10
10
  import '../chunk-2LWYZOWB.mjs';
11
11
  import '../chunk-IJZ4XPO2.mjs';
@@ -1,4 +1,4 @@
1
- import { R as ResolvedModel } from './index-CpxCXwo_.js';
1
+ import { R as ResolvedModel } from './index-BZfxAdXA.js';
2
2
  import { M as ModelKind } from './base-B8IIoaqg.js';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { c as LLMPricing } from './catalog-IWd755ti.js';
1
+ import { L as LLMPricing } from './catalog-Cg0AJJZ7.js';
2
2
  import { ImageModelDefinition } from './image/index.js';
3
3
  import { VideoModelDefinition } from './video/index.js';
4
4
  import { AudioModelDefinition } from './audio/index.js';
@@ -24,7 +24,15 @@ type ResolvedModel = {
24
24
  kind: "llm";
25
25
  id: string;
26
26
  canonicalId: string;
27
- pricing: LLMPricing;
27
+ /** Undefined for a real, known id with no pricing row yet — existence
28
+ * and pricing are independent, see `LlmModelId`'s doc comment in
29
+ * `llm/catalog.ts`. Every reader MUST handle the absent case; never
30
+ * assume a `kind: "llm"` result is priced. */
31
+ pricing: LLMPricing | undefined;
32
+ /** Best-effort provider even when `pricing` is absent (falls back to
33
+ * `CONTEXT_WINDOWS`'s own provider field — see `getModelProvider`).
34
+ * Prefer this over `pricing?.provider` when you only need routing. */
35
+ provider: string | undefined;
28
36
  } | {
29
37
  kind: "image";
30
38
  id: string;
@@ -1,6 +1,6 @@
1
- import { A as AccessDecision } from './evaluate-CvrdzuYW.js';
1
+ import { A as AccessDecision } from './evaluate-D3gXrAg-.js';
2
2
  import { C as CatalogPriceTier, L as Lifecycle, M as ModelKind } from './base-B8IIoaqg.js';
3
- import { R as ResolvedModel } from './index-CpxCXwo_.js';
3
+ import { R as ResolvedModel } from './index-BZfxAdXA.js';
4
4
 
5
5
  /**
6
6
  * Model enrichment — `catalogPriceTier` / `tags` / `lifecycle` / `actions`
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { ImageAspectRatio, ImageAspectRatioSchema, ImageCapabilities, ImageCapabilitiesSchema, ImageEntry, ImageEntrySchema, ImagePricing, ImagePricingSchema, ImageReferenceImages, ImageReferenceImagesSchema, LLMEntry, LLMEntrySchema, LlmPricing, LlmPricingSchema, ModelEntry, ModelEntrySchema, VideoCapabilities, VideoCapabilitiesSchema, VideoCostMultipliers, VideoCostMultipliersSchema, VideoEntry, VideoEntrySchema, VideoPricing, VideoPricingSchema, VideoResolution, VideoResolutionSchema } from './schema/index.js';
2
- export { D as DEFAULT_PRICING, L as LLMCreditCostResult, c as LLMPricing, d as LLMUsageBreakdown, e as LLM_PRICING_CATALOG, M as MODEL_ALIASES, i as calculateLLMCreditCost, n as resolvePricing } from './catalog-IWd755ti.js';
2
+ export { D as DEFAULT_PRICING, a as LLMCreditCostResult, L as LLMPricing, b as LLMUsageBreakdown, c as LLM_PRICING_CATALOG, M as MODEL_ALIASES, d as calculateLLMCreditCost, r as resolvePricing } from './catalog-Cg0AJJZ7.js';
3
3
  export { AGENT_EDITABLE_MODEL_IDS, AGENT_GENERATIVE_MODEL_IDS, AGENT_IMAGE_MODEL_IDS, IMAGE_MODEL_CATALOG, IMAGE_MODEL_IDS, ImageModelDefinition, generateImageModelTable } from './image/index.js';
4
4
  export { AGENT_VIDEO_MODEL_IDS, VIDEO_MODEL_CATALOG, VIDEO_MODEL_IDS, VideoModelDefinition, generateVideoModelTable } from './video/index.js';
5
5
  export { AGENT_AUDIO_MODEL_IDS, AGENT_STT_MODEL_IDS, AGENT_TTS_MODEL_IDS, AUDIO_MODEL_CATALOG, AUDIO_MODEL_IDS, AudioBillingUnit, AudioModality, AudioModelDefinition, AudioProvider, DEFAULT_GEMINI_LIVE_MODEL, GEMINI_LIVE_MODEL_IDS, S2S_MODEL_IDS, generateAudioModelTable, isAcceptedGeminiLiveModel } from './audio/index.js';
@@ -9,12 +9,12 @@ export { ProviderGroup, SurfaceProfile, applyProfile, expandProviders, filterVoi
9
9
  export { CC_USD_RATE, CREDIT_USD_RATE, DEFAULT_PRICING_FLOORS, DEFAULT_PRICING_MARKUP, PricingCategory, PricingMarkup, computeCenticredits, pricingRegistry } from './pricing/index.js';
10
10
  export { CalculateCostOptions, CostResult, CostUsage, CostUsageKindMismatchError, UnknownModelError, calculateAudioCost, calculateCost, calculateImageCost, calculateLLMCost, calculateVideoCost } from './cost/index.js';
11
11
  export { ShouldDebitDecision, ShouldDebitInput, shouldDebit } from './byok/index.js';
12
- export { A as AccessDecision, a as AccessEffect, b as AccessEvalInput, c as AccessRule, d as AccessTarget, e as AppScope, f as evaluateAccess } from './evaluate-CvrdzuYW.js';
12
+ export { A as AccessDecision, a as AccessEffect, b as AccessEvalInput, c as AccessRule, d as AccessTarget, e as AppScope, f as evaluateAccess } from './evaluate-D3gXrAg-.js';
13
13
  export { CatalogDefaultDecision, evaluateCatalogDefaults } from './access/index.js';
14
14
  export { CatalogOverlay, MergedOverlay, clearCatalogOverlays, getMergedOverlay, registerCatalogOverlay } from './overlay/index.js';
15
- import { R as ResolvedModel } from './index-CpxCXwo_.js';
16
- export { C as CatalogKind, L as ListModelsFilter, g as getModel, a as getModelsByProvider, b as getStaticModelProvider, i as isAgentVisible, l as listModels, r as resolveAlias } from './index-CpxCXwo_.js';
17
- export { A as AvailableConnector, a as AvailableModel, b as AvailableModelCapabilities, c as AvailableModelsActor, d as AvailableModelsResponse, L as ListAvailableModelsParams, M as ModelEnrichment, g as getEnrichment, m as modelHasAction, e as modelHasTag, f as modelMatchesCatalogPriceTier, h as modelMatchesKind, i as modelMatchesPriceTier, p as priceTierForModel } from './index-Bk5U4gcS.js';
15
+ import { R as ResolvedModel } from './index-BZfxAdXA.js';
16
+ export { C as CatalogKind, L as ListModelsFilter, g as getModel, a as getModelsByProvider, b as getStaticModelProvider, i as isAgentVisible, l as listModels, r as resolveAlias } from './index-BZfxAdXA.js';
17
+ export { A as AvailableConnector, a as AvailableModel, b as AvailableModelCapabilities, c as AvailableModelsActor, d as AvailableModelsResponse, L as ListAvailableModelsParams, M as ModelEnrichment, g as getEnrichment, m as modelHasAction, e as modelHasTag, f as modelMatchesCatalogPriceTier, h as modelMatchesKind, i as modelMatchesPriceTier, p as priceTierForModel } from './index-DC8jecem.js';
18
18
  export { A as AudioCapabilities, a as AudioCapabilitiesSchema, b as AudioEntry, c as AudioEntrySchema, d as AudioPricing, e as AudioPricingSchema } from './audio-DR0g_ZH_.js';
19
19
  export { C as CatalogPriceTier, a as CatalogPriceTierSchema, b as CatalogProvider, c as CatalogProviderSchema, L as Lifecycle, d as LifecycleSchema, M as ModelKind, e as ModelKindSchema, N as NsfwPolicy, f as NsfwPolicySchema, P as PROVIDER_KEY_ENV, g as PROVIDER_KEY_ENV_ALIASES, h as baseEntryShape } from './base-B8IIoaqg.js';
20
20
  import 'zod';
package/dist/index.mjs CHANGED
@@ -1,17 +1,17 @@
1
- export { applyProfile, expandProviders, filterVoicesByProviders, getProviderGroup, getSurfaceProfile, groupForProvider, listProviderGroups, listSurfaceProfiles, listSurfaced, modelMatchesProfile } from './chunk-C7NB3TTG.mjs';
2
- export { CostUsageKindMismatchError, UnknownModelError, calculateAudioCost, calculateCost, calculateImageCost, calculateLLMCost, calculateVideoCost } from './chunk-K5Z4VDIW.mjs';
3
- import { getModel } from './chunk-HP6XQD3U.mjs';
4
- export { getModel, getModelsByProvider, getStaticModelProvider, isAgentVisible, listModels, resolveAlias } from './chunk-HP6XQD3U.mjs';
5
- import './chunk-6DLCFYAL.mjs';
1
+ export { applyProfile, expandProviders, filterVoicesByProviders, getProviderGroup, getSurfaceProfile, groupForProvider, listProviderGroups, listSurfaceProfiles, listSurfaced, modelMatchesProfile } from './chunk-O7ZJEMH6.mjs';
2
+ export { CostUsageKindMismatchError, UnknownModelError, calculateAudioCost, calculateCost, calculateImageCost, calculateLLMCost, calculateVideoCost } from './chunk-LE7NKYLT.mjs';
3
+ import { getModel } from './chunk-RKG52ASE.mjs';
4
+ export { getModel, getModelsByProvider, getStaticModelProvider, isAgentVisible, listModels, resolveAlias } from './chunk-RKG52ASE.mjs';
5
+ import './chunk-RK6MHEIS.mjs';
6
6
  export { shouldDebit } from './chunk-XFDXTFV3.mjs';
7
- export { evaluateAccess, evaluateCatalogDefaults } from './chunk-HRRG2RZO.mjs';
8
- import { priceTierForModel } from './chunk-WTHHXXIK.mjs';
9
- export { assertReservedPrefixDiscipline, getActions, getEnrichment, isActionTag, modelHasAction, modelHasTag, modelMatchesCatalogPriceTier, modelMatchesKind, modelMatchesPriceTier, priceTierForModel } from './chunk-WTHHXXIK.mjs';
7
+ export { evaluateAccess, evaluateCatalogDefaults } from './chunk-PUIEZ3G4.mjs';
8
+ import { priceTierForModel } from './chunk-BZ7O32GA.mjs';
9
+ export { assertReservedPrefixDiscipline, getActions, getEnrichment, isActionTag, modelHasAction, modelHasTag, modelMatchesCatalogPriceTier, modelMatchesKind, modelMatchesPriceTier, priceTierForModel } from './chunk-BZ7O32GA.mjs';
10
10
  export { clearCatalogOverlays, getMergedOverlay, registerCatalogOverlay } from './chunk-H6JUTF3U.mjs';
11
11
  export { AudioCapabilitiesSchema, AudioEntrySchema, AudioPricingSchema, ImageAspectRatioSchema, ImageCapabilitiesSchema, ImageEntrySchema, ImagePricingSchema, ImageReferenceImagesSchema, LLMEntrySchema, LlmPricingSchema, ModelEntrySchema, VideoCapabilitiesSchema, VideoCostMultipliersSchema, VideoEntrySchema, VideoPricingSchema, VideoResolutionSchema } from './chunk-HL2G36MT.mjs';
12
12
  export { CatalogPriceTierSchema, CatalogProviderSchema, LifecycleSchema, ModelKindSchema, NsfwPolicySchema, PROVIDER_KEY_ENV, PROVIDER_KEY_ENV_ALIASES, baseEntryShape } from './chunk-DW45X6XT.mjs';
13
- import './chunk-O7TXHU5W.mjs';
14
- export { DEFAULT_PRICING, LLM_PRICING_CATALOG, MODEL_ALIASES, calculateLLMCreditCost, resolvePricing } from './chunk-TF7JGPTO.mjs';
13
+ import './chunk-ZTTWZ7PL.mjs';
14
+ export { DEFAULT_PRICING, LLM_PRICING_CATALOG, MODEL_ALIASES, calculateLLMCreditCost, resolvePricing } from './chunk-MR5ZPIUN.mjs';
15
15
  export { CC_USD_RATE, CREDIT_USD_RATE, DEFAULT_PRICING_FLOORS, DEFAULT_PRICING_MARKUP, computeCenticredits, pricingRegistry } from './chunk-QHELXPSL.mjs';
16
16
  export { AGENT_EDITABLE_MODEL_IDS, AGENT_GENERATIVE_MODEL_IDS, AGENT_IMAGE_MODEL_IDS, IMAGE_MODEL_CATALOG, IMAGE_MODEL_IDS, generateImageModelTable } from './chunk-2LWYZOWB.mjs';
17
17
  export { AGENT_VIDEO_MODEL_IDS, VIDEO_MODEL_CATALOG, VIDEO_MODEL_IDS, generateVideoModelTable } from './chunk-IJZ4XPO2.mjs';
@@ -1,7 +1,17 @@
1
- export { C as CacheStats, a as CalculateLLMCreditCostOptions, b as ContextWindowEntry, D as DEFAULT_PRICING, K as KnownLlmId, L as LLMCreditCostResult, c as LLMPricing, d as LLMUsageBreakdown, e as LLM_PRICING_CATALOG, f as LlmModelAlias, g as LlmModelId, M as MODEL_ALIASES, h as ModelRoute, i as calculateLLMCreditCost, j as getCacheStats, k as getModelProvider, r as resolveAlias, l as resolveContextWindow, m as resolveModelRoute, n as resolvePricing, o as resolvePricingExact } from '../catalog-IWd755ti.js';
1
+ export { C as CacheStats, e as CalculateLLMCreditCostOptions, f as ContextWindowEntry, D as DEFAULT_PRICING, K as KnownLlmId, a as LLMCreditCostResult, L as LLMPricing, b as LLMUsageBreakdown, c as LLM_PRICING_CATALOG, g as LlmModelAlias, h as LlmModelId, M as MODEL_ALIASES, i as ModelRoute, d as calculateLLMCreditCost, j as getCacheStats, k as getModelProvider, l as isKnownLlmId, m as listNativeModelIds, n as listUnpricedKnownLlmIds, o as resolveAlias, p as resolveContextWindow, q as resolveModelRoute, r as resolvePricing, s as resolvePricingExact } from '../catalog-Cg0AJJZ7.js';
2
2
  import '../base-B8IIoaqg.js';
3
3
  import 'zod';
4
4
 
5
+ /**
6
+ * Shared human-readable token formatting, so the `agentproto models` CLI and
7
+ * the `catalog_models` MCP tool render the same `1M`/`200k` shapes instead of
8
+ * raw integers. Lives next to `resolveContextWindow` (its data source) — one
9
+ * formatter per concept, both output surfaces consume it.
10
+ */
11
+ /** Format a token count compactly — `1M`, `500k`, `2k`, `448`. Undefined ⇒
12
+ * null so JSON output omits rather than fabricates a value. */
13
+ declare function formatTokens(n: number | undefined): string | null;
14
+
5
15
  /**
6
16
  * Curated, SDK-ready LLM model ids.
7
17
  *
@@ -45,4 +55,4 @@ declare const LLM_TIERS: {
45
55
  };
46
56
  type LlmTierName = keyof typeof LLM_TIERS;
47
57
 
48
- export { LLM_TIERS, type LlmTierName, OPERATOR_AGENT_MODELS, OPERATOR_DEFAULT_GEMINI, OPERATOR_DEFAULT_PREMIUM, OPERATOR_DEFAULT_STANDARD, type OperatorAgentModel, WORKFLOW_FAST_MODEL, WORKFLOW_PREMIUM_MODEL, WORKFLOW_TINY_MODEL };
58
+ export { LLM_TIERS, type LlmTierName, OPERATOR_AGENT_MODELS, OPERATOR_DEFAULT_GEMINI, OPERATOR_DEFAULT_PREMIUM, OPERATOR_DEFAULT_STANDARD, type OperatorAgentModel, WORKFLOW_FAST_MODEL, WORKFLOW_PREMIUM_MODEL, WORKFLOW_TINY_MODEL, formatTokens };
@@ -1,5 +1,5 @@
1
- export { LLM_TIERS, OPERATOR_AGENT_MODELS, OPERATOR_DEFAULT_GEMINI, OPERATOR_DEFAULT_PREMIUM, OPERATOR_DEFAULT_STANDARD, WORKFLOW_FAST_MODEL, WORKFLOW_PREMIUM_MODEL, WORKFLOW_TINY_MODEL } from '../chunk-O7TXHU5W.mjs';
2
- export { DEFAULT_PRICING, LLM_PRICING_CATALOG, MODEL_ALIASES, calculateLLMCreditCost, getCacheStats, getModelProvider, resolveAlias, resolveContextWindow, resolveModelRoute, resolvePricing, resolvePricingExact } from '../chunk-TF7JGPTO.mjs';
1
+ export { LLM_TIERS, OPERATOR_AGENT_MODELS, OPERATOR_DEFAULT_GEMINI, OPERATOR_DEFAULT_PREMIUM, OPERATOR_DEFAULT_STANDARD, WORKFLOW_FAST_MODEL, WORKFLOW_PREMIUM_MODEL, WORKFLOW_TINY_MODEL, formatTokens } from '../chunk-ZTTWZ7PL.mjs';
2
+ export { DEFAULT_PRICING, LLM_PRICING_CATALOG, MODEL_ALIASES, calculateLLMCreditCost, getCacheStats, getModelProvider, isKnownLlmId, listNativeModelIds, listUnpricedKnownLlmIds, resolveAlias, resolveContextWindow, resolveModelRoute, resolvePricing, resolvePricingExact } from '../chunk-MR5ZPIUN.mjs';
3
3
  import '../chunk-QHELXPSL.mjs';
4
4
  //# sourceMappingURL=index.mjs.map
5
5
  //# sourceMappingURL=index.mjs.map
@@ -1,4 +1,4 @@
1
- import { c as LLMPricing } from '../catalog-IWd755ti.js';
1
+ import { L as LLMPricing } from '../catalog-Cg0AJJZ7.js';
2
2
  import { ImageModelDefinition } from '../image/index.js';
3
3
  import { VideoModelDefinition } from '../video/index.js';
4
4
  import { AudioModelDefinition } from '../audio/index.js';
@@ -1,8 +1,8 @@
1
- import '../evaluate-CvrdzuYW.js';
1
+ import '../evaluate-D3gXrAg-.js';
2
2
  import '../base-B8IIoaqg.js';
3
- export { A as AvailableConnector, a as AvailableModel, b as AvailableModelCapabilities, c as AvailableModelsActor, d as AvailableModelsResponse, L as ListAvailableModelsParams, P as PRICE_TIER_NAMES, j as PRICE_TIER_SLOTS, k as priceTierBar, l as priceTierName } from '../index-Bk5U4gcS.js';
4
- import '../index-CpxCXwo_.js';
5
- import '../catalog-IWd755ti.js';
3
+ export { A as AvailableConnector, a as AvailableModel, b as AvailableModelCapabilities, c as AvailableModelsActor, d as AvailableModelsResponse, L as ListAvailableModelsParams, P as PRICE_TIER_NAMES, j as PRICE_TIER_SLOTS, k as priceTierBar, l as priceTierName } from '../index-DC8jecem.js';
4
+ import '../index-BZfxAdXA.js';
5
+ import '../catalog-Cg0AJJZ7.js';
6
6
  import '../image/index.js';
7
7
  import '../video/index.js';
8
8
  import '../audio/index.js';
@@ -1,4 +1,4 @@
1
- import { c as LLMPricing } from '../catalog-IWd755ti.js';
1
+ import { L as LLMPricing } from '../catalog-Cg0AJJZ7.js';
2
2
  import '../base-B8IIoaqg.js';
3
3
  import 'zod';
4
4
 
@@ -1,6 +1,6 @@
1
- export { InvalidModelRefError, OPENROUTER_VARIANTS, clearCustomRoutes, diagnoseModelRef, formatModelRef, isModelRefString, listRouterLlmRoutes, parseModelRef, registerCustomRoute, resolveCustomRoute, resolveLlmModelRoute, stripAnthropicNativeVendor, stripFixedNativeVendor, stripRouteSuffix, tryParseModelRef } from '../chunk-6DLCFYAL.mjs';
1
+ export { InvalidModelRefError, OPENROUTER_VARIANTS, clearCustomRoutes, diagnoseModelRef, formatModelRef, isModelRefString, listRouterLlmRoutes, parseModelRef, registerCustomRoute, resolveCustomRoute, resolveLlmModelRoute, stripAnthropicNativeVendor, stripFixedNativeVendor, stripRouteSuffix, tryParseModelRef } from '../chunk-RK6MHEIS.mjs';
2
2
  import '../chunk-DW45X6XT.mjs';
3
- import '../chunk-TF7JGPTO.mjs';
3
+ import '../chunk-MR5ZPIUN.mjs';
4
4
  import '../chunk-QHELXPSL.mjs';
5
5
  //# sourceMappingURL=index.mjs.map
6
6
  //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentproto/model-catalog",
3
- "version": "0.8.4",
3
+ "version": "0.9.1",
4
4
  "description": "Unified, dependency-light model catalog: LLM, image, video, audio entries + cost dispatcher + picker. Zod-only; the OSS core that @agstudio/model-catalog layers billing/access/BYOK on top of.",
5
5
  "keywords": [
6
6
  "agentproto",
@@ -119,7 +119,7 @@
119
119
  }
120
120
  },
121
121
  "dependencies": {
122
- "zod": "^4.4.3"
122
+ "zod": "^4.5.4"
123
123
  },
124
124
  "devDependencies": {
125
125
  "@types/node": "^25.6.2",