mirror of
https://github.com/decolua/9router.git
synced 2026-05-08 12:01:28 +00:00
Fix antigravity
This commit is contained in:
@@ -164,8 +164,8 @@ export const PROVIDERS = {
|
||||
},
|
||||
antigravity: {
|
||||
baseUrls: [
|
||||
"https://daily-cloudcode-pa.googleapis.com",
|
||||
"https://cloudcode-pa.googleapis.com",
|
||||
"https://daily-cloudcode-pa.googleapis.com"
|
||||
],
|
||||
format: "antigravity",
|
||||
headers: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "9router-app",
|
||||
"version": "0.2.98",
|
||||
"version": "0.2.99",
|
||||
"description": "9Router web dashboard",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
@@ -43,4 +43,4 @@
|
||||
"postcss": "^8.5.6",
|
||||
"tailwindcss": "^4"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,32 +293,27 @@ const PROVIDERS = {
|
||||
console.log("Failed to load code assist:", e);
|
||||
}
|
||||
|
||||
// Onboard user to enable Gemini Code Assist
|
||||
// Fire-and-forget onboarding — does not block DB save
|
||||
if (projectId) {
|
||||
try {
|
||||
const doOnboard = async () => {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
const onboardRes = await fetch(ANTIGRAVITY_CONFIG.onboardUserEndpoint, {
|
||||
method: "POST",
|
||||
headers,
|
||||
body: JSON.stringify({ tierId, metadata, cloudaicompanionProject: projectId, mode: 1 }),
|
||||
});
|
||||
if (onboardRes.ok) {
|
||||
const result = await onboardRes.json();
|
||||
if (result.done === true) {
|
||||
// Extract final project ID from response
|
||||
if (result.response?.cloudaicompanionProject) {
|
||||
const respProject = result.response.cloudaicompanionProject;
|
||||
projectId = typeof respProject === 'string' ? respProject.trim() : (respProject.id || projectId);
|
||||
}
|
||||
break;
|
||||
try {
|
||||
const onboardRes = await fetch(ANTIGRAVITY_CONFIG.onboardUserEndpoint, {
|
||||
method: "POST",
|
||||
headers,
|
||||
body: JSON.stringify({ tierId, metadata, cloudaicompanionProject: projectId, mode: 1 }),
|
||||
});
|
||||
if (onboardRes.ok) {
|
||||
const result = await onboardRes.json();
|
||||
if (result.done === true) break;
|
||||
}
|
||||
} catch (e) {
|
||||
break;
|
||||
}
|
||||
// Wait 5 seconds before retry
|
||||
await new Promise(resolve => setTimeout(resolve, 5000));
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("Failed to onboard user:", e);
|
||||
}
|
||||
};
|
||||
doOnboard().catch(() => {});
|
||||
}
|
||||
|
||||
return { userInfo, projectId };
|
||||
|
||||
Reference in New Issue
Block a user