feat: cherry-pick PR #183 — multi-provider support, PWA, dynamic models, UI improvements

Cherry-picked from decolua/9router PR #183.
Note: open-sse changes included but need further review due to extensive modifications.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Quan
2026-02-25 11:40:50 +07:00
committed by decolua
parent 147fc168f9
commit 07717bad60
30 changed files with 773 additions and 159 deletions

View File

@@ -221,16 +221,26 @@ async function getAntigravityUsage(accessToken, providerSpecificData) {
"Authorization": `Bearer ${accessToken}`,
"User-Agent": ANTIGRAVITY_CONFIG.userAgent,
"Content-Type": "application/json",
"X-Client-Name": "antigravity",
"X-Client-Version": "1.107.0",
},
body: JSON.stringify({
...(projectId ? { project: projectId } : {}),
metadata: CLIENT_METADATA,
mode: 1
...(projectId ? { project: projectId } : {})
}),
});
if (response.status === 403) {
return { message: "Antigravity access forbidden. Check subscription." };
return {
message: "Antigravity quota API access forbidden. Chat may still work.",
quotas: {}
};
}
if (response.status === 401) {
return {
message: "Antigravity quota API authentication expired. Chat may still work.",
quotas: {}
};
}
if (!response.ok) {
@@ -470,6 +480,15 @@ async function getKiroUsage(accessToken, providerSpecificData) {
if (!response.ok) {
const errorText = await response.text();
// Handle authentication errors gracefully
if (response.status === 403 || response.status === 401) {
return {
message: "Kiro quota API authentication expired. Chat may still work.",
quotas: {}
};
}
throw new Error(`Kiro API error (${response.status}): ${errorText}`);
}