refactor(registry): B2 migrate to LiteLLM-style schema — unified models[] with kind field

- 71 registry files: flat `media.*Config.models` → `models[]` with `kind` field
- `media` wrapper removed → serviceKinds, *Config fields promoted top-level
- `type` field renamed to `kind` (llm/image/tts/stt/embedding/embedding/video/music)
- providers/index.js: PROVIDER_MEDIA now built from flat top-level media fields
- shared/constants/providers.js: buildProviderEntry reads flat top-level media fields
- route /v1/models: modelKind() uses kind||type; removed subConfig merge block
- models/info route: removed sub-config fallback lookup (all models in PROVIDER_MODELS)
- ttsProviders/index.js: synthesizeViaConfig reads tts models from PROVIDER_MODELS
- test-models route, helpers.js, validate route: kind||type compat
- Baselines: PROVIDERS 62/62 ✅, Alias 90/90 ✅

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
decolua
2026-06-14 14:32:59 +07:00
parent e53ce79abb
commit dd1e0f9bcc
82 changed files with 2518 additions and 3651 deletions

View File

@@ -4,54 +4,43 @@ import { ANTIGRAVITY_OAUTH_CLIENT } from "../shared.js";
export default {
id: "antigravity",
alias: "ag",
uiAlias: "ag",
display: {
"name": "Antigravity",
"icon": "rocket_launch",
"color": "#F59E0B",
"website": "https://antigravity.google",
"notice": {
"signupUrl": "https://antigravity.google"
},
"deprecated": true,
"deprecationNotice": "RISK_NOTICE"
name: "Antigravity",
icon: "rocket_launch",
color: "#F59E0B",
website: "https://antigravity.google",
notice: {
signupUrl: "https://antigravity.google",
},
deprecated: true,
deprecationNotice: "RISK_NOTICE",
},
category: "oauth",
uiAlias: "ag",
transport: {
baseUrls: [
"https://daily-cloudcode-pa.googleapis.com",
"https://daily-cloudcode-pa.sandbox.googleapis.com"
"https://daily-cloudcode-pa.sandbox.googleapis.com",
],
format: "antigravity",
headers: { "User-Agent": `antigravity/1.107.0 ${platform()}/${arch()}` },
// 429/503 use computeRetryDelay hook (Retry-After header/body → cap, else backoff)
retry: { 429: { attempts: 6 }, 503: { attempts: 3 } },
headers: {
"User-Agent": "antigravity/1.107.0 darwin/arm64",
},
retry: {
"429": {
attempts: 6,
},
"503": {
attempts: 3,
},
},
usage: {
quotaApiUrl: "https://cloudcode-pa.googleapis.com/v1internal:fetchAvailableModels",
loadProjectApiUrl: "https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",
tokenUrl: "https://oauth2.googleapis.com/token"
tokenUrl: "https://oauth2.googleapis.com/token",
},
...ANTIGRAVITY_OAUTH_CLIENT
},
oauth: {
authorizeUrl: "https://accounts.google.com/o/oauth2/v2/auth",
tokenUrl: "https://oauth2.googleapis.com/token",
userInfoUrl: "https://www.googleapis.com/oauth2/v1/userinfo",
scopes: [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/userinfo.profile",
"https://www.googleapis.com/auth/cclog",
"https://www.googleapis.com/auth/experimentsandconfigs"
],
apiEndpoint: "https://cloudcode-pa.googleapis.com",
apiVersion: "v1internal",
loadCodeAssistEndpoint: "https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",
onboardUserEndpoint: "https://cloudcode-pa.googleapis.com/v1internal:onboardUser",
loadCodeAssistUserAgent: "google-api-nodejs-client/9.15.1",
loadCodeAssistApiClient: "google-cloud-sdk vscode_cloudshelleditor/0.1"
,
refreshLeadMs: 300000
clientId: "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",
clientSecret: "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",
},
models: [
{ id: "gemini-3-flash-agent", name: "Gemini 3.5 Flash (High)" },
@@ -62,7 +51,28 @@ export default {
{ id: "claude-sonnet-4-6", name: "Claude Sonnet 4.6 (Thinking)" },
{ id: "claude-opus-4-6-thinking", name: "Claude Opus 4.6 (Thinking)" },
{ id: "gpt-oss-120b-medium", name: "GPT-OSS 120B (Medium)" },
{ id: "gemini-3-flash", name: "Gemini 3 Flash", thinking: false }
{ id: "gemini-3-flash", name: "Gemini 3 Flash", thinking: false },
],
features: {"usage":true},
oauth: {
authorizeUrl: "https://accounts.google.com/o/oauth2/v2/auth",
tokenUrl: "https://oauth2.googleapis.com/token",
userInfoUrl: "https://www.googleapis.com/oauth2/v1/userinfo",
scopes: [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/userinfo.profile",
"https://www.googleapis.com/auth/cclog",
"https://www.googleapis.com/auth/experimentsandconfigs",
],
apiEndpoint: "https://cloudcode-pa.googleapis.com",
apiVersion: "v1internal",
loadCodeAssistEndpoint: "https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",
onboardUserEndpoint: "https://cloudcode-pa.googleapis.com/v1internal:onboardUser",
loadCodeAssistUserAgent: "google-api-nodejs-client/9.15.1",
loadCodeAssistApiClient: "google-cloud-sdk vscode_cloudshelleditor/0.1",
refreshLeadMs: 300000,
},
features: {
usage: true,
},
};