opencode-antigravity-auth-remix 1.0.7 → 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 (58) hide show
  1. package/README.md +24 -605
  2. package/dist/src/constants.d.ts +40 -6
  3. package/dist/src/constants.d.ts.map +1 -1
  4. package/dist/src/constants.js +135 -6
  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 +75 -0
  24. package/dist/src/plugin/image.d.ts.map +1 -0
  25. package/dist/src/plugin/image.js +364 -0
  26. package/dist/src/plugin/image.js.map +1 -0
  27. package/dist/src/plugin/request-helpers.d.ts +30 -17
  28. package/dist/src/plugin/request-helpers.d.ts.map +1 -1
  29. package/dist/src/plugin/request-helpers.js +117 -25
  30. package/dist/src/plugin/request-helpers.js.map +1 -1
  31. package/dist/src/plugin/request.d.ts.map +1 -1
  32. package/dist/src/plugin/request.js +118 -18
  33. package/dist/src/plugin/request.js.map +1 -1
  34. package/dist/src/plugin/search.d.ts.map +1 -1
  35. package/dist/src/plugin/search.js +44 -48
  36. package/dist/src/plugin/search.js.map +1 -1
  37. package/dist/src/plugin/storage.d.ts.map +1 -1
  38. package/dist/src/plugin/storage.js +104 -3
  39. package/dist/src/plugin/storage.js.map +1 -1
  40. package/dist/src/plugin/transform/gemini.d.ts.map +1 -1
  41. package/dist/src/plugin/transform/gemini.js +22 -3
  42. package/dist/src/plugin/transform/gemini.js.map +1 -1
  43. package/dist/src/plugin/transform/index.d.ts +2 -1
  44. package/dist/src/plugin/transform/index.d.ts.map +1 -1
  45. package/dist/src/plugin/transform/index.js +1 -1
  46. package/dist/src/plugin/transform/index.js.map +1 -1
  47. package/dist/src/plugin/transform/model-resolver.d.ts +14 -3
  48. package/dist/src/plugin/transform/model-resolver.d.ts.map +1 -1
  49. package/dist/src/plugin/transform/model-resolver.js +83 -16
  50. package/dist/src/plugin/transform/model-resolver.js.map +1 -1
  51. package/dist/src/plugin/transform/types.d.ts +2 -0
  52. package/dist/src/plugin/transform/types.d.ts.map +1 -1
  53. package/dist/src/plugin/types.d.ts +1 -1
  54. package/dist/src/plugin/types.d.ts.map +1 -1
  55. package/dist/src/plugin.d.ts.map +1 -1
  56. package/dist/src/plugin.js +230 -308
  57. package/dist/src/plugin.js.map +1 -1
  58. package/package.json +67 -63
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,7 +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** - (NEW) Built-in web search and URL analysis powered by Antigravity API
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.
28
30
 
29
31
  ## Installation
30
32
 
@@ -35,7 +37,7 @@ Enable Opencode to authenticate against **Antigravity** (Google's IDE) via OAuth
35
37
  Paste this into any LLM agent (Claude Code, OpenCode, Cursor, etc.):
36
38
 
37
39
  ```
38
- 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
39
41
  ```
40
42
 
41
43
  **Option B: Manual setup**
@@ -44,7 +46,7 @@ Install the opencode-antigravity-auth plugin and add the Antigravity model defin
44
46
 
45
47
  ```json
46
48
  {
47
- "plugin": ["opencode-antigravity-auth-remix@1.0.7"]
49
+ "plugin": ["opencode-antigravity-auth-remix@1.1.0"]
48
50
  }
49
51
  ```
50
52
 
@@ -58,7 +60,7 @@ Install the opencode-antigravity-auth plugin and add the Antigravity model defin
58
60
 
59
61
  ```json
60
62
  {
61
- "plugin": ["opencode-antigravity-auth-remix@1.0.7"],
63
+ "plugin": ["opencode-antigravity-auth-remix@1.1.0"],
62
64
  "provider": {
63
65
  "google": {
64
66
  "models": {
@@ -82,148 +84,6 @@ Install the opencode-antigravity-auth plugin and add the Antigravity model defin
82
84
  opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5
83
85
  ```
84
86
 
85
- <details>
86
- <summary><b>Installation Guide for LLM Agents</b></summary>
87
-
88
- ### Step-by-Step Instructions
89
-
90
- 1. Edit the OpenCode configuration file:
91
- - Linux/Mac: `~/.config/opencode/opencode.json`
92
- - Windows: `%APPDATA%\opencode\opencode.json`
93
-
94
- 2. Add the plugin to the `plugins` array
95
-
96
- 3. Set `provider` to `"google"` and choose a model
97
-
98
- ### Complete Configuration Example
99
-
100
- Create `~/.config/opencode/opencode.json`:
101
-
102
- ```json
103
- {
104
- "$schema": "https://opencode.ai/config.json",
105
- "plugin": ["opencode-antigravity-auth-remix@1.0.7"],
106
- "provider": {
107
- "google": {
108
- "models": {
109
- "antigravity-gemini-3-pro-low": {
110
- "name": "Gemini 3 Pro Low (Antigravity)",
111
- "limit": { "context": 1048576, "output": 65535 },
112
- "modalities": {
113
- "input": ["text", "image", "pdf"],
114
- "output": ["text"]
115
- }
116
- },
117
- "antigravity-gemini-3-pro-high": {
118
- "name": "Gemini 3 Pro High (Antigravity)",
119
- "limit": { "context": 1048576, "output": 65535 },
120
- "modalities": {
121
- "input": ["text", "image", "pdf"],
122
- "output": ["text"]
123
- }
124
- },
125
- "antigravity-gemini-3-flash": {
126
- "name": "Gemini 3 Flash (Antigravity)",
127
- "limit": { "context": 1048576, "output": 65536 },
128
- "modalities": {
129
- "input": ["text", "image", "pdf"],
130
- "output": ["text"]
131
- }
132
- },
133
- "gemini-3-pro-low": {
134
- "name": "Gemini 3 Pro Low (Gemini)",
135
- "limit": { "context": 1048576, "output": 65535 },
136
- "modalities": {
137
- "input": ["text", "image", "pdf"],
138
- "output": ["text"]
139
- }
140
- },
141
- "gemini-3-pro-high": {
142
- "name": "Gemini 3 Pro High (Gemini)",
143
- "limit": { "context": 1048576, "output": 65535 },
144
- "modalities": {
145
- "input": ["text", "image", "pdf"],
146
- "output": ["text"]
147
- }
148
- },
149
- "gemini-3-flash": {
150
- "name": "Gemini 3 Flash (Gemini)",
151
- "limit": { "context": 1048576, "output": 65536 },
152
- "modalities": {
153
- "input": ["text", "image", "pdf"],
154
- "output": ["text"]
155
- }
156
- },
157
- "antigravity-claude-sonnet-4-5": {
158
- "name": "Claude Sonnet 4.5 (Antigravity)",
159
- "limit": { "context": 200000, "output": 64000 },
160
- "modalities": {
161
- "input": ["text", "image", "pdf"],
162
- "output": ["text"]
163
- }
164
- },
165
- "antigravity-claude-sonnet-4-5-thinking-low": {
166
- "name": "Claude Sonnet 4.5 Low (Antigravity)",
167
- "limit": { "context": 200000, "output": 64000 },
168
- "modalities": {
169
- "input": ["text", "image", "pdf"],
170
- "output": ["text"]
171
- }
172
- },
173
- "antigravity-claude-sonnet-4-5-thinking-medium": {
174
- "name": "Claude Sonnet 4.5 Medium (Antigravity)",
175
- "limit": { "context": 200000, "output": 64000 },
176
- "modalities": {
177
- "input": ["text", "image", "pdf"],
178
- "output": ["text"]
179
- }
180
- },
181
- "antigravity-claude-sonnet-4-5-thinking-high": {
182
- "name": "Claude Sonnet 4.5 High (Antigravity)",
183
- "limit": { "context": 200000, "output": 64000 },
184
- "modalities": {
185
- "input": ["text", "image", "pdf"],
186
- "output": ["text"]
187
- }
188
- },
189
- "antigravity-claude-opus-4-5-thinking-low": {
190
- "name": "Claude Opus 4.5 Low (Antigravity)",
191
- "limit": { "context": 200000, "output": 64000 },
192
- "modalities": {
193
- "input": ["text", "image", "pdf"],
194
- "output": ["text"]
195
- }
196
- },
197
- "antigravity-claude-opus-4-5-thinking-medium": {
198
- "name": "Claude Opus 4.5 Medium (Antigravity)",
199
- "limit": { "context": 200000, "output": 64000 },
200
- "modalities": {
201
- "input": ["text", "image", "pdf"],
202
- "output": ["text"]
203
- }
204
- },
205
- "antigravity-claude-opus-4-5-thinking-high": {
206
- "name": "Claude Opus 4.5 High (Antigravity)",
207
- "limit": { "context": 200000, "output": 64000 },
208
- "modalities": {
209
- "input": ["text", "image", "pdf"],
210
- "output": ["text"]
211
- }
212
- }
213
- }
214
- }
215
- }
216
- }
217
- ```
218
-
219
- ### Verification
220
-
221
- ```bash
222
- opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5
223
- ```
224
-
225
- </details>
226
-
227
87
  ## Available Models
228
88
 
229
89
  ### Antigravity Quota
@@ -243,8 +103,6 @@ Models with `antigravity-` prefix use Antigravity quota:
243
103
  | `google/antigravity-claude-opus-4-5-thinking-medium` | Opus with 16K thinking budget |
244
104
  | `google/antigravity-claude-opus-4-5-thinking-high` | Opus with 32K thinking budget |
245
105
 
246
- > **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).
247
-
248
106
  ### Gemini CLI Quota
249
107
 
250
108
  Models with `-preview` suffix use Gemini CLI quota:
@@ -256,467 +114,28 @@ Models with `-preview` suffix use Gemini CLI quota:
256
114
  | `google/gemini-3-flash-preview` | Gemini 3 Flash (preview) |
257
115
  | `google/gemini-3-pro-preview` | Gemini 3 Pro (preview) |
258
116
 
259
- <details>
260
- <summary><b>Full models configuration</b></summary>
261
-
262
- ```json
263
- {
264
- "$schema": "https://opencode.ai/config.json",
265
- "plugin": ["opencode-antigravity-auth-remix@1.0.7"],
266
- "provider": {
267
- "google": {
268
- "models": {
269
- "antigravity-gemini-3-pro-low": {
270
- "name": "Gemini 3 Pro Low (Antigravity)",
271
- "limit": { "context": 1048576, "output": 65535 },
272
- "modalities": {
273
- "input": ["text", "image", "pdf"],
274
- "output": ["text"]
275
- }
276
- },
277
- "antigravity-gemini-3-pro-high": {
278
- "name": "Gemini 3 Pro High (Antigravity)",
279
- "limit": { "context": 1048576, "output": 65535 },
280
- "modalities": {
281
- "input": ["text", "image", "pdf"],
282
- "output": ["text"]
283
- }
284
- },
285
- "antigravity-gemini-3-flash": {
286
- "name": "Gemini 3 Flash (Antigravity)",
287
- "limit": { "context": 1048576, "output": 65536 },
288
- "modalities": {
289
- "input": ["text", "image", "pdf"],
290
- "output": ["text"]
291
- }
292
- },
293
- "gemini-3-pro-low": {
294
- "name": "Gemini 3 Pro Low (Antigravity)",
295
- "limit": { "context": 1048576, "output": 65535 },
296
- "modalities": {
297
- "input": ["text", "image", "pdf"],
298
- "output": ["text"]
299
- }
300
- },
301
- "gemini-3-pro-high": {
302
- "name": "Gemini 3 Pro High (Antigravity)",
303
- "limit": { "context": 1048576, "output": 65535 },
304
- "modalities": {
305
- "input": ["text", "image", "pdf"],
306
- "output": ["text"]
307
- }
308
- },
309
- "gemini-3-flash": {
310
- "name": "Gemini 3 Flash (Antigravity)",
311
- "limit": { "context": 1048576, "output": 65536 },
312
- "modalities": {
313
- "input": ["text", "image", "pdf"],
314
- "output": ["text"]
315
- }
316
- },
317
- "antigravity-claude-sonnet-4-5": {
318
- "name": "Claude Sonnet 4.5 (Antigravity)",
319
- "limit": { "context": 200000, "output": 64000 },
320
- "modalities": {
321
- "input": ["text", "image", "pdf"],
322
- "output": ["text"]
323
- }
324
- },
325
- "antigravity-claude-sonnet-4-5-thinking-low": {
326
- "name": "Claude Sonnet 4.5 Think Low (Antigravity)",
327
- "limit": { "context": 200000, "output": 64000 },
328
- "modalities": {
329
- "input": ["text", "image", "pdf"],
330
- "output": ["text"]
331
- }
332
- },
333
- "antigravity-claude-sonnet-4-5-thinking-medium": {
334
- "name": "Claude Sonnet 4.5 Think Medium (Antigravity)",
335
- "limit": { "context": 200000, "output": 64000 },
336
- "modalities": {
337
- "input": ["text", "image", "pdf"],
338
- "output": ["text"]
339
- }
340
- },
341
- "antigravity-claude-sonnet-4-5-thinking-high": {
342
- "name": "Claude Sonnet 4.5 Think High (Antigravity)",
343
- "limit": { "context": 200000, "output": 64000 },
344
- "modalities": {
345
- "input": ["text", "image", "pdf"],
346
- "output": ["text"]
347
- }
348
- },
349
- "antigravity-claude-opus-4-5-thinking-low": {
350
- "name": "Claude Opus 4.5 Think Low (Antigravity)",
351
- "limit": { "context": 200000, "output": 64000 },
352
- "modalities": {
353
- "input": ["text", "image", "pdf"],
354
- "output": ["text"]
355
- }
356
- },
357
- "antigravity-claude-opus-4-5-thinking-medium": {
358
- "name": "Claude Opus 4.5 Think Medium (Antigravity)",
359
- "limit": { "context": 200000, "output": 64000 },
360
- "modalities": {
361
- "input": ["text", "image", "pdf"],
362
- "output": ["text"]
363
- }
364
- },
365
- "antigravity-claude-opus-4-5-thinking-high": {
366
- "name": "Claude Opus 4.5 Think High (Antigravity)",
367
- "limit": { "context": 200000, "output": 64000 },
368
- "modalities": {
369
- "input": ["text", "image", "pdf"],
370
- "output": ["text"]
371
- }
372
- },
373
- "gemini-2.5-flash": {
374
- "name": "Gemini 2.5 Flash (CLI)",
375
- "limit": { "context": 1048576, "output": 65536 },
376
- "modalities": {
377
- "input": ["text", "image", "pdf"],
378
- "output": ["text"]
379
- }
380
- },
381
- "gemini-2.5-pro": {
382
- "name": "Gemini 2.5 Pro (CLI)",
383
- "limit": { "context": 1048576, "output": 65536 },
384
- "modalities": {
385
- "input": ["text", "image", "pdf"],
386
- "output": ["text"]
387
- }
388
- },
389
- "gemini-3-flash-preview": {
390
- "name": "Gemini 3 Flash Preview (CLI)",
391
- "limit": { "context": 1048576, "output": 65536 },
392
- "modalities": {
393
- "input": ["text", "image", "pdf"],
394
- "output": ["text"]
395
- }
396
- },
397
- "gemini-3-pro-preview": {
398
- "name": "Gemini 3 Pro Preview (CLI)",
399
- "limit": { "context": 1048576, "output": 65535 },
400
- "modalities": {
401
- "input": ["text", "image", "pdf"],
402
- "output": ["text"]
403
- }
404
- }
405
- }
406
- }
407
- }
408
- }
409
- ```
410
-
411
- </details>
412
-
413
- ## Multi-Account Setup
414
-
415
- Add multiple Google accounts for higher combined quotas. The plugin automatically rotates between accounts when one is rate-limited.
416
-
417
- ```bash
418
- opencode auth login
419
- ```
420
-
421
- <details>
422
- <summary><b>How multi-account works</b></summary>
423
-
424
- ### Load Balancing Behavior
425
-
426
- - **Sticky account selection** - Sticks to the same account until rate-limited (preserves Anthropic's prompt cache)
427
- - **Per-model-family limits** - Rate limits tracked separately for Claude and Gemini models
428
- - **Dual quota pools for Gemini** - Automatic fallback between Antigravity quota and Gemini CLI quota before switching accounts
429
- - **Smart retry threshold** - Short rate limits (≤5s) are retried on same account
430
- - **Exponential backoff** - Increasing delays for consecutive rate limits
431
-
432
- ### Dual Quota Pools (Gemini only)
433
-
434
- For Gemini models, the plugin accesses **two independent quota pools** per account:
435
-
436
- | Quota Pool | When Used |
437
- | --------------- | ----------------------------------------- |
438
- | **Antigravity** | Primary (tried first) |
439
- | **Gemini CLI** | Fallback when Antigravity is rate-limited |
440
-
441
- This effectively **doubles your Gemini quota** per account.
442
-
443
- ### Adding Accounts
444
-
445
- When running `opencode auth login` with existing accounts:
446
-
447
- ```
448
- 2 account(s) saved:
449
- 1. user1@gmail.com
450
- 2. user2@gmail.com
451
-
452
- (a)dd new account(s) or (f)resh start? [a/f]:
453
- ```
454
-
455
- ### Account Storage
456
-
457
- - Stored in `~/.config/opencode/antigravity-accounts.json`
458
- - Contains OAuth refresh tokens - **treat like a password**
459
- - If Google revokes a token (`invalid_grant`), that account is automatically removed
460
-
461
- </details>
462
-
463
- ## Configuration
464
-
465
- Create `~/.config/opencode/antigravity.json` (or `.opencode/antigravity.json` in project root):
466
-
467
- ### General Settings
468
-
469
- | Option | Default | Description |
470
- | ------------- | ---------- | ---------------------------------------------- |
471
- | `quiet_mode` | `false` | Suppress toast notifications (except recovery) |
472
- | `debug` | `false` | Enable debug logging to file |
473
- | `log_dir` | OS default | Custom directory for debug logs |
474
- | `auto_update` | `true` | Enable automatic plugin updates |
475
-
476
- ### Session Recovery
477
-
478
- | Option | Default | Description |
479
- | ------------------ | ------------ | -------------------------------------------- |
480
- | `session_recovery` | `true` | Auto-recover from tool_result_missing errors |
481
- | `auto_resume` | `true` | Auto-send resume prompt after recovery |
482
- | `resume_text` | `"continue"` | Text to send when auto-resuming |
483
-
484
- ### Error Recovery
485
-
486
- | Option | Default | Description |
487
- | ------------------------------- | ------- | ----------------------------------------------- |
488
- | `empty_response_max_attempts` | `4` | Retries for empty API responses |
489
- | `empty_response_retry_delay_ms` | `2000` | Delay between retries |
490
- | `tool_id_recovery` | `true` | Fix mismatched tool IDs from context compaction |
491
- | `claude_tool_hardening` | `true` | Prevent tool parameter hallucination |
492
-
493
- ### Token Management
494
-
495
- | Option | Default | Description |
496
- | ---------------------------------- | ------- | --------------------------------------------- |
497
- | `proactive_token_refresh` | `true` | Refresh tokens before expiry |
498
- | `proactive_refresh_buffer_seconds` | `1800` | Refresh 30min before expiry |
499
- | `max_rate_limit_wait_seconds` | `300` | Max wait time when rate limited (0=unlimited) |
500
- | `quota_fallback` | `false` | Try alternate quota when rate limited |
501
-
502
- ### Environment Overrides
503
-
504
- ```bash
505
- OPENCODE_ANTIGRAVITY_QUIET=1 # quiet_mode
506
- OPENCODE_ANTIGRAVITY_DEBUG=1 # debug
507
- OPENCODE_ANTIGRAVITY_LOG_DIR=/path # log_dir
508
- OPENCODE_ANTIGRAVITY_KEEP_THINKING=1 # keep_thinking
509
- ```
510
-
511
- <details>
512
- <summary><b>Full configuration example</b></summary>
513
-
514
- ```json
515
- {
516
- "$schema": "https://raw.githubusercontent.com/Darkstarrd-dev/opencode-antigravity-auth/main/assets/antigravity.schema.json",
517
- "quiet_mode": false,
518
- "debug": false,
519
- "log_dir": "/custom/log/path",
520
- "auto_update": true,
521
- "keep_thinking": false,
522
- "session_recovery": true,
523
- "auto_resume": true,
524
- "resume_text": "continue",
525
- "empty_response_max_attempts": 4,
526
- "empty_response_retry_delay_ms": 2000,
527
- "tool_id_recovery": true,
528
- "claude_tool_hardening": true,
529
- "proactive_token_refresh": true,
530
- "proactive_refresh_buffer_seconds": 1800,
531
- "proactive_refresh_check_interval_seconds": 300,
532
- "max_rate_limit_wait_seconds": 300,
533
- "quota_fallback": false,
534
- "signature_cache": {
535
- "enabled": true,
536
- "memory_ttl_seconds": 3600,
537
- "disk_ttl_seconds": 172800,
538
- "write_interval_seconds": 60
539
- }
540
- }
541
- ```
542
-
543
- </details>
544
-
545
- ## Troubleshoot
546
-
547
- ### Multi account auth issues
548
-
549
- If you encounter auth issue please try remove `antigravity-account.json` and auth again
550
-
551
- ### Gemini model not found
552
-
553
- Try add this line to in `google` field under `provider`
554
- `"npm": "@ai-sdk/google"`
555
-
556
- ### Error during the session
557
-
558
- 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
559
-
560
- ## Known Plugin Interactions
561
-
562
- ### @tarquinen/opencode-dcp
563
-
564
- DCP creates synthetic assistant messages that lack thinking blocks. **Our plugin must be listed BEFORE DCP:**
565
-
566
- ```json
567
- {
568
- "plugin": ["opencode-antigravity-auth@beta", "@tarquinen/opencode-dcp@latest"]
569
- }
570
- ```
571
-
572
- ### oh-my-opencode
573
-
574
- When using opencode-antigravity-auth, disable the built-in auth and override agent models in oh-my-opencode.json:
575
-
576
- ```json
577
- {
578
- "google_auth": false,
579
- "agents": {
580
- "frontend-ui-ux-engineer": { "model": "google/gemini-3-pro-high" },
581
- "document-writer": { "model": "google/gemini-3-flash" },
582
- "multimodal-looker": { "model": "google/gemini-3-flash" }
583
- }
584
- }
585
- ```
586
-
587
- When spawning parallel subagents, multiple processes may select the same account causing rate limit errors. **Workaround:** Add more accounts via `opencode auth login`.
588
-
589
- ### Plugins You Don't Need
590
-
591
- - **gemini-auth plugins** - Not needed. This plugin handles all Google OAuth authentication.
592
-
593
- <details>
594
- <summary><b>Migration Guide (v1.2.7+)</b></summary>
595
-
596
- If upgrading from v1.2.6 or earlier:
597
-
598
- ### What Changed
599
-
600
- v1.2.7+ uses explicit prefixes to distinguish quota sources:
601
-
602
- | Model Type | New Name (Recommended) | Old Name (Still Works) |
603
- | ---------------------- | ------------------------------- | ---------------------- |
604
- | Gemini 3 (Antigravity) | `antigravity-gemini-3-pro-low` | `gemini-3-pro-low` |
605
- | Gemini 3 (Antigravity) | `antigravity-gemini-3-pro-high` | `gemini-3-pro-high` |
606
- | Gemini 3 (Antigravity) | `antigravity-gemini-3-flash` | `gemini-3-flash` |
607
- | Gemini 3 (CLI) | `gemini-3-pro-preview` | N/A |
608
- | Claude | `antigravity-claude-sonnet-4-5` | `claude-sonnet-4-5` |
609
-
610
- ### Action Required
611
-
612
- **Update your config to use `antigravity-` prefix:**
613
-
614
- ```diff
615
- - "gemini-3-pro-low": { ... }
616
- + "antigravity-gemini-3-pro-low": { ... }
617
- ```
618
-
619
- > **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.
620
-
621
- ### Step 1: Clear Old Tokens (Optional - do this if you have issues calling models)
622
-
623
- ```bash
624
- rm -rf ~/.config/opencode/antigravity-account.json
625
- opencode auth login
626
- ```
627
-
628
- ### Step 2: Update opencode.json
629
-
630
- Models now use `antigravity-` prefix for Antigravity quota. See [Available Models](#available-models).
631
-
632
- ### Step 3: Create antigravity.json (Optional)
633
-
634
- ```json
635
- {
636
- "$schema": "https://raw.githubusercontent.com/Darkstarrd-dev/opencode-antigravity-auth/main/assets/antigravity.schema.json",
637
- "quiet_mode": false,
638
- "debug": false
639
- }
640
- ```
641
-
642
- </details>
643
-
644
- <details>
645
- <summary><b>E2E Testing</b></summary>
646
-
647
- The plugin includes regression tests for stability verification. Tests consume API quota.
648
-
649
- ```bash
650
- # Sanity tests (7 tests, ~5 min)
651
- npx tsx script/test-regression.ts --sanity
652
-
653
- # Heavy tests (4 tests, ~30 min)
654
- npx tsx script/test-regression.ts --heavy
655
-
656
- # Concurrent tests (3 tests)
657
- npx tsx script/test-regression.ts --category concurrency
658
-
659
- # Run specific test
660
- npx tsx script/test-regression.ts --test thinking-tool-use
661
-
662
- # List tests without running
663
- npx tsx script/test-regression.ts --dry-run
664
- ```
665
-
666
- </details>
667
-
668
- ## Debugging
669
-
670
- ```bash
671
- OPENCODE_ANTIGRAVITY_DEBUG=1 opencode # Basic logging
672
- OPENCODE_ANTIGRAVITY_DEBUG=2 opencode # Verbose (full request/response bodies)
673
- ```
674
-
675
- Logs are written to `~/.config/opencode/antigravity-logs/`.
676
-
677
- ## Documentation
678
-
679
- - [Architecture](docs/ARCHITECTURE.md) - Plugin internals and request flow
680
- - [API Spec](docs/ANTIGRAVITY_API_SPEC.md) - Antigravity API reference
681
-
682
- <details>
683
- <summary><b>Safety, Usage & Legal</b></summary>
684
-
685
- ### Intended Use
686
-
687
- - Personal / internal development only
688
- - Respect internal quotas and data handling policies
689
- - Not for production services or bypassing intended limits
690
-
691
- ### Warning (Assumption of Risk)
692
-
693
- By using this plugin, you acknowledge:
694
-
695
- - **Terms of Service risk** - This approach may violate ToS of AI model providers
696
- - **Account risk** - Providers may suspend or ban accounts
697
- - **No guarantees** - APIs may change without notice
698
- - **Assumption of risk** - You assume all legal, financial, and technical risks
699
-
700
- ### Legal
701
-
702
- - Not affiliated with Google. This is an independent open-source project.
703
- - "Antigravity", "Gemini", "Google Cloud", and "Google" are trademarks of Google LLC.
704
- - Software is provided "as is", without warranty.
117
+ ## Built-in Tools
705
118
 
706
- </details>
119
+ ### generate_image
707
120
 
708
- ## Credits
121
+ AI image generation with automatic file saving and WebP conversion. Uses `gemini-3-pro-image`.
709
122
 
710
- Built with help from:
123
+ | Parameter | Type | Required | Default | Description |
124
+ |-----------|------|----------|---------|-------------|
125
+ | `prompt` | string | Yes | - | Image description |
126
+ | `aspect_ratio` | string | No | "1:1" | Aspect ratio |
127
+ | `quality` | string | No | "standard" | Image quality (hd = 4K) |
711
128
 
712
- - [opencode-gemini-auth](https://github.com/jenslys/opencode-gemini-auth) - Gemini OAuth groundwork by [@jenslys](https://github.com/jenslys)
713
- - [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI) - Antigravity API reference
129
+ **Supported aspect ratios:** `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `21:9`
714
130
 
715
- ## Support
131
+ **Features:**
132
+ - Auto-saves to `{project}/imgs/` directory
133
+ - Generates WebP version (75% quality) alongside original
134
+ - 4K support via dynamic model configuration
716
135
 
717
- If this plugin helps you, consider supporting its continued maintenance:
136
+ ### google_search (WIP)
718
137
 
719
- [![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.
720
139
 
721
140
  ## License
722
141