antigravity-claude-proxy 2.1.0 → 2.2.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.
- package/README.md +31 -6
- package/package.json +3 -2
- package/public/css/src/input.css +0 -2
- package/public/css/style.css +1 -1
- package/public/index.html +0 -1
- package/public/js/components/server-config.js +97 -0
- package/public/js/config/constants.js +21 -1
- package/public/js/data-store.js +0 -7
- package/public/js/translations/en.js +24 -0
- package/public/js/translations/id.js +25 -0
- package/public/js/translations/pt.js +26 -0
- package/public/js/translations/tr.js +26 -0
- package/public/js/translations/zh.js +25 -0
- package/public/js/utils/account-actions.js +0 -10
- package/public/js/utils/error-handler.js +0 -50
- package/public/js/utils/validators.js +0 -93
- package/public/views/settings.html +157 -0
- package/src/account-manager/index.js +91 -41
- package/src/account-manager/strategies/base-strategy.js +104 -0
- package/src/account-manager/strategies/hybrid-strategy.js +195 -0
- package/src/account-manager/strategies/index.js +85 -0
- package/src/account-manager/strategies/round-robin-strategy.js +76 -0
- package/src/account-manager/strategies/sticky-strategy.js +138 -0
- package/src/account-manager/strategies/trackers/health-tracker.js +162 -0
- package/src/account-manager/strategies/trackers/index.js +8 -0
- package/src/account-manager/strategies/trackers/token-bucket-tracker.js +121 -0
- package/src/cli/accounts.js +13 -9
- package/src/cloudcode/message-handler.js +163 -37
- package/src/cloudcode/streaming-handler.js +162 -34
- package/src/config.js +21 -2
- package/src/constants.js +21 -11
- package/src/errors.js +36 -1
- package/src/format/request-converter.js +10 -0
- package/src/format/signature-cache.js +0 -34
- package/src/format/thinking-utils.js +5 -5
- package/src/index.js +49 -13
- package/src/server.js +66 -10
- package/src/utils/helpers.js +0 -29
- package/src/utils/logger.js +0 -3
- package/src/webui/index.js +11 -1
- package/public/js/app-init.js +0 -140
- package/public/js/components/model-manager.js +0 -47
- package/src/account-manager/selection.js +0 -201
- package/src/utils/retry.js +0 -161
package/README.md
CHANGED
|
@@ -272,13 +272,37 @@ Gemini models include full thinking support with `thoughtSignature` handling for
|
|
|
272
272
|
|
|
273
273
|
## Multi-Account Load Balancing
|
|
274
274
|
|
|
275
|
-
When you add multiple accounts, the proxy
|
|
275
|
+
When you add multiple accounts, the proxy intelligently distributes requests across them using configurable selection strategies.
|
|
276
276
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
277
|
+
### Account Selection Strategies
|
|
278
|
+
|
|
279
|
+
Choose a strategy based on your needs:
|
|
280
|
+
|
|
281
|
+
| Strategy | Best For | Description |
|
|
282
|
+
| --- | --- | --- |
|
|
283
|
+
| **Hybrid** (Default) | Most users | Smart selection combining health score, token bucket rate limiting, and LRU freshness |
|
|
284
|
+
| **Sticky** | Prompt caching | Stays on the same account to maximize cache hits, switches only when rate-limited |
|
|
285
|
+
| **Round-Robin** | Even distribution | Cycles through accounts sequentially for balanced load |
|
|
286
|
+
|
|
287
|
+
**Configure via CLI:**
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
antigravity-claude-proxy start --strategy=hybrid # Default: smart distribution
|
|
291
|
+
antigravity-claude-proxy start --strategy=sticky # Cache-optimized
|
|
292
|
+
antigravity-claude-proxy start --strategy=round-robin # Load-balanced
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
**Or via WebUI:** Settings → Server → Account Selection Strategy
|
|
296
|
+
|
|
297
|
+
### How It Works
|
|
298
|
+
|
|
299
|
+
- **Health Score Tracking**: Accounts earn points for successful requests and lose points for failures/rate-limits
|
|
300
|
+
- **Token Bucket Rate Limiting**: Client-side throttling with regenerating tokens (50 max, 6/minute)
|
|
301
|
+
- **Automatic Cooldown**: Rate-limited accounts recover automatically after reset time expires
|
|
302
|
+
- **Invalid Account Detection**: Accounts needing re-authentication are marked and skipped
|
|
303
|
+
- **Prompt Caching Support**: Session IDs derived from conversation enable cache hits across turns
|
|
304
|
+
|
|
305
|
+
### Monitoring
|
|
282
306
|
|
|
283
307
|
Check account status, subscription tiers, and quota anytime:
|
|
284
308
|
|
|
@@ -395,6 +419,7 @@ npm run test:streaming # Streaming SSE events
|
|
|
395
419
|
npm run test:interleaved # Interleaved thinking
|
|
396
420
|
npm run test:images # Image processing
|
|
397
421
|
npm run test:caching # Prompt caching
|
|
422
|
+
npm run test:strategies # Account selection strategies
|
|
398
423
|
```
|
|
399
424
|
|
|
400
425
|
---
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antigravity-claude-proxy",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Proxy server to use Antigravity's Claude models with Claude Code CLI",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"test:crossmodel": "node tests/test-cross-model-thinking.cjs",
|
|
35
35
|
"test:oauth": "node tests/test-oauth-no-browser.cjs",
|
|
36
36
|
"test:emptyretry": "node tests/test-empty-response-retry.cjs",
|
|
37
|
-
"test:sanitizer": "node tests/test-schema-sanitizer.cjs"
|
|
37
|
+
"test:sanitizer": "node tests/test-schema-sanitizer.cjs",
|
|
38
|
+
"test:strategies": "node tests/test-strategies.cjs"
|
|
38
39
|
},
|
|
39
40
|
"keywords": [
|
|
40
41
|
"claude",
|
package/public/css/src/input.css
CHANGED