mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
Retry short-lived 5xx/capacity errors (500/502/503/504 + message patterns) with bounded backoff capped at 15s; honor Retry-After/reset hints and skip when wait is too long. Keep 400 non-retryable. Enable the retry hook for 500 alongside existing 429/503. Deduplicate sanitized Antigravity tool names before emitting the single functionDeclarations group to avoid upstream "Tool names must be unique" rejections. Add Headroom size diagnostics and phantom-savings warning when reported token delta does not shrink the outbound payload. Co-authored-by: Cursor <cursoragent@cursor.com>
86 lines
3.0 KiB
JavaScript
86 lines
3.0 KiB
JavaScript
import { platform, arch } from "os";
|
|
import { ANTIGRAVITY_OAUTH_CLIENT } from "../shared.js";
|
|
|
|
export default {
|
|
id: "antigravity",
|
|
priority: 20,
|
|
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",
|
|
},
|
|
category: "oauth",
|
|
serviceKinds: ["llm", "image"],
|
|
transport: {
|
|
baseUrls: [
|
|
"https://daily-cloudcode-pa.googleapis.com",
|
|
"https://daily-cloudcode-pa.sandbox.googleapis.com",
|
|
],
|
|
format: "antigravity",
|
|
headers: {
|
|
"User-Agent": "antigravity/1.107.0 darwin/arm64",
|
|
},
|
|
retry: {
|
|
"429": {
|
|
attempts: 3,
|
|
},
|
|
"500": {
|
|
attempts: 3,
|
|
},
|
|
"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",
|
|
},
|
|
clientId: "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",
|
|
clientSecret: "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",
|
|
},
|
|
models: [
|
|
{ id: "gemini-3-flash-agent", name: "Gemini 3.5 Flash (High)" },
|
|
{ id: "gemini-3.5-flash-low", name: "Gemini 3.5 Flash (Medium)" },
|
|
{ id: "gemini-3.5-flash-extra-low", name: "Gemini 3.5 Flash (Low)" },
|
|
{ id: "gemini-pro-agent", name: "Gemini 3.1 Pro (High)" },
|
|
{ id: "gemini-3.1-pro-low", name: "Gemini 3.1 Pro (Low)" },
|
|
{ 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 },
|
|
// Image generation models
|
|
{ id: "gemini-3.1-flash-image", name: "Gemini 3.1 Flash (Image)", kind: "image", imageGen: true, capabilities: ["textToImage"] },
|
|
],
|
|
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,
|
|
},
|
|
};
|