mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-14 02:42:24 +03:00
Validado em lote numa worktree combinada com #12524, #12538, #12277 e #12367 sobre o tip de release/v3.8.51: os quatro boardaram sem conflito (áreas disjuntas — zai-web, nvidia, clova, cursor/devin/fable). typecheck:core limpo, check:provider-consistency OK (272 entradas REGISTRY, 355 providers canônicos), check:known-symbols OK, e 305/305 nos testes tocados pelos quatro PRs. Os IDs de modelo adicionados foram conferidos individualmente. Obrigado, @backryun.
28 lines
1.0 KiB
TypeScript
28 lines
1.0 KiB
TypeScript
import {
|
|
CLAUDE_CODE_CLIENT_VERSION,
|
|
CLAUDE_CODE_RUNTIME_VERSION,
|
|
CLAUDE_CODE_SDK_PACKAGE_VERSION,
|
|
getClaudeCodeUserAgent,
|
|
} from "@/shared/constants/claudeCodeClient";
|
|
|
|
export const CLAUDE_CODE_COMPATIBLE_VERSION = CLAUDE_CODE_CLIENT_VERSION;
|
|
export const CLAUDE_CODE_COMPATIBLE_USER_AGENT = getClaudeCodeUserAgent("sdk-cli");
|
|
export const CLAUDE_CODE_COMPATIBLE_STAINLESS_PACKAGE_VERSION = CLAUDE_CODE_SDK_PACKAGE_VERSION;
|
|
export const CLAUDE_CODE_COMPATIBLE_STAINLESS_RUNTIME_VERSION = CLAUDE_CODE_RUNTIME_VERSION;
|
|
const CONTEXT_1M_NATIVE_MODELS = ["claude-fable-5-1", "claude-opus-5"];
|
|
|
|
export function modelHasNativeContext1m(model: string | null | undefined): boolean {
|
|
const normalizedModel = String(model || "")
|
|
.trim()
|
|
.toLowerCase()
|
|
.replace(/^.*?(?=claude-)/, "")
|
|
.replace(/-\d{8}$/, "");
|
|
|
|
return CONTEXT_1M_NATIVE_MODELS.some(
|
|
(supported) =>
|
|
normalizedModel === supported ||
|
|
(normalizedModel.startsWith(`${supported}-`) &&
|
|
!/^\d/.test(normalizedModel.slice(supported.length + 1)))
|
|
);
|
|
}
|