import type { DiscoveredEndpoint } from './gateway-generator.js'; interface ProfileEntry { model: string; backend: string; mode: string; /** PI `--provider` (= gateway endpoint group). Required for backend='pi'; omitted for claude/codex. */ provider?: string; fallback?: ProfileEntry[]; extraEnv?: Record; extraOption?: Record; } interface ProfilesFile { defaultProfile: string; profiles: Record; } /** A (mode, model) pair the user can pick as the source for plan/execute or fallback. */ export interface ModelChoice { mode: string; model: string; } export interface GenerateOpts { /** Explicit (mode, model) to use as the `plan` profile. Otherwise the first lexicographic choice. */ planChoice?: ModelChoice; /** Explicit (mode, model) to use as the `execute` profile. Same default rule as planChoice. */ executeChoice?: ModelChoice; /** Ordered fallback chain for the `plan` profile. */ planFallback?: ModelChoice[]; /** Ordered fallback chain for the `execute` profile. */ executeFallback?: ModelChoice[]; /** Additional models to register as standalone named profiles (profile name = model name). */ extraProfiles?: ModelChoice[]; } /** * Flatten endpoints to a list of (mode, model) choices the user can pick from. * Strictly sorted by (mode ASC, model ASC) — no tier or provider preference. */ export declare function listChoices(endpoints: DiscoveredEndpoint[]): ModelChoice[]; /** * Generate a profiles.json object from discovered endpoints. * * Generates exactly two profiles: `plan` and `execute`. * - If `planChoice` is omitted, picks the first lexicographic (mode, model) tuple. * - Same default rule for `execute`. * - Fallback chains are taken verbatim from `planFallback` / `executeFallback` (no auto-derivation). * - No tier classification, no auto-generated deepseek-pro / codex / etc. — users explicitly choose * what they want via cortex init's interactive UI. */ export declare function generateProfiles(endpoints: DiscoveredEndpoint[], opts?: GenerateOpts): ProfilesFile; /** * Merge generated profiles into existing profiles.json. * - Non-(plan/execute) existing profiles are always preserved. * - For `plan` and `execute`: `overwrite=true` replaces them with generated; * `overwrite=false` (default) preserves existing user customization. * - defaultProfile is only updated if the current default doesn't exist in merged. */ export declare function mergeProfilesJson(generated: ProfilesFile, outputDir?: string, overwrite?: boolean): ProfilesFile; export interface WriteProfilesOpts extends GenerateOpts { /** Output directory. Defaults to ~/.cortex/config. */ outputDir?: string; /** Force overwrite of existing `plan` / `execute` profiles. Default false. */ overwrite?: boolean; /** Additional models to register as standalone named profiles. */ extraProfiles?: ModelChoice[]; } /** * Write profiles.json to ~/.cortex/config/profiles.json (or outputDir/profiles.json). * Merges with existing file to preserve user customizations unless overwrite=true. */ export declare function writeProfilesJson(endpoints: DiscoveredEndpoint[], optsOrOutputDir?: WriteProfilesOpts | string): string; export {};