mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
refactor(open-sse): registry consolidation + DRY media/oauth/adhoc cleanup
- Single-source registry: oauth clientId/tokenUrl, usage URLs, image/embed configs, search defaultModel, codex fixedPort, google token url derive. - Remove 29 unused OmniRoute providers (registry 100→71); media intact. - De-adhoc: codex literals → registry format/oauth flags; reasoningInject, image/embed openrouter headers + xai bodyFields config-driven. - Add REGISTRY_TEMPLATE.js + expand PROVIDER_DEFAULTS/schema JSDoc. - Baselines updated; PROVIDERS 62 + alias 90 byte-for-byte, golden snapshots. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -20,15 +20,18 @@ export function mapStainlessArch() {
|
||||
}
|
||||
}
|
||||
|
||||
// Anthropic API version (single source — reused across claude-format providers/executors)
|
||||
export const ANTHROPIC_API_VERSION = "2023-06-01";
|
||||
|
||||
// Shared Claude-compatible API headers (reused across claude-format providers)
|
||||
export const CLAUDE_API_HEADERS = {
|
||||
"Anthropic-Version": "2023-06-01",
|
||||
"Anthropic-Version": ANTHROPIC_API_VERSION,
|
||||
"Anthropic-Beta": "claude-code-20250219,interleaved-thinking-2025-05-14"
|
||||
};
|
||||
|
||||
// Full Claude CLI fingerprint — required by providers that gate on client identity (e.g. agentrouter)
|
||||
export const CLAUDE_CLI_SPOOF_HEADERS = {
|
||||
"Anthropic-Version": "2023-06-01",
|
||||
"Anthropic-Version": ANTHROPIC_API_VERSION,
|
||||
"Anthropic-Beta": "claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28",
|
||||
"Anthropic-Dangerous-Direct-Browser-Access": "true",
|
||||
"User-Agent": "claude-cli/2.1.92 (external, sdk-cli)",
|
||||
@@ -47,6 +50,10 @@ export const CLAUDE_CLI_SPOOF_HEADERS = {
|
||||
// Shared baseUrls
|
||||
export const KIMI_CODING_BASE_URL = "https://api.kimi.com/coding/v1/messages";
|
||||
|
||||
// Default base for dynamic compat providers (openai-compatible-* / anthropic-compatible-*) when user gives no baseUrl
|
||||
export const OPENAI_COMPAT_BASE = "https://api.openai.com/v1";
|
||||
export const ANTHROPIC_COMPAT_BASE = "https://api.anthropic.com/v1";
|
||||
|
||||
// Antigravity OAuth client credentials (public CLI client — duplicated in usage.js + src/lib/oauth)
|
||||
export const ANTIGRAVITY_OAUTH_CLIENT = {
|
||||
clientId: "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",
|
||||
|
||||
Reference in New Issue
Block a user