opencode-antigravity-auth-remix 1.0.8 → 1.1.0

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 +15 -628
  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 +67 -65
package/README.md CHANGED
@@ -2,14 +2,15 @@
2
2
 
3
3
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
4
4
 
5
- > **This is an enhanced fork** that merges the best features from two excellent projects:
5
+ > **This is an enhanced fork** that merges the best features from multiple excellent projects:
6
6
  >
7
7
  > | Feature | Source |
8
8
  > | ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
9
9
  > | 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) |
10
+ > | `google_search` Tool (Experimental) | [shekohex/opencode-google-antigravity-auth](https://github.com/shekohex/opencode-google-antigravity-auth) |
11
+ > | `generate_image` Tool (Native Implementation) | Ported from Antigravity Manager logic |
11
12
  >
12
- > **Credits:** Thanks to [@NoeFabris](https://github.com/NoeFabris) and [@shekohex](https://github.com/shekohex) for their original work!
13
+ > **Status:** Version 1.1.0 - Stable Image Gen, Dual Channel (CLI/Anti), Search Tool (WIP/Disabled)
13
14
 
14
15
  ---
15
16
 
@@ -24,8 +25,8 @@ Enable Opencode to authenticate against **Antigravity** (Google's IDE) via OAuth
24
25
  - **Extended Thinking** - Native support for Claude thinking budgets and Gemini 3 thinking levels
25
26
  - **Auto Recovery** - Automatic session recovery from Claude tool_result_missing errors
26
27
  - **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
28
+ - **generate_image Tool** - AI image generation with auto-save, WebP conversion, and 4K support (Stability varies)
29
+ - **google_search Tool** - (WIP) Built-in web search. Currently returning "Preview access required" errors.
29
30
 
30
31
  ## Installation
31
32
 
@@ -36,7 +37,7 @@ Enable Opencode to authenticate against **Antigravity** (Google's IDE) via OAuth
36
37
  Paste this into any LLM agent (Claude Code, OpenCode, Cursor, etc.):
37
38
 
38
39
  ```
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
40
+ 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
41
  ```
41
42
 
42
43
  **Option B: Manual setup**
@@ -45,7 +46,7 @@ Install the opencode-antigravity-auth plugin and add the Antigravity model defin
45
46
 
46
47
  ```json
47
48
  {
48
- "plugin": ["opencode-antigravity-auth-remix@1.0.8"]
49
+ "plugin": ["opencode-antigravity-auth-remix@1.1.0"]
49
50
  }
50
51
  ```
51
52
 
@@ -59,7 +60,7 @@ Install the opencode-antigravity-auth plugin and add the Antigravity model defin
59
60
 
60
61
  ```json
61
62
  {
62
- "plugin": ["opencode-antigravity-auth-remix@1.0.8"],
63
+ "plugin": ["opencode-antigravity-auth-remix@1.1.0"],
63
64
  "provider": {
64
65
  "google": {
65
66
  "models": {
@@ -83,148 +84,6 @@ Install the opencode-antigravity-auth plugin and add the Antigravity model defin
83
84
  opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5
84
85
  ```
85
86
 
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
87
  ## Available Models
229
88
 
230
89
  ### Antigravity Quota
@@ -244,8 +103,6 @@ Models with `antigravity-` prefix use Antigravity quota:
244
103
  | `google/antigravity-claude-opus-4-5-thinking-medium` | Opus with 16K thinking budget |
245
104
  | `google/antigravity-claude-opus-4-5-thinking-high` | Opus with 32K thinking budget |
246
105
 
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).
248
-
249
106
  ### Gemini CLI Quota
250
107
 
251
108
  Models with `-preview` suffix use Gemini CLI quota:
@@ -257,498 +114,28 @@ Models with `-preview` suffix use Gemini CLI quota:
257
114
  | `google/gemini-3-flash-preview` | Gemini 3 Flash (preview) |
258
115
  | `google/gemini-3-pro-preview` | Gemini 3 Pro (preview) |
259
116
 
260
- <details>
261
- <summary><b>Full models configuration</b></summary>
262
-
263
- ```json
264
- {
265
- "$schema": "https://opencode.ai/config.json",
266
- "plugin": ["opencode-antigravity-auth-remix@1.0.8"],
267
- "provider": {
268
- "google": {
269
- "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)",
280
- "limit": { "context": 1048576, "output": 65535 },
281
- "modalities": {
282
- "input": ["text", "image", "pdf"],
283
- "output": ["text"]
284
- }
285
- },
286
- "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)",
312
- "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"]
332
- }
333
- },
334
- "antigravity-claude-sonnet-4-5-thinking-medium": {
335
- "name": "Claude Sonnet 4.5 Think Medium (Antigravity)",
336
- "limit": { "context": 200000, "output": 64000 },
337
- "modalities": {
338
- "input": ["text", "image", "pdf"],
339
- "output": ["text"]
340
- }
341
- },
342
- "antigravity-claude-sonnet-4-5-thinking-high": {
343
- "name": "Claude Sonnet 4.5 Think High (Antigravity)",
344
- "limit": { "context": 200000, "output": 64000 },
345
- "modalities": {
346
- "input": ["text", "image", "pdf"],
347
- "output": ["text"]
348
- }
349
- },
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)",
360
- "limit": { "context": 200000, "output": 64000 },
361
- "modalities": {
362
- "input": ["text", "image", "pdf"],
363
- "output": ["text"]
364
- }
365
- },
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"]
372
- }
373
- },
374
- "gemini-2.5-flash": {
375
- "name": "Gemini 2.5 Flash (CLI)",
376
- "limit": { "context": 1048576, "output": 65536 },
377
- "modalities": {
378
- "input": ["text", "image", "pdf"],
379
- "output": ["text"]
380
- }
381
- },
382
- "gemini-2.5-pro": {
383
- "name": "Gemini 2.5 Pro (CLI)",
384
- "limit": { "context": 1048576, "output": 65536 },
385
- "modalities": {
386
- "input": ["text", "image", "pdf"],
387
- "output": ["text"]
388
- }
389
- },
390
- "gemini-3-flash-preview": {
391
- "name": "Gemini 3 Flash Preview (CLI)",
392
- "limit": { "context": 1048576, "output": 65536 },
393
- "modalities": {
394
- "input": ["text", "image", "pdf"],
395
- "output": ["text"]
396
- }
397
- },
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
- }
405
- }
406
- }
407
- }
408
- }
409
- }
410
- ```
411
-
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.
417
-
418
- ```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:
447
-
448
- ```
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
-
462
- </details>
463
-
464
- ## Configuration
465
-
466
- Create `~/.config/opencode/antigravity.json` (or `.opencode/antigravity.json` in project root):
467
-
468
- ### General Settings
469
-
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 |
476
-
477
- ### Session Recovery
478
-
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 |
484
-
485
- ### Error Recovery
486
-
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 |
493
-
494
- ### Token Management
495
-
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 |
502
-
503
- ### Environment Overrides
504
-
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
- ```
511
-
512
- <details>
513
- <summary><b>Full configuration example</b></summary>
514
-
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
- ```
543
-
544
- </details>
545
-
546
- ## Troubleshoot
547
-
548
- ### Multi account auth issues
549
-
550
- If you encounter auth issue please try remove `antigravity-account.json` and auth again
551
-
552
- ### Gemini model not found
553
-
554
- Try add this line to in `google` field under `provider`
555
- `"npm": "@ai-sdk/google"`
556
-
557
- ### Error during the session
558
-
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
560
-
561
- ## Known Plugin Interactions
562
-
563
- ### @tarquinen/opencode-dcp
564
-
565
- DCP creates synthetic assistant messages that lack thinking blocks. **Our plugin must be listed BEFORE DCP:**
566
-
567
- ```json
568
- {
569
- "plugin": ["opencode-antigravity-auth@beta", "@tarquinen/opencode-dcp@latest"]
570
- }
571
- ```
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
- }
586
- ```
587
-
588
- When spawning parallel subagents, multiple processes may select the same account causing rate limit errors. **Workaround:** Add more accounts via `opencode auth login`.
589
-
590
- ### Plugins You Don't Need
591
-
592
- - **gemini-auth plugins** - Not needed. This plugin handles all Google OAuth authentication.
593
-
594
- <details>
595
- <summary><b>Migration Guide (v1.2.7+)</b></summary>
596
-
597
- If upgrading from v1.2.6 or earlier:
598
-
599
- ### What Changed
600
-
601
- v1.2.7+ uses explicit prefixes to distinguish quota sources:
602
-
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` |
610
-
611
- ### Action Required
612
-
613
- **Update your config to use `antigravity-` prefix:**
614
-
615
- ```diff
616
- - "gemini-3-pro-low": { ... }
617
- + "antigravity-gemini-3-pro-low": { ... }
618
- ```
619
-
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.
621
-
622
- ### Step 1: Clear Old Tokens (Optional - do this if you have issues calling models)
623
-
624
- ```bash
625
- rm -rf ~/.config/opencode/antigravity-account.json
626
- opencode auth login
627
- ```
628
-
629
- ### Step 2: Update opencode.json
630
-
631
- Models now use `antigravity-` prefix for Antigravity quota. See [Available Models](#available-models).
632
-
633
- ### Step 3: Create antigravity.json (Optional)
634
-
635
- ```json
636
- {
637
- "$schema": "https://raw.githubusercontent.com/Darkstarrd-dev/opencode-antigravity-auth/main/assets/antigravity.schema.json",
638
- "quiet_mode": false,
639
- "debug": false
640
- }
641
- ```
642
-
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.
649
-
650
- ```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
659
-
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
665
- ```
666
-
667
- </details>
668
-
669
117
  ## Built-in Tools
670
118
 
671
- ### google_search
672
-
673
- Web search and URL analysis powered by Antigravity API.
674
-
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 |
680
-
681
119
  ### generate_image
682
120
 
683
- AI image generation with automatic file saving and WebP conversion.
121
+ AI image generation with automatic file saving and WebP conversion. Uses `gemini-3-pro-image`.
684
122
 
685
123
  | Parameter | Type | Required | Default | Description |
686
124
  |-----------|------|----------|---------|-------------|
687
125
  | `prompt` | string | Yes | - | Image description |
688
126
  | `aspect_ratio` | string | No | "1:1" | Aspect ratio |
689
- | `quality` | string | No | "standard" | Image quality |
127
+ | `quality` | string | No | "standard" | Image quality (hd = 4K) |
690
128
 
691
- **Supported aspect ratios:** `1:1` (square), `16:9` (landscape), `9:16` (portrait), `4:3`, `3:4`, `21:9` (wide)
129
+ **Supported aspect ratios:** `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `21:9`
692
130
 
693
131
  **Features:**
694
132
  - Auto-saves to `{project}/imgs/` directory
695
133
  - 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
- ```
706
-
707
- Logs are written to `~/.config/opencode/antigravity-logs/`.
708
-
709
- ## Documentation
710
-
711
- - [Architecture](docs/ARCHITECTURE.md) - Plugin internals and request flow
712
- - [API Spec](docs/ANTIGRAVITY_API_SPEC.md) - Antigravity API reference
713
-
714
- <details>
715
- <summary><b>Safety, Usage & Legal</b></summary>
716
-
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
134
+ - 4K support via dynamic model configuration
748
135
 
749
- If this plugin helps you, consider supporting its continued maintenance:
136
+ ### google_search (WIP)
750
137
 
751
- [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/S6S81QBOIR)
138
+ Web search and URL analysis. Currently experimental and may return "Preview access required" errors due to API restrictions.
752
139
 
753
140
  ## License
754
141