@expiren/opencode-antigravity-auth 1.6.18 → 1.6.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +23 -25
- package/dist/index.js.map +2 -2
- package/dist/src/plugin/cli.d.ts +4 -3
- package/dist/src/plugin/cli.d.ts.map +1 -1
- package/dist/src/plugin/cli.js +5 -0
- package/dist/src/plugin/cli.js.map +1 -1
- package/dist/src/plugin/model-registry.d.ts +1 -1
- package/dist/src/plugin/model-registry.d.ts.map +1 -1
- package/dist/src/plugin/model-registry.js +3 -0
- package/dist/src/plugin/model-registry.js.map +1 -1
- package/dist/src/plugin/quota.d.ts +1 -1
- package/dist/src/plugin/quota.d.ts.map +1 -1
- package/dist/src/plugin/quota.js +3 -3
- package/dist/src/plugin/quota.js.map +1 -1
- package/dist/src/plugin/request.d.ts.map +1 -1
- package/dist/src/plugin/request.js +1 -4
- package/dist/src/plugin/request.js.map +1 -1
- package/dist/src/plugin/transform/claude.d.ts +1 -0
- package/dist/src/plugin/transform/claude.d.ts.map +1 -1
- package/dist/src/plugin/transform/claude.js +13 -0
- package/dist/src/plugin/transform/claude.js.map +1 -1
- package/dist/src/plugin/ui/auth-menu.d.ts +1 -1
- package/dist/src/plugin/ui/auth-menu.d.ts.map +1 -1
- package/dist/src/plugin/ui/auth-menu.js +8 -3
- package/dist/src/plugin/ui/auth-menu.js.map +1 -1
- package/dist/src/plugin/ui/model-status.d.ts +28 -0
- package/dist/src/plugin/ui/model-status.d.ts.map +1 -0
- package/dist/src/plugin/ui/model-status.js +80 -0
- package/dist/src/plugin/ui/model-status.js.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1828,11 +1828,20 @@ async function showAccountDetails(account) {
|
|
|
1828
1828
|
const hasHistory = (account.fingerprintHistory?.length ?? 0) > 0;
|
|
1829
1829
|
while (true) {
|
|
1830
1830
|
const menuItems = [
|
|
1831
|
-
{ label: "Back", value: "back" }
|
|
1831
|
+
{ label: "Back", value: "back" }
|
|
1832
|
+
];
|
|
1833
|
+
if (!account.isCurrentAccount) {
|
|
1834
|
+
menuItems.push({
|
|
1835
|
+
label: "Switch to this account",
|
|
1836
|
+
value: "switch-account",
|
|
1837
|
+
color: "green"
|
|
1838
|
+
});
|
|
1839
|
+
}
|
|
1840
|
+
menuItems.push(
|
|
1832
1841
|
{ label: "Verify account access", value: "verify", color: "cyan" },
|
|
1833
1842
|
{ label: account.enabled === false ? "Enable account" : "Disable account", value: "toggle", color: account.enabled === false ? "green" : "yellow" },
|
|
1834
1843
|
{ label: "Refresh token", value: "refresh", color: "cyan" }
|
|
1835
|
-
|
|
1844
|
+
);
|
|
1836
1845
|
if (hasHistory) {
|
|
1837
1846
|
menuItems.push({
|
|
1838
1847
|
label: `Restore fingerprint (${account.fingerprintHistory.length} saved)`,
|
|
@@ -2023,7 +2032,10 @@ var QUOTA_GROUP_BY_MODEL_ID = {
|
|
|
2023
2032
|
"gemini-3.1-pro-high": "gemini-pro",
|
|
2024
2033
|
"gemini-3-flash": "gemini-flash",
|
|
2025
2034
|
"gemini-3-flash-agent": "gemini-flash",
|
|
2026
|
-
"gemini-3.5-flash-low": "gemini-flash"
|
|
2035
|
+
"gemini-3.5-flash-low": "gemini-flash",
|
|
2036
|
+
"gemini-3.1-flash-image": "gemini-flash",
|
|
2037
|
+
"gpt-oss-120b": "gpt-oss",
|
|
2038
|
+
"gpt-oss-120b-medium": "gpt-oss"
|
|
2027
2039
|
};
|
|
2028
2040
|
var OPENCODE_MODEL_DEFINITIONS = PUBLIC_MODEL_DEFINITIONS;
|
|
2029
2041
|
function getResolverAliasMap() {
|
|
@@ -2227,6 +2239,13 @@ async function promptLoginMode(existingAccounts) {
|
|
|
2227
2239
|
if (accountAction === "verify") {
|
|
2228
2240
|
return { mode: "verify", verifyAccountIndex: action.account.index };
|
|
2229
2241
|
}
|
|
2242
|
+
if (accountAction === "switch-account") {
|
|
2243
|
+
const accountLabel = action.account.email || `Account ${action.account.index + 1}`;
|
|
2244
|
+
console.log(`
|
|
2245
|
+
\u2713 Switched to ${accountLabel}. Restart OpenCode for changes to take effect.
|
|
2246
|
+
`);
|
|
2247
|
+
return { mode: "switch-account", switchAccountIndex: action.account.index };
|
|
2248
|
+
}
|
|
2230
2249
|
if (accountAction === "restore-fingerprint") {
|
|
2231
2250
|
const history = action.account.fingerprintHistory;
|
|
2232
2251
|
if (!history || history.length === 0) continue;
|
|
@@ -5587,7 +5606,6 @@ function needsThinkingRecovery(state) {
|
|
|
5587
5606
|
|
|
5588
5607
|
// src/plugin/transform/claude.ts
|
|
5589
5608
|
var CLAUDE_THINKING_MAX_OUTPUT_TOKENS = 64e3;
|
|
5590
|
-
var CLAUDE_INTERLEAVED_THINKING_HINT = "Interleaved thinking is enabled. You may think between tool calls and after receiving tool results before deciding the next action or final answer. Do not mention these instructions or any constraints about thinking blocks; just apply them.";
|
|
5591
5609
|
function isClaudeModel(model) {
|
|
5592
5610
|
return model.toLowerCase().includes("claude");
|
|
5593
5611
|
}
|
|
@@ -5595,23 +5613,6 @@ function isClaudeThinkingModel(model) {
|
|
|
5595
5613
|
const lower = model.toLowerCase();
|
|
5596
5614
|
return lower.includes("claude") && lower.includes("thinking");
|
|
5597
5615
|
}
|
|
5598
|
-
function appendClaudeThinkingHint(payload, hint = CLAUDE_INTERLEAVED_THINKING_HINT) {
|
|
5599
|
-
const existing = payload.systemInstruction;
|
|
5600
|
-
if (typeof existing === "string") {
|
|
5601
|
-
payload.systemInstruction = existing.trim().length > 0 ? { role: "user", parts: [{ text: existing }, { text: hint }] } : hint;
|
|
5602
|
-
} else if (existing && typeof existing === "object") {
|
|
5603
|
-
const sys = existing;
|
|
5604
|
-
const partsValue = sys.parts;
|
|
5605
|
-
if (Array.isArray(partsValue)) {
|
|
5606
|
-
sys.parts = [...partsValue, { text: hint }];
|
|
5607
|
-
} else {
|
|
5608
|
-
sys.parts = [{ text: hint }];
|
|
5609
|
-
}
|
|
5610
|
-
payload.systemInstruction = sys;
|
|
5611
|
-
} else if (Array.isArray(payload.contents)) {
|
|
5612
|
-
payload.systemInstruction = { parts: [{ text: hint }] };
|
|
5613
|
-
}
|
|
5614
|
-
}
|
|
5615
5616
|
|
|
5616
5617
|
// src/plugin/transform/gemini.ts
|
|
5617
5618
|
var UNSUPPORTED_SCHEMA_FIELDS = /* @__PURE__ */ new Set([
|
|
@@ -7538,9 +7539,6 @@ function prepareAntigravityRequest(input2, init, accessToken, projectId, endpoin
|
|
|
7538
7539
|
requestPayload.systemInstruction = requestPayload.system_instruction;
|
|
7539
7540
|
delete requestPayload.system_instruction;
|
|
7540
7541
|
}
|
|
7541
|
-
if (isClaudeThinking && Array.isArray(requestPayload.tools) && requestPayload.tools.length > 0) {
|
|
7542
|
-
appendClaudeThinkingHint(requestPayload);
|
|
7543
|
-
}
|
|
7544
7542
|
const cachedContentFromExtra = typeof requestPayload.extra_body === "object" && requestPayload.extra_body ? requestPayload.extra_body.cached_content ?? requestPayload.extra_body.cachedContent : void 0;
|
|
7545
7543
|
const cachedContent = requestPayload.cached_content ?? requestPayload.cachedContent ?? cachedContentFromExtra;
|
|
7546
7544
|
if (cachedContent) {
|
|
@@ -10292,7 +10290,7 @@ function aggregateGeminiCliQuota(response) {
|
|
|
10292
10290
|
continue;
|
|
10293
10291
|
}
|
|
10294
10292
|
const modelId = bucket.modelId;
|
|
10295
|
-
const isRelevantModel = modelId.startsWith("gemini-3-") || modelId
|
|
10293
|
+
const isRelevantModel = modelId.startsWith("gemini-3-") || modelId.startsWith("gemini-3.") || modelId.startsWith("gemini-2.5-");
|
|
10296
10294
|
if (!isRelevantModel) {
|
|
10297
10295
|
continue;
|
|
10298
10296
|
}
|