opencode-antigravity-auth-remix 1.0.8 → 1.1.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.
Files changed (57) hide show
  1. package/README.md +351 -581
  2. package/dist/src/constants.d.ts +27 -24
  3. package/dist/src/constants.d.ts.map +1 -1
  4. package/dist/src/constants.js +101 -12
  5. package/dist/src/constants.js.map +1 -1
  6. package/dist/src/plugin/accounts.d.ts +9 -1
  7. package/dist/src/plugin/accounts.d.ts.map +1 -1
  8. package/dist/src/plugin/accounts.js +81 -1
  9. package/dist/src/plugin/accounts.js.map +1 -1
  10. package/dist/src/plugin/config/loader.d.ts.map +1 -1
  11. package/dist/src/plugin/config/loader.js +10 -1
  12. package/dist/src/plugin/config/loader.js.map +1 -1
  13. package/dist/src/plugin/config/schema.d.ts +32 -0
  14. package/dist/src/plugin/config/schema.d.ts.map +1 -1
  15. package/dist/src/plugin/config/schema.js +29 -0
  16. package/dist/src/plugin/config/schema.js.map +1 -1
  17. package/dist/src/plugin/core/streaming/transformer.d.ts +2 -1
  18. package/dist/src/plugin/core/streaming/transformer.d.ts.map +1 -1
  19. package/dist/src/plugin/core/streaming/transformer.js +98 -4
  20. package/dist/src/plugin/core/streaming/transformer.js.map +1 -1
  21. package/dist/src/plugin/core/streaming/types.d.ts +1 -0
  22. package/dist/src/plugin/core/streaming/types.d.ts.map +1 -1
  23. package/dist/src/plugin/image.d.ts.map +1 -1
  24. package/dist/src/plugin/image.js +50 -67
  25. package/dist/src/plugin/image.js.map +1 -1
  26. package/dist/src/plugin/request-helpers.d.ts +30 -17
  27. package/dist/src/plugin/request-helpers.d.ts.map +1 -1
  28. package/dist/src/plugin/request-helpers.js +117 -25
  29. package/dist/src/plugin/request-helpers.js.map +1 -1
  30. package/dist/src/plugin/request.d.ts.map +1 -1
  31. package/dist/src/plugin/request.js +118 -18
  32. package/dist/src/plugin/request.js.map +1 -1
  33. package/dist/src/plugin/search.d.ts.map +1 -1
  34. package/dist/src/plugin/search.js +44 -48
  35. package/dist/src/plugin/search.js.map +1 -1
  36. package/dist/src/plugin/storage.d.ts.map +1 -1
  37. package/dist/src/plugin/storage.js +104 -3
  38. package/dist/src/plugin/storage.js.map +1 -1
  39. package/dist/src/plugin/transform/gemini.d.ts.map +1 -1
  40. package/dist/src/plugin/transform/gemini.js +22 -3
  41. package/dist/src/plugin/transform/gemini.js.map +1 -1
  42. package/dist/src/plugin/transform/index.d.ts +2 -1
  43. package/dist/src/plugin/transform/index.d.ts.map +1 -1
  44. package/dist/src/plugin/transform/index.js +1 -1
  45. package/dist/src/plugin/transform/index.js.map +1 -1
  46. package/dist/src/plugin/transform/model-resolver.d.ts +14 -3
  47. package/dist/src/plugin/transform/model-resolver.d.ts.map +1 -1
  48. package/dist/src/plugin/transform/model-resolver.js +83 -16
  49. package/dist/src/plugin/transform/model-resolver.js.map +1 -1
  50. package/dist/src/plugin/transform/types.d.ts +2 -0
  51. package/dist/src/plugin/transform/types.d.ts.map +1 -1
  52. package/dist/src/plugin/types.d.ts +1 -1
  53. package/dist/src/plugin/types.d.ts.map +1 -1
  54. package/dist/src/plugin.d.ts.map +1 -1
  55. package/dist/src/plugin.js +223 -351
  56. package/dist/src/plugin.js.map +1 -1
  57. package/package.json +68 -65
package/README.md CHANGED
@@ -1,15 +1,20 @@
1
1
  # Antigravity + Gemini CLI OAuth Plugin for Opencode (Enhanced Fork)
2
2
 
3
+ [English](#english) | [简体中文](#简体中文)
4
+
5
+ <a name="english"></a>
6
+
3
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
4
8
 
5
- > **This is an enhanced fork** that merges the best features from two excellent projects:
9
+ > **This is an enhanced fork** that merges the best features from multiple excellent projects:
6
10
  >
7
11
  > | Feature | Source |
8
12
  > | ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
9
13
  > | Dual Quota System, Multi-Account Rotation, Session Recovery, Thinking Recovery | [NoeFabris/opencode-antigravity-auth](https://github.com/NoeFabris/opencode-antigravity-auth) |
10
- > | `google_search` Tool (Web Search & URL Analysis) | [shekohex/opencode-google-antigravity-auth](https://github.com/shekohex/opencode-google-antigravity-auth) |
14
+ > | `google_search` Tool (Experimental) | [shekohex/opencode-google-antigravity-auth](https://github.com/shekohex/opencode-google-antigravity-auth) |
15
+ > | `generate_image` Tool (Native Implementation) | Ported from Antigravity Manager logic |
11
16
  >
12
- > **Credits:** Thanks to [@NoeFabris](https://github.com/NoeFabris) and [@shekohex](https://github.com/shekohex) for their original work!
17
+ > **Status:** Version 1.1.1 - Fixed `@opencode-ai/plugin` dependency resolution (upgraded to v1.0.182+)
13
18
 
14
19
  ---
15
20
 
@@ -24,8 +29,8 @@ Enable Opencode to authenticate against **Antigravity** (Google's IDE) via OAuth
24
29
  - **Extended Thinking** - Native support for Claude thinking budgets and Gemini 3 thinking levels
25
30
  - **Auto Recovery** - Automatic session recovery from Claude tool_result_missing errors
26
31
  - **Plugin Compatible** - Works alongside other OpenCode plugins (opencodesync, etc.)
27
- - **google_search Tool** - Built-in web search and URL analysis powered by Antigravity API
28
- - **generate_image Tool** - (NEW) AI image generation with auto-save and WebP conversion
32
+ - **generate_image Tool** - AI image generation with auto-save, WebP conversion, and 4K support (Stability varies)
33
+ - **google_search Tool** - (WIP) Built-in web search. Currently returning "Preview access required" errors.
29
34
 
30
35
  ## Installation
31
36
 
@@ -36,7 +41,7 @@ Enable Opencode to authenticate against **Antigravity** (Google's IDE) via OAuth
36
41
  Paste this into any LLM agent (Claude Code, OpenCode, Cursor, etc.):
37
42
 
38
43
  ```
39
- Install the opencode-antigravity-auth plugin and add the Antigravity model definitions to ~/.config/opencode/opencode.json by following: https://raw.githubusercontent.com/Darkstarrd-dev/opencode-antigravity-auth/main/README.md
44
+ Install the opencode-antigravity-auth-remix plugin and add the Antigravity model definitions to ~/.config/opencode/opencode.json by following: https://raw.githubusercontent.com/Darkstarrd-dev/opencode-antigravity-auth/main/README.md
40
45
  ```
41
46
 
42
47
  **Option B: Manual setup**
@@ -45,7 +50,7 @@ Install the opencode-antigravity-auth plugin and add the Antigravity model defin
45
50
 
46
51
  ```json
47
52
  {
48
- "plugin": ["opencode-antigravity-auth-remix@1.0.8"]
53
+ "plugin": ["opencode-antigravity-auth-remix@1.1.1"]
49
54
  }
50
55
  ```
51
56
 
@@ -55,353 +60,161 @@ Install the opencode-antigravity-auth plugin and add the Antigravity model defin
55
60
  opencode auth login
56
61
  ```
57
62
 
58
- 3. **Add models** (see [Available Models](#available-models) for full list):
59
-
60
- ```json
61
- {
62
- "plugin": ["opencode-antigravity-auth-remix@1.0.8"],
63
- "provider": {
64
- "google": {
65
- "models": {
66
- "antigravity-claude-sonnet-4-5": {
67
- "name": "Claude Sonnet 4.5 (Antigravity)",
68
- "limit": { "context": 200000, "output": 64000 },
69
- "modalities": {
70
- "input": ["text", "image", "pdf"],
71
- "output": ["text"]
72
- }
73
- }
74
- }
75
- }
76
- }
77
- }
78
- ```
63
+ 3. **Add models** - Copy the complete configuration below to your `~/.config/opencode/opencode.json`:
79
64
 
80
65
  4. **Use it:**
81
66
 
82
67
  ```bash
83
- opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5
68
+ opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5-thinking-high
84
69
  ```
85
70
 
86
- <details>
87
- <summary><b>Installation Guide for LLM Agents</b></summary>
88
-
89
- ### Step-by-Step Instructions
90
-
91
- 1. Edit the OpenCode configuration file:
92
- - Linux/Mac: `~/.config/opencode/opencode.json`
93
- - Windows: `%APPDATA%\opencode\opencode.json`
94
-
95
- 2. Add the plugin to the `plugins` array
96
-
97
- 3. Set `provider` to `"google"` and choose a model
98
-
99
- ### Complete Configuration Example
100
-
101
- Create `~/.config/opencode/opencode.json`:
102
-
103
- ```json
104
- {
105
- "$schema": "https://opencode.ai/config.json",
106
- "plugin": ["opencode-antigravity-auth-remix@1.0.8"],
107
- "provider": {
108
- "google": {
109
- "models": {
110
- "antigravity-gemini-3-pro-low": {
111
- "name": "Gemini 3 Pro Low (Antigravity)",
112
- "limit": { "context": 1048576, "output": 65535 },
113
- "modalities": {
114
- "input": ["text", "image", "pdf"],
115
- "output": ["text"]
116
- }
117
- },
118
- "antigravity-gemini-3-pro-high": {
119
- "name": "Gemini 3 Pro High (Antigravity)",
120
- "limit": { "context": 1048576, "output": 65535 },
121
- "modalities": {
122
- "input": ["text", "image", "pdf"],
123
- "output": ["text"]
124
- }
125
- },
126
- "antigravity-gemini-3-flash": {
127
- "name": "Gemini 3 Flash (Antigravity)",
128
- "limit": { "context": 1048576, "output": 65536 },
129
- "modalities": {
130
- "input": ["text", "image", "pdf"],
131
- "output": ["text"]
132
- }
133
- },
134
- "gemini-3-pro-low": {
135
- "name": "Gemini 3 Pro Low (Gemini)",
136
- "limit": { "context": 1048576, "output": 65535 },
137
- "modalities": {
138
- "input": ["text", "image", "pdf"],
139
- "output": ["text"]
140
- }
141
- },
142
- "gemini-3-pro-high": {
143
- "name": "Gemini 3 Pro High (Gemini)",
144
- "limit": { "context": 1048576, "output": 65535 },
145
- "modalities": {
146
- "input": ["text", "image", "pdf"],
147
- "output": ["text"]
148
- }
149
- },
150
- "gemini-3-flash": {
151
- "name": "Gemini 3 Flash (Gemini)",
152
- "limit": { "context": 1048576, "output": 65536 },
153
- "modalities": {
154
- "input": ["text", "image", "pdf"],
155
- "output": ["text"]
156
- }
157
- },
158
- "antigravity-claude-sonnet-4-5": {
159
- "name": "Claude Sonnet 4.5 (Antigravity)",
160
- "limit": { "context": 200000, "output": 64000 },
161
- "modalities": {
162
- "input": ["text", "image", "pdf"],
163
- "output": ["text"]
164
- }
165
- },
166
- "antigravity-claude-sonnet-4-5-thinking-low": {
167
- "name": "Claude Sonnet 4.5 Low (Antigravity)",
168
- "limit": { "context": 200000, "output": 64000 },
169
- "modalities": {
170
- "input": ["text", "image", "pdf"],
171
- "output": ["text"]
172
- }
173
- },
174
- "antigravity-claude-sonnet-4-5-thinking-medium": {
175
- "name": "Claude Sonnet 4.5 Medium (Antigravity)",
176
- "limit": { "context": 200000, "output": 64000 },
177
- "modalities": {
178
- "input": ["text", "image", "pdf"],
179
- "output": ["text"]
180
- }
181
- },
182
- "antigravity-claude-sonnet-4-5-thinking-high": {
183
- "name": "Claude Sonnet 4.5 High (Antigravity)",
184
- "limit": { "context": 200000, "output": 64000 },
185
- "modalities": {
186
- "input": ["text", "image", "pdf"],
187
- "output": ["text"]
188
- }
189
- },
190
- "antigravity-claude-opus-4-5-thinking-low": {
191
- "name": "Claude Opus 4.5 Low (Antigravity)",
192
- "limit": { "context": 200000, "output": 64000 },
193
- "modalities": {
194
- "input": ["text", "image", "pdf"],
195
- "output": ["text"]
196
- }
197
- },
198
- "antigravity-claude-opus-4-5-thinking-medium": {
199
- "name": "Claude Opus 4.5 Medium (Antigravity)",
200
- "limit": { "context": 200000, "output": 64000 },
201
- "modalities": {
202
- "input": ["text", "image", "pdf"],
203
- "output": ["text"]
204
- }
205
- },
206
- "antigravity-claude-opus-4-5-thinking-high": {
207
- "name": "Claude Opus 4.5 High (Antigravity)",
208
- "limit": { "context": 200000, "output": 64000 },
209
- "modalities": {
210
- "input": ["text", "image", "pdf"],
211
- "output": ["text"]
212
- }
213
- }
214
- }
215
- }
216
- }
217
- }
218
- ```
219
-
220
- ### Verification
221
-
222
- ```bash
223
- opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5
224
- ```
225
-
226
- </details>
227
-
228
71
  ## Available Models
229
72
 
230
73
  ### Antigravity Quota
231
74
 
232
- Models with `antigravity-` prefix use Antigravity quota:
233
-
234
- | Model | Description |
235
- | ------------------------------------------------------ | --------------------------------- |
236
- | `google/antigravity-gemini-3-flash` | Gemini 3 Flash (minimal thinking) |
237
- | `google/antigravity-gemini-3-pro-low` | Gemini 3 Pro with low thinking |
238
- | `google/antigravity-gemini-3-pro-high` | Gemini 3 Pro with high thinking |
239
- | `google/antigravity-claude-sonnet-4-5` | Claude Sonnet 4.5 (no thinking) |
240
- | `google/antigravity-claude-sonnet-4-5-thinking-low` | Sonnet with 8K thinking budget |
241
- | `google/antigravity-claude-sonnet-4-5-thinking-medium` | Sonnet with 16K thinking budget |
242
- | `google/antigravity-claude-sonnet-4-5-thinking-high` | Sonnet with 32K thinking budget |
243
- | `google/antigravity-claude-opus-4-5-thinking-low` | Opus with 8K thinking budget |
244
- | `google/antigravity-claude-opus-4-5-thinking-medium` | Opus with 16K thinking budget |
245
- | `google/antigravity-claude-opus-4-5-thinking-high` | Opus with 32K thinking budget |
75
+ Models with `antigravity-` prefix use **Antigravity quota** (Claude + Gemini 3):
246
76
 
247
- > **Backward compatibility:** Old model names (`gemini-3-pro-low`, `gemini-3-pro-high`, `gemini-3-flash`) still work as a fallback. However, you should update to the `antigravity-` prefix for stability. See [Migration Guide](#migration-guide-v127).
77
+ | # | Model | Variants | Description |
78
+ |---| ------------------------------------------- | ------------------------------ | ------------------------------ |
79
+ | 01| `google/antigravity-gemini-3-pro` | `-low`, `-high` | Gemini 3 Pro with thinking |
80
+ | 02| `google/antigravity-gemini-3-flash` | `-minimal`, `-low`, `-medium`, `-high` | Gemini 3 Flash with thinking |
81
+ | 03| `google/antigravity-claude-opus-4-5-thinking` | `-low`, `-medium`, `-high` | Claude Opus 4.5 with thinking |
82
+ | 04| `google/antigravity-claude-sonnet-4-5-thinking` | `-low`, `-medium`, `-high` | Claude Sonnet 4.5 with thinking|
83
+ | 05| `google/antigravity-claude-sonnet-4-5` | - | Claude Sonnet 4.5 (no thinking)|
248
84
 
249
85
  ### Gemini CLI Quota
250
86
 
251
- Models with `-preview` suffix use Gemini CLI quota:
87
+ Models without `antigravity-` prefix use **Gemini CLI quota**:
252
88
 
253
- | Model | Description |
254
- | ------------------------------- | ------------------------ |
255
- | `google/gemini-2.5-flash` | Gemini 2.5 Flash |
256
- | `google/gemini-2.5-pro` | Gemini 2.5 Pro |
257
- | `google/gemini-3-flash-preview` | Gemini 3 Flash (preview) |
258
- | `google/gemini-3-pro-preview` | Gemini 3 Pro (preview) |
89
+ | # | Model | Variants | Description |
90
+ |---| ------------------------------- | ------------------------------------- | ------------------------------ |
91
+ | 06| `google/gemini-3-pro-preview` | `-low`, `-medium`, `-high` | Gemini 3 Pro (CLI quota) |
92
+ | 07| `google/gemini-3-flash-preview` | `-minimal`, `-low`, `-medium`, `-high`| Gemini 3 Flash (CLI quota) |
93
+ | 08| `google/gemini-2.5-pro` | - | Gemini 2.5 Pro |
94
+ | 09| `google/gemini-2.5-flash` | - | Gemini 2.5 Flash |
95
+ | 10| `google/gemini-2.5-flash-lite` | - | Gemini 2.5 Flash Lite |
259
96
 
260
- <details>
261
- <summary><b>Full models configuration</b></summary>
97
+ ## Complete Configuration
98
+
99
+ Copy this to `~/.config/opencode/opencode.json`:
262
100
 
263
101
  ```json
264
102
  {
265
103
  "$schema": "https://opencode.ai/config.json",
266
- "plugin": ["opencode-antigravity-auth-remix@1.0.8"],
104
+ "plugin": ["opencode-antigravity-auth-remix@1.1.1"],
267
105
  "provider": {
268
106
  "google": {
269
107
  "models": {
270
- "antigravity-gemini-3-pro-low": {
271
- "name": "Gemini 3 Pro Low (Antigravity)",
272
- "limit": { "context": 1048576, "output": 65535 },
273
- "modalities": {
274
- "input": ["text", "image", "pdf"],
275
- "output": ["text"]
276
- }
277
- },
278
- "antigravity-gemini-3-pro-high": {
279
- "name": "Gemini 3 Pro High (Antigravity)",
108
+ "antigravity-gemini-3-pro": {
109
+ "id": "antigravity-gemini-3-pro",
110
+ "name": "#01 Gemini 3 Pro (Antigravity)",
111
+ "reasoning": true,
280
112
  "limit": { "context": 1048576, "output": 65535 },
281
- "modalities": {
282
- "input": ["text", "image", "pdf"],
283
- "output": ["text"]
113
+ "cost": { "input": 0, "output": 0 },
114
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
115
+ "variants": {
116
+ "low": { "options": { "thinkingConfig": { "thinkingLevel": "low", "includeThoughts": true } } },
117
+ "high": { "options": { "thinkingConfig": { "thinkingLevel": "high", "includeThoughts": true } } }
284
118
  }
285
119
  },
286
120
  "antigravity-gemini-3-flash": {
287
- "name": "Gemini 3 Flash (Antigravity)",
288
- "limit": { "context": 1048576, "output": 65536 },
289
- "modalities": {
290
- "input": ["text", "image", "pdf"],
291
- "output": ["text"]
292
- }
293
- },
294
- "gemini-3-pro-low": {
295
- "name": "Gemini 3 Pro Low (Antigravity)",
296
- "limit": { "context": 1048576, "output": 65535 },
297
- "modalities": {
298
- "input": ["text", "image", "pdf"],
299
- "output": ["text"]
300
- }
301
- },
302
- "gemini-3-pro-high": {
303
- "name": "Gemini 3 Pro High (Antigravity)",
304
- "limit": { "context": 1048576, "output": 65535 },
305
- "modalities": {
306
- "input": ["text", "image", "pdf"],
307
- "output": ["text"]
308
- }
309
- },
310
- "gemini-3-flash": {
311
- "name": "Gemini 3 Flash (Antigravity)",
121
+ "id": "antigravity-gemini-3-flash",
122
+ "name": "#02 Gemini 3 Flash (Antigravity)",
123
+ "reasoning": true,
312
124
  "limit": { "context": 1048576, "output": 65536 },
313
- "modalities": {
314
- "input": ["text", "image", "pdf"],
315
- "output": ["text"]
316
- }
317
- },
318
- "antigravity-claude-sonnet-4-5": {
319
- "name": "Claude Sonnet 4.5 (Antigravity)",
320
- "limit": { "context": 200000, "output": 64000 },
321
- "modalities": {
322
- "input": ["text", "image", "pdf"],
323
- "output": ["text"]
324
- }
325
- },
326
- "antigravity-claude-sonnet-4-5-thinking-low": {
327
- "name": "Claude Sonnet 4.5 Think Low (Antigravity)",
328
- "limit": { "context": 200000, "output": 64000 },
329
- "modalities": {
330
- "input": ["text", "image", "pdf"],
331
- "output": ["text"]
125
+ "cost": { "input": 0, "output": 0 },
126
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
127
+ "variants": {
128
+ "minimal": { "options": { "thinkingConfig": { "thinkingLevel": "minimal", "includeThoughts": true } } },
129
+ "low": { "options": { "thinkingConfig": { "thinkingLevel": "low", "includeThoughts": true } } },
130
+ "medium": { "options": { "thinkingConfig": { "thinkingLevel": "medium", "includeThoughts": true } } },
131
+ "high": { "options": { "thinkingConfig": { "thinkingLevel": "high", "includeThoughts": true } } }
332
132
  }
333
133
  },
334
- "antigravity-claude-sonnet-4-5-thinking-medium": {
335
- "name": "Claude Sonnet 4.5 Think Medium (Antigravity)",
134
+ "antigravity-claude-opus-4-5-thinking": {
135
+ "id": "antigravity-claude-opus-4-5-thinking",
136
+ "name": "#03 Claude Opus 4.5 Thinking (Antigravity)",
137
+ "reasoning": true,
336
138
  "limit": { "context": 200000, "output": 64000 },
337
- "modalities": {
338
- "input": ["text", "image", "pdf"],
339
- "output": ["text"]
139
+ "cost": { "input": 0, "output": 0 },
140
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
141
+ "variants": {
142
+ "low": { "options": { "thinkingConfig": { "thinkingBudget": 8192, "includeThoughts": true } } },
143
+ "medium": { "options": { "thinkingConfig": { "thinkingBudget": 16384, "includeThoughts": true } } },
144
+ "high": { "options": { "thinkingConfig": { "thinkingBudget": 32768, "includeThoughts": true } } }
340
145
  }
341
146
  },
342
- "antigravity-claude-sonnet-4-5-thinking-high": {
343
- "name": "Claude Sonnet 4.5 Think High (Antigravity)",
147
+ "antigravity-claude-sonnet-4-5-thinking": {
148
+ "id": "antigravity-claude-sonnet-4-5-thinking",
149
+ "name": "#04 Claude Sonnet 4.5 Thinking (Antigravity)",
150
+ "reasoning": true,
344
151
  "limit": { "context": 200000, "output": 64000 },
345
- "modalities": {
346
- "input": ["text", "image", "pdf"],
347
- "output": ["text"]
152
+ "cost": { "input": 0, "output": 0 },
153
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
154
+ "variants": {
155
+ "low": { "options": { "thinkingConfig": { "thinkingBudget": 8192, "includeThoughts": true } } },
156
+ "medium": { "options": { "thinkingConfig": { "thinkingBudget": 16384, "includeThoughts": true } } },
157
+ "high": { "options": { "thinkingConfig": { "thinkingBudget": 32768, "includeThoughts": true } } }
348
158
  }
349
159
  },
350
- "antigravity-claude-opus-4-5-thinking-low": {
351
- "name": "Claude Opus 4.5 Think Low (Antigravity)",
352
- "limit": { "context": 200000, "output": 64000 },
353
- "modalities": {
354
- "input": ["text", "image", "pdf"],
355
- "output": ["text"]
356
- }
357
- },
358
- "antigravity-claude-opus-4-5-thinking-medium": {
359
- "name": "Claude Opus 4.5 Think Medium (Antigravity)",
160
+ "antigravity-claude-sonnet-4-5": {
161
+ "id": "antigravity-claude-sonnet-4-5",
162
+ "name": "#05 Claude Sonnet 4.5 (Antigravity)",
163
+ "reasoning": false,
360
164
  "limit": { "context": 200000, "output": 64000 },
361
- "modalities": {
362
- "input": ["text", "image", "pdf"],
363
- "output": ["text"]
364
- }
165
+ "cost": { "input": 0, "output": 0 },
166
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
365
167
  },
366
- "antigravity-claude-opus-4-5-thinking-high": {
367
- "name": "Claude Opus 4.5 Think High (Antigravity)",
368
- "limit": { "context": 200000, "output": 64000 },
369
- "modalities": {
370
- "input": ["text", "image", "pdf"],
371
- "output": ["text"]
168
+ "gemini-3-pro-preview": {
169
+ "id": "gemini-3-pro-preview",
170
+ "name": "#06 Gemini 3 Pro (CLI)",
171
+ "reasoning": true,
172
+ "limit": { "context": 1000000, "output": 64000 },
173
+ "cost": { "input": 0, "output": 0 },
174
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
175
+ "variants": {
176
+ "low": { "options": { "thinkingConfig": { "thinkingLevel": "low", "includeThoughts": true } } },
177
+ "medium": { "options": { "thinkingConfig": { "thinkingLevel": "medium", "includeThoughts": true } } },
178
+ "high": { "options": { "thinkingConfig": { "thinkingLevel": "high", "includeThoughts": true } } }
372
179
  }
373
180
  },
374
- "gemini-2.5-flash": {
375
- "name": "Gemini 2.5 Flash (CLI)",
181
+ "gemini-3-flash-preview": {
182
+ "id": "gemini-3-flash-preview",
183
+ "name": "#07 Gemini 3 Flash (CLI)",
184
+ "reasoning": true,
376
185
  "limit": { "context": 1048576, "output": 65536 },
377
- "modalities": {
378
- "input": ["text", "image", "pdf"],
379
- "output": ["text"]
186
+ "cost": { "input": 0, "output": 0 },
187
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
188
+ "variants": {
189
+ "minimal": { "options": { "thinkingConfig": { "thinkingLevel": "minimal", "includeThoughts": true } } },
190
+ "low": { "options": { "thinkingConfig": { "thinkingLevel": "low", "includeThoughts": true } } },
191
+ "medium": { "options": { "thinkingConfig": { "thinkingLevel": "medium", "includeThoughts": true } } },
192
+ "high": { "options": { "thinkingConfig": { "thinkingLevel": "high", "includeThoughts": true } } }
380
193
  }
381
194
  },
382
195
  "gemini-2.5-pro": {
383
- "name": "Gemini 2.5 Pro (CLI)",
196
+ "id": "gemini-2.5-pro",
197
+ "name": "#08 Gemini 2.5 Pro (CLI)",
198
+ "reasoning": true,
384
199
  "limit": { "context": 1048576, "output": 65536 },
385
- "modalities": {
386
- "input": ["text", "image", "pdf"],
387
- "output": ["text"]
388
- }
200
+ "cost": { "input": 0, "output": 0 },
201
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
389
202
  },
390
- "gemini-3-flash-preview": {
391
- "name": "Gemini 3 Flash Preview (CLI)",
203
+ "gemini-2.5-flash": {
204
+ "id": "gemini-2.5-flash",
205
+ "name": "#09 Gemini 2.5 Flash (CLI)",
206
+ "reasoning": false,
392
207
  "limit": { "context": 1048576, "output": 65536 },
393
- "modalities": {
394
- "input": ["text", "image", "pdf"],
395
- "output": ["text"]
396
- }
208
+ "cost": { "input": 0, "output": 0 },
209
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
397
210
  },
398
- "gemini-3-pro-preview": {
399
- "name": "Gemini 3 Pro Preview (CLI)",
400
- "limit": { "context": 1048576, "output": 65535 },
401
- "modalities": {
402
- "input": ["text", "image", "pdf"],
403
- "output": ["text"]
404
- }
211
+ "gemini-2.5-flash-lite": {
212
+ "id": "gemini-2.5-flash-lite",
213
+ "name": "#10 Gemini 2.5 Flash Lite (CLI)",
214
+ "reasoning": false,
215
+ "limit": { "context": 1048576, "output": 65536 },
216
+ "cost": { "input": 0, "output": 0 },
217
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
405
218
  }
406
219
  }
407
220
  }
@@ -409,347 +222,304 @@ Models with `-preview` suffix use Gemini CLI quota:
409
222
  }
410
223
  ```
411
224
 
412
- </details>
413
-
414
- ## Multi-Account Setup
415
-
416
- Add multiple Google accounts for higher combined quotas. The plugin automatically rotates between accounts when one is rate-limited.
225
+ ### Usage Examples
417
226
 
418
227
  ```bash
419
- opencode auth login
420
- ```
421
-
422
- <details>
423
- <summary><b>How multi-account works</b></summary>
424
-
425
- ### Load Balancing Behavior
426
-
427
- - **Sticky account selection** - Sticks to the same account until rate-limited (preserves Anthropic's prompt cache)
428
- - **Per-model-family limits** - Rate limits tracked separately for Claude and Gemini models
429
- - **Dual quota pools for Gemini** - Automatic fallback between Antigravity quota and Gemini CLI quota before switching accounts
430
- - **Smart retry threshold** - Short rate limits (≤5s) are retried on same account
431
- - **Exponential backoff** - Increasing delays for consecutive rate limits
432
-
433
- ### Dual Quota Pools (Gemini only)
434
-
435
- For Gemini models, the plugin accesses **two independent quota pools** per account:
436
-
437
- | Quota Pool | When Used |
438
- | --------------- | ----------------------------------------- |
439
- | **Antigravity** | Primary (tried first) |
440
- | **Gemini CLI** | Fallback when Antigravity is rate-limited |
441
-
442
- This effectively **doubles your Gemini quota** per account.
443
-
444
- ### Adding Accounts
445
-
446
- When running `opencode auth login` with existing accounts:
228
+ # Antigravity quota models
229
+ opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5-thinking-high
230
+ opencode run "Hello" --model=google/antigravity-gemini-3-pro-high
447
231
 
232
+ # Gemini CLI quota models
233
+ opencode run "Hello" --model=google/gemini-3-pro-preview-high
234
+ opencode run "Hello" --model=google/gemini-2.5-flash
448
235
  ```
449
- 2 account(s) saved:
450
- 1. user1@gmail.com
451
- 2. user2@gmail.com
452
-
453
- (a)dd new account(s) or (f)resh start? [a/f]:
454
- ```
455
-
456
- ### Account Storage
457
-
458
- - Stored in `~/.config/opencode/antigravity-accounts.json`
459
- - Contains OAuth refresh tokens - **treat like a password**
460
- - If Google revokes a token (`invalid_grant`), that account is automatically removed
461
236
 
462
- </details>
463
-
464
- ## Configuration
465
-
466
- Create `~/.config/opencode/antigravity.json` (or `.opencode/antigravity.json` in project root):
467
-
468
- ### General Settings
237
+ ## Built-in Tools
469
238
 
470
- | Option | Default | Description |
471
- | ------------- | ---------- | ---------------------------------------------- |
472
- | `quiet_mode` | `false` | Suppress toast notifications (except recovery) |
473
- | `debug` | `false` | Enable debug logging to file |
474
- | `log_dir` | OS default | Custom directory for debug logs |
475
- | `auto_update` | `true` | Enable automatic plugin updates |
239
+ ### generate_image
476
240
 
477
- ### Session Recovery
241
+ AI image generation with automatic file saving and WebP conversion. Uses `gemini-3-pro-image`.
478
242
 
479
- | Option | Default | Description |
480
- | ------------------ | ------------ | -------------------------------------------- |
481
- | `session_recovery` | `true` | Auto-recover from tool_result_missing errors |
482
- | `auto_resume` | `true` | Auto-send resume prompt after recovery |
483
- | `resume_text` | `"continue"` | Text to send when auto-resuming |
243
+ | Parameter | Type | Required | Default | Description |
244
+ |-----------|------|----------|---------|-------------|
245
+ | `prompt` | string | Yes | - | Image description |
246
+ | `aspect_ratio` | string | No | "1:1" | Aspect ratio |
247
+ | `quality` | string | No | "standard" | Image quality (hd = 4K) |
484
248
 
485
- ### Error Recovery
249
+ **Supported aspect ratios:** `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `21:9`
486
250
 
487
- | Option | Default | Description |
488
- | ------------------------------- | ------- | ----------------------------------------------- |
489
- | `empty_response_max_attempts` | `4` | Retries for empty API responses |
490
- | `empty_response_retry_delay_ms` | `2000` | Delay between retries |
491
- | `tool_id_recovery` | `true` | Fix mismatched tool IDs from context compaction |
492
- | `claude_tool_hardening` | `true` | Prevent tool parameter hallucination |
251
+ **Features:**
252
+ - Auto-saves to `{project}/imgs/` directory
253
+ - Generates WebP version (75% quality) alongside original
254
+ - 4K support via dynamic model configuration
493
255
 
494
- ### Token Management
256
+ ### google_search (WIP)
495
257
 
496
- | Option | Default | Description |
497
- | ---------------------------------- | ------- | --------------------------------------------- |
498
- | `proactive_token_refresh` | `true` | Refresh tokens before expiry |
499
- | `proactive_refresh_buffer_seconds` | `1800` | Refresh 30min before expiry |
500
- | `max_rate_limit_wait_seconds` | `300` | Max wait time when rate limited (0=unlimited) |
501
- | `quota_fallback` | `false` | Try alternate quota when rate limited |
258
+ Web search and URL analysis. Currently experimental and may return "Preview access required" errors due to API restrictions.
502
259
 
503
- ### Environment Overrides
260
+ ## License
504
261
 
505
- ```bash
506
- OPENCODE_ANTIGRAVITY_QUIET=1 # quiet_mode
507
- OPENCODE_ANTIGRAVITY_DEBUG=1 # debug
508
- OPENCODE_ANTIGRAVITY_LOG_DIR=/path # log_dir
509
- OPENCODE_ANTIGRAVITY_KEEP_THINKING=1 # keep_thinking
510
- ```
262
+ MIT
511
263
 
512
- <details>
513
- <summary><b>Full configuration example</b></summary>
264
+ ---
514
265
 
515
- ```json
516
- {
517
- "$schema": "https://raw.githubusercontent.com/Darkstarrd-dev/opencode-antigravity-auth/main/assets/antigravity.schema.json",
518
- "quiet_mode": false,
519
- "debug": false,
520
- "log_dir": "/custom/log/path",
521
- "auto_update": true,
522
- "keep_thinking": false,
523
- "session_recovery": true,
524
- "auto_resume": true,
525
- "resume_text": "continue",
526
- "empty_response_max_attempts": 4,
527
- "empty_response_retry_delay_ms": 2000,
528
- "tool_id_recovery": true,
529
- "claude_tool_hardening": true,
530
- "proactive_token_refresh": true,
531
- "proactive_refresh_buffer_seconds": 1800,
532
- "proactive_refresh_check_interval_seconds": 300,
533
- "max_rate_limit_wait_seconds": 300,
534
- "quota_fallback": false,
535
- "signature_cache": {
536
- "enabled": true,
537
- "memory_ttl_seconds": 3600,
538
- "disk_ttl_seconds": 172800,
539
- "write_interval_seconds": 60
540
- }
541
- }
542
- ```
266
+ <a name="简体中文"></a>
543
267
 
544
- </details>
268
+ # Antigravity + Gemini CLI OAuth Opencode 插件 (增强分支)
545
269
 
546
- ## Troubleshoot
270
+ [English](#english) | [简体中文](#简体中文)
547
271
 
548
- ### Multi account auth issues
272
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
549
273
 
550
- If you encounter auth issue please try remove `antigravity-account.json` and auth again
274
+ > **这是一个增强分支**,融合了多个优秀项目的核心功能:
275
+ >
276
+ > | 功能 | 来源 |
277
+ > | ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
278
+ > | 双配额系统、多账号轮换、会话恢复、思考过程恢复 | [NoeFabris/opencode-antigravity-auth](https://github.com/NoeFabris/opencode-antigravity-auth) |
279
+ > | `google_search` 工具 (实验性) | [shekohex/opencode-google-antigravity-auth](https://github.com/shekohex/opencode-google-antigravity-auth) |
280
+ > | `generate_image` 工具 (原生实现) | 移植自 Antigravity Manager 逻辑 |
281
+ >
282
+ > **状态:** 版本 1.1.1 - 修复了 `@opencode-ai/plugin` 依赖解析问题 (已升级至 v1.0.182+)
551
283
 
552
- ### Gemini model not found
284
+ ---
553
285
 
554
- Try add this line to in `google` field under `provider`
555
- `"npm": "@ai-sdk/google"`
286
+ 使 Opencode 能够通过 OAuth 验证 **Antigravity** (Google 的 IDE),从而让你可以使用 Google 凭据访问 Antigravity 配额并使用 `gemini-3-pro-high` `claude-opus-4-5-thinking` 等模型。
556
287
 
557
- ### Error during the session
288
+ ## 核心功能
558
289
 
559
- If you encounter error during the session, try chat `continue` the recover session mechanism should be trigger and you can continue the session, if the error blocked the session please workaround by use command `/undo` to revert to the state before the error and try again it should work
290
+ - **Google OAuth 登录** - 通过 `opencode auth login` 自动刷新令牌
291
+ - **双配额系统** - 单个插件即可访问 Antigravity 配额 (Claude, Gemini 3) 和 Gemini CLI 配额
292
+ - **多账号轮换** - 支持添加多个 Google 账号;当某个账号触发频率限制时自动切换
293
+ - **实时 SSE 流式传输** - 包括思考块 (Thinking blocks) 和增量输出
294
+ - **扩展思考能力** - 原生支持 Claude 思考预算和 Gemini 3 思考等级
295
+ - **自动恢复** - 自动处理 Claude 的 `tool_result_missing` 错误并恢复会话
296
+ - **插件兼容性** - 可与其他 OpenCode 插件 (如 opencodesync 等) 同时运行
297
+ - **generate_image 工具** - AI 图像生成,支持自动保存、WebP 转换和 4K 输出 (稳定性视配额而定)
298
+ - **google_search 工具** - (开发中) 内置网页搜索。目前可能会返回 "Preview access required" 错误。
560
299
 
561
- ## Known Plugin Interactions
300
+ ## 安装步骤
562
301
 
563
- ### @tarquinen/opencode-dcp
302
+ ### 智能助手安装 (推荐)
564
303
 
565
- DCP creates synthetic assistant messages that lack thinking blocks. **Our plugin must be listed BEFORE DCP:**
304
+ 将以下指令发送给任何 LLM 助手 (Claude Code, OpenCode, Cursor 等):
566
305
 
567
- ```json
568
- {
569
- "plugin": ["opencode-antigravity-auth@beta", "@tarquinen/opencode-dcp@latest"]
570
- }
571
306
  ```
572
-
573
- ### oh-my-opencode
574
-
575
- When using opencode-antigravity-auth, disable the built-in auth and override agent models in oh-my-opencode.json:
576
-
577
- ```json
578
- {
579
- "google_auth": false,
580
- "agents": {
581
- "frontend-ui-ux-engineer": { "model": "google/gemini-3-pro-high" },
582
- "document-writer": { "model": "google/gemini-3-flash" },
583
- "multimodal-looker": { "model": "google/gemini-3-flash" }
584
- }
585
- }
307
+ 参考 https://raw.githubusercontent.com/Darkstarrd-dev/opencode-antigravity-auth/main/README.md 安装 opencode-antigravity-auth-remix 插件,并将 Antigravity 模型定义添加到 ~/.config/opencode/opencode.json。
586
308
  ```
587
309
 
588
- When spawning parallel subagents, multiple processes may select the same account causing rate limit errors. **Workaround:** Add more accounts via `opencode auth login`.
310
+ ### 手动安装
589
311
 
590
- ### Plugins You Don't Need
312
+ 1. **在配置中添加插件** (`~/.config/opencode/opencode.json`):
591
313
 
592
- - **gemini-auth plugins** - Not needed. This plugin handles all Google OAuth authentication.
314
+ ```json
315
+ {
316
+ "plugin": ["opencode-antigravity-auth-remix@1.1.1"]
317
+ }
318
+ ```
593
319
 
594
- <details>
595
- <summary><b>Migration Guide (v1.2.7+)</b></summary>
320
+ 2. **身份验证:**
596
321
 
597
- If upgrading from v1.2.6 or earlier:
322
+ ```bash
323
+ opencode auth login
324
+ ```
598
325
 
599
- ### What Changed
326
+ 3. **添加模型定义** - 将下方的完整配置复制到你的 `~/.config/opencode/opencode.json`。
600
327
 
601
- v1.2.7+ uses explicit prefixes to distinguish quota sources:
328
+ 4. **开始使用:**
602
329
 
603
- | Model Type | New Name (Recommended) | Old Name (Still Works) |
604
- | ---------------------- | ------------------------------- | ---------------------- |
605
- | Gemini 3 (Antigravity) | `antigravity-gemini-3-pro-low` | `gemini-3-pro-low` |
606
- | Gemini 3 (Antigravity) | `antigravity-gemini-3-pro-high` | `gemini-3-pro-high` |
607
- | Gemini 3 (Antigravity) | `antigravity-gemini-3-flash` | `gemini-3-flash` |
608
- | Gemini 3 (CLI) | `gemini-3-pro-preview` | N/A |
609
- | Claude | `antigravity-claude-sonnet-4-5` | `claude-sonnet-4-5` |
330
+ ```bash
331
+ opencode run "你好" --model=google/antigravity-claude-sonnet-4-5-thinking-high
332
+ ```
610
333
 
611
- ### Action Required
334
+ ## 可用模型
612
335
 
613
- **Update your config to use `antigravity-` prefix:**
336
+ ### Antigravity 配额 (Antigravity Quota)
614
337
 
615
- ```diff
616
- - "gemini-3-pro-low": { ... }
617
- + "antigravity-gemini-3-pro-low": { ... }
618
- ```
338
+ 带有 `antigravity-` 前缀的模型使用 **Antigravity 配额** (包含 Claude 和 Gemini 3):
619
339
 
620
- > **Why update?** Old names work now as a fallback, but this depends on Gemini CLI using `-preview` suffix. If Google removes `-preview` in the future, old names may route to the wrong quota. The `antigravity-` prefix is explicit and stable.
340
+ | # | 模型 | 变体 (Variants) | 描述 |
341
+ |---| ------------------------------------------- | ------------------------------ | ------------------------------ |
342
+ | 01| `google/antigravity-gemini-3-pro` | `-low`, `-high` | Gemini 3 Pro (带思考过程) |
343
+ | 02| `google/antigravity-gemini-3-flash` | `-minimal`, `-low`, `-medium`, `-high` | Gemini 3 Flash (带思考过程) |
344
+ | 03| `google/antigravity-claude-opus-4-5-thinking` | `-low`, `-medium`, `-high` | Claude Opus 4.5 (带思考预算) |
345
+ | 04| `google/antigravity-claude-sonnet-4-5-thinking` | `-low`, `-medium`, `-high` | Claude Sonnet 4.5 (带思考预算)|
346
+ | 05| `google/antigravity-claude-sonnet-4-5` | - | Claude Sonnet 4.5 (普通模式)|
621
347
 
622
- ### Step 1: Clear Old Tokens (Optional - do this if you have issues calling models)
348
+ ### Gemini CLI 配额 (Gemini CLI Quota)
623
349
 
624
- ```bash
625
- rm -rf ~/.config/opencode/antigravity-account.json
626
- opencode auth login
627
- ```
350
+ 不带 `antigravity-` 前缀的模型使用 **Gemini CLI 配额**:
628
351
 
629
- ### Step 2: Update opencode.json
352
+ | # | 模型 | 变体 (Variants) | 描述 |
353
+ |---| ------------------------------- | ------------------------------------- | ------------------------------ |
354
+ | 06| `google/gemini-3-pro-preview` | `-low`, `-medium`, `-high` | Gemini 3 Pro (CLI 配额) |
355
+ | 07| `google/gemini-3-flash-preview` | `-minimal`, `-low`, `-medium`, `-high`| Gemini 3 Flash (CLI 配额) |
356
+ | 08| `google/gemini-2.5-pro` | - | Gemini 2.5 Pro |
357
+ | 09| `google/gemini-2.5-flash` | - | Gemini 2.5 Flash |
358
+ | 10| `google/gemini-2.5-flash-lite` | - | Gemini 2.5 Flash Lite |
630
359
 
631
- Models now use `antigravity-` prefix for Antigravity quota. See [Available Models](#available-models).
360
+ ## 完整配置示例
632
361
 
633
- ### Step 3: Create antigravity.json (Optional)
362
+ 将以下内容复制到 `~/.config/opencode/opencode.json`:
634
363
 
635
364
  ```json
636
365
  {
637
- "$schema": "https://raw.githubusercontent.com/Darkstarrd-dev/opencode-antigravity-auth/main/assets/antigravity.schema.json",
638
- "quiet_mode": false,
639
- "debug": false
366
+ "$schema": "https://opencode.ai/config.json",
367
+ "plugin": ["opencode-antigravity-auth-remix@1.1.1"],
368
+ "provider": {
369
+ "google": {
370
+ "models": {
371
+ "antigravity-gemini-3-pro": {
372
+ "id": "antigravity-gemini-3-pro",
373
+ "name": "#01 Gemini 3 Pro (Antigravity)",
374
+ "reasoning": true,
375
+ "limit": { "context": 1048576, "output": 65535 },
376
+ "cost": { "input": 0, "output": 0 },
377
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
378
+ "variants": {
379
+ "low": { "options": { "thinkingConfig": { "thinkingLevel": "low", "includeThoughts": true } } },
380
+ "high": { "options": { "thinkingConfig": { "thinkingLevel": "high", "includeThoughts": true } } }
381
+ }
382
+ },
383
+ "antigravity-gemini-3-flash": {
384
+ "id": "antigravity-gemini-3-flash",
385
+ "name": "#02 Gemini 3 Flash (Antigravity)",
386
+ "reasoning": true,
387
+ "limit": { "context": 1048576, "output": 65536 },
388
+ "cost": { "input": 0, "output": 0 },
389
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
390
+ "variants": {
391
+ "minimal": { "options": { "thinkingConfig": { "thinkingLevel": "minimal", "includeThoughts": true } } },
392
+ "low": { "options": { "thinkingConfig": { "thinkingLevel": "low", "includeThoughts": true } } },
393
+ "medium": { "options": { "thinkingConfig": { "thinkingLevel": "medium", "includeThoughts": true } } },
394
+ "high": { "options": { "thinkingConfig": { "thinkingLevel": "high", "includeThoughts": true } } }
395
+ }
396
+ },
397
+ "antigravity-claude-opus-4-5-thinking": {
398
+ "id": "antigravity-claude-opus-4-5-thinking",
399
+ "name": "#03 Claude Opus 4.5 Thinking (Antigravity)",
400
+ "reasoning": true,
401
+ "limit": { "context": 200000, "output": 64000 },
402
+ "cost": { "input": 0, "output": 0 },
403
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
404
+ "variants": {
405
+ "low": { "options": { "thinkingConfig": { "thinkingBudget": 8192, "includeThoughts": true } } },
406
+ "medium": { "options": { "thinkingConfig": { "thinkingBudget": 16384, "includeThoughts": true } } },
407
+ "high": { "options": { "thinkingConfig": { "thinkingBudget": 32768, "includeThoughts": true } } }
408
+ }
409
+ },
410
+ "antigravity-claude-sonnet-4-5-thinking": {
411
+ "id": "antigravity-claude-sonnet-4-5-thinking",
412
+ "name": "#04 Claude Sonnet 4.5 Thinking (Antigravity)",
413
+ "reasoning": true,
414
+ "limit": { "context": 200000, "output": 64000 },
415
+ "cost": { "input": 0, "output": 0 },
416
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
417
+ "variants": {
418
+ "low": { "options": { "thinkingConfig": { "thinkingBudget": 8192, "includeThoughts": true } } },
419
+ "medium": { "options": { "thinkingConfig": { "thinkingBudget": 16384, "includeThoughts": true } } },
420
+ "high": { "options": { "thinkingConfig": { "thinkingBudget": 32768, "includeThoughts": true } } }
421
+ }
422
+ },
423
+ "antigravity-claude-sonnet-4-5": {
424
+ "id": "antigravity-claude-sonnet-4-5",
425
+ "name": "#05 Claude Sonnet 4.5 (Antigravity)",
426
+ "reasoning": false,
427
+ "limit": { "context": 200000, "output": 64000 },
428
+ "cost": { "input": 0, "output": 0 },
429
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
430
+ },
431
+ "gemini-3-pro-preview": {
432
+ "id": "gemini-3-pro-preview",
433
+ "name": "#06 Gemini 3 Pro (CLI)",
434
+ "reasoning": true,
435
+ "limit": { "context": 1000000, "output": 64000 },
436
+ "cost": { "input": 0, "output": 0 },
437
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
438
+ "variants": {
439
+ "low": { "options": { "thinkingConfig": { "thinkingLevel": "low", "includeThoughts": true } } },
440
+ "medium": { "options": { "thinkingConfig": { "thinkingLevel": "medium", "includeThoughts": true } } },
441
+ "high": { "options": { "thinkingConfig": { "thinkingLevel": "high", "includeThoughts": true } } }
442
+ }
443
+ },
444
+ "gemini-3-flash-preview": {
445
+ "id": "gemini-3-flash-preview",
446
+ "name": "#07 Gemini 3 Flash (CLI)",
447
+ "reasoning": true,
448
+ "limit": { "context": 1048576, "output": 65536 },
449
+ "cost": { "input": 0, "output": 0 },
450
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
451
+ "variants": {
452
+ "minimal": { "options": { "thinkingConfig": { "thinkingLevel": "minimal", "includeThoughts": true } } },
453
+ "low": { "options": { "thinkingConfig": { "thinkingLevel": "low", "includeThoughts": true } } },
454
+ "medium": { "options": { "thinkingConfig": { "thinkingLevel": "medium", "includeThoughts": true } } },
455
+ "high": { "options": { "thinkingConfig": { "thinkingLevel": "high", "includeThoughts": true } } }
456
+ }
457
+ },
458
+ "gemini-2.5-pro": {
459
+ "id": "gemini-2.5-pro",
460
+ "name": "#08 Gemini 2.5 Pro (CLI)",
461
+ "reasoning": true,
462
+ "limit": { "context": 1048576, "output": 65536 },
463
+ "cost": { "input": 0, "output": 0 },
464
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
465
+ },
466
+ "gemini-2.5-flash": {
467
+ "id": "gemini-2.5-flash",
468
+ "name": "#09 Gemini 2.5 Flash (CLI)",
469
+ "reasoning": false,
470
+ "limit": { "context": 1048576, "output": 65536 },
471
+ "cost": { "input": 0, "output": 0 },
472
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
473
+ },
474
+ "gemini-2.5-flash-lite": {
475
+ "id": "gemini-2.5-flash-lite",
476
+ "name": "#10 Gemini 2.5 Flash Lite (CLI)",
477
+ "reasoning": false,
478
+ "limit": { "context": 1048576, "output": 65536 },
479
+ "cost": { "input": 0, "output": 0 },
480
+ "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
481
+ }
482
+ }
483
+ }
484
+ }
640
485
  }
641
486
  ```
642
487
 
643
- </details>
644
-
645
- <details>
646
- <summary><b>E2E Testing</b></summary>
647
-
648
- The plugin includes regression tests for stability verification. Tests consume API quota.
488
+ ## 使用示例
649
489
 
650
490
  ```bash
651
- # Sanity tests (7 tests, ~5 min)
652
- npx tsx script/test-regression.ts --sanity
653
-
654
- # Heavy tests (4 tests, ~30 min)
655
- npx tsx script/test-regression.ts --heavy
656
-
657
- # Concurrent tests (3 tests)
658
- npx tsx script/test-regression.ts --category concurrency
491
+ # 使用 Antigravity 配额模型
492
+ opencode run "你好" --model=google/antigravity-claude-sonnet-4-5-thinking-high
493
+ opencode run "你好" --model=google/antigravity-gemini-3-pro-high
659
494
 
660
- # Run specific test
661
- npx tsx script/test-regression.ts --test thinking-tool-use
662
-
663
- # List tests without running
664
- npx tsx script/test-regression.ts --dry-run
495
+ # 使用 Gemini CLI 配额模型
496
+ opencode run "你好" --model=google/gemini-3-pro-preview-high
497
+ opencode run "你好" --model=google/gemini-2.5-flash
665
498
  ```
666
499
 
667
- </details>
668
-
669
- ## Built-in Tools
670
-
671
- ### google_search
500
+ ## 内置工具
672
501
 
673
- Web search and URL analysis powered by Antigravity API.
502
+ ### generate_image (生图工具)
674
503
 
675
- | Parameter | Type | Required | Description |
676
- |-----------|------|----------|-------------|
677
- | `query` | string | Yes | Search query |
678
- | `urls` | string[] | No | URLs to analyze |
679
- | `thinking` | boolean | Yes | Enable thinking mode |
504
+ 基于 `gemini-3-pro-image` 实现的 AI 图像生成工具,支持自动保存和 WebP 格式转换。
680
505
 
681
- ### generate_image
682
-
683
- AI image generation with automatic file saving and WebP conversion.
684
-
685
- | Parameter | Type | Required | Default | Description |
506
+ | 参数 | 类型 | 是否必填 | 默认值 | 描述 |
686
507
  |-----------|------|----------|---------|-------------|
687
- | `prompt` | string | Yes | - | Image description |
688
- | `aspect_ratio` | string | No | "1:1" | Aspect ratio |
689
- | `quality` | string | No | "standard" | Image quality |
690
-
691
- **Supported aspect ratios:** `1:1` (square), `16:9` (landscape), `9:16` (portrait), `4:3`, `3:4`, `21:9` (wide)
692
-
693
- **Features:**
694
- - Auto-saves to `{project}/imgs/` directory
695
- - Generates WebP version (75% quality) alongside original
696
- - Logs all requests to `imgs/list.md`
697
-
698
- **Trigger phrases:** "generate an image of...", "draw a picture of...", "create an illustration of..."
699
-
700
- ## Debugging
701
-
702
- ```bash
703
- OPENCODE_ANTIGRAVITY_DEBUG=1 opencode # Basic logging
704
- OPENCODE_ANTIGRAVITY_DEBUG=2 opencode # Verbose (full request/response bodies)
705
- ```
508
+ | `prompt` | string | | - | 图像描述词 |
509
+ | `aspect_ratio` | string | | "1:1" | 纵横比 |
510
+ | `quality` | string | | "standard" | 图像质量 (hd = 4K) |
706
511
 
707
- Logs are written to `~/.config/opencode/antigravity-logs/`.
512
+ **支持的纵横比:** `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `21:9`
708
513
 
709
- ## Documentation
514
+ **主要特性:**
515
+ - 自动保存至项目目录下的 `{project}/imgs/`
516
+ - 同时生成 WebP 版本 (75% 质量) 以节省空间
517
+ - 支持动态配置 4K (HD) 高清输出
710
518
 
711
- - [Architecture](docs/ARCHITECTURE.md) - Plugin internals and request flow
712
- - [API Spec](docs/ANTIGRAVITY_API_SPEC.md) - Antigravity API reference
519
+ ### google_search (搜索工具 - 开发中)
713
520
 
714
- <details>
715
- <summary><b>Safety, Usage & Legal</b></summary>
521
+ 网页搜索和 URL 分析。由于 API 限制,目前处于实验阶段,可能会触发 "Preview access required" 错误。
716
522
 
717
- ### Intended Use
718
-
719
- - Personal / internal development only
720
- - Respect internal quotas and data handling policies
721
- - Not for production services or bypassing intended limits
722
-
723
- ### Warning (Assumption of Risk)
724
-
725
- By using this plugin, you acknowledge:
726
-
727
- - **Terms of Service risk** - This approach may violate ToS of AI model providers
728
- - **Account risk** - Providers may suspend or ban accounts
729
- - **No guarantees** - APIs may change without notice
730
- - **Assumption of risk** - You assume all legal, financial, and technical risks
731
-
732
- ### Legal
733
-
734
- - Not affiliated with Google. This is an independent open-source project.
735
- - "Antigravity", "Gemini", "Google Cloud", and "Google" are trademarks of Google LLC.
736
- - Software is provided "as is", without warranty.
737
-
738
- </details>
739
-
740
- ## Credits
741
-
742
- Built with help from:
743
-
744
- - [opencode-gemini-auth](https://github.com/jenslys/opencode-gemini-auth) - Gemini OAuth groundwork by [@jenslys](https://github.com/jenslys)
745
- - [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI) - Antigravity API reference
746
-
747
- ## Support
748
-
749
- If this plugin helps you, consider supporting its continued maintenance:
750
-
751
- [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/S6S81QBOIR)
752
-
753
- ## License
523
+ ## 开源协议
754
524
 
755
525
  MIT