@agentproto/model-catalog 0.11.4 → 0.12.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 (43) hide show
  1. package/README.md +7 -0
  2. package/dist/access/index.d.ts +3 -3
  3. package/dist/access/index.mjs +4 -4
  4. package/dist/{catalog-BAKSkM-q.d.ts → catalog-bHxCjKZP.d.ts} +404 -231
  5. package/dist/{chunk-TTIJME5T.mjs → chunk-7U7XGVHP.mjs} +12 -2
  6. package/dist/chunk-7U7XGVHP.mjs.map +1 -0
  7. package/dist/{chunk-PD7TZ6PJ.mjs → chunk-ARZ2NGZS.mjs} +4 -4
  8. package/dist/{chunk-PD7TZ6PJ.mjs.map → chunk-ARZ2NGZS.mjs.map} +1 -1
  9. package/dist/{chunk-WDIFBFY5.mjs → chunk-BOCXDO4T.mjs} +240 -155
  10. package/dist/chunk-BOCXDO4T.mjs.map +1 -0
  11. package/dist/{chunk-3YADNIR3.mjs → chunk-DDP4LWNM.mjs} +4 -4
  12. package/dist/{chunk-3YADNIR3.mjs.map → chunk-DDP4LWNM.mjs.map} +1 -1
  13. package/dist/{chunk-3MQVOHXC.mjs → chunk-HKPGUJ6C.mjs} +3 -3
  14. package/dist/{chunk-3MQVOHXC.mjs.map → chunk-HKPGUJ6C.mjs.map} +1 -1
  15. package/dist/{chunk-BTPINTV6.mjs → chunk-HOTSTCXF.mjs} +3 -3
  16. package/dist/{chunk-BTPINTV6.mjs.map → chunk-HOTSTCXF.mjs.map} +1 -1
  17. package/dist/{chunk-N23C5AL6.mjs → chunk-K5FVQ66Z.mjs} +34 -61
  18. package/dist/chunk-K5FVQ66Z.mjs.map +1 -0
  19. package/dist/{chunk-JTWZ2BXT.mjs → chunk-YGKXLIZQ.mjs} +5 -5
  20. package/dist/{chunk-JTWZ2BXT.mjs.map → chunk-YGKXLIZQ.mjs.map} +1 -1
  21. package/dist/{chunk-DR2AOQDW.mjs → chunk-ZFELFXSM.mjs} +3 -3
  22. package/dist/{chunk-DR2AOQDW.mjs.map → chunk-ZFELFXSM.mjs.map} +1 -1
  23. package/dist/cost/index.mjs +6 -6
  24. package/dist/curation/index.d.ts +2 -2
  25. package/dist/curation/index.mjs +6 -6
  26. package/dist/{evaluate-BCFSdYJh.d.ts → evaluate-ChQi1sh7.d.ts} +1 -1
  27. package/dist/{index-BG_DyoXP.d.ts → index-D75ALRM7.d.ts} +1 -1
  28. package/dist/{index-BLuu7OZP.d.ts → index-DigHyBLg.d.ts} +2 -2
  29. package/dist/index.d.ts +5 -5
  30. package/dist/index.mjs +11 -11
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/llm/index.d.ts +1 -1
  33. package/dist/llm/index.mjs +2 -2
  34. package/dist/overlay/index.d.ts +1 -1
  35. package/dist/picker/index.d.ts +4 -4
  36. package/dist/route-identity/index.d.ts +1 -1
  37. package/dist/route-identity/index.mjs +2 -2
  38. package/dist/schema/index.d.ts +21 -0
  39. package/dist/schema/index.mjs +1 -1
  40. package/package.json +1 -1
  41. package/dist/chunk-N23C5AL6.mjs.map +0 -1
  42. package/dist/chunk-TTIJME5T.mjs.map +0 -1
  43. package/dist/chunk-WDIFBFY5.mjs.map +0 -1
@@ -13,6 +13,16 @@ var LlmPricingSchema = z.object({
13
13
  creditOutputPer1M: z.number().nonnegative(),
14
14
  cacheReadMultiplier: z.number().nonnegative().optional(),
15
15
  cacheWriteMultiplier: z.number().nonnegative().optional(),
16
+ // Prompt-length tiers (Claude Haiku 5.5 over 100k, …). See `LLMPricing.tiers`.
17
+ tiers: z.array(
18
+ z.object({
19
+ aboveInputTokens: z.number().int().nonnegative(),
20
+ inputPer1M: z.number().nonnegative(),
21
+ outputPer1M: z.number().nonnegative(),
22
+ cacheReadMultiplier: z.number().nonnegative().optional(),
23
+ cacheWriteMultiplier: z.number().nonnegative().optional()
24
+ })
25
+ ).optional(),
16
26
  // Router (how we call the model) vs vendor (who made it). See
17
27
  // `LLMPricing` in ../llm/catalog.ts for the contract.
18
28
  provider: z.string().optional(),
@@ -148,5 +158,5 @@ var ModelEntrySchema = z.discriminatedUnion("kind", [
148
158
  ]);
149
159
 
150
160
  export { AudioCapabilitiesSchema, AudioEntrySchema, AudioPricingSchema, ImageAspectRatioSchema, ImageCapabilitiesSchema, ImageEntrySchema, ImagePricingSchema, ImageReferenceImagesSchema, LLMEntrySchema, LlmPricingSchema, ModelEntrySchema, VideoCapabilitiesSchema, VideoCostMultipliersSchema, VideoEntrySchema, VideoPricingSchema, VideoResolutionSchema };
151
- //# sourceMappingURL=chunk-TTIJME5T.mjs.map
152
- //# sourceMappingURL=chunk-TTIJME5T.mjs.map
161
+ //# sourceMappingURL=chunk-7U7XGVHP.mjs.map
162
+ //# sourceMappingURL=chunk-7U7XGVHP.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schema/llm.ts","../src/schema/image.ts","../src/schema/video.ts","../src/schema/audio.ts","../src/schema/index.ts"],"names":["z"],"mappings":";;;;;;;;AAQO,IAAM,gBAAA,GAAmB,EAAE,MAAA,CAAO;AAAA,EACvC,UAAA,EAAY,CAAA,CAAE,MAAA,EAAO,CAAE,WAAA,EAAY;AAAA,EACnC,WAAA,EAAa,CAAA,CAAE,MAAA,EAAO,CAAE,WAAA,EAAY;AAAA,EACpC,gBAAA,EAAkB,CAAA,CAAE,MAAA,EAAO,CAAE,WAAA,EAAY;AAAA,EACzC,iBAAA,EAAmB,CAAA,CAAE,MAAA,EAAO,CAAE,WAAA,EAAY;AAAA,EAC1C,qBAAqB,CAAA,CAAE,MAAA,EAAO,CAAE,WAAA,GAAc,QAAA,EAAS;AAAA,EACvD,sBAAsB,CAAA,CAAE,MAAA,EAAO,CAAE,WAAA,GAAc,QAAA,EAAS;AAAA;AAAA,EAExD,OAAO,CAAA,CACJ,KAAA;AAAA,IACC,EAAE,MAAA,CAAO;AAAA,MACP,kBAAkB,CAAA,CAAE,MAAA,EAAO,CAAE,GAAA,GAAM,WAAA,EAAY;AAAA,MAC/C,UAAA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;AAAA,EAChC,UAAA,EAAYA,CAAAA,CAAE,OAAA,EAAQ,CAAE,QAAA,EAAS;AAAA,EACjC,WAAA,EAAaA,CAAAA,CAAE,OAAA,EAAQ,CAAE,QAAA,EAAS;AAAA,EAClC,iBAAA,EAAmBA,CAAAA,CAAE,OAAA,EAAQ,CAAE,QAAA;AACjC,CAAC;AAGM,IAAM,kBAAA,GAAqBA,EAAE,MAAA,CAAO;AAAA,EACzC,aAAaA,CAAAA,CAAE,IAAA,CAAK,CAAC,eAAA,EAAiB,YAAY,CAAC,CAAA;AAAA,EACnD,QAAA,EAAUA,CAAAA,CAAE,MAAA,EAAO,CAAE,WAAA,EAAY;AAAA,EACjC,YAAA,EAAcA,CAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA,EAElC,YAAYA,CAAAA,CAAE,MAAA,EAAO,CAAE,WAAA,GAAc,QAAA,EAAS;AAAA;AAAA,EAE9C,oBAAoBA,CAAAA,CAAE,MAAA,EAAO,CAAE,WAAA,GAAc,QAAA;AAC/C,CAAC;AAOM,IAAM,gBAAA,GAAmBA,EAAE,MAAA,CAAO;AAAA,EACvC,GAAG,cAAA;AAAA,EACH,IAAA,EAAMA,CAAAA,CAAE,OAAA,CAAQ,OAAO,CAAA;AAAA,EACvB,YAAA,EAAc,uBAAA;AAAA,EACd,OAAA,EAAS,kBAAA;AAAA,EACT,kBAAkBA,CAAAA,CAAE,KAAA,CAAMA,EAAE,MAAA,EAAQ,EAAE,QAAA;AACxC,CAAC;;;AC5BM,IAAM,gBAAA,GAAmBA,CAAAA,CAAE,kBAAA,CAAmB,MAAA,EAAQ;AAAA,EAC3D,cAAA;AAAA,EACA,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA;AACF,CAAC","file":"chunk-7U7XGVHP.mjs","sourcesContent":["import { z } from \"zod\"\nimport { baseEntryShape } from \"./base.js\"\n\n/**\n * LLM pricing — token-based. Mirrors the historical `LLMPricing` shape in\n * `packages/core/src/config/llm-pricing.ts` so the existing\n * `calculateLLMCreditCost` formula carries over verbatim.\n */\nexport const LlmPricingSchema = z.object({\n inputPer1M: z.number().nonnegative(),\n outputPer1M: z.number().nonnegative(),\n creditInputPer1M: z.number().nonnegative(),\n creditOutputPer1M: z.number().nonnegative(),\n cacheReadMultiplier: z.number().nonnegative().optional(),\n cacheWriteMultiplier: z.number().nonnegative().optional(),\n // Prompt-length tiers (Claude Haiku 5.5 over 100k, …). See `LLMPricing.tiers`.\n tiers: z\n .array(\n z.object({\n aboveInputTokens: z.number().int().nonnegative(),\n inputPer1M: z.number().nonnegative(),\n outputPer1M: z.number().nonnegative(),\n cacheReadMultiplier: z.number().nonnegative().optional(),\n cacheWriteMultiplier: z.number().nonnegative().optional(),\n })\n )\n .optional(),\n // Router (how we call the model) vs vendor (who made it). See\n // `LLMPricing` in ../llm/catalog.ts for the contract.\n provider: z.string().optional(),\n vendor: z.string().optional(),\n})\nexport type LlmPricing = z.infer<typeof LlmPricingSchema>\n\nexport const LLMEntrySchema = z.object({\n ...baseEntryShape,\n kind: z.literal(\"llm\"),\n pricing: LlmPricingSchema,\n contextWindow: z.number().int().positive().optional(),\n})\nexport type LLMEntry = z.infer<typeof LLMEntrySchema>\n","import { z } from \"zod\"\nimport { baseEntryShape } from \"./base.js\"\n\nexport const ImageCapabilitiesSchema = z.object({\n generate: z.boolean(),\n edit: z.boolean(),\n upscale: z.boolean().optional(),\n})\nexport type ImageCapabilities = z.infer<typeof ImageCapabilitiesSchema>\n\nexport const ImageReferenceImagesSchema = z.object({\n supported: z.boolean(),\n fieldName: z.enum([\"image_input\", \"input_images\", \"input_image\", \"none\"]),\n maxCount: z.number().int().nonnegative(),\n singular: z.boolean(),\n})\nexport type ImageReferenceImages = z.infer<typeof ImageReferenceImagesSchema>\n\nexport const ImageAspectRatioSchema = z.object({\n supported: z.array(z.string()).min(1),\n default: z.string(),\n})\nexport type ImageAspectRatio = z.infer<typeof ImageAspectRatioSchema>\n\n/**\n * Pricing inputs for a model entry.\n *\n * Credit math is **derived at call time** by `computeCenticredits()` from\n * `baseCost × category-markup`. The catalog only carries the\n * production-cost input. An entry can opt out of the formula via\n * `overrideCreditCost` (strategic subsidy / partner pricing) — used\n * sparingly so a category-wide tune stays a one-line change in\n * `pricing/index.ts`.\n *\n * `costPerImage` / `costTier` / `creditCost` are deprecated but kept\n * readable so production data + admin UI keep parsing. New entries\n * should not set them.\n */\nexport const ImagePricingSchema = z.object({\n costPerImage: z.number().nonnegative().optional(),\n costTier: z.enum([\"low\", \"medium\", \"high\"]).optional(),\n billingUnit: z.literal(\"per_image\"),\n baseCost: z.number().nonnegative(),\n /** @deprecated Derived at call time. Kept for back-compat. */\n creditCost: z.number().nonnegative().optional(),\n /**\n * Strategic per-model override. When set, bypasses the formula and\n * the user is charged this many credits per output regardless of\n * provider cost or category markup.\n */\n overrideCreditCost: z.number().nonnegative().optional(),\n})\nexport type ImagePricing = z.infer<typeof ImagePricingSchema>\n\nexport const ImageEntrySchema = z.object({\n ...baseEntryShape,\n kind: z.literal(\"image\"),\n capabilities: ImageCapabilitiesSchema,\n referenceImages: ImageReferenceImagesSchema,\n aspectRatio: ImageAspectRatioSchema,\n output: z.enum([\"string\", \"array\"]),\n pricing: ImagePricingSchema,\n triggerWord: z.string().optional(),\n})\nexport type ImageEntry = z.infer<typeof ImageEntrySchema>\n","import { z } from \"zod\"\nimport { baseEntryShape } from \"./base.js\"\n\nexport const VideoCapabilitiesSchema = z.object({\n textToVideo: z.boolean(),\n imageToVideo: z.boolean(),\n subjectReference: z.boolean(),\n audio: z.boolean(),\n})\nexport type VideoCapabilities = z.infer<typeof VideoCapabilitiesSchema>\n\nexport const VideoResolutionSchema = z.enum([\n \"480p\",\n \"540p\",\n \"720p\",\n \"1080p\",\n \"1440p\",\n \"4k\",\n])\nexport type VideoResolution = z.infer<typeof VideoResolutionSchema>\n\n/**\n * Mirrors `CostMultipliers` from `the app integration-core`. Keys are\n * stringified so JSON round-trips cleanly.\n */\nexport const VideoCostMultipliersSchema = z.object({\n resolution: z.record(z.string(), z.number().positive()).optional(),\n duration: z.record(z.string(), z.number().positive()).optional(),\n mode: z.record(z.string(), z.number().positive()).optional(),\n})\nexport type VideoCostMultipliers = z.infer<typeof VideoCostMultipliersSchema>\n\nexport const VideoPricingSchema = z.object({\n costPerClip: z.number().nonnegative().optional(),\n costTier: z.enum([\"low\", \"medium\", \"high\"]).optional(),\n billingUnit: z.enum([\"per_clip\", \"per_second\"]),\n baseCost: z.number().nonnegative(),\n baseCostUnit: z.string(),\n /** Provider-cost multipliers (resolution / duration / mode). */\n multipliers: VideoCostMultipliersSchema.optional(),\n /** @deprecated Derived at call time. */\n creditCost: z.number().nonnegative().optional(),\n /**\n * @deprecated Use `multipliers` (provider-side) + per-category markup\n * in `pricing-registry`. The credit multipliers used to be a parallel\n * structure; now the formula re-applies `multipliers` to the derived\n * credit count automatically.\n */\n creditMultipliers: VideoCostMultipliersSchema.optional(),\n /** Strategic per-model override — bypasses the formula. */\n overrideCreditCost: z.number().nonnegative().optional(),\n})\nexport type VideoPricing = z.infer<typeof VideoPricingSchema>\n\nexport const VideoEntrySchema = z.object({\n ...baseEntryShape,\n kind: z.literal(\"video\"),\n capabilities: VideoCapabilitiesSchema,\n maxDuration: z.number().positive(),\n supportedResolutions: z.array(VideoResolutionSchema).min(1),\n supportedAspectRatios: z.array(z.string()).min(1),\n pricing: VideoPricingSchema,\n})\nexport type VideoEntry = z.infer<typeof VideoEntrySchema>\n","import { z } from \"zod\"\nimport { baseEntryShape } from \"./base.js\"\n\n// Single source of truth for audio model capabilities — mirrors (and is\n// re-used by) the runtime `AudioModelDefinition` in `audio/catalog.ts`.\n// Modality is multi-valued boolean flags (`tts`/`stt`/`s2s`) — a model may\n// do more than one; `s2s` is a speech↔speech engine (distinct from a\n// tts+llm+stt cascade). Transport (`streaming`) is a SEPARATE axis.\nexport const AudioCapabilitiesSchema = z.object({\n tts: z.boolean().optional(),\n stt: z.boolean().optional(),\n s2s: z.boolean().optional(),\n languages: z.array(z.string()),\n voiceCloning: z.boolean().optional(),\n streaming: z.boolean().optional(),\n timestamps: z.boolean().optional(),\n diarization: z.boolean().optional(),\n languageDetection: z.boolean().optional(),\n})\nexport type AudioCapabilities = z.infer<typeof AudioCapabilitiesSchema>\n\nexport const AudioPricingSchema = z.object({\n billingUnit: z.enum([\"per_character\", \"per_second\"]),\n baseCost: z.number().nonnegative(),\n baseCostUnit: z.string().optional(),\n /** @deprecated Derived at call time from `baseCost × category-markup`. */\n creditCost: z.number().nonnegative().optional(),\n /** Strategic per-model override — bypasses the formula. */\n overrideCreditCost: z.number().nonnegative().optional(),\n})\nexport type AudioPricing = z.infer<typeof AudioPricingSchema>\n\n// Voices are NOT per-model metadata — they live in the shared, provider-\n// neutral voice catalog (an app voice-catalog module,\n// `CatalogVoice`), referenced by id. The old per-entry `voice` placeholder\n// (+ its `VoiceMetadataSchema`) was never populated — removed.\nexport const AudioEntrySchema = z.object({\n ...baseEntryShape,\n kind: z.literal(\"audio\"),\n capabilities: AudioCapabilitiesSchema,\n pricing: AudioPricingSchema,\n supportedLocales: z.array(z.string()).optional(),\n})\nexport type AudioEntry = z.infer<typeof AudioEntrySchema>\n","import { z } from \"zod\"\nimport { LLMEntrySchema } from \"./llm.js\"\nimport { ImageEntrySchema } from \"./image.js\"\nimport { VideoEntrySchema } from \"./video.js\"\nimport { AudioEntrySchema } from \"./audio.js\"\n\nexport * from \"./base.js\"\nexport * from \"./llm.js\"\nexport * from \"./image.js\"\nexport * from \"./video.js\"\nexport * from \"./audio.js\"\nexport * from \"./voice.js\"\n\n/** Discriminated union over every kind. */\nexport const ModelEntrySchema = z.discriminatedUnion(\"kind\", [\n LLMEntrySchema,\n ImageEntrySchema,\n VideoEntrySchema,\n AudioEntrySchema,\n])\nexport type ModelEntry = z.infer<typeof ModelEntrySchema>\n"]}
@@ -1,5 +1,5 @@
1
- import { listModels } from './chunk-JTWZ2BXT.mjs';
2
- import { modelHasTag } from './chunk-3MQVOHXC.mjs';
1
+ import { listModels } from './chunk-YGKXLIZQ.mjs';
2
+ import { modelHasTag } from './chunk-HKPGUJ6C.mjs';
3
3
 
4
4
  /**
5
5
  * @agentproto/model-catalog v0.1.0
@@ -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-PD7TZ6PJ.mjs.map
134
- //# sourceMappingURL=chunk-PD7TZ6PJ.mjs.map
133
+ //# sourceMappingURL=chunk-ARZ2NGZS.mjs.map
134
+ //# sourceMappingURL=chunk-ARZ2NGZS.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,EAAO,aAAa,SAAA,EAAW,CAAC,WAAW,CAAA,EAAE;AAAA,EAChE,EAAE,IAAI,UAAA,EAAY,KAAA,EAAO,YAAY,SAAA,EAAW,CAAC,UAAU,CAAA,EAAE;AAAA,EAC7D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AA,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-PD7TZ6PJ.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,IAAM,eAAA,GAA4C;AAAA,EAChD,EAAE,IAAI,QAAA,EAAU,KAAA,EAAO,UAAU,SAAA,EAAW,CAAC,QAAA,EAAU,iBAAiB,CAAA,EAAE;AAAA,EAC1E,EAAE,IAAI,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AAG,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-ARZ2NGZS.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"]}