import { readAuthForModel } from "./config.ts"; import type { ApiKeyAuth, ApiKeyModelConfig, Config, CodexModelConfig, OAuthLoadedAuth, } from "./config.ts"; function expectType(_: T) {} declare const apiModel: ApiKeyModelConfig; declare const codexModel: CodexModelConfig; declare const config: Config; expectType(apiModel.baseUrl); // @ts-expect-error Codex models use the fixed Codex backend and do not have a base URL. expectType(codexModel.baseUrl); async function checkReadAuthForModelTypes() { const apiAuth = await readAuthForModel(apiModel, config); if (apiAuth.ok) { expectType(apiAuth.auth); // @ts-expect-error API-key models cannot resolve to OAuth auth. expectType(apiAuth.auth); } const codexAuth = await readAuthForModel(codexModel, config); if (codexAuth.ok) { expectType(codexAuth.auth); // @ts-expect-error Codex models cannot resolve to API-key auth. expectType(codexAuth.auth); } }