/** * Reasoning-tier family collapse + OpenCode variant routing. * * Cursor exposes many models as distinct slugs per effort * (`grok-4.5-fast-high`, `claude-4.6-opus-high`, …). OpenCode's picker UX is * base model + Select variant. This module: * 1. Collapses effort-suffixed catalogs into one base entry per family * 2. Builds the non-empty `variants` map that suppresses OpenCode's generic * low/medium/high auto-fill for openai-compatible providers * 3. Resolves `(baseId, reasoning_effort)` → Cursor slug/parameters * * Dependency-free (safe for bin/setup.ts bundling). */ import type { CursorModel, CursorModelParameter, CursorModelVariantMetadata } from "./model-fallbacks"; /** Known effort tokens that may appear as a trailing `-` on a model id. */ export declare const EFFORT_SUFFIXES: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"]; export type EffortSuffix = (typeof EFFORT_SUFFIXES)[number]; export interface EffortSplit { stem: string; /** Trailing effort token on the id, or null if none. */ effort: EffortSuffix | null; } export declare function splitEffortId(id: string): EffortSplit; /** * Map Cursor's current `cursor-grok-4.6-high-fast` slugs onto the collapse * convention (`grok-4.6-fast-high`). Unmatched ids pass through unchanged. */ export declare function remapCursorGrokSlug(id: string): string; export declare function isGrokEffortFamily(stem: string): boolean; /** True when this id/stem is the removed non-fast grok-4.5 family. */ export declare function isRemovedNonFastGrok(idOrStem: string): boolean; /** Map a Cursor slug effort suffix → OpenCode variant key for this family. */ export declare function openCodeEffortFromSlugSuffix(stem: string, slugSuffix: string, applyLegacyGrokShift?: boolean): string; /** Map an OpenCode variant key → Cursor slug effort suffix for this family. */ export declare function slugSuffixFromOpenCodeEffort(stem: string, openCodeEffort: string, applyLegacyGrokShift?: boolean): string; /** Extract the OpenCode effort key stored on a variant (or derive from publicId). */ export declare function variantOpenCodeEffort(stem: string, variant: CursorModelVariantMetadata): string; /** * Collapse effort-suffixed models that share a stem into one base entry. * Models without an effort suffix and with a unique stem pass through unchanged * (aside from carrying any pre-existing variants). */ export declare function collapseModelsToFamilies(models: readonly CursorModel[]): CursorModel[]; /** * OpenCode `model.variants` map. Non-empty so ProviderTransform.variants is * skipped. Single-tier reasoning models get `{ default: {} }` only. */ export declare function opencodeVariantsForFamily(model: CursorModel): Record; export interface ResolvedEffortSelection { publicId: string; cursorModelId: string; displayName: string; parameters: CursorModelParameter[]; maxMode: boolean; } /** * Pick the Cursor selection for a catalog model + optional OpenCode effort. * Legacy full slugs are expected to be resolved to a catalog entry (via id / * aliases / legacySlugs) before calling this; when the matched model is a * collapsed family, `effort` selects the tier. When the matched model is * itself a legacy alias hit that was looked up by full slug, pass the slug * effort via `matchedById` semantics: if `effort` is empty and model.id is a * stem, use the default variant. */ export declare function resolveEffortSelection(model: CursorModel, effort?: string | null, opts?: { matchedId?: string; }): ResolvedEffortSelection;