/** * Codex model discovery — the 3-tier resolution chain, in one place. * * Split from `./codex-protocol.ts` on purpose: this module imports the * `CODEX_MODELS` catalog, and the runtime provider needs the protocol (to * refresh a token) without paying for the catalog. Keeping them apart means * `../openai-codex.ts` can import one and not the other. * * Resolution order — the live backend is authoritative, the catalog is the * offline answer, and the inline list is the never-happens floor: * * 1. **Live backend** — `GET /models`, filtered to ids that are * still current for ChatGPT sign-in. * 2. **models.dev catalog** — the `openai` provider's models whose `family` * is `gpt-codex` / `gpt-codex-spark`, filtered the same way. * 3. **Inline fallback** — {@link FALLBACK_CODEX_MODELS}, derived from core's * `CODEX_MODELS`. Only reachable on a fresh install with no network. * * @module oauth/codex-models */ import type { ModelsRegistry } from '@wrongstack/core/types'; /** * Recommended Codex models for ChatGPT sign-in. Derived from `CODEX_MODELS` in * core, the single source of truth for Codex id/name/description. */ export declare const FALLBACK_CODEX_MODELS: ReadonlyArray<{ id: string; name: string; }>; /** Families in the models.dev catalog that indicate Responses-API compatibility. */ export declare const CODEX_CATALOG_FAMILIES: Set; export declare function fallbackCodexModelIds(): string[]; export declare function fallbackCodexProviderModels(): Array<{ id: string; name: string; }>; /** * Narrow a list of available model ids to the ones still current for ChatGPT * sign-in. Used to drop deprecated ids from a live `/models` response and to * pick current ids out of the models.dev catalog. */ export declare function filterCurrentCodexModelIds(ids: Iterable): string[]; export declare function isCodexCatalogModel(model: { family?: string | undefined; }): boolean; /** * Fetch the account's available Codex model ids live from the ChatGPT backend. * Best-effort: returns `[]` on any failure so login still succeeds and the * caller falls through to the catalog or the inline list. */ export declare function fetchCodexModels(accessToken: string, baseUrl?: string | undefined, signal?: AbortSignal): Promise; /** * Resolve the available Codex model ids through the 3-tier chain documented at * the top of this module. * * @param modelsRegistry - optional; tier 2 is skipped when absent. * @param accessToken - accepted as a promise so a caller can start the request * before the token has settled. */ export declare function resolveCodexModels(modelsRegistry: ModelsRegistry | undefined, accessToken: string | Promise, baseUrl?: string | undefined, signal?: AbortSignal): Promise; //# sourceMappingURL=codex-models.d.ts.map