n9router 0.3.96 → 0.3.97
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 +67 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -380,17 +380,78 @@ Your CLI tool → n9router MITM proxy → Antigravity Account A
|
|
|
380
380
|
- Tokens nearing expiry trigger a **background refresh** — zero interruptions
|
|
381
381
|
- Live **pool status dashboard**: quota bars, cooldown countdowns, per-account health
|
|
382
382
|
|
|
383
|
-
|
|
383
|
+
<div align="center">
|
|
384
|
+
<img src="./images/token-rotate-under-the-hood.png" alt="Token Rotate — How It Works Under the Hood" width="700"/>
|
|
385
|
+
</div>
|
|
386
|
+
|
|
387
|
+
### 🚀 Step-by-Step Setup
|
|
388
|
+
|
|
389
|
+
<div align="center">
|
|
390
|
+
<img src="./images/token-rotate-setup-guide.png" alt="Token Rotate Setup Guide" width="600"/>
|
|
391
|
+
</div>
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
**Prerequisites:** n9router must be running (`npm install -g n9router` → `n9router`).
|
|
395
|
+
|
|
396
|
+
**Step 1 — Add Antigravity accounts to the pool**
|
|
397
|
+
|
|
398
|
+
Go to **Dashboard → Providers → Antigravity** and connect at least one account via OAuth. Repeat for every additional account you want in the rotation pool.
|
|
399
|
+
|
|
400
|
+
> **Shortcut:** If you already use Antigravity Management Tools, click **"Import Accounts"** inside the Antigravity provider card to bulk-import all existing accounts in one click — no manual OAuth flow needed.
|
|
401
|
+
|
|
402
|
+
**Step 2 — Start the MITM Server**
|
|
403
|
+
|
|
404
|
+
Go to **Dashboard → n9router Tools → MITM Server** and click **Start**.
|
|
405
|
+
|
|
406
|
+
The MITM proxy intercepts HTTPS traffic between Antigravity IDE and its servers. It needs to be running before rotation can work.
|
|
407
|
+
|
|
408
|
+
**Step 3 — Enable DNS Redirect**
|
|
409
|
+
|
|
410
|
+
Go to **Dashboard → n9router Tools → DNS Redirect** and click **Enable for Antigravity**.
|
|
411
|
+
|
|
412
|
+
This redirects your machine's DNS so that Antigravity IDE's API calls are transparently routed through the local MITM proxy.
|
|
413
|
+
|
|
414
|
+
**Step 4 — Turn on Token Swap Pool**
|
|
415
|
+
|
|
416
|
+
Go to **Dashboard → n9router Tools → Token Swap Pool** and toggle it **ON**.
|
|
417
|
+
|
|
418
|
+
Choose your rotation strategy:
|
|
419
|
+
|
|
420
|
+
| Strategy | When to use |
|
|
421
|
+
|----------|-------------|
|
|
422
|
+
| **Round-Robin** | You have 3+ accounts and want even load distribution |
|
|
423
|
+
| **Sticky** | You have 2 accounts and want to drain one fully before switching |
|
|
424
|
+
|
|
425
|
+
**Step 5 — Restart Antigravity IDE**
|
|
426
|
+
|
|
427
|
+
Fully close Antigravity (quit the app, not just minimize it), then reopen it. This is required because DNS redirect only affects **new** connections — existing sessions still talk to the real Antigravity servers and bypass the proxy.
|
|
428
|
+
|
|
429
|
+
> On macOS: right-click the Antigravity icon in the Dock → **Quit**, then relaunch.
|
|
430
|
+
> On Windows: close from the system tray → relaunch.
|
|
431
|
+
|
|
432
|
+
**Step 6 — Code as usual in Antigravity IDE**
|
|
433
|
+
|
|
434
|
+
No settings changes needed inside Antigravity. Just use it normally — n9router silently rotates accounts in the background whenever a quota limit or 429 is hit.
|
|
384
435
|
|
|
385
436
|
```
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
437
|
+
Antigravity IDE → n9router MITM proxy → Antigravity Account A
|
|
438
|
+
↓ (429 / quota hit)
|
|
439
|
+
→ Antigravity Account B ← auto-rotated
|
|
440
|
+
↓ (quota hit)
|
|
441
|
+
→ Antigravity Account C
|
|
442
|
+
↓ (all on cooldown)
|
|
443
|
+
→ waits cooldown timer, then retries
|
|
389
444
|
```
|
|
390
445
|
|
|
391
|
-
|
|
446
|
+
**Managing the pool from the dashboard:**
|
|
447
|
+
|
|
448
|
+
- View each account's remaining quota and reset time
|
|
449
|
+
- See which account is "next up" in the rotation queue
|
|
450
|
+
- Enable / disable individual accounts without removing them
|
|
451
|
+
- Reset the sticky streak for a specific account manually
|
|
452
|
+
- Watch live cooldown countdowns after a quota hit
|
|
392
453
|
|
|
393
|
-
> **Note:** Token Swap Pool (Mode B) and MITM Model Routing (Mode A) are mutually exclusive.
|
|
454
|
+
> **Note:** Token Swap Pool (Mode B) and MITM Model Routing (Mode A) are mutually exclusive. When Token Swap Pool is enabled, the MITM alias pass-through is bypassed and shown as **"Bypassed"** in the UI. Disable Token Swap Pool to use Model Routing instead.
|
|
394
455
|
|
|
395
456
|
---
|
|
396
457
|
|