/** * Registry types for {@link https://github.com/x12i/ai-profiles | @x12i/ai-profiles}. * * An **AI profile** is a capability contract (e.g. `cheap`, `deep`, `json`) — what kind of * work is needed — not a specific model. Each profile has a **default choice** and optional * **choices** (alternatives) that map intent to `provider`, `modelId`, pricing, and runtime * defaults. Tasks should reference profiles (and optional choices), not vendor model names. * * @see README.md — “Why AI profiles” for the full design rationale. */ export type AIProvider = "openai" | "anthropic" | "google" | "deepseek" | "minimax" | "mistral" | "mistralai" | "qwen" | "moonshotai" | "zai" | "tencent" | "meta" | "perplexity" | "cohere" | "amazon" | "nvidia" | "microsoft" | "baidu" | "ai21" | "reka" | "upstage" | "groq" | "together" | "xai" | "local" | "custom" | "openrouter" /** OpenRouter org prefixes not yet given a dedicated alias. */ | (string & {}); /** Alias for evidence / routing identity (same as {@link AIProvider}). */ export type ProviderId = AIProvider; export type InstructionTier = "default" | "cpu" | "reasoning"; /** Supported input/output media for a model or profile intent contract. */ export type ModelModality = "text" | "image" | "audio" | "video" | "file"; /** OpenRouter routing preference (`0`/`1`, strings, booleans). Defaults to true when omitted. */ export type PreferOpenRouterInput = boolean | 0 | 1 | "0" | "1" | "true" | "false" | string; export interface CostTierSpec { /** * Stable key that callers use (e.g. "tier1", "tier2", "budget", "premium"). * When `ResolveAIProfileOptions.costTier` matches this key, its `cap` is applied. */ key: string; label?: string; cap: CostCapPer1M; } export type ModelFocusPreset = "input" | "reasoning" | "output"; export interface ModelCapabilityFilter { reasoning?: boolean; structuredOutput?: boolean; tools?: boolean; } export interface ModelSignals { /** * Stable boolean that communicates whether the resolved model is a reasoning-capable SKU. * Derived from the models catalog (`capabilities.reasoning` → `capabilities.supportsReasoning`). */ isReasoningModel: boolean; supportsStructuredOutput?: boolean; supportsTools?: boolean; contextWindow?: number; /** Max completion/output tokens from catalog (`maxCompletionTokens` on the catalog row). */ maxOutputTokens?: number; } /** * OpenRouter model-browser lane. Profiles declare a lane so resolution only * pulls models relevant to that workload (text chat vs image vs embeddings, …). */ export type ProfileCatalogLane = "text" | "image" | "embeddings" | "audio" | "video" | "rerank" | "speech" | "transcription"; /** * Short discovery tags (2–6 chars). Many per profile; partial overlap is OK for ranking. * Vendor affinity: `ds`, `ggl`, `xai`, `mmx`, `ant`, `oai`. * * See {@link listAIProfileTags} / `AI_PROFILE_TAG_GLOSSARY` for labels and meanings. */ export type ProfileTagMatchMode = "any" | "all"; export type AIProfileTag = "flg" | "eco" | "pro" | "exp" | "agt" | "sec" | "cyb" | "rsn" | "anl" | "for" | "aud" | "str" | "json" | "xtr" | "cls" | "cod" | "eng" | "res" | "cre" | "wrt" | "sum" | "vis" | "rte" | "tri" | "wf" | "bat" | "rev" | "spd" | "loc" | "vnd" | "ds" | "ggl" | "xai" | "mmx" | "ant" | "oai"; /** Tag usage row for registry-backed discovery UIs. */ export interface AIProfileTagUsage { tag: AIProfileTag; /** Profiles that include this tag. */ profiles: string[]; count: number; label?: string; category?: string; description?: string; } /** Required or actual input/output media for profile resolution. */ export interface ModalityContract { input: ModelModality[]; output: ModelModality[]; } export type AIProfileBackend = "openrouter" | "llama-cpp" | "ollama" | "lmstudio" | "vllm" | "transformersjs" | "onnxruntime" | "custom"; export interface CostCapPer1M { /** Max USD per 1M input tokens. */ maxInput?: number; /** Max USD per 1M output tokens. */ maxOutput?: number; /** Max average of input and output rates (USD per 1M tokens). */ maxBlended?: number; } /** Shorthand: applies the same ceiling to input and output rates. */ export type CostCapOption = number | CostCapPer1M; export interface AIModelPricing { input?: number; cachedInput?: number; output?: number; batchInput?: number; batchCachedInput?: number; batchOutput?: number; cacheWrite5m?: number; cacheWrite1h?: number; cacheHit?: number; inputBelow200k?: number; inputAbove200k?: number; outputBelow200k?: number; outputAbove200k?: number; notes?: string; } export interface AIRuntimeDefaults { reasoningEffort?: "minimal" | "low" | "medium" | "high" | "max"; outputMode?: "text" | "json" | "schema"; temperature?: number; toolPolicy?: "none" | "read-only" | "write-with-approval" | "write-allowed"; executionMode?: "sync" | "batch" | "offline"; requireCitations?: boolean; allowWeb?: boolean; allowFileSearch?: boolean; allowCodeExecution?: boolean; humanReview?: "none" | "before-write" | "before-final"; instructionTier?: InstructionTier; backend?: AIProfileBackend; } /** * One implementation option within a profile (e.g. `default`, `google_floor`, `openai_deep`). * Choices let the same profile intent use different providers, cost/quality trade-offs, or * capabilities (long context, batch execution) without changing caller code. */ export interface ProfileChoicePricingV2 { billingModel: "token" | "self_hosted"; currency: "USD"; unit: "1M_tokens"; priceStatus?: "standard" | "promotional" | "estimated"; notes?: string; standard?: { input?: number; output?: number; cachedInput?: number; }; batch?: { input?: number; output?: number; }; cache?: { write5m?: number; write1h?: number; hit?: number; write?: number; }; futureStandard?: { input?: number; output?: number; validUntil?: string; notes?: string; }; } export interface ProfileChoiceVerification { lastVerifiedAt?: string; sourceRefs?: string[]; } export interface ProfileChoiceLimits { contextWindow?: number; maxOutputTokens?: number; } export type ModelAvailabilityStatus = "verified" | "predicted"; export type DeploymentType = "proprietary" | "openWeightsHosted" | "selfHosted"; export interface ProfileRequiredCapabilities { reasoning?: "minimal" | "low" | "medium" | "high" | "max"; coding?: boolean; context?: "standard" | "large" | "xlarge"; cost?: "low" | "medium" | "high"; speed?: "high"; latency?: "low"; quality?: "high" | "premium"; structuredOutput?: boolean; supportsJsonSchema?: boolean; supportsVision?: boolean; supportsTools?: boolean; /** Required input media for tasks using this profile (e.g. `text`, `image`). */ inputModalities?: ModelModality[]; /** Required output media for tasks using this profile (e.g. `text`). */ outputModalities?: ModelModality[]; } export interface ModelCapabilitiesSnapshot { contextWindow?: number; maxOutputTokens?: number; supportsVision?: boolean; supportsTools?: boolean; supportsReasoning?: boolean; supportsJsonSchema?: boolean; supportsCaching?: boolean; supportsBatch?: boolean; supportsStreaming?: boolean; inputModalities?: ModelModality[]; outputModalities?: ModelModality[]; /** OpenRouter `reasoning: { effort }` is supported for this model. */ supportsOpenRouterReasoningParam?: boolean; /** Catalog defines `internalReasoning` pricing separate from prompt tokens. */ hasReasoningPricing?: boolean; /** Suggested `reasoning.effort` when gateway does not set runtime override. */ suggestedReasoningEffort?: "low" | "medium" | "high"; } /** Companion model for dual-model flows (review, escalation, verification). */ export type SecondaryRef = { kind: "choice"; choice: string; reason?: string; runtime?: AIRuntimeDefaults; } | { kind: "model"; provider: AIProvider; modelId: string; reason?: string; runtime?: AIRuntimeDefaults; }; export interface AIProfileChoice { choice: string; /** * Optional override labels for this choice. * If omitted, resolution should hydrate from the models catalog (or generate a fallback). */ displayName?: string; description?: string; /** Canonical vendor-native model identifier. */ provider: AIProvider; modelId: string; /** Optional companion model when primary + secondary workflows are needed. */ secondary?: SecondaryRef; /** Whether the SKU is production-stable or a forward-looking placeholder. */ modelStatus?: ModelAvailabilityStatus; /** How the model is operated when not a proprietary vendor API. */ deploymentType?: DeploymentType; /** Legacy flat pricing and/or v2 nested pricing blocks. */ pricing?: AIModelPricing | ProfileChoicePricingV2; runtime?: AIRuntimeDefaults; reason?: string; status?: "active" | "experimental" | "deprecated"; verification?: ProfileChoiceVerification; limits?: ProfileChoiceLimits; /** Explicit modality override when catalog linkage is missing or ambiguous. */ modalities?: ModalityContract; metadata?: Record; } /** * Capability contract for a class of AI work (cost, speed, reasoning, structured output, * agentic tools, research, local inference). Resolved via {@link resolveAIProfile}. */ export interface AIProfileDefinition { profile: string; displayName: string; description: string; /** Grouping for filtering (`cost`, `speed`, `standard`, `reasoning`, `output`, `agentic`, `research`, `local`). */ category: string; /** * Vendor namespace profile (e.g. `openai/default`, `claude/sonnet-latest-model`). * When true, the resolver should avoid throwing UNKNOWN_CHOICE for inputs like `openai/gpt-4` * and instead fall through to direct model parsing. */ vendorFamily?: boolean; /** Discovery tags (`flagship`, `economic`, `pro`, `expert`, …). */ tags?: AIProfileTag[]; /** OpenRouter catalog lane (Text, Image, Embeddings, …). Required on every profile. */ catalogLane: ProfileCatalogLane; defaultChoice: string; choices: Record; /** Intent contract for dynamic model selection (Optimixer). */ requiredCapabilities?: ProfileRequiredCapabilities; /** Profile-level deployment strategy (e.g. open weights). */ deploymentType?: DeploymentType; /** Deterministic failover order when trimming vendors or choices. */ fallbackChoiceOrder?: string[]; /** * Default secondary choice key when a primary choice has no `secondary` ref. * Must exist in `choices`. */ defaultSecondaryChoice?: string; intendedUseCases?: string[]; status?: "active" | "experimental" | "deprecated"; runtime?: AIRuntimeDefaults; metadata?: Record; } export type ModelsProfilesSchemaId = "x12i.ai-profiles.models-profiles" | "x12i.ai-profiles.model-registry.v2" | "x12i.ai-profiles.model-registry.v3" | "x12i.ai-profiles.model-registry.v4"; export interface ModelsProfilesJson { schema: ModelsProfilesSchemaId; registryId?: string; /** Optional label in source JSON; not used for compatibility or selection logic. */ version?: string; generatedAt?: string; lastVerifiedAt?: string; namingConvention?: string; semantics?: Record; sourceCatalog?: { providers: Array<{ id: string; docsUrl?: string; }>; modelsCatalogUrl?: string; /** @deprecated Use modelsCatalogUrl */ openRouterCatalogUrl?: string; }; currency: "USD"; pricingUnit: "1M_tokens"; profiles: Record; } export type RegistrySourceMode = "auto" | "remote" | "bundled"; export interface AIProfilesRegistry { /** Copied from models-profiles when present; informational only. */ version?: string; generatedAt?: string; currency: "USD"; pricingUnit: "1M_tokens"; profiles: Record; source: "remote" | "bundled"; loadedAt: string; } export interface AIProfileSummary { profile: string; displayName: string; description: string; category: string; defaultChoice: string; choices: string[]; tags: AIProfileTag[]; catalogLane: ProfileCatalogLane; defaultProvider: AIProvider; defaultModelId: string; source: "remote" | "bundled"; /** Echo of registry `version` when present; not used by this package. */ registryVersion?: string; } export interface AIProfileWarning { code: "USING_BUNDLED_FALLBACK" | "PROFILE_DEPRECATED" | "CHOICE_DEPRECATED" | "PRICING_MISSING" | "MODEL_PREDICTED" | "PRICING_FROM_CATALOG" | "REMOTE_REFRESH_FAILED_USING_CACHE" | "OPENROUTER_UNAVAILABLE" | "CPU_LOCAL_PROFILE" | "MODEL_INPUT_FALLBACK_GUESS" | "CATALOG_BUNDLED_FALLBACK" | "CATALOG_REGISTRY_FALLBACK" | "CATALOG_PROFILE_REGISTRY_FALLBACK" | "CATALOG_PARSED_FALLBACK" | "SECONDARY_SAME_AS_PRIMARY"; message: string; } export interface ModelInvocationEndpoint { provider: AIProvider; modelId: string; } export interface ModelInvocation { direct: ModelInvocationEndpoint; openrouter: ModelInvocationEndpoint | null; } export type ModelRegistryKind = "linked" | "openrouter-only" | "local-only" | "faulty"; export type ModelLinkageStatus = "matched" | "faulty" | "skipped" | "catalog-miss"; export interface ModelRegistryLinkage { status: ModelLinkageStatus; openRouterCatalogId?: string; canonicalSlug?: string; matchMethod?: string; exemptReason?: string; } export interface ModelRegistryEntry { registryKey: string; kind: ModelRegistryKind; vendor: ModelInvocationEndpoint; invocation: ModelInvocation; linkage: ModelRegistryLinkage; usage: { profileChoices: Array<{ profile: string; choice: string; }>; }; } export interface ModelsRegistryJson { schema: "x12i.ai-profiles.models-registry"; version?: string; generatedAt?: string; inputs?: { openRouterCatalog?: { schema?: string; version?: string; generatedAt?: string; modelCount?: number; }; modelsProfiles?: { version?: string; generatedAt?: string; choiceCount?: number; }; }; models: Record; } export interface CatalogOpenRouterPricing { input?: number; output?: number; cachedInput?: number; cacheWrite?: number; batchInput?: number; batchOutput?: number; imageInput?: number; audioInput?: number; internalReasoning?: number; webSearchPerRequest?: number; } export interface CatalogOpenRouterCapabilities { reasoning?: boolean; toolCalling?: boolean; structuredOutputs?: boolean; imageGeneration?: boolean; } export interface CatalogDirectSlice { provider: AIProvider; modelId: string; /** * OpenRouter slug prefix when `provider` is `custom` (e.g. `qwen` for `qwen/qwen3.7-max`). * Not used for API calls — documents the upstream vendor namespace. */ vendorNamespace?: string; } export interface CatalogOpenRouterSlice { provider: "openrouter"; modelId: string; canonicalSlug?: string; status?: string; modalities?: { input?: string[]; output?: string[]; }; contextWindow?: number; maxCompletionTokens?: number; knowledgeCutoff?: string; pricing?: CatalogOpenRouterPricing; capabilities?: CatalogOpenRouterCapabilities; /** * Best-effort live signals (when available from sync tooling). * Omitted on bundled catalogs that don't include the fields. */ performance?: { throughputTokensPerSecP50?: number; latencyMsP50?: number; uptimePct30m?: number; measuredAt?: string; }; /** Optional cross-benchmark ranking score (higher is better). */ rankingScore?: number; /** Known OpenRouter suffix routing variants that are supported for this slug (informational). */ routingVariants?: string[]; } /** * Unified catalog model: two explicit call shapes (never conflate them). * - `direct` — vendor-native / direct API identity * - `openrouter` — OpenRouter transport (`provider` is always `openrouter`) */ export interface CatalogModelEntry { direct: CatalogDirectSlice; openrouter: CatalogOpenRouterSlice; displayName?: string; family?: string; /** * Curated vendor sub-family for discovery and vendor profiles (e.g. openai: mini/nano/o/gpt). * Distinct from the OpenRouter slug prefix (`family`). */ modelFamily?: string; status?: string; modalities?: CatalogOpenRouterSlice["modalities"]; contextWindow?: number; maxCompletionTokens?: number; knowledgeCutoff?: string; /** ISO timestamp derived from the OpenRouter `created` field when available. */ releasedAt?: string; /** * Discovery tags (same vocabulary as profiles). Derived + inherited during registry finish — * not hand-maintained per SKU. */ tags?: AIProfileTag[]; } export interface ModelsCatalogJson { schema: "x12i.ai-profiles.models-catalog"; version?: string; generatedAt?: string; currency: "USD"; pricingUnit: "1M_tokens"; sources: { openrouter: { catalogUrl: string; pricingUrl?: string; verifiedAt?: string; normalization?: string; }; }; notes?: string[]; models: CatalogModelEntry[]; } /** @deprecated Use {@link ModelsCatalogJson} */ export type OpenRouterModelsCatalogJson = ModelsCatalogJson; export interface ProfileVendorCoverageResult { profile: string; leadingVendorsPresent: AIProvider[]; leadingVendorsMissing: AIProvider[]; nonLeadingChoices: Array<{ choice: string; provider: AIProvider; }>; } export interface ValidateProfileVendorCoverageResult { ok: boolean; profiles: ProfileVendorCoverageResult[]; } export interface ProfileModalityMismatch { profile: string; choice: string; provider: string; modelId: string; required: ModalityContract; actual: ModalityContract; } export interface ProfileModalityCoverageResult { profile: string; requiredModalities: ModalityContract; mismatches: ProfileModalityMismatch[]; ready: boolean; } export interface ValidateProfileModalityCoverageResult { ok: boolean; profiles: ProfileModalityCoverageResult[]; } /** * Rich catalog-backed model snapshot: pricing, capabilities, limits, and optional raw catalog row. * Use {@link lookupBundledCatalogModel} / {@link resolveCatalogModelDetails} for slugs; * {@link resolveAIProfile} with `includeCatalog: true` for profile/choice. */ export interface ResolvedCatalogModel { input: string; provider: AIProvider; modelId: string; routing: "openrouter" | "direct"; invocation: ModelInvocation; displayName?: string; family?: string; status?: string; knowledgeCutoff?: string; catalogLane: ProfileCatalogLane; openRouterModelId?: string; canonicalSlug?: string; pricing?: AIModelPricing & { currency: "USD"; unit: "1M_tokens"; }; /** Raw OpenRouter pricing slice (image/audio/reasoning rates, web search, …). */ catalogPricing?: CatalogOpenRouterPricing; /** Context window in tokens (from catalog `contextWindow`). */ contextWindow?: number; /** Max completion/output tokens (from catalog `maxCompletionTokens`). */ maxCompletionTokens?: number; limits?: ProfileChoiceLimits; capabilities?: ModelCapabilitiesSnapshot; /** Raw OpenRouter capabilities slice from the catalog entry. */ catalogCapabilities?: CatalogOpenRouterCapabilities; modalities: ModalityContract; modelSignals: ModelSignals; /** Set when the model is linked to a profile choice. */ profileChoice?: { profile: string; choice: string; }; /** Full catalog row when requested via `includeCatalogEntry`. */ catalogEntry?: CatalogModelEntry; matchConfidence?: "exact" | "high" | "low" | "parsed"; warnings?: AIProfileWarning[]; } export interface LookupCatalogModelOptions { preferOpenRouter?: PreferOpenRouterInput; /** Attach the full `models-catalog.json` row on the result. */ includeCatalogEntry?: boolean; } export interface ResolveCatalogModelDetailsOptions extends LookupCatalogModelOptions { source?: RegistrySourceMode; refresh?: boolean; } /** Materialized profile + choice: model, pricing, runtime, and routing after registry resolution. */ export interface ResolvedAIProfile { input: string; /** Whether the input resolved through profile intent or direct model fallback. */ resolutionKind?: "profile" | "model"; profile: string; profileDisplayName: string; profileDescription: string; category: string; catalogLane: ProfileCatalogLane; choice: string; choiceDisplayName: string; choiceDescription: string; provider: AIProvider; modelId: string; /** How the resolved provider/model were routed (`openrouter` vs vendor-direct). */ routing: "openrouter" | "direct"; instructionTier: InstructionTier; backend: AIProfileBackend; pricing?: AIModelPricing & { currency: "USD"; unit: "1M_tokens"; }; /** Echo of choice modelStatus when present. */ modelStatus?: ModelAvailabilityStatus; limits?: ProfileChoiceLimits; capabilities?: ModelCapabilitiesSnapshot; /** Stable capability summary derived from catalog capabilities/limits. */ modelSignals: ModelSignals; /** Profile intent contract (from registry definition). */ requiredCapabilities?: ProfileRequiredCapabilities; /** Resolved model input/output media from catalog or choice override. */ modalities: ModalityContract; /** Input/output media required by the profile intent (after option overrides). */ requiredModalities: ModalityContract; /** Cost cap applied during choice selection, if any. */ costCapApplied?: CostCapPer1M; runtime: Required; metadata?: Record; reason?: string; source: "remote" | "bundled"; /** Echo of registry `version` when present; not used by this package. */ registryVersion?: string; loadedAt: string; expiresAt: string; /** Direct and OpenRouter call shapes for the resolved choice. */ invocation: ModelInvocation; warnings?: AIProfileWarning[]; /** Set when `resolveAIProfile` is called with `includeSecondary: true`. */ secondary?: ResolvedSecondaryModel | null; /** * Rich catalog snapshot (pricing, reasoning, raw catalog pricing/capabilities). * Set when `includeCatalog: true` on {@link resolveAIProfile}. */ catalogModel?: ResolvedCatalogModel; } /** Materialized secondary model for a resolved primary choice. */ export interface ResolvedSecondaryModel { profile: string; primaryChoice: string; secondaryChoice?: string; provider: AIProvider; modelId: string; routing: "openrouter" | "direct"; instructionTier: InstructionTier; backend: AIProfileBackend; pricing?: ResolvedAIProfile["pricing"]; modalities: ModalityContract; invocation: ModelInvocation; reason?: string; runtime: Required; modelSignals: ModelSignals; warnings?: AIProfileWarning[]; } export interface ResolveSecondaryModelResult { primary: Pick; secondary: ResolvedSecondaryModel | null; source: "remote" | "bundled"; loadedAt: string; } export interface AIProfileChoiceSummary { /** Canonical lookup key: `profile/choice`. */ key: string; profile: string; choice: string; profileDisplayName: string; choiceDisplayName: string; description: string; category: string; catalogLane: ProfileCatalogLane; provider: AIProvider; modelId: string; isDefaultChoice: boolean; source: "remote" | "bundled"; registryVersion?: string; } export interface ListAIProfileChoicesOptions { source?: RegistrySourceMode; refresh?: boolean; includeExperimental?: boolean; includeDeprecated?: boolean; category?: string; catalogLane?: ProfileCatalogLane; } export interface ResolveCatalogModelOptions { source?: RegistrySourceMode; refresh?: boolean; preferOpenRouter?: PreferOpenRouterInput; /** When true, attach `catalogModel` on the resolved result. */ includeCatalog?: boolean; includeCatalogEntry?: boolean; } export interface ListAIProfilesOptions { source?: RegistrySourceMode; refresh?: boolean; includeExperimental?: boolean; includeDeprecated?: boolean; category?: string; /** * Filter profiles by these tags (short ids like `cyb`, or aliases like `cyber`). * Use with `tagMatch`: `"any"` (default) or `"all"`. */ tags?: Array; /** `"any"` = match if any tag present; `"all"` = every tag required. */ tagMatch?: ProfileTagMatchMode; /** * Include `vendorFamily` / `category: "discovery"` profiles in tag/search pools. * Default `false`. Also auto-included when requested tags contain `vnd`. */ includeDiscovery?: boolean; /** Free-text search across profile keys, tags, descriptions, and choices. */ search?: string; /** Only profiles for this OpenRouter catalog lane (e.g. `text`, `image`). */ catalogLane?: ProfileCatalogLane; /** * Optional catalog-derived capability filter: only include profiles that have at least * one choice whose catalog capabilities match. */ capabilityFilter?: ModelCapabilityFilter; /** * Preset shorthand for capabilityFilter. * - "reasoning": requires a reasoning-capable model * - "output": requires structured output capability * - "input": prefers large-context / heavy-input models (catalog-derived heuristic) */ focus?: ModelFocusPreset; } export interface ResolveAIProfileOptions { source?: RegistrySourceMode; refresh?: boolean; /** * When true (default), remote models resolve via OpenRouter (`provider: "openrouter"`, * `modelId: "{vendor}/{model}"`). When false, use the choice's vendor provider and model id. * Falls back to `PREFER_OPENROUTER` in `.env` when omitted (`1`/`true` → OpenRouter, * `0`/`false` → direct). Azure and AWS routing are not supported yet. */ preferOpenRouter?: PreferOpenRouterInput; /** Restrict resolution to these vendors; auto-picks when default is outside the set. */ allowedProviders?: AIProvider[]; /** When auto-picking, rank {@link LEADING_VENDORS} ahead of other providers (default true). */ preferLeadingVendors?: boolean; /** * Override profile-required input media (e.g. `["text", "image"]`). * Choices whose catalog modalities do not satisfy the contract are excluded. */ inputModalities?: ModelModality[]; /** Override profile-required output media (default `["text"]` for most profiles). */ outputModalities?: ModelModality[]; /** * USD per 1M token cost ceiling when picking among profile choices. * A number applies to both input and output rates; use `{ maxInput, maxOutput, maxBlended }` for finer control. */ costCapPer1M?: CostCapOption; /** * Optional cost-tier key that maps to a `{ maxOutput, maxInput, maxBlended }` cap. * When provided and `costCapPer1M` is not set, it applies as the selection cap. */ costTier?: string; /** Override or extend the default tier table used by `costTier`. */ costTiers?: CostTierSpec[]; /** Optional catalog-derived capability filter applied when picking among choices. */ capabilityFilter?: ModelCapabilityFilter; /** Preset shorthand for capabilityFilter. */ focus?: ModelFocusPreset; /** * When false, allow choices without an OpenRouter catalog entry (only for `local`). * Default `true` for all other profiles. */ requireOpenRouterCatalog?: boolean; /** Must match the resolved profile's lane (`text`, `image`, …). Required. */ catalogLane: ProfileCatalogLane; /** When true, attach `secondary` on the resolved profile (extra catalog work). */ includeSecondary?: boolean; /** * When true, attach `catalogModel` with full catalog enrichment (pricing, reasoning, * raw catalog pricing/capabilities, optional catalog row). */ includeCatalog?: boolean; /** Pass through to catalog enrichment when `includeCatalog` is true. */ includeCatalogEntry?: boolean; } export interface ResolveSecondaryModelOptions { source?: RegistrySourceMode; refresh?: boolean; preferOpenRouter?: PreferOpenRouterInput; allowedProviders?: AIProvider[]; preferLeadingVendors?: boolean; inputModalities?: ModelModality[]; outputModalities?: ModelModality[]; catalogLane: ProfileCatalogLane; capabilityFilter?: ModelCapabilityFilter; focus?: ModelFocusPreset; } export interface LoadRegistryOptions { source?: RegistrySourceMode; refresh?: boolean; } export interface LoadRegistryResult { registry: AIProfilesRegistry; warnings: AIProfileWarning[]; } export interface ProfileStatisticsFilter { includeDeprecated?: boolean; includeExperimental?: boolean; category?: string; } export interface GetAIRegistryStatisticsOptions extends LoadRegistryOptions { /** Include models catalog counts (default true). */ includeCatalog?: boolean; /** Include profile↔catalog linkage counts (default true). */ includeLinkage?: boolean; includeDeprecated?: boolean; includeExperimental?: boolean; category?: string; } export interface AIRegistryStatistics { schema: "x12i.ai-profiles.registry-statistics"; generatedAt: string; sources: { profiles: "remote" | "bundled"; catalog?: "remote" | "bundled"; }; registry: { version?: string; loadedAt: string; currency: "USD"; pricingUnit: "1M_tokens"; }; profiles: { total: number; choices: number; uniqueProviders: number; providers: AIProvider[]; uniqueModelKeys: number; uniqueVendorModelIds: number; byStatus: Record; byCategory: Record; categories: string[]; averageChoicesPerProfile: number; }; catalog?: { totalModels: number; uniqueDirectProviders: number; directProviders: string[]; active: number; deprecated: number; withPricing: number; withReasoningCapability: number; catalogVersion?: string; generatedAt?: string; }; linkage?: { registryEntries: number; profileChoiceReferences: number; byLinkageStatus: Record; byKind: Record; matched: number; faulty: number; catalogMiss: number; skipped: number; }; } export type ProfileCatalogLinkageIssueCode = "embedded_api" | "catalog_miss" | "invocation_mismatch" | "routing_mismatch" | "heuristic_fallback" | "unstable_openrouter_slug"; export interface ProfileCatalogLinkageIssue { profile: string; choice: string; code: ProfileCatalogLinkageIssueCode; message: string; } export interface ValidateProfileCatalogLinkageResult { ok: boolean; issues: ProfileCatalogLinkageIssue[]; choiceCount: number; catalogLinked: number; exempt: number; } //# sourceMappingURL=types.d.ts.map