opencode-antigravity-auth-remix 1.4.0 → 1.4.3

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 (93) hide show
  1. package/README.md +347 -24
  2. package/dist/src/antigravity/oauth.d.ts.map +1 -1
  3. package/dist/src/antigravity/oauth.js +14 -5
  4. package/dist/src/antigravity/oauth.js.map +1 -1
  5. package/dist/src/constants.d.ts +33 -21
  6. package/dist/src/constants.d.ts.map +1 -1
  7. package/dist/src/constants.js +83 -27
  8. package/dist/src/constants.js.map +1 -1
  9. package/dist/src/plugin/accounts.d.ts +42 -3
  10. package/dist/src/plugin/accounts.d.ts.map +1 -1
  11. package/dist/src/plugin/accounts.js +196 -20
  12. package/dist/src/plugin/accounts.js.map +1 -1
  13. package/dist/src/plugin/cli.d.ts +17 -12
  14. package/dist/src/plugin/cli.d.ts.map +1 -1
  15. package/dist/src/plugin/cli.js +56 -15
  16. package/dist/src/plugin/cli.js.map +1 -1
  17. package/dist/src/plugin/config/loader.d.ts.map +1 -1
  18. package/dist/src/plugin/config/loader.js +0 -13
  19. package/dist/src/plugin/config/loader.js.map +1 -1
  20. package/dist/src/plugin/config/schema.d.ts +38 -319
  21. package/dist/src/plugin/config/schema.d.ts.map +1 -1
  22. package/dist/src/plugin/config/schema.js +66 -27
  23. package/dist/src/plugin/config/schema.js.map +1 -1
  24. package/dist/src/plugin/core/streaming/transformer.d.ts.map +1 -1
  25. package/dist/src/plugin/core/streaming/transformer.js +37 -6
  26. package/dist/src/plugin/core/streaming/transformer.js.map +1 -1
  27. package/dist/src/plugin/core/streaming/types.d.ts.map +1 -1
  28. package/dist/src/plugin/debug.d.ts.map +1 -1
  29. package/dist/src/plugin/debug.js +14 -1
  30. package/dist/src/plugin/debug.js.map +1 -1
  31. package/dist/src/plugin/fingerprint.d.ts +70 -0
  32. package/dist/src/plugin/fingerprint.d.ts.map +1 -0
  33. package/dist/src/plugin/fingerprint.js +154 -0
  34. package/dist/src/plugin/fingerprint.js.map +1 -0
  35. package/dist/src/plugin/image.d.ts.map +1 -1
  36. package/dist/src/plugin/image.js +7 -3
  37. package/dist/src/plugin/image.js.map +1 -1
  38. package/dist/src/plugin/project.d.ts.map +1 -1
  39. package/dist/src/plugin/project.js +8 -2
  40. package/dist/src/plugin/project.js.map +1 -1
  41. package/dist/src/plugin/quota.d.ts +25 -0
  42. package/dist/src/plugin/quota.d.ts.map +1 -0
  43. package/dist/src/plugin/quota.js +192 -0
  44. package/dist/src/plugin/quota.js.map +1 -0
  45. package/dist/src/plugin/request-helpers.d.ts +0 -8
  46. package/dist/src/plugin/request-helpers.d.ts.map +1 -1
  47. package/dist/src/plugin/request-helpers.js +61 -43
  48. package/dist/src/plugin/request-helpers.js.map +1 -1
  49. package/dist/src/plugin/request.d.ts +4 -1
  50. package/dist/src/plugin/request.d.ts.map +1 -1
  51. package/dist/src/plugin/request.js +58 -15
  52. package/dist/src/plugin/request.js.map +1 -1
  53. package/dist/src/plugin/rotation.d.ts +5 -4
  54. package/dist/src/plugin/rotation.d.ts.map +1 -1
  55. package/dist/src/plugin/rotation.js +35 -9
  56. package/dist/src/plugin/rotation.js.map +1 -1
  57. package/dist/src/plugin/search.d.ts +13 -5
  58. package/dist/src/plugin/search.d.ts.map +1 -1
  59. package/dist/src/plugin/search.js +71 -113
  60. package/dist/src/plugin/search.js.map +1 -1
  61. package/dist/src/plugin/storage.d.ts +3 -0
  62. package/dist/src/plugin/storage.d.ts.map +1 -1
  63. package/dist/src/plugin/storage.js +15 -2
  64. package/dist/src/plugin/storage.js.map +1 -1
  65. package/dist/src/plugin/transform/gemini.d.ts +1 -13
  66. package/dist/src/plugin/transform/gemini.d.ts.map +1 -1
  67. package/dist/src/plugin/transform/gemini.js +49 -12
  68. package/dist/src/plugin/transform/gemini.js.map +1 -1
  69. package/dist/src/plugin/transform/model-resolver.d.ts.map +1 -1
  70. package/dist/src/plugin/transform/model-resolver.js +4 -2
  71. package/dist/src/plugin/transform/model-resolver.js.map +1 -1
  72. package/dist/src/plugin/transform/types.d.ts +5 -0
  73. package/dist/src/plugin/transform/types.d.ts.map +1 -1
  74. package/dist/src/plugin/ui/ansi.d.ts +32 -0
  75. package/dist/src/plugin/ui/ansi.d.ts.map +1 -0
  76. package/dist/src/plugin/ui/ansi.js +52 -0
  77. package/dist/src/plugin/ui/ansi.js.map +1 -0
  78. package/dist/src/plugin/ui/auth-menu.d.ts +29 -0
  79. package/dist/src/plugin/ui/auth-menu.d.ts.map +1 -0
  80. package/dist/src/plugin/ui/auth-menu.js +97 -0
  81. package/dist/src/plugin/ui/auth-menu.js.map +1 -0
  82. package/dist/src/plugin/ui/confirm.d.ts +2 -0
  83. package/dist/src/plugin/ui/confirm.d.ts.map +1 -0
  84. package/dist/src/plugin/ui/confirm.js +15 -0
  85. package/dist/src/plugin/ui/confirm.js.map +1 -0
  86. package/dist/src/plugin/ui/select.d.ts +14 -0
  87. package/dist/src/plugin/ui/select.d.ts.map +1 -0
  88. package/dist/src/plugin/ui/select.js +174 -0
  89. package/dist/src/plugin/ui/select.js.map +1 -0
  90. package/dist/src/plugin.d.ts.map +1 -1
  91. package/dist/src/plugin.js +452 -179
  92. package/dist/src/plugin.js.map +1 -1
  93. package/package.json +4 -4
package/README.md CHANGED
@@ -10,10 +10,10 @@
10
10
  >
11
11
  > | Feature | Source |
12
12
  > | ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
13
- > | Dual Quota System, Multi-Account Rotation, Session Recovery, Thinking Recovery, `google_search` Tool | [NoeFabris/opencode-antigravity-auth](https://github.com/NoeFabris/opencode-antigravity-auth) |
13
+ > | Dual Quota System, Multi-Account Rotation, Session Recovery, Thinking Recovery | [NoeFabris/opencode-antigravity-auth](https://github.com/NoeFabris/opencode-antigravity-auth) |
14
14
  > | `generate_image` Tool (Native Implementation + Img2Img) | Native Implementation |
15
15
  >
16
- > **Status:** Version 1.3.9 - Added endpoint auto-switching and stability improvements.
16
+ > **Status:** Version 1.4.3 - Aligned endpoint headers and metadata with reference implementation.
17
17
 
18
18
  ---
19
19
 
@@ -29,7 +29,27 @@ Enable Opencode to authenticate against **Antigravity** (Google's IDE) via OAuth
29
29
  - **Auto Recovery** - Automatic session recovery from Claude tool_result_missing errors
30
30
  - **Plugin Compatible** - Works alongside other OpenCode plugins (opencodesync, etc.)
31
31
  - **generate_image Tool** - AI image generation with text-to-image, image-to-image (multi-image fusion), auto-save, and 4K support
32
- - **google_search Tool** - High-quality web search with structural citations and URL analysis.
32
+
33
+ <details open>
34
+ <summary><b>⚠️ Terms of Service Warning — Read Before Installing</b></summary>
35
+
36
+ > [!CAUTION]
37
+ > Using this plugin may violate Google's Terms of Service. A small number of users have reported their Google accounts being **banned** or **shadow-banned** (restricted access without explicit notification).
38
+ >
39
+ > **High-risk scenarios:**
40
+ > - 🚨 **Fresh Google accounts** have a very high chance of getting banned
41
+ > - 🚨 **New accounts with Pro/Ultra subscriptions** are frequently flagged and banned
42
+ >
43
+ > **By using this plugin, you acknowledge:**
44
+ > - This is an unofficial tool not endorsed by Google
45
+ > - Your account may be suspended or permanently banned
46
+ > - You assume all risks associated with using this plugin
47
+ >
48
+ > **Recommendation:** Use an established Google account that you don't rely on for critical services. Avoid creating new accounts specifically for this plugin.
49
+
50
+ </details>
51
+
52
+ ---
33
53
 
34
54
  ## Installation
35
55
 
@@ -49,7 +69,7 @@ Install the opencode-antigravity-auth-remix plugin and add the Antigravity model
49
69
 
50
70
  ```json
51
71
  {
52
- "plugin": ["opencode-antigravity-auth-remix@1.3.9"]
72
+ "plugin": ["opencode-antigravity-auth-remix@1.4.3"]
53
73
  }
54
74
  ```
55
75
 
@@ -100,7 +120,7 @@ Copy this to `~/.config/opencode/opencode.json`:
100
120
  ```json
101
121
  {
102
122
  "$schema": "https://opencode.ai/config.json",
103
- "plugin": ["opencode-antigravity-auth-remix@1.3.8"],
123
+ "plugin": ["opencode-antigravity-auth-remix@1.4.3"],
104
124
  "provider": {
105
125
  "google": {
106
126
  "models": {
@@ -244,7 +264,7 @@ AI image generation with automatic file saving and WebP conversion. Uses `gemini
244
264
  | `prompt` | string | Yes | - | Image description |
245
265
  | `aspect_ratio` | string | No | "1:1" | Aspect ratio |
246
266
  | `quality` | string | No | "standard" | Image quality (hd = 4K) |
247
- | `imagePaths` | string[] | No | [] | List of reference image paths for Image-to-Image generation (max 10) |
267
+ | `reference_images` | string[] | No | [] | List of reference image paths for Image-to-Image generation (max 10) |
248
268
 
249
269
  **Supported aspect ratios:** `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `21:9`
250
270
 
@@ -257,24 +277,26 @@ AI image generation with automatic file saving and WebP conversion. Uses `gemini
257
277
 
258
278
  #### Image-to-Image Guide
259
279
 
260
- To use Image-to-Image generation, provide the absolute local paths of your reference images in the `imagePaths` parameter.
280
+ To use Image-to-Image generation, provide the absolute local paths of your reference images in the `reference_images` parameter.
261
281
 
262
282
  **Scenario 1: Style Transfer**
263
283
  - **Prompt**: "Turn this photo into a cyberpunk style illustration"
264
- - **imagePaths**: `["/path/to/your/photo.jpg"]`
284
+ - **reference_images**: `["/path/to/your/photo.jpg"]`
265
285
 
266
286
  **Scenario 2: Multi-Image Fusion**
267
287
  - **Prompt**: "Combine the cat from the first image and the dog from the second image playing together in a park"
268
- - **imagePaths**: `["/path/to/cat.jpg", "/path/to/dog.png"]`
288
+ - **reference_images**: `["/path/to/cat.jpg", "/path/to/dog.png"]`
269
289
 
270
290
  **Notes**:
271
291
  - Paths must be absolute local file system paths.
272
292
  - Supports JPG, PNG, WebP.
273
293
  - Maximum 10 reference images.
274
294
 
275
- ### google_search
295
+ **Account management options (via `opencode auth login`):**
296
+ - **Check quotas** — View remaining API quota for each account
297
+ - **Manage accounts** — Enable/disable specific accounts for rotation
276
298
 
277
- High-quality web search and URL analysis with structural citations.
299
+ For details on load balancing, dual quota pools, and account storage, see [docs/MULTI-ACCOUNT.md](docs/MULTI-ACCOUNT.md).
278
300
 
279
301
  ## License
280
302
 
@@ -294,10 +316,10 @@ MIT
294
316
  >
295
317
  > | 功能 | 来源 |
296
318
  > | ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
297
- > | 双配额系统、多账号轮换、会话恢复、思考过程恢复、`google_search` 工具 | [NoeFabris/opencode-antigravity-auth](https://github.com/NoeFabris/opencode-antigravity-auth) |
319
+ > | 双配额系统、多账号轮换、会话恢复、思考过程恢复 | [NoeFabris/opencode-antigravity-auth](https://github.com/NoeFabris/opencode-antigravity-auth) |
298
320
  > | `generate_image` 工具 (原生实现 + 图生图) | 原生实现 |
299
321
  >
300
- > **状态:** 版本 1.3.7 - 集成原生工具并优化稳定性。
322
+ > **状态:** 版本 1.4.3 - 对齐了端点请求头和元数据实现。
301
323
 
302
324
  ---
303
325
 
@@ -313,7 +335,6 @@ MIT
313
335
  - **自动恢复** - 自动处理 Claude 的 `tool_result_missing` 错误并恢复会话
314
336
  - **插件兼容性** - 可与其他 OpenCode 插件 (如 opencodesync 等) 同时运行
315
337
  - **generate_image 工具** - AI 图像生成,支持文生图、图生图 (多图融合)、自动保存、WebP 转换和 4K 输出
316
- - **google_search 工具** - 高质量网页搜索,支持结构化引用和 URL 分析。
317
338
 
318
339
  ## 安装步骤
319
340
 
@@ -331,7 +352,7 @@ MIT
331
352
 
332
353
  ```json
333
354
  {
334
- "plugin": ["opencode-antigravity-auth-remix@1.3.9"]
355
+ "plugin": ["opencode-antigravity-auth-remix@1.4.3"]
335
356
  }
336
357
  ```
337
358
 
@@ -382,7 +403,7 @@ MIT
382
403
  ```json
383
404
  {
384
405
  "$schema": "https://opencode.ai/config.json",
385
- "plugin": ["opencode-antigravity-auth-remix@1.3.8"],
406
+ "plugin": ["opencode-antigravity-auth-remix@1.4.3"],
386
407
  "provider": {
387
408
  "google": {
388
409
  "models": {
@@ -505,6 +526,132 @@ MIT
505
526
 
506
527
  ## 使用示例
507
528
 
529
+ ### Gemini 3 Models 400 Error ("Unknown name 'parameters'")
530
+
531
+ **Error:**
532
+ ```
533
+ Invalid JSON payload received. Unknown name "parameters" at 'request.tools[0]'
534
+ ```
535
+
536
+ **Causes:**
537
+ - Tool schema incompatibility with Gemini's strict protobuf validation
538
+ - MCP servers with malformed schemas
539
+ - Plugin version regression
540
+
541
+ **Solutions:**
542
+ 1. **Update to latest beta:**
543
+ ```json
544
+ { "plugin": ["opencode-antigravity-auth@beta"] }
545
+ ```
546
+
547
+ 2. **Disable MCP servers** one-by-one to find the problematic one
548
+
549
+ 3. **Add npm override:**
550
+ ```json
551
+ { "provider": { "google": { "npm": "@ai-sdk/google" } } }
552
+ ```
553
+
554
+ ---
555
+
556
+ ### MCP Servers Causing Errors
557
+
558
+ Some MCP servers have schemas incompatible with Antigravity's strict JSON format.
559
+
560
+ **Common symptom:**
561
+ ```bash
562
+ Invalid function name must start with a letter or underscore
563
+ ```
564
+
565
+ Sometimes it shows up as:
566
+ ```bash
567
+ GenerateContentRequest.tools[0].function_declarations[12].name: Invalid function name must start with a letter or underscore
568
+ ```
569
+
570
+ This usually means an MCP tool name starts with a number (for example, a 1mcp key like `1mcp_*`). Rename the MCP key to start with a letter (e.g., `gw`) or disable that MCP entry for Antigravity models.
571
+
572
+ **Diagnosis:**
573
+ 1. Disable all MCP servers in your config
574
+ 2. Enable one-by-one until error reappears
575
+ 3. Report the specific MCP in a [GitHub issue](https://github.com/NoeFabris/opencode-antigravity-auth/issues)
576
+
577
+ ---
578
+
579
+ ### "All Accounts Rate-Limited" (But Quota Available)
580
+
581
+ **Cause:** Cascade bug in `clearExpiredRateLimits()` in hybrid mode (fixed in recent beta).
582
+
583
+ **Solutions:**
584
+ 1. Update to latest beta version
585
+ 2. If persists, delete accounts file and re-authenticate
586
+ 3. Try switching `account_selection_strategy` to `"sticky"` in `antigravity.json`
587
+
588
+ ---
589
+
590
+ ### Session Recovery
591
+
592
+ If you encounter errors during a session:
593
+ 1. Type `continue` to trigger the recovery mechanism
594
+ 2. If blocked, use `/undo` to revert to pre-error state
595
+ 3. Retry the operation
596
+
597
+ ---
598
+
599
+ ### Using with Oh-My-OpenCode
600
+
601
+ **Important:** Disable the built-in Google auth to prevent conflicts:
602
+
603
+ ```json
604
+ // ~/.config/opencode/oh-my-opencode.json
605
+ {
606
+ "google_auth": false,
607
+ "agents": {
608
+ "frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3-pro" },
609
+ "document-writer": { "model": "google/antigravity-gemini-3-flash" }
610
+ }
611
+ }
612
+ ```
613
+
614
+ ---
615
+
616
+ ### Infinite `.tmp` Files Created
617
+
618
+ **Cause:** When account is rate-limited and plugin retries infinitely, it creates many temp files.
619
+
620
+ **Workaround:**
621
+ 1. Stop OpenCode
622
+ 2. Clean up: `rm ~/.config/opencode/*.tmp`
623
+ 3. Add more accounts or wait for rate limit to expire
624
+
625
+ ---
626
+
627
+ ### OAuth Callback Issues
628
+
629
+ <details>
630
+ <summary><b>Safari OAuth Callback Fails (macOS)</b></summary>
631
+
632
+ **Symptoms:**
633
+ - "fail to authorize" after successful Google login
634
+ - Safari shows "Safari can't open the page"
635
+
636
+ **Cause:** Safari's "HTTPS-Only Mode" blocks `http://localhost` callback.
637
+
638
+ **Solutions:**
639
+
640
+ 1. **Use Chrome or Firefox** (easiest):
641
+ Copy the OAuth URL and paste into a different browser.
642
+
643
+ 2. **Disable HTTPS-Only Mode temporarily:**
644
+ - Safari > Settings (⌘,) > Privacy
645
+ - Uncheck "Enable HTTPS-Only Mode"
646
+ - Run `opencode auth login`
647
+ - Re-enable after authentication
648
+
649
+ </details>
650
+
651
+ <details>
652
+ <summary><b>Port Conflict (Address Already in Use)</b></summary>
653
+
654
+ **macOS / Linux:**
508
655
  ```bash
509
656
  # 使用 Antigravity 配额模型
510
657
  opencode run "你好" --model=google/antigravity-claude-sonnet-4-5-thinking-high
@@ -526,7 +673,7 @@ opencode run "你好" --model=google/gemini-2.5-flash
526
673
  | `prompt` | string | 是 | - | 图像描述词 |
527
674
  | `aspect_ratio` | string | 否 | "1:1" | 纵横比 |
528
675
  | `quality` | string | 否 | "standard" | 图像质量 (hd = 4K) |
529
- | `imagePaths` | string[] | 否 | [] | 图生图参考图片路径列表 (最多10张) |
676
+ | `reference_images` | string[] | 否 | [] | 图生图参考图片路径列表 (最多10张) |
530
677
 
531
678
  **支持的纵横比:** `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `21:9`
532
679
 
@@ -539,25 +686,201 @@ opencode run "你好" --model=google/gemini-2.5-flash
539
686
 
540
687
  #### 图生图 (Image-to-Image) 使用指南
541
688
 
542
- 要使用图生图功能,只需在调用工具时通过 `imagePaths` 参数提供参考图片的本地绝对路径。
689
+ 要使用图生图功能,只需在调用工具时通过 `reference_images` 参数提供参考图片的本地绝对路径。
543
690
 
544
691
  **示例场景 1:风格迁移**
545
692
  - **Prompt**: "Turn this photo into a cyberpunk style illustration"
546
- - **imagePaths**: `["/path/to/your/photo.jpg"]`
693
+ - **reference_images**: `["/path/to/your/photo.jpg"]`
547
694
 
548
695
  **示例场景 2:多图融合**
549
696
  - **Prompt**: "Combine the cat from the first image and the dog from the second image playing together in a park"
550
- - **imagePaths**: `["/path/to/cat.jpg", "/path/to/dog.png"]`
697
+ - **reference_images**: `["/path/to/cat.jpg", "/path/to/dog.png"]`
551
698
 
552
699
  **注意**:
553
700
  - 图片路径必须是本地文件系统的绝对路径。
554
701
  - 支持 JPG, PNG, WebP 格式。
555
702
  - 最多支持 10 张参考图片。
556
703
 
557
- ### google_search (搜索工具)
558
-
559
- 高质量网页搜索和 URL 分析,支持结构化引用来源。
560
-
561
704
  ## 开源协议
562
705
 
563
706
  MIT
707
+
708
+ ---
709
+
710
+ ### Migrating Accounts Between Machines
711
+
712
+ When copying `antigravity-accounts.json` to a new machine:
713
+ 1. Ensure the plugin is installed: `"plugin": ["opencode-antigravity-auth@beta"]`
714
+ 2. Copy `~/.config/opencode/antigravity-accounts.json`
715
+ 3. If you get "API key missing" error, the refresh token may be invalid — re-authenticate
716
+
717
+ ## Known Plugin Interactions
718
+ For details on load balancing, dual quota pools, and account storage, see [docs/MULTI-ACCOUNT.md](docs/MULTI-ACCOUNT.md).
719
+
720
+ ---
721
+
722
+ ## Plugin Compatibility
723
+
724
+ ### @tarquinen/opencode-dcp
725
+
726
+ DCP creates synthetic assistant messages that lack thinking blocks. **List this plugin BEFORE DCP:**
727
+
728
+ ```json
729
+ {
730
+ "plugin": [
731
+ "opencode-antigravity-auth@latest",
732
+ "@tarquinen/opencode-dcp@latest"
733
+ ]
734
+ }
735
+ ```
736
+
737
+ ### oh-my-opencode
738
+
739
+ Disable built-in auth and override agent models in `oh-my-opencode.json`:
740
+
741
+ ```json
742
+ {
743
+ "google_auth": false,
744
+ "agents": {
745
+ "frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3-pro" },
746
+ "document-writer": { "model": "google/antigravity-gemini-3-flash" },
747
+ "multimodal-looker": { "model": "google/antigravity-gemini-3-flash" }
748
+ }
749
+ }
750
+ ```
751
+
752
+ > **Tip:** When spawning parallel subagents, enable `pid_offset_enabled: true` in `antigravity.json` to distribute sessions across accounts.
753
+
754
+ ### Plugins you don't need
755
+
756
+ - **gemini-auth plugins** — Not needed. This plugin handles all Google OAuth.
757
+
758
+ ---
759
+
760
+ ## Configuration
761
+
762
+ Create `~/.config/opencode/antigravity.json` for optional settings:
763
+
764
+ ```json
765
+ {
766
+ "$schema": "https://raw.githubusercontent.com/NoeFabris/opencode-antigravity-auth/main/assets/antigravity.schema.json"
767
+ }
768
+ ```
769
+
770
+ Most users don't need to configure anything — defaults work well.
771
+
772
+ ### Model Behavior
773
+
774
+ | Option | Default | What it does |
775
+ |--------|---------|--------------
776
+ | `keep_thinking` | `false` | Preserve Claude's thinking across turns. **Warning:** enabling may degrade model stability. |
777
+ | `session_recovery` | `true` | Auto-recover from tool errors |
778
+
779
+ ### Account Rotation
780
+
781
+ | Your Setup | Recommended Config |
782
+ |------------|-------------------|
783
+ | **1 account** | `"account_selection_strategy": "sticky"` |
784
+ | **2-5 accounts** | Default (`"hybrid"`) works great |
785
+ | **5+ accounts** | `"account_selection_strategy": "round-robin"` |
786
+ | **Parallel agents** | Add `"pid_offset_enabled": true` |
787
+
788
+ ### Rate Limit Scheduling
789
+
790
+ Control how the plugin handles rate limits:
791
+
792
+ | Option | Default | What it does |
793
+ |--------|---------|--------------|
794
+ | `scheduling_mode` | `"cache_first"` | `"cache_first"` = wait for same account (preserves prompt cache), `"balance"` = switch immediately, `"performance_first"` = round-robin |
795
+ | `max_cache_first_wait_seconds` | `60` | Max seconds to wait in cache_first mode before switching accounts |
796
+ | `failure_ttl_seconds` | `3600` | Reset failure count after this many seconds (prevents old failures from permanently penalizing accounts) |
797
+
798
+ **When to use each mode:**
799
+ - **cache_first** (default): Best for long conversations. Waits for the same account to recover, preserving your prompt cache.
800
+ - **balance**: Best for quick tasks. Switches accounts immediately when rate-limited for maximum availability.
801
+ - **performance_first**: Best for many short requests. Distributes load evenly across all accounts.
802
+
803
+ ### App Behavior
804
+
805
+ | Option | Default | What it does |
806
+ |--------|---------|--------------|
807
+ | `quiet_mode` | `false` | Hide toast notifications |
808
+ | `debug` | `false` | Enable debug logging |
809
+ | `auto_update` | `true` | Auto-update plugin |
810
+
811
+ For all options, see [docs/CONFIGURATION.md](docs/CONFIGURATION.md).
812
+
813
+ **Environment variables:**
814
+ ```bash
815
+ OPENCODE_ANTIGRAVITY_DEBUG=1 opencode # Enable debug logging
816
+ OPENCODE_ANTIGRAVITY_DEBUG=2 opencode # Verbose logging
817
+ ```
818
+
819
+ ---
820
+
821
+ ## Troubleshooting
822
+
823
+ See the full [Troubleshooting Guide](docs/TROUBLESHOOTING.md) for solutions to common issues including:
824
+
825
+ - Auth problems and token refresh
826
+ - "Model not found" errors
827
+ - Session recovery
828
+ - Gemini CLI permission errors
829
+ - Safari OAuth issues
830
+ - Plugin compatibility
831
+ - Migration guides
832
+
833
+ ---
834
+
835
+ ## Documentation
836
+
837
+ - [Configuration](docs/CONFIGURATION.md) — All configuration options
838
+ - [Multi-Account](docs/MULTI-ACCOUNT.md) — Load balancing, dual quota pools, account storage
839
+ - [Model Variants](docs/MODEL-VARIANTS.md) — Thinking budgets and variant system
840
+ - [Troubleshooting](docs/TROUBLESHOOTING.md) — Common issues and fixes
841
+ - [Architecture](docs/ARCHITECTURE.md) — How the plugin works
842
+ - [API Spec](docs/ANTIGRAVITY_API_SPEC.md) — Antigravity API reference
843
+
844
+ ---
845
+
846
+ ## Support
847
+
848
+ If this plugin helps you, consider supporting its maintenance:
849
+
850
+ [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/S6S81QBOIR)
851
+
852
+ ---
853
+
854
+ ## Credits
855
+
856
+ - [opencode-gemini-auth](https://github.com/jenslys/opencode-gemini-auth) by [@jenslys](https://github.com/jenslys)
857
+ - [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI)
858
+
859
+ ## License
860
+
861
+ MIT License. See [LICENSE](LICENSE) for details.
862
+
863
+ <details>
864
+ <summary><b>Legal</b></summary>
865
+
866
+ ### Intended Use
867
+
868
+ - Personal / internal development only
869
+ - Respect internal quotas and data handling policies
870
+ - Not for production services or bypassing intended limits
871
+
872
+ ### Warning
873
+
874
+ By using this plugin, you acknowledge:
875
+
876
+ - **Terms of Service risk** — This approach may violate ToS of AI model providers
877
+ - **Account risk** — Providers may suspend or ban accounts
878
+ - **No guarantees** — APIs may change without notice
879
+ - **Assumption of risk** — You assume all legal, financial, and technical risks
880
+
881
+ ### Disclaimer
882
+
883
+ - Not affiliated with Google. This is an independent open-source project.
884
+ - "Antigravity", "Gemini", "Google Cloud", and "Google" are trademarks of Google LLC.
885
+
886
+ </details>
@@ -1 +1 @@
1
- {"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../src/antigravity/oauth.ts"],"names":[],"mappings":"AA0BA;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,+BAA+B;IACvC,IAA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ACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,8BAA8B,CAAC,CAwEzC"}
@@ -1,5 +1,5 @@
1
1
  import { generatePKCE } from "@openauthjs/openauth/pkce";
2
- import { ANTIGRAVITY_CLIENT_ID, ANTIGRAVITY_CLIENT_SECRET, ANTIGRAVITY_REDIRECT_URI, ANTIGRAVITY_SCOPES, ANTIGRAVITY_ENDPOINT_FALLBACKS, ANTIGRAVITY_LOAD_ENDPOINTS, ANTIGRAVITY_HEADERS, } from "../constants";
2
+ import { ANTIGRAVITY_CLIENT_ID, ANTIGRAVITY_CLIENT_SECRET, ANTIGRAVITY_REDIRECT_URI, ANTIGRAVITY_SCOPES, ANTIGRAVITY_ENDPOINT_FALLBACKS, ANTIGRAVITY_LOAD_ENDPOINTS, ANTIGRAVITY_HEADERS, GEMINI_CLI_HEADERS, } from "../constants";
3
3
  import { createLogger } from "../plugin/logger";
4
4
  import { calculateTokenExpiry } from "../plugin/auth";
5
5
  const log = createLogger("oauth");
@@ -62,8 +62,9 @@ async function fetchProjectID(accessToken) {
62
62
  const loadHeaders = {
63
63
  Authorization: `Bearer ${accessToken}`,
64
64
  "Content-Type": "application/json",
65
- "User-Agent": ANTIGRAVITY_HEADERS["User-Agent"],
66
- Host: "cloudcode-pa.googleapis.com",
65
+ "User-Agent": GEMINI_CLI_HEADERS["User-Agent"],
66
+ "X-Goog-Api-Client": GEMINI_CLI_HEADERS["X-Goog-Api-Client"],
67
+ "Client-Metadata": ANTIGRAVITY_HEADERS["Client-Metadata"],
67
68
  };
68
69
  const loadEndpoints = Array.from(new Set([...ANTIGRAVITY_LOAD_ENDPOINTS, ...ANTIGRAVITY_ENDPOINT_FALLBACKS]));
69
70
  for (const baseEndpoint of loadEndpoints) {
@@ -74,7 +75,9 @@ async function fetchProjectID(accessToken) {
74
75
  headers: loadHeaders,
75
76
  body: JSON.stringify({
76
77
  metadata: {
77
- ideType: "ANTIGRAVITY",
78
+ ideType: "IDE_UNSPECIFIED",
79
+ platform: "PLATFORM_UNSPECIFIED",
80
+ pluginType: "GEMINI",
78
81
  },
79
82
  }),
80
83
  });
@@ -113,7 +116,11 @@ export async function exchangeAntigravity(code, state) {
113
116
  const tokenResponse = await fetch("https://oauth2.googleapis.com/token", {
114
117
  method: "POST",
115
118
  headers: {
116
- "Content-Type": "application/x-www-form-urlencoded",
119
+ "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
120
+ "Accept": "*/*",
121
+ "Accept-Encoding": "gzip, deflate, br",
122
+ "User-Agent": GEMINI_CLI_HEADERS["User-Agent"],
123
+ "X-Goog-Api-Client": GEMINI_CLI_HEADERS["X-Goog-Api-Client"],
117
124
  },
118
125
  body: new URLSearchParams({
119
126
  client_id: ANTIGRAVITY_CLIENT_ID,
@@ -132,6 +139,8 @@ export async function exchangeAntigravity(code, state) {
132
139
  const userInfoResponse = await fetch("https://www.googleapis.com/oauth2/v1/userinfo?alt=json", {
133
140
  headers: {
134
141
  Authorization: `Bearer ${tokenPayload.access_token}`,
142
+ "User-Agent": GEMINI_CLI_HEADERS["User-Agent"],
143
+ "X-Goog-Api-Client": GEMINI_CLI_HEADERS["X-Goog-Api-Client"],
135
144
  },
136
145
  });
137
146
  const userInfo = userInfoResponse.ok
@@ -1 +1 @@
1
- {"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../../src/antigravity/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,8BAA8B,EAC9B,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,GAAG,GAAG,YAAY,CAAC,OA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