import type { Api, Model as ApiModel } from "./types"; /** User-facing thinking levels, ordered least to most intensive. */ export declare const enum Effort { Minimal = "minimal", Low = "low", Medium = "medium", High = "high", XHigh = "xhigh", Max = "max" } export declare const THINKING_EFFORTS: readonly Effort[]; /** * Static fallback model injected when Cloudflare AI Gateway discovery * returns no results. Ensures the provider always has at least one usable * model entry in the catalog. */ export declare const CLOUDFLARE_FALLBACK_MODEL: ApiModel<"anthropic-messages">; /** * Returns a copy of the model with canonical thinking metadata attached. * * This helper belongs to catalog enrichment only. Runtime consumers should * trust `model.thinking` and avoid inferring capabilities on demand. */ export declare function enrichModelThinking(model: ApiModel): ApiModel; /** * Returns a copy of the model with thinking metadata recomputed from the * canonical rules, replacing any existing `thinking`. */ export declare function refreshModelThinking(model: ApiModel): ApiModel; /** * Extract the GLM generation from a Zhipu/ZAI model id: `glm-5.3` and * `glm-5.3-flash` -> 5.3, `glm-5` and `glm-5-turbo` -> 5, `glm-4.7` -> 4.7. * Returns undefined for ids that are not a plain GLM generation, including the * vision line (`glm-5v-turbo`), so those never inherit text-model corrections. */ export declare function glmGeneration(modelId: string): number | undefined; /** * Apply upstream metadata corrections to a mutable array of models. * * Each model is first normalized through `refreshModelThinking()` so generated * catalogs keep canonical thinking metadata and policy fixes in one pass. */ export declare function applyGeneratedModelPolicies(models: ApiModel[]): void; /** * Link OpenAI model variants to their context promotion targets. * * When a model's context is exhausted, the agent can promote to a sibling * model with a larger context window on the same provider: * - `OpenAI code backend-spark` variants promote to `gpt-5.5`. * * `gpt-5.5` itself is a 1M-context model and is not demoted to `gpt-5.4` * (which has a smaller window), so it has no promotion target. */ export declare function linkOpenAIPromotionTargets(models: ApiModel[]): void; /** * Returns the supported thinking efforts declared on the model metadata. * * Catalog enrichment is responsible for normalizing bundled model metadata up front. * Runtime callers must treat explicit `model.thinking` on custom models as authoritative * so proxy-specific overrides from `models.yml` survive request construction. * * @throws Error when a reasoning-capable model is missing thinking metadata */ export declare function getSupportedEfforts(model: ApiModel): readonly Effort[]; /** * Clamps a requested thinking level against explicit model metadata. * * Non-reasoning models always resolve to `undefined`. */ export declare function clampThinkingLevelForModel(model: ApiModel | undefined, requested: Effort | undefined): Effort | undefined; export declare function requireSupportedEffort(model: ApiModel, effort: Effort): Effort; /** Maps a normalized thinking effort to Google's `thinkingLevel` enum values. */ export declare function mapEffortToGoogleThinkingLevel(model: ApiModel, effort: Effort): "MINIMAL" | "LOW" | "MEDIUM" | "HIGH"; /** Maps a normalized thinking effort to Anthropic adaptive effort values. */ export declare function mapEffortToAnthropicAdaptiveEffort(model: ApiModel, effort: Effort): "low" | "medium" | "high" | "xhigh" | "max"; /** * Returns true for Anthropic models with Opus 4.7 API restrictions: * - Sampling parameters (temperature/top_p/top_k) return 400 error * - Thinking content is omitted by default (needs display: "summarized") */ export declare function hasOpus47ApiRestrictions(modelId: string): boolean;