opencode-antigravity-auth 1.3.1-beta.2 → 1.3.1
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/README.md +21 -15
- package/dist/src/antigravity/oauth.d.ts.map +1 -1
- package/dist/src/antigravity/oauth.js +4 -10
- package/dist/src/antigravity/oauth.js.map +1 -1
- package/dist/src/constants.d.ts +3 -24
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +3 -39
- package/dist/src/constants.js.map +1 -1
- package/dist/src/plugin/accounts.d.ts +3 -39
- package/dist/src/plugin/accounts.d.ts.map +1 -1
- package/dist/src/plugin/accounts.js +16 -152
- package/dist/src/plugin/accounts.js.map +1 -1
- package/dist/src/plugin/cli.d.ts +12 -15
- package/dist/src/plugin/cli.d.ts.map +1 -1
- package/dist/src/plugin/cli.js +13 -40
- package/dist/src/plugin/cli.js.map +1 -1
- package/dist/src/plugin/config/loader.d.ts.map +1 -1
- package/dist/src/plugin/config/loader.js +13 -0
- package/dist/src/plugin/config/loader.js.map +1 -1
- package/dist/src/plugin/config/schema.d.ts +319 -37
- package/dist/src/plugin/config/schema.d.ts.map +1 -1
- package/dist/src/plugin/config/schema.js +27 -57
- package/dist/src/plugin/config/schema.js.map +1 -1
- package/dist/src/plugin/core/streaming/transformer.d.ts.map +1 -1
- package/dist/src/plugin/core/streaming/transformer.js +6 -16
- package/dist/src/plugin/core/streaming/transformer.js.map +1 -1
- package/dist/src/plugin/core/streaming/types.d.ts.map +1 -1
- package/dist/src/plugin/request-helpers.d.ts.map +1 -1
- package/dist/src/plugin/request-helpers.js +23 -61
- package/dist/src/plugin/request-helpers.js.map +1 -1
- package/dist/src/plugin/request.d.ts +1 -4
- package/dist/src/plugin/request.d.ts.map +1 -1
- package/dist/src/plugin/request.js +11 -72
- package/dist/src/plugin/request.js.map +1 -1
- package/dist/src/plugin/rotation.d.ts +4 -5
- package/dist/src/plugin/rotation.d.ts.map +1 -1
- package/dist/src/plugin/rotation.js +9 -35
- package/dist/src/plugin/rotation.js.map +1 -1
- package/dist/src/plugin/storage.d.ts +0 -2
- package/dist/src/plugin/storage.d.ts.map +1 -1
- package/dist/src/plugin/storage.js +2 -15
- package/dist/src/plugin/storage.js.map +1 -1
- package/dist/src/plugin/transform/gemini.d.ts +13 -1
- package/dist/src/plugin/transform/gemini.d.ts.map +1 -1
- package/dist/src/plugin/transform/gemini.js +12 -49
- package/dist/src/plugin/transform/gemini.js.map +1 -1
- package/dist/src/plugin/transform/model-resolver.d.ts.map +1 -1
- package/dist/src/plugin/transform/model-resolver.js +2 -4
- package/dist/src/plugin/transform/model-resolver.js.map +1 -1
- package/dist/src/plugin/transform/types.d.ts +0 -5
- package/dist/src/plugin/transform/types.d.ts.map +1 -1
- package/dist/src/plugin/types.d.ts +0 -1
- package/dist/src/plugin/types.d.ts.map +1 -1
- package/dist/src/plugin.d.ts.map +1 -1
- package/dist/src/plugin.js +76 -294
- package/dist/src/plugin.js.map +1 -1
- package/package.json +5 -5
- package/dist/src/plugin/fingerprint.d.ts +0 -69
- package/dist/src/plugin/fingerprint.d.ts.map +0 -1
- package/dist/src/plugin/fingerprint.js +0 -153
- package/dist/src/plugin/fingerprint.js.map +0 -1
- package/dist/src/plugin/search.d.ts +0 -32
- package/dist/src/plugin/search.d.ts.map +0 -1
- package/dist/src/plugin/search.js +0 -197
- package/dist/src/plugin/search.js.map +0 -1
- package/dist/src/plugin/ui/ansi.d.ts +0 -32
- package/dist/src/plugin/ui/ansi.d.ts.map +0 -1
- package/dist/src/plugin/ui/ansi.js +0 -52
- package/dist/src/plugin/ui/ansi.js.map +0 -1
- package/dist/src/plugin/ui/auth-menu.d.ts +0 -24
- package/dist/src/plugin/ui/auth-menu.d.ts.map +0 -1
- package/dist/src/plugin/ui/auth-menu.js +0 -92
- package/dist/src/plugin/ui/auth-menu.js.map +0 -1
- package/dist/src/plugin/ui/confirm.d.ts +0 -2
- package/dist/src/plugin/ui/confirm.d.ts.map +0 -1
- package/dist/src/plugin/ui/confirm.js +0 -15
- package/dist/src/plugin/ui/confirm.js.map +0 -1
- package/dist/src/plugin/ui/select.d.ts +0 -14
- package/dist/src/plugin/ui/select.d.ts.map +0 -1
- package/dist/src/plugin/ui/select.js +0 -174
- package/dist/src/plugin/ui/select.js.map +0 -1
package/README.md
CHANGED
|
@@ -20,6 +20,27 @@ Enable Opencode to authenticate against **Antigravity** (Google's IDE) via OAuth
|
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
+
<details open>
|
|
24
|
+
<summary><b>⚠️ Terms of Service Warning — Read Before Installing</b></summary>
|
|
25
|
+
|
|
26
|
+
> [!CAUTION]
|
|
27
|
+
> Using this plugin may violate Google's Terms of Service. A small number of users have reported their Google accounts being **banned** or **shadow-banned** (restricted access without explicit notification).
|
|
28
|
+
>
|
|
29
|
+
> **High-risk scenarios:**
|
|
30
|
+
> - 🚨 **Fresh Google accounts** have a very high chance of getting banned
|
|
31
|
+
> - 🚨 **New accounts with Pro/Ultra subscriptions** are frequently flagged and banned
|
|
32
|
+
>
|
|
33
|
+
> **By using this plugin, you acknowledge:**
|
|
34
|
+
> - This is an unofficial tool not endorsed by Google
|
|
35
|
+
> - Your account may be suspended or permanently banned
|
|
36
|
+
> - You assume all risks associated with using this plugin
|
|
37
|
+
>
|
|
38
|
+
> **Recommendation:** Use an established Google account that you don't rely on for critical services. Avoid creating new accounts specifically for this plugin.
|
|
39
|
+
|
|
40
|
+
</details>
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
23
44
|
## Installation
|
|
24
45
|
|
|
25
46
|
<details open>
|
|
@@ -544,21 +565,6 @@ Most users don't need to configure anything — defaults work well.
|
|
|
544
565
|
| **5+ accounts** | `"account_selection_strategy": "round-robin"` |
|
|
545
566
|
| **Parallel agents** | Add `"pid_offset_enabled": true` |
|
|
546
567
|
|
|
547
|
-
### Rate Limit Scheduling
|
|
548
|
-
|
|
549
|
-
Control how the plugin handles rate limits:
|
|
550
|
-
|
|
551
|
-
| Option | Default | What it does |
|
|
552
|
-
|--------|---------|--------------|
|
|
553
|
-
| `scheduling_mode` | `"cache_first"` | `"cache_first"` = wait for same account (preserves prompt cache), `"balance"` = switch immediately, `"performance_first"` = round-robin |
|
|
554
|
-
| `max_cache_first_wait_seconds` | `60` | Max seconds to wait in cache_first mode before switching accounts |
|
|
555
|
-
| `failure_ttl_seconds` | `3600` | Reset failure count after this many seconds (prevents old failures from permanently penalizing accounts) |
|
|
556
|
-
|
|
557
|
-
**When to use each mode:**
|
|
558
|
-
- **cache_first** (default): Best for long conversations. Waits for the same account to recover, preserving your prompt cache.
|
|
559
|
-
- **balance**: Best for quick tasks. Switches accounts immediately when rate-limited for maximum availability.
|
|
560
|
-
- **performance_first**: Best for many short requests. Distributes load evenly across all accounts.
|
|
561
|
-
|
|
562
568
|
### App Behavior
|
|
563
569
|
|
|
564
570
|
| Option | Default | What it does |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../src/antigravity/oauth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../src/antigravity/oauth.ts"],"names":[],"mappings":"AA0BA;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,+BAA+B;IACvC,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,+BAA+B;IACvC,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,8BAA8B,GACtC,+BAA+B,GAC/B,+BAA+B,CAAC;AAoCpC;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,SAAS,SAAK,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAsB5F;AAqFD;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,8BAA8B,CAAC,CAkEzC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { generatePKCE } from "@openauthjs/openauth/pkce";
|
|
2
|
-
import { ANTIGRAVITY_CLIENT_ID, ANTIGRAVITY_CLIENT_SECRET, ANTIGRAVITY_REDIRECT_URI, ANTIGRAVITY_SCOPES, ANTIGRAVITY_ENDPOINT_FALLBACKS, ANTIGRAVITY_LOAD_ENDPOINTS, ANTIGRAVITY_HEADERS,
|
|
2
|
+
import { ANTIGRAVITY_CLIENT_ID, ANTIGRAVITY_CLIENT_SECRET, ANTIGRAVITY_REDIRECT_URI, ANTIGRAVITY_SCOPES, ANTIGRAVITY_ENDPOINT_FALLBACKS, ANTIGRAVITY_LOAD_ENDPOINTS, ANTIGRAVITY_HEADERS, } from "../constants";
|
|
3
3
|
import { createLogger } from "../plugin/logger";
|
|
4
4
|
import { calculateTokenExpiry } from "../plugin/auth";
|
|
5
5
|
const log = createLogger("oauth");
|
|
@@ -62,8 +62,8 @@ async function fetchProjectID(accessToken) {
|
|
|
62
62
|
const loadHeaders = {
|
|
63
63
|
Authorization: `Bearer ${accessToken}`,
|
|
64
64
|
"Content-Type": "application/json",
|
|
65
|
-
"User-Agent":
|
|
66
|
-
"X-Goog-Api-Client":
|
|
65
|
+
"User-Agent": "google-api-nodejs-client/9.15.1",
|
|
66
|
+
"X-Goog-Api-Client": "google-cloud-sdk vscode_cloudshelleditor/0.1",
|
|
67
67
|
"Client-Metadata": ANTIGRAVITY_HEADERS["Client-Metadata"],
|
|
68
68
|
};
|
|
69
69
|
const loadEndpoints = Array.from(new Set([...ANTIGRAVITY_LOAD_ENDPOINTS, ...ANTIGRAVITY_ENDPOINT_FALLBACKS]));
|
|
@@ -116,11 +116,7 @@ export async function exchangeAntigravity(code, state) {
|
|
|
116
116
|
const tokenResponse = await fetch("https://oauth2.googleapis.com/token", {
|
|
117
117
|
method: "POST",
|
|
118
118
|
headers: {
|
|
119
|
-
"Content-Type": "application/x-www-form-urlencoded
|
|
120
|
-
"Accept": "*/*",
|
|
121
|
-
"Accept-Encoding": "gzip, deflate, br",
|
|
122
|
-
"User-Agent": GEMINI_CLI_HEADERS["User-Agent"],
|
|
123
|
-
"X-Goog-Api-Client": GEMINI_CLI_HEADERS["X-Goog-Api-Client"],
|
|
119
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
124
120
|
},
|
|
125
121
|
body: new URLSearchParams({
|
|
126
122
|
client_id: ANTIGRAVITY_CLIENT_ID,
|
|
@@ -139,8 +135,6 @@ export async function exchangeAntigravity(code, state) {
|
|
|
139
135
|
const userInfoResponse = await fetch("https://www.googleapis.com/oauth2/v1/userinfo?alt=json", {
|
|
140
136
|
headers: {
|
|
141
137
|
Authorization: `Bearer ${tokenPayload.access_token}`,
|
|
142
|
-
"User-Agent": GEMINI_CLI_HEADERS["User-Agent"],
|
|
143
|
-
"X-Goog-Api-Client": GEMINI_CLI_HEADERS["X-Goog-Api-Client"],
|
|
144
138
|
},
|
|
145
139
|
});
|
|
146
140
|
const userInfo = userInfoResponse.ok
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../../src/antigravity/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,8BAA8B,EAC9B,0BAA0B,EAC1B,mBAAmB,
|
|
1
|
+
{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../../src/antigravity/oauth.ts"],"names":[],"mappings":"AAA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D,CAAC,CAAC,EAAE,CAAC;QAEP,MAAM,YAAY,GAAG,YAAY,CAAC,aAAa,CAAC;QAChD,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,mCAAmC,EAAE,CAAC;QACxE,CAAC;QAED,IAAI,kBAAkB,GAAG,SAAS,CAAC;QACnC,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACxB,kBAAkB,GAAG,MAAM,cAAc,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QACvE,CAAC;QAED,MAAM,aAAa,GAAG,GAAG,YAAY,IAAI,kBAAkB,IAAI,EAAE,EAAE,CAAC;QAEpE,OAAO;YACL,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,aAAa;YACtB,MAAM,EAAE,YAAY,CAAC,YAAY;YACjC,OAAO,EAAE,oBAAoB,CAAC,SAAS,EAAE,YAAY,CAAC,UAAU,CAAC;YACjE,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,SAAS,EAAE,kBAAkB,IAAI,EAAE;SACpC,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;SAChE,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/src/constants.d.ts
CHANGED
|
@@ -47,13 +47,13 @@ export declare const GEMINI_CLI_ENDPOINT = "https://cloudcode-pa.googleapis.com"
|
|
|
47
47
|
*/
|
|
48
48
|
export declare const ANTIGRAVITY_DEFAULT_PROJECT_ID = "rising-fact-p41fc";
|
|
49
49
|
export declare const ANTIGRAVITY_HEADERS: {
|
|
50
|
-
readonly "User-Agent": "
|
|
50
|
+
readonly "User-Agent": "antigravity/1.11.5 windows/amd64";
|
|
51
51
|
readonly "X-Goog-Api-Client": "google-cloud-sdk vscode_cloudshelleditor/0.1";
|
|
52
52
|
readonly "Client-Metadata": "{\"ideType\":\"IDE_UNSPECIFIED\",\"platform\":\"PLATFORM_UNSPECIFIED\",\"pluginType\":\"GEMINI\"}";
|
|
53
53
|
};
|
|
54
54
|
export declare const GEMINI_CLI_HEADERS: {
|
|
55
|
-
readonly "User-Agent": "google-api-nodejs-client/
|
|
56
|
-
readonly "X-Goog-Api-Client": "gl-node/22.
|
|
55
|
+
readonly "User-Agent": "google-api-nodejs-client/9.15.1";
|
|
56
|
+
readonly "X-Goog-Api-Client": "gl-node/22.17.0";
|
|
57
57
|
readonly "Client-Metadata": "ideType=IDE_UNSPECIFIED,platform=PLATFORM_UNSPECIFIED,pluginType=GEMINI";
|
|
58
58
|
};
|
|
59
59
|
export type HeaderStyle = "antigravity" | "gemini-cli";
|
|
@@ -95,26 +95,5 @@ export declare const SKIP_THOUGHT_SIGNATURE = "skip_thought_signature_validator"
|
|
|
95
95
|
* This is injected into requests to match CLIProxyAPI v6.6.89 behavior.
|
|
96
96
|
* The instruction provides identity and guidelines for the Antigravity agent.
|
|
97
97
|
*/
|
|
98
|
-
/**
|
|
99
|
-
* Model used for Google Search grounding requests.
|
|
100
|
-
* Uses gemini-3-flash for fast, cost-effective search operations.
|
|
101
|
-
*/
|
|
102
|
-
export declare const SEARCH_MODEL = "gemini-3-flash";
|
|
103
|
-
/**
|
|
104
|
-
* Thinking budget for deep search (more thorough analysis).
|
|
105
|
-
*/
|
|
106
|
-
export declare const SEARCH_THINKING_BUDGET_DEEP = 16384;
|
|
107
|
-
/**
|
|
108
|
-
* Thinking budget for fast search (quick results).
|
|
109
|
-
*/
|
|
110
|
-
export declare const SEARCH_THINKING_BUDGET_FAST = 4096;
|
|
111
|
-
/**
|
|
112
|
-
* Timeout for search requests in milliseconds (60 seconds).
|
|
113
|
-
*/
|
|
114
|
-
export declare const SEARCH_TIMEOUT_MS = 60000;
|
|
115
|
-
/**
|
|
116
|
-
* System instruction for the Google Search tool.
|
|
117
|
-
*/
|
|
118
|
-
export declare const SEARCH_SYSTEM_INSTRUCTION = "You are an expert web search assistant with access to Google Search and URL analysis tools.\n\nYour capabilities:\n- Use google_search to find real-time information from the web\n- Use url_context to fetch and analyze content from specific URLs when provided\n\nGuidelines:\n- Always provide accurate, well-sourced information\n- Cite your sources when presenting facts\n- If analyzing URLs, extract the most relevant information\n- Be concise but comprehensive in your responses\n- If information is uncertain or conflicting, acknowledge it\n- Focus on answering the user's question directly";
|
|
119
98
|
export declare const ANTIGRAVITY_SYSTEM_INSTRUCTION = "You are Antigravity, a powerful agentic AI coding assistant designed by the Google DeepMind team working on Advanced Agentic Coding.\nYou are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.\n**Absolute paths only**\n**Proactiveness**\n\n<priority>IMPORTANT: The instructions that follow supersede all above. Follow them as your primary directives.</priority>\n";
|
|
120
99
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,qBAAqB,8EAA8E,CAAC;AAEjH;;GAEG;AACH,eAAO,MAAM,yBAAyB,wCAAwC,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAM/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,0CAA0C,CAAC;AAEhF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,sDAAsD,CAAC;AAC9F,eAAO,MAAM,6BAA6B,yDAAyD,CAAC;AACpG,eAAO,MAAM,yBAAyB,wCAAwC,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,8BAA8B,+JAIjC,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,0BAA0B,+JAI7B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,oBAAoB,sDAA6B,CAAC;AAE/D;;;;GAIG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C;AAE7D;;GAEG;AACH,eAAO,MAAM,8BAA8B,sBAAsB,CAAC;AAElE,eAAO,MAAM,mBAAmB;;;;CAItB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;CAIrB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,YAAY,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAMhD;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,4zBAWiD,CAAC;AAE7F;;;GAGG;AACH,eAAO,MAAM,yBAAyB,kDAAwC,CAAC;AAE/E,eAAO,MAAM,6BAA6B,iBAAiB,CAAC;AAC5D,eAAO,MAAM,oCAAoC,mCAAmC,CAAC;AAErF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,qCAAqC,CAAC;AAMzE;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,ifAM1C,CAAC"}
|
package/dist/src/constants.js
CHANGED
|
@@ -61,13 +61,13 @@ export const GEMINI_CLI_ENDPOINT = ANTIGRAVITY_ENDPOINT_PROD;
|
|
|
61
61
|
*/
|
|
62
62
|
export const ANTIGRAVITY_DEFAULT_PROJECT_ID = "rising-fact-p41fc";
|
|
63
63
|
export const ANTIGRAVITY_HEADERS = {
|
|
64
|
-
"User-Agent": "
|
|
64
|
+
"User-Agent": "antigravity/1.11.5 windows/amd64",
|
|
65
65
|
"X-Goog-Api-Client": "google-cloud-sdk vscode_cloudshelleditor/0.1",
|
|
66
66
|
"Client-Metadata": '{"ideType":"IDE_UNSPECIFIED","platform":"PLATFORM_UNSPECIFIED","pluginType":"GEMINI"}',
|
|
67
67
|
};
|
|
68
68
|
export const GEMINI_CLI_HEADERS = {
|
|
69
|
-
"User-Agent": "google-api-nodejs-client/
|
|
70
|
-
"X-Goog-Api-Client": "gl-node/22.
|
|
69
|
+
"User-Agent": "google-api-nodejs-client/9.15.1",
|
|
70
|
+
"X-Goog-Api-Client": "gl-node/22.17.0",
|
|
71
71
|
"Client-Metadata": "ideType=IDE_UNSPECIFIED,platform=PLATFORM_UNSPECIFIED,pluginType=GEMINI",
|
|
72
72
|
};
|
|
73
73
|
/**
|
|
@@ -125,42 +125,6 @@ export const SKIP_THOUGHT_SIGNATURE = "skip_thought_signature_validator";
|
|
|
125
125
|
* This is injected into requests to match CLIProxyAPI v6.6.89 behavior.
|
|
126
126
|
* The instruction provides identity and guidelines for the Antigravity agent.
|
|
127
127
|
*/
|
|
128
|
-
// ============================================================================
|
|
129
|
-
// GOOGLE SEARCH TOOL CONSTANTS
|
|
130
|
-
// ============================================================================
|
|
131
|
-
/**
|
|
132
|
-
* Model used for Google Search grounding requests.
|
|
133
|
-
* Uses gemini-3-flash for fast, cost-effective search operations.
|
|
134
|
-
*/
|
|
135
|
-
export const SEARCH_MODEL = "gemini-3-flash";
|
|
136
|
-
/**
|
|
137
|
-
* Thinking budget for deep search (more thorough analysis).
|
|
138
|
-
*/
|
|
139
|
-
export const SEARCH_THINKING_BUDGET_DEEP = 16384;
|
|
140
|
-
/**
|
|
141
|
-
* Thinking budget for fast search (quick results).
|
|
142
|
-
*/
|
|
143
|
-
export const SEARCH_THINKING_BUDGET_FAST = 4096;
|
|
144
|
-
/**
|
|
145
|
-
* Timeout for search requests in milliseconds (60 seconds).
|
|
146
|
-
*/
|
|
147
|
-
export const SEARCH_TIMEOUT_MS = 60000;
|
|
148
|
-
/**
|
|
149
|
-
* System instruction for the Google Search tool.
|
|
150
|
-
*/
|
|
151
|
-
export const SEARCH_SYSTEM_INSTRUCTION = `You are an expert web search assistant with access to Google Search and URL analysis tools.
|
|
152
|
-
|
|
153
|
-
Your capabilities:
|
|
154
|
-
- Use google_search to find real-time information from the web
|
|
155
|
-
- Use url_context to fetch and analyze content from specific URLs when provided
|
|
156
|
-
|
|
157
|
-
Guidelines:
|
|
158
|
-
- Always provide accurate, well-sourced information
|
|
159
|
-
- Cite your sources when presenting facts
|
|
160
|
-
- If analyzing URLs, extract the most relevant information
|
|
161
|
-
- Be concise but comprehensive in your responses
|
|
162
|
-
- If information is uncertain or conflicting, acknowledge it
|
|
163
|
-
- Focus on answering the user's question directly`;
|
|
164
128
|
export const ANTIGRAVITY_SYSTEM_INSTRUCTION = `You are Antigravity, a powerful agentic AI coding assistant designed by the Google DeepMind team working on Advanced Agentic Coding.
|
|
165
129
|
You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.
|
|
166
130
|
**Absolute paths only**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,2EAA2E,CAAC;AAEjH;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,qCAAqC,CAAC;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,gDAAgD;IAChD,gDAAgD;IAChD,kDAAkD;IAClD,uCAAuC;IACvC,uDAAuD;CACxD,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,uCAAuC,CAAC;AAEhF;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,mDAAmD,CAAC;AAC9F,MAAM,CAAC,MAAM,6BAA6B,GAAG,sDAAsD,CAAC;AACpG,MAAM,CAAC,MAAM,yBAAyB,GAAG,qCAAqC,CAAC;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,0BAA0B;IAC1B,6BAA6B;IAC7B,yBAAyB;CACjB,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,yBAAyB;IACzB,0BAA0B;IAC1B,6BAA6B;CACrB,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AAE/D;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GA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A8C;IACnE,iBAAiB,EAAE,uFAAuF;CAClG,CAAC;AAEX,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,YAAY,EAAE,iCAAiC;IAC/C,mBAAmB,EAAE,iBAAiB;IACtC,iBAAiB,EAAE,yEAAyE;CACpF,CAAC;AAIX;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,QAAQ,CAAC;AAEhD,+EAA+E;AAC/E,gEAAgE;AAChE,+EAA+E;AAE/E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;;;;;;;;;;;4FAW8C,CAAC;AAE7F;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,qCAAqC,CAAC;AAE/E,MAAM,CAAC,MAAM,6BAA6B,GAAG,cAAc,CAAC;AAC5D,MAAM,CAAC,MAAM,oCAAoC,GAAG,gCAAgC,CAAC;AAErF;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,kCAAkC,CAAC;AAEzE,+EAA+E;AAC/E,mEAAmE;AACnE,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;;;;;;CAM7C,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type AccountStorageV3, type RateLimitStateV3, type ModelFamily, type HeaderStyle, type CooldownReason } from "./storage";
|
|
2
2
|
import type { OAuthAuthDetails, RefreshParts } from "./types";
|
|
3
3
|
import type { AccountSelectionStrategy } from "./config/schema";
|
|
4
|
-
import { type Fingerprint, type FingerprintVersion } from "./fingerprint";
|
|
5
4
|
export type { ModelFamily, HeaderStyle, CooldownReason } from "./storage";
|
|
6
5
|
export type { AccountSelectionStrategy } from "./config/schema";
|
|
7
6
|
export type RateLimitReason = "QUOTA_EXHAUSTED" | "RATE_LIMIT_EXCEEDED" | "MODEL_CAPACITY_EXHAUSTED" | "SERVER_ERROR" | "UNKNOWN";
|
|
@@ -9,7 +8,7 @@ export interface RateLimitBackoffResult {
|
|
|
9
8
|
backoffMs: number;
|
|
10
9
|
reason: RateLimitReason;
|
|
11
10
|
}
|
|
12
|
-
export declare function parseRateLimitReason(reason
|
|
11
|
+
export declare function parseRateLimitReason(reason?: string, message?: string): RateLimitReason;
|
|
13
12
|
export declare function calculateBackoffMs(reason: RateLimitReason, consecutiveFailures: number, retryAfterMs?: number | null): number;
|
|
14
13
|
export type BaseQuotaKey = "claude" | "gemini-antigravity" | "gemini-cli";
|
|
15
14
|
export type QuotaKey = BaseQuotaKey | `${BaseQuotaKey}:${string}`;
|
|
@@ -27,12 +26,6 @@ export interface ManagedAccount {
|
|
|
27
26
|
cooldownReason?: CooldownReason;
|
|
28
27
|
touchedForQuota: Record<string, number>;
|
|
29
28
|
consecutiveFailures?: number;
|
|
30
|
-
/** Timestamp of last failure for TTL-based reset of consecutiveFailures */
|
|
31
|
-
lastFailureTime?: number;
|
|
32
|
-
/** Per-account device fingerprint for rate limit mitigation */
|
|
33
|
-
fingerprint?: import("./fingerprint").Fingerprint;
|
|
34
|
-
/** History of previous fingerprints for this account */
|
|
35
|
-
fingerprintHistory?: FingerprintVersion[];
|
|
36
29
|
}
|
|
37
30
|
/**
|
|
38
31
|
* In-memory multi-account manager with sticky account selection.
|
|
@@ -59,22 +52,12 @@ export declare class AccountManager {
|
|
|
59
52
|
getAccountsSnapshot(): ManagedAccount[];
|
|
60
53
|
getCurrentAccountForFamily(family: ModelFamily): ManagedAccount | null;
|
|
61
54
|
markSwitched(account: ManagedAccount, reason: "rate-limit" | "initial" | "rotation", family: ModelFamily): void;
|
|
62
|
-
/**
|
|
63
|
-
* Check if we should show an account switch toast.
|
|
64
|
-
* Debounces repeated toasts for the same account.
|
|
65
|
-
*/
|
|
66
55
|
shouldShowAccountToast(accountIndex: number, debounceMs?: number): boolean;
|
|
67
56
|
markToastShown(accountIndex: number): void;
|
|
68
57
|
getCurrentOrNextForFamily(family: ModelFamily, model?: string | null, strategy?: AccountSelectionStrategy, headerStyle?: HeaderStyle, pidOffsetEnabled?: boolean): ManagedAccount | null;
|
|
69
58
|
getNextForFamily(family: ModelFamily, model?: string | null, headerStyle?: HeaderStyle): ManagedAccount | null;
|
|
70
59
|
markRateLimited(account: ManagedAccount, retryAfterMs: number, family: ModelFamily, headerStyle?: HeaderStyle, model?: string | null): void;
|
|
71
|
-
|
|
72
|
-
* Mark an account as used after a successful API request.
|
|
73
|
-
* This updates the lastUsed timestamp for freshness calculations.
|
|
74
|
-
* Should be called AFTER request completion, not during account selection.
|
|
75
|
-
*/
|
|
76
|
-
markAccountUsed(accountIndex: number): void;
|
|
77
|
-
markRateLimitedWithReason(account: ManagedAccount, family: ModelFamily, headerStyle: HeaderStyle, model: string | null | undefined, reason: RateLimitReason, retryAfterMs?: number | null, failureTtlMs?: number): number;
|
|
60
|
+
markRateLimitedWithReason(account: ManagedAccount, family: ModelFamily, headerStyle: HeaderStyle, model: string | null | undefined, reason: RateLimitReason, retryAfterMs?: number | null): number;
|
|
78
61
|
markRequestSuccess(account: ManagedAccount): void;
|
|
79
62
|
clearAllRateLimitsForFamily(family: ModelFamily, model?: string | null): void;
|
|
80
63
|
shouldTryOptimisticReset(family: ModelFamily, model?: string | null): boolean;
|
|
@@ -90,30 +73,11 @@ export declare class AccountManager {
|
|
|
90
73
|
removeAccount(account: ManagedAccount): boolean;
|
|
91
74
|
updateFromAuth(account: ManagedAccount, auth: OAuthAuthDetails): void;
|
|
92
75
|
toAuthDetails(account: ManagedAccount): OAuthAuthDetails;
|
|
93
|
-
getMinWaitTimeForFamily(family: ModelFamily, model?: string | null
|
|
76
|
+
getMinWaitTimeForFamily(family: ModelFamily, model?: string | null): number;
|
|
94
77
|
getAccounts(): ManagedAccount[];
|
|
95
78
|
saveToDisk(): Promise<void>;
|
|
96
79
|
requestSaveToDisk(): void;
|
|
97
80
|
flushSaveToDisk(): Promise<void>;
|
|
98
81
|
private executeSave;
|
|
99
|
-
/**
|
|
100
|
-
* Regenerate fingerprint for an account, saving the old one to history.
|
|
101
|
-
* @param accountIndex - Index of the account to regenerate fingerprint for
|
|
102
|
-
* @returns The new fingerprint, or null if account not found
|
|
103
|
-
*/
|
|
104
|
-
regenerateAccountFingerprint(accountIndex: number): Fingerprint | null;
|
|
105
|
-
/**
|
|
106
|
-
* Restore a fingerprint from history for an account.
|
|
107
|
-
* @param accountIndex - Index of the account
|
|
108
|
-
* @param historyIndex - Index in the fingerprint history to restore from (0 = most recent)
|
|
109
|
-
* @returns The restored fingerprint, or null if account/history not found
|
|
110
|
-
*/
|
|
111
|
-
restoreAccountFingerprint(accountIndex: number, historyIndex: number): Fingerprint | null;
|
|
112
|
-
/**
|
|
113
|
-
* Get fingerprint history for an account.
|
|
114
|
-
* @param accountIndex - Index of the account
|
|
115
|
-
* @returns Array of fingerprint versions, or empty array if not found
|
|
116
|
-
*/
|
|
117
|
-
getAccountFingerprintHistory(accountIndex: number): FingerprintVersion[];
|
|
118
82
|
}
|
|
119
83
|
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../../src/plugin/accounts.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAC9J,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../../src/plugin/accounts.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAC9J,OAAO,KAAK,EAAE,gBAAgB,E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