pi-antigravity-rotator 2.1.0 → 2.1.2
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/CHANGELOG.md +14 -0
- package/README.md +24 -2
- package/package.json +1 -1
- package/src/compat.ts +3 -3
- package/src/dashboard.ts +44 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [2.1.2] - 2026-05-25
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Developer Role Support**: Added comprehensive compatibility and validation support for the newer `"developer"` role (introduced by OpenAI to replace the system prompt on models like o1/gpt-4o).
|
|
9
|
+
- **Developer Message Routing**: Automatically routes messages with the `"developer"` role as system instructions upstream in the Antigravity request mapping.
|
|
10
|
+
- **Improved Adapter Coverage**: Extended type validation and integration testing in the compat adapters to fully cover the new schema additions.
|
|
11
|
+
|
|
12
|
+
## [2.1.1] - 2026-05-21
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- **Discord Server Integration**: Added direct links and a styled interactive badge to the official project Discord server for community coordination.
|
|
16
|
+
- **Account Quota Donations UI**: Integrated a detailed step-by-step guide directly inside the dashboard's "Support the Creator" modal on how to safely donate a secondary Google account quota, along with a one-click guide link to the README.
|
|
17
|
+
- **README Guide on Quota Donations**: Added comprehensive instructions in the README on how to extract and securely share secondary/throwaway account credentials, including clear steps on how to revoke access at any time from Google settings.
|
|
18
|
+
|
|
5
19
|
## [2.1.0] - 2026-05-21
|
|
6
20
|
|
|
7
21
|
### Added
|
package/README.md
CHANGED
|
@@ -25,7 +25,29 @@ Multi-account rotation proxy for Google Antigravity. Distributes API usage acros
|
|
|
25
25
|
|
|
26
26
|
If this tool has helped you optimize your API usage and save costs, consider supporting its development!
|
|
27
27
|
|
|
28
|
-
<a href="https://ko-fi.com/tuxevil" target="_blank"><img src="https://storage.ko-fi.com/cdn/kofi2.png?v=3" height="36" alt="Buy Me a Coffee at ko-fi.com" /></a>
|
|
28
|
+
<a href="https://ko-fi.com/tuxevil" target="_blank"><img src="https://storage.ko-fi.com/cdn/kofi2.png?v=3" height="36" alt="Buy Me a Coffee at ko-fi.com" /></a> <a href="https://discord.gg/GgwVqTaKgK" target="_blank"><img src="https://img.shields.io/badge/Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white" height="36" alt="Join Discord" /></a>
|
|
29
|
+
|
|
30
|
+
### Donate Account Quota
|
|
31
|
+
|
|
32
|
+
Another great way to support the development of this project is by donating an authorized Google account. This helps me test new features, debug rotation algorithms, and keep improving the rotator.
|
|
33
|
+
|
|
34
|
+
To donate a quota-enabled account safely:
|
|
35
|
+
|
|
36
|
+
1. **Use a Secondary Account:** To protect your privacy and primary Google Cloud resources, we strongly recommend creating and using a disposable or "throwaway" Google account.
|
|
37
|
+
2. **Authorize the Account:** Run `npm run login` (or `pi-antigravity-rotator login`) on your local machine and complete the Google sign-in.
|
|
38
|
+
3. **Copy the Configuration:** Open your local `accounts.json` file and copy the JSON block of the newly added account from the `accounts` array. It will look like this:
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"email": "your-throwaway-account@gmail.com",
|
|
42
|
+
"refreshToken": "1//your_long_refresh_token_here...",
|
|
43
|
+
"projectId": "project-id-here",
|
|
44
|
+
"projectSource": "google",
|
|
45
|
+
"label": "donated-account"
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
4. **Send the Block:** Send this JSON block to me via email at [tuxevil@dragont.ec](mailto:tuxevil@dragont.ec) or reach out directly on our official [Discord Server](https://discord.gg/GgwVqTaKgK).
|
|
49
|
+
5. **Revoke Access Anytime:** You retain full control over your account. If you wish to stop donating, simply go to your [Google Account Settings](https://myaccount.google.com/) -> **Security** -> **Your connections to third-party apps & services**, find the authorized application (e.g., **Google Cloud SDK**), and click **Remove Access**. The rotator will immediately lose access and disable the account on the next refresh attempt.
|
|
50
|
+
|
|
29
51
|
|
|
30
52
|
## v2.0 Highlights
|
|
31
53
|
|
|
@@ -436,7 +458,7 @@ Current adapter scope:
|
|
|
436
458
|
|
|
437
459
|
- Text chat/messages.
|
|
438
460
|
- **Responses API compatibility**: Supports `POST /v1/responses` plus basic in-memory retrieve/delete/cancel/input-items endpoints for Codex-style agents.
|
|
439
|
-
- **Model Role Support**: Fully supports the `"
|
|
461
|
+
- **Developer and Model Role Support**: Fully supports the `"developer"` (mapped to system instructions) and `"model"` roles in chat message histories, validating and routing them correctly.
|
|
440
462
|
- **Request Normalization**: Automatically normalizes loose inputs (non-array messages), legacy prompt/input fields (e.g. `prompt` strings/arrays or `input` structures), and raw native Antigravity requests (`request.contents`) into standard OpenAI/Anthropic format.
|
|
441
463
|
- **Native Reasoning visibility**: Models with thinking capabilities (Gemini 3 Pro, Gemini 3.5 Flash, Claude Sonnet 4.6 Thinking) automatically expose their interleaved thinking blocks in real-time as OpenAI `reasoning_content` or Anthropic `thinking_delta` chunks.
|
|
442
464
|
- Streaming mode is supported as compatibility SSE. The adapter buffers the upstream Antigravity stream, then emits one OpenAI/Anthropic-compatible final delta. Native token-by-token pass-through is not implemented yet.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-antigravity-rotator",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Multi-account rotation proxy for Google Antigravity with per-model routing, real-time quota tracking, and infringement detection",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/src/compat.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { withRotation, flattenHeaders, type RequestBody } from "./proxy.js";
|
|
|
10
10
|
const compatLogger = logger.child("compat");
|
|
11
11
|
|
|
12
12
|
export interface ChatMessage {
|
|
13
|
-
role: "system" | "user" | "assistant" | "model" | "tool";
|
|
13
|
+
role: "system" | "developer" | "user" | "assistant" | "model" | "tool";
|
|
14
14
|
content: string | Array<{ type: string; text?: string;[key: string]: unknown }> | null;
|
|
15
15
|
tool_calls?: OpenAIToolCall[];
|
|
16
16
|
tool_call_id?: string;
|
|
@@ -531,7 +531,7 @@ function convertToolChoiceToGemini(toolChoice: unknown): GeminiToolConfig | unde
|
|
|
531
531
|
function validateMessages(value: unknown): value is ChatMessage[] {
|
|
532
532
|
return Array.isArray(value) && value.every((msg) => {
|
|
533
533
|
if (!isRecord(msg)) return false;
|
|
534
|
-
if (!["system", "user", "assistant", "model", "tool"].includes(String(msg.role))) return false;
|
|
534
|
+
if (!["system", "developer", "user", "assistant", "model", "tool"].includes(String(msg.role))) return false;
|
|
535
535
|
return typeof msg.content === "string" || msg.content === null || Array.isArray(msg.content);
|
|
536
536
|
});
|
|
537
537
|
}
|
|
@@ -1009,7 +1009,7 @@ export function openAIToAntigravityBody(input: OpenAIChatCompletionRequest): Req
|
|
|
1009
1009
|
// Separate system messages from conversation turns
|
|
1010
1010
|
const systemParts: string[] = [];
|
|
1011
1011
|
const conversationMessages = input.messages.filter((msg) => {
|
|
1012
|
-
if (msg.role === "system") {
|
|
1012
|
+
if (msg.role === "system" || msg.role === "developer") {
|
|
1013
1013
|
const text = typeof msg.content === "string" ? msg.content : extractText(msg.content);
|
|
1014
1014
|
if (text) systemParts.push(text);
|
|
1015
1015
|
return false;
|
package/src/dashboard.ts
CHANGED
|
@@ -525,6 +525,20 @@ const DASHBOARD_HTML = `<!DOCTYPE html>
|
|
|
525
525
|
transform-origin: center;
|
|
526
526
|
}
|
|
527
527
|
|
|
528
|
+
.discord-btn svg {
|
|
529
|
+
fill: currentColor !important;
|
|
530
|
+
stroke: none !important;
|
|
531
|
+
transition: transform 0.2s, color 0.2s;
|
|
532
|
+
}
|
|
533
|
+
.discord-btn:hover {
|
|
534
|
+
border-color: rgba(88, 101, 242, 0.4) !important;
|
|
535
|
+
background: rgba(88, 101, 242, 0.08) !important;
|
|
536
|
+
}
|
|
537
|
+
.discord-btn:hover svg {
|
|
538
|
+
color: #5865F2 !important;
|
|
539
|
+
transform: scale(1.12);
|
|
540
|
+
}
|
|
541
|
+
|
|
528
542
|
.badge-pro { background: rgba(52, 211, 153, 0.15); color: var(--green); }
|
|
529
543
|
.badge-free { background: rgba(110, 110, 130, 0.08); color: var(--text-dim); }
|
|
530
544
|
.badge-fmgr { background: rgba(124, 92, 252, 0.15); color: var(--accent); font-size: 9px; }
|
|
@@ -1330,6 +1344,10 @@ const DASHBOARD_HTML = `<!DOCTYPE html>
|
|
|
1330
1344
|
<button class="header-icon-btn heart-beat" id="kofiBtn" onclick="openModal('donationModal')" title="Support the Creator" aria-label="Buy me a coffee">
|
|
1331
1345
|
<svg viewBox="0 0 24 24"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg>
|
|
1332
1346
|
</button>
|
|
1347
|
+
|
|
1348
|
+
<a class="header-icon-btn discord-btn" id="discordBtn" href="https://discord.gg/GgwVqTaKgK" target="_blank" title="Join our Discord" aria-label="Join Discord server">
|
|
1349
|
+
<svg viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"/></svg>
|
|
1350
|
+
</a>
|
|
1333
1351
|
</div>
|
|
1334
1352
|
</div>
|
|
1335
1353
|
|
|
@@ -1461,14 +1479,35 @@ const DASHBOARD_HTML = `<!DOCTYPE html>
|
|
|
1461
1479
|
<div style="padding: 16px; font-size: 0.95rem; line-height: 1.5; color: var(--text);">
|
|
1462
1480
|
<p style="margin-bottom:12px;font-weight:bold;">❤️ A quick message from Sebastián (extension creator)</p>
|
|
1463
1481
|
<p style="margin-bottom:12px;">Hello from Ecuador! I built this tool so that everyone can access AI regardless of their budget.</p>
|
|
1464
|
-
<p style="margin-bottom:12px;">To be completely transparent: I'm going through a very difficult financial situation. Instead of giving up, I'm dedicating all my effort to maintaining and improving this project. If you find the extension useful, a small donation (even $1) means the world to me right now and allows me to
|
|
1465
|
-
<p style="margin-bottom:
|
|
1466
|
-
<
|
|
1467
|
-
|
|
1468
|
-
<a href="https://ko-fi.com/tuxevil" target="_blank" style="display:inline-flex;flex-direction:column;align-items:center;background-color:#FF5E5B;color:white;padding:12px 24px;border-radius:6px;text-decoration:none;transition:opacity 0.2s;" onmouseover="this.style.opacity='0.9'" onmouseout="this.style.opacity='1'">
|
|
1482
|
+
<p style="margin-bottom:12px;">To be completely transparent: I'm going through a very difficult financial situation. Instead of giving up, I'm dedicating all my effort to maintaining and improving this project. If you find the extension useful, a small donation (even $1) or <strong>donating a secondary Google account to share its API quota</strong> for testing and development means the world to me right now and allows me to keep coding.</p>
|
|
1483
|
+
<p style="margin-bottom:16px;">If you're short on cash, I completely understand, but please keep using it for free! But if you can lend me a hand today (either financially or by donating quota), I'd be incredibly grateful:</p>
|
|
1484
|
+
<div style="display:flex;flex-direction:column;gap:12px;margin-bottom:20px;align-items:center;">
|
|
1485
|
+
<a href="https://ko-fi.com/tuxevil" target="_blank" style="display:inline-flex;flex-direction:column;align-items:center;background-color:#FF5E5B;color:white;padding:12px 24px;border-radius:6px;text-decoration:none;transition:opacity 0.2s;width:100%;box-sizing:border-box;text-align:center;" onmouseover="this.style.opacity='0.9'" onmouseout="this.style.opacity='1'">
|
|
1469
1486
|
<span style="font-weight:bold;font-size:1.1rem;">☕ Buy me a coffee on Ko-fi</span>
|
|
1470
1487
|
<span style="font-size:0.9rem;margin-top:4px;opacity:0.9;">ko-fi.com/tuxevil</span>
|
|
1471
1488
|
</a>
|
|
1489
|
+
|
|
1490
|
+
<div style="font-size:0.8rem;color:var(--text-dim);font-weight:bold;text-transform:uppercase;letter-spacing:0.5px;margin:4px 0;">— OR —</div>
|
|
1491
|
+
|
|
1492
|
+
<div style="width:100%; padding:14px; border: 1px solid var(--border); border-radius: 8px; background: rgba(255,255,255,0.02); box-sizing: border-box; text-align: left;">
|
|
1493
|
+
<p style="margin-bottom:10px;font-weight:bold;color:var(--accent);display:flex;align-items:center;gap:6px;font-size:0.95rem;">
|
|
1494
|
+
🔑 How to Donate Account Quota:
|
|
1495
|
+
</p>
|
|
1496
|
+
<ol style="margin-left:18px; margin-bottom:14px; font-size:0.85rem; color:var(--text-dim); line-height:1.5;">
|
|
1497
|
+
<li style="margin-bottom:4px;">Use/create a <strong>secondary or throwaway</strong> Google account.</li>
|
|
1498
|
+
<li style="margin-bottom:4px;">Run <code style="background:rgba(255,255,255,0.06);padding:2px 4px;border-radius:4px;font-family:monospace;font-size:0.8rem;color:var(--text);">npm run login</code> locally to authorize it.</li>
|
|
1499
|
+
<li style="margin-bottom:4px;">Open your local <code style="font-family:monospace;font-size:0.8rem;color:var(--text);">accounts.json</code> and copy the account's JSON block.</li>
|
|
1500
|
+
<li style="margin-bottom:0;">Send it to Sebastián via Email (<a href="mailto:tuxevil@dragont.ec" style="color:var(--accent);text-decoration:underline;">tuxevil@dragont.ec</a>) or Discord.</li>
|
|
1501
|
+
</ol>
|
|
1502
|
+
<div style="display:flex;gap:10px;justify-content:center;flex-wrap:wrap;">
|
|
1503
|
+
<a href="https://github.com/tuxevil/pi-antigravity-rotator#donate-account-quota" target="_blank" class="btn-update-link" style="display:inline-flex;align-items:center;justify-content:center;gap:6px;font-size:0.8rem;text-decoration:none;padding:6px 14px;flex:1;min-width:120px;text-align:center;">
|
|
1504
|
+
📖 Read Full Guide
|
|
1505
|
+
</a>
|
|
1506
|
+
<a href="https://discord.gg/GgwVqTaKgK" target="_blank" class="btn-update-link" style="display:inline-flex;align-items:center;justify-content:center;gap:6px;font-size:0.8rem;text-decoration:none;padding:6px 14px;border-color:rgba(88,101,242,0.4);color:#5865F2;flex:1;min-width:120px;text-align:center;" onmouseover="this.style.background='rgba(88,101,242,0.08)'" onmouseout="this.style.background='transparent'">
|
|
1507
|
+
💬 Join Discord
|
|
1508
|
+
</a>
|
|
1509
|
+
</div>
|
|
1510
|
+
</div>
|
|
1472
1511
|
</div>
|
|
1473
1512
|
<div style="text-align: center;">
|
|
1474
1513
|
<button class="btn-secondary" onclick="hideDonationModalPermanently()">I've supported or prefer not to see this</button>
|