- migrate web UI to shared Base UI primitives (alerts, buttons, combobox, toast, etc.) - refactor chat and branch toolbars to use new components and cleaner interactions - add cross-platform file-manager fallback in `openInEditor` server handling - update model contracts/tests and web dependencies to support new UI flow
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
export const MODEL_OPTIONS = [
|
|
{ slug: "gpt-5.3-codex", name: "GPT-5.3 Codex" },
|
|
{ slug: "gpt-5.3-codex-spark", name: "GPT-5.3 Codex Spark" },
|
|
{ slug: "gpt-5.2-codex", name: "GPT-5.2 Codex" },
|
|
{ slug: "gpt-5.2", name: "GPT-5.2" },
|
|
] as const;
|
|
|
|
export type ModelSlug = (typeof MODEL_OPTIONS)[number]["slug"];
|
|
|
|
export const DEFAULT_MODEL = "gpt-5.3-codex";
|
|
|
|
export const MODEL_SLUG_ALIASES: Record<string, ModelSlug> = {
|
|
"5.3": "gpt-5.3-codex",
|
|
"gpt-5.3": "gpt-5.3-codex",
|
|
"5.3-spark": "gpt-5.3-codex-spark",
|
|
"gpt-5.3-spark": "gpt-5.3-codex-spark",
|
|
};
|
|
|
|
export function normalizeModelSlug(model: string | null | undefined): ModelSlug | null {
|
|
if (typeof model !== "string") {
|
|
return null;
|
|
}
|
|
|
|
const trimmed = model.trim();
|
|
if (!trimmed) {
|
|
return null;
|
|
}
|
|
|
|
return MODEL_SLUG_ALIASES[trimmed] ?? (trimmed as ModelSlug);
|
|
}
|
|
|
|
export function resolveModelSlug(model: string | null | undefined): ModelSlug {
|
|
const normalized = normalizeModelSlug(model);
|
|
if (!normalized) {
|
|
return DEFAULT_MODEL;
|
|
}
|
|
|
|
return MODEL_OPTIONS.some((option) => option.slug === normalized) ? normalized : DEFAULT_MODEL;
|
|
}
|