opencode-antigravity-auth 1.2.8-beta.2 → 1.2.8-beta.4
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 +112 -79
- package/dist/src/constants.d.ts +6 -0
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +88 -0
- package/dist/src/constants.js.map +1 -1
- package/dist/src/plugin/accounts.d.ts +1 -1
- package/dist/src/plugin/accounts.d.ts.map +1 -1
- package/dist/src/plugin/accounts.js +3 -3
- package/dist/src/plugin/accounts.js.map +1 -1
- package/dist/src/plugin/config/loader.d.ts.map +1 -1
- package/dist/src/plugin/config/loader.js +5 -0
- package/dist/src/plugin/config/loader.js.map +1 -1
- package/dist/src/plugin/config/schema.d.ts +15 -0
- package/dist/src/plugin/config/schema.d.ts.map +1 -1
- package/dist/src/plugin/config/schema.js +14 -0
- package/dist/src/plugin/config/schema.js.map +1 -1
- package/dist/src/plugin/core/streaming/transformer.d.ts +2 -1
- package/dist/src/plugin/core/streaming/transformer.d.ts.map +1 -1
- package/dist/src/plugin/core/streaming/transformer.js +98 -4
- package/dist/src/plugin/core/streaming/transformer.js.map +1 -1
- package/dist/src/plugin/core/streaming/types.d.ts +1 -0
- package/dist/src/plugin/core/streaming/types.d.ts.map +1 -1
- package/dist/src/plugin/request-helpers.d.ts +19 -21
- package/dist/src/plugin/request-helpers.d.ts.map +1 -1
- package/dist/src/plugin/request-helpers.js +86 -47
- package/dist/src/plugin/request-helpers.js.map +1 -1
- package/dist/src/plugin/request.d.ts.map +1 -1
- package/dist/src/plugin/request.js +99 -15
- package/dist/src/plugin/request.js.map +1 -1
- package/dist/src/plugin/transform/gemini.d.ts.map +1 -1
- package/dist/src/plugin/transform/gemini.js +22 -3
- package/dist/src/plugin/transform/gemini.js.map +1 -1
- package/dist/src/plugin/transform/model-resolver.d.ts +3 -3
- package/dist/src/plugin/transform/model-resolver.d.ts.map +1 -1
- package/dist/src/plugin/transform/model-resolver.js +39 -17
- package/dist/src/plugin/transform/model-resolver.js.map +1 -1
- package/dist/src/plugin.d.ts.map +1 -1
- package/dist/src/plugin.js +1 -1
- package/dist/src/plugin.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,16 +53,15 @@ Install the opencode-antigravity-auth plugin and add the Antigravity model defin
|
|
|
53
53
|
"provider": {
|
|
54
54
|
"google": {
|
|
55
55
|
"models": {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
56
|
+
"antigravity-claude-sonnet-4-5-thinking": {
|
|
57
|
+
"name": "Claude Sonnet 4.5 Thinking",
|
|
58
|
+
"limit": { "context": 200000, "output": 64000 },
|
|
59
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
60
|
+
"variants": {
|
|
61
|
+
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
|
|
62
|
+
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
|
|
63
|
+
}
|
|
64
|
+
}
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
}
|
|
@@ -72,7 +71,7 @@ Install the opencode-antigravity-auth plugin and add the Antigravity model defin
|
|
|
72
71
|
4. **Use it:**
|
|
73
72
|
|
|
74
73
|
```bash
|
|
75
|
-
opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5-thinking --variant=
|
|
74
|
+
opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5-thinking --variant=max
|
|
76
75
|
```
|
|
77
76
|
|
|
78
77
|
<details>
|
|
@@ -99,66 +98,65 @@ Create `~/.config/opencode/opencode.json`:
|
|
|
99
98
|
"google": {
|
|
100
99
|
"models": {
|
|
101
100
|
"antigravity-gemini-3-pro": {
|
|
102
|
-
"name": "Gemini 3 Pro",
|
|
101
|
+
"name": "Gemini 3 Pro (Antigravity)",
|
|
103
102
|
"limit": { "context": 1048576, "output": 65535 },
|
|
104
103
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
105
104
|
"variants": {
|
|
106
|
-
"low": { "
|
|
107
|
-
"high": { "
|
|
105
|
+
"low": { "thinkingLevel": "low" },
|
|
106
|
+
"high": { "thinkingLevel": "high" }
|
|
108
107
|
}
|
|
109
108
|
},
|
|
110
109
|
"antigravity-gemini-3-flash": {
|
|
111
|
-
"name": "Gemini 3 Flash",
|
|
110
|
+
"name": "Gemini 3 Flash (Antigravity)",
|
|
112
111
|
"limit": { "context": 1048576, "output": 65536 },
|
|
113
112
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
114
113
|
"variants": {
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"
|
|
114
|
+
"minimal": { "thinkingLevel": "minimal" },
|
|
115
|
+
"low": { "thinkingLevel": "low" },
|
|
116
|
+
"medium": { "thinkingLevel": "medium" },
|
|
117
|
+
"high": { "thinkingLevel": "high" }
|
|
118
118
|
}
|
|
119
119
|
},
|
|
120
120
|
"antigravity-claude-sonnet-4-5": {
|
|
121
|
-
"name": "Claude Sonnet 4.5 (
|
|
121
|
+
"name": "Claude Sonnet 4.5 (Antigravity)",
|
|
122
122
|
"limit": { "context": 200000, "output": 64000 },
|
|
123
123
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
124
124
|
},
|
|
125
125
|
"antigravity-claude-sonnet-4-5-thinking": {
|
|
126
|
-
"name": "Claude Sonnet 4.5 Thinking",
|
|
126
|
+
"name": "Claude Sonnet 4.5 Thinking (Antigravity)",
|
|
127
127
|
"limit": { "context": 200000, "output": 64000 },
|
|
128
128
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
129
129
|
"variants": {
|
|
130
|
-
"low": { "
|
|
131
|
-
"
|
|
132
|
-
"max": { "providerOptions": { "google": { "thinkingConfig": { "thinkingBudget": 32768 } } } }
|
|
130
|
+
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
|
|
131
|
+
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
|
|
133
132
|
}
|
|
134
133
|
},
|
|
135
134
|
"antigravity-claude-opus-4-5-thinking": {
|
|
136
|
-
"name": "Claude Opus 4.5 Thinking",
|
|
135
|
+
"name": "Claude Opus 4.5 Thinking (Antigravity)",
|
|
137
136
|
"limit": { "context": 200000, "output": 64000 },
|
|
138
137
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
139
138
|
"variants": {
|
|
140
|
-
"low": { "
|
|
141
|
-
"
|
|
142
|
-
"max": { "providerOptions": { "google": { "thinkingConfig": { "thinkingBudget": 32768 } } } }
|
|
139
|
+
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
|
|
140
|
+
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
|
|
143
141
|
}
|
|
144
142
|
},
|
|
145
143
|
"gemini-2.5-flash": {
|
|
146
|
-
"name": "Gemini 2.5 Flash (CLI)",
|
|
144
|
+
"name": "Gemini 2.5 Flash (Gemini CLI)",
|
|
147
145
|
"limit": { "context": 1048576, "output": 65536 },
|
|
148
146
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
149
147
|
},
|
|
150
148
|
"gemini-2.5-pro": {
|
|
151
|
-
"name": "Gemini 2.5 Pro (CLI)",
|
|
149
|
+
"name": "Gemini 2.5 Pro (Gemini CLI)",
|
|
152
150
|
"limit": { "context": 1048576, "output": 65536 },
|
|
153
151
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
154
152
|
},
|
|
155
153
|
"gemini-3-flash-preview": {
|
|
156
|
-
"name": "Gemini 3 Flash Preview (CLI)",
|
|
154
|
+
"name": "Gemini 3 Flash Preview (Gemini CLI)",
|
|
157
155
|
"limit": { "context": 1048576, "output": 65536 },
|
|
158
156
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
159
157
|
},
|
|
160
158
|
"gemini-3-pro-preview": {
|
|
161
|
-
"name": "Gemini 3 Pro Preview (CLI)",
|
|
159
|
+
"name": "Gemini 3 Pro Preview (Gemini CLI)",
|
|
162
160
|
"limit": { "context": 1048576, "output": 65535 },
|
|
163
161
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
164
162
|
}
|
|
@@ -171,7 +169,7 @@ Create `~/.config/opencode/opencode.json`:
|
|
|
171
169
|
### Verification
|
|
172
170
|
|
|
173
171
|
```bash
|
|
174
|
-
opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5-thinking --variant=
|
|
172
|
+
opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5-thinking --variant=max
|
|
175
173
|
```
|
|
176
174
|
|
|
177
175
|
</details>
|
|
@@ -185,19 +183,18 @@ Models with `antigravity-` prefix use Antigravity quota. **Thinking models suppo
|
|
|
185
183
|
| Model | Variants | Description |
|
|
186
184
|
|-------|----------|-------------|
|
|
187
185
|
| `google/antigravity-gemini-3-pro` | low, high | Gemini 3 Pro with configurable thinking |
|
|
188
|
-
| `google/antigravity-gemini-3-flash` | low, medium, high | Gemini 3 Flash with configurable thinking |
|
|
186
|
+
| `google/antigravity-gemini-3-flash` | minimal, low, medium, high | Gemini 3 Flash with configurable thinking |
|
|
189
187
|
| `google/antigravity-claude-sonnet-4-5` | - | Claude Sonnet 4.5 (no thinking) |
|
|
190
|
-
| `google/antigravity-claude-sonnet-4-5-thinking` | low,
|
|
191
|
-
| `google/antigravity-claude-opus-4-5-thinking` | low,
|
|
188
|
+
| `google/antigravity-claude-sonnet-4-5-thinking` | low, max | Claude Sonnet with configurable thinking |
|
|
189
|
+
| `google/antigravity-claude-opus-4-5-thinking` | low, max | Claude Opus with configurable thinking |
|
|
192
190
|
|
|
193
|
-
**Variant
|
|
194
|
-
- `low
|
|
195
|
-
- `
|
|
196
|
-
- `high`: 32,768 tokens
|
|
191
|
+
**Variant configuration:**
|
|
192
|
+
- **Gemini 3**: Uses `thinkingLevel` string (`"low"`, `"medium"`, `"high"`)
|
|
193
|
+
- **Claude**: Uses `thinkingBudget` number (8192, 32768 tokens)
|
|
197
194
|
|
|
198
195
|
**Usage:**
|
|
199
196
|
```bash
|
|
200
|
-
opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5-thinking --variant=
|
|
197
|
+
opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5-thinking --variant=max
|
|
201
198
|
```
|
|
202
199
|
|
|
203
200
|
### Gemini CLI Quota
|
|
@@ -222,67 +219,65 @@ Models with `-preview` suffix use Gemini CLI quota:
|
|
|
222
219
|
"google": {
|
|
223
220
|
"models": {
|
|
224
221
|
"antigravity-gemini-3-pro": {
|
|
225
|
-
"name": "Gemini 3 Pro",
|
|
222
|
+
"name": "Gemini 3 Pro (Antigravity)",
|
|
226
223
|
"limit": { "context": 1048576, "output": 65535 },
|
|
227
224
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
228
225
|
"variants": {
|
|
229
|
-
"low": { "
|
|
230
|
-
"
|
|
231
|
-
"high": { "providerOptions": { "google": { "thinkingConfig": { "thinkingBudget": 32768 } } } }
|
|
226
|
+
"low": { "thinkingLevel": "low" },
|
|
227
|
+
"high": { "thinkingLevel": "high" }
|
|
232
228
|
}
|
|
233
229
|
},
|
|
234
230
|
"antigravity-gemini-3-flash": {
|
|
235
|
-
"name": "Gemini 3 Flash",
|
|
231
|
+
"name": "Gemini 3 Flash (Antigravity)",
|
|
236
232
|
"limit": { "context": 1048576, "output": 65536 },
|
|
237
233
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
238
234
|
"variants": {
|
|
239
|
-
"
|
|
240
|
-
"
|
|
241
|
-
"
|
|
235
|
+
"minimal": { "thinkingLevel": "minimal" },
|
|
236
|
+
"low": { "thinkingLevel": "low" },
|
|
237
|
+
"medium": { "thinkingLevel": "medium" },
|
|
238
|
+
"high": { "thinkingLevel": "high" }
|
|
242
239
|
}
|
|
243
240
|
},
|
|
244
241
|
"antigravity-claude-sonnet-4-5": {
|
|
245
|
-
"name": "Claude Sonnet 4.5 (no thinking)",
|
|
242
|
+
"name": "Claude Sonnet 4.5 (no thinking) (Antigravity)",
|
|
246
243
|
"limit": { "context": 200000, "output": 64000 },
|
|
247
244
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
248
245
|
},
|
|
249
246
|
"antigravity-claude-sonnet-4-5-thinking": {
|
|
250
|
-
"name": "Claude Sonnet 4.5 Thinking",
|
|
247
|
+
"name": "Claude Sonnet 4.5 Thinking (Antigravity)",
|
|
251
248
|
"limit": { "context": 200000, "output": 64000 },
|
|
252
249
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
253
250
|
"variants": {
|
|
254
|
-
"low": { "
|
|
255
|
-
"
|
|
256
|
-
"max": { "providerOptions": { "google": { "thinkingConfig": { "thinkingBudget": 32768 } } } }
|
|
251
|
+
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
|
|
252
|
+
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
|
|
257
253
|
}
|
|
258
254
|
},
|
|
259
255
|
"antigravity-claude-opus-4-5-thinking": {
|
|
260
|
-
"name": "Claude Opus 4.5 Thinking",
|
|
256
|
+
"name": "Claude Opus 4.5 Thinking (Antigravity)",
|
|
261
257
|
"limit": { "context": 200000, "output": 64000 },
|
|
262
258
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
263
259
|
"variants": {
|
|
264
|
-
"low": { "
|
|
265
|
-
"
|
|
266
|
-
"max": { "providerOptions": { "google": { "thinkingConfig": { "thinkingBudget": 32768 } } } }
|
|
260
|
+
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
|
|
261
|
+
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
|
|
267
262
|
}
|
|
268
263
|
},
|
|
269
264
|
"gemini-2.5-flash": {
|
|
270
|
-
"name": "Gemini 2.5 Flash (CLI)",
|
|
265
|
+
"name": "Gemini 2.5 Flash (Gemini CLI)",
|
|
271
266
|
"limit": { "context": 1048576, "output": 65536 },
|
|
272
267
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
273
268
|
},
|
|
274
269
|
"gemini-2.5-pro": {
|
|
275
|
-
"name": "Gemini 2.5 Pro (CLI)",
|
|
270
|
+
"name": "Gemini 2.5 Pro (Gemini CLI)",
|
|
276
271
|
"limit": { "context": 1048576, "output": 65536 },
|
|
277
272
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
278
273
|
},
|
|
279
274
|
"gemini-3-flash-preview": {
|
|
280
|
-
"name": "Gemini 3 Flash Preview (CLI)",
|
|
275
|
+
"name": "Gemini 3 Flash Preview (Gemini CLI)",
|
|
281
276
|
"limit": { "context": 1048576, "output": 65536 },
|
|
282
277
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
283
278
|
},
|
|
284
279
|
"gemini-3-pro-preview": {
|
|
285
|
-
"name": "Gemini 3 Pro Preview (CLI)",
|
|
280
|
+
"name": "Gemini 3 Pro Preview (Gemini CLI)",
|
|
286
281
|
"limit": { "context": 1048576, "output": 65535 },
|
|
287
282
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
288
283
|
}
|
|
@@ -311,29 +306,42 @@ When you define a model with `variants`, OpenCode will show variant options in t
|
|
|
311
306
|
"limit": { "context": 200000, "output": 64000 },
|
|
312
307
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
313
308
|
"variants": {
|
|
314
|
-
"low": { "
|
|
315
|
-
"
|
|
316
|
-
"max": { "providerOptions": { "google": { "thinkingConfig": { "thinkingBudget": 32768 } } } }
|
|
309
|
+
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
|
|
310
|
+
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
|
|
317
311
|
}
|
|
318
312
|
}
|
|
319
313
|
}
|
|
320
314
|
```
|
|
321
315
|
|
|
322
|
-
### Supported
|
|
316
|
+
### Supported Variant Formats
|
|
323
317
|
|
|
324
|
-
The plugin accepts
|
|
318
|
+
The plugin accepts different variant formats depending on the model family:
|
|
325
319
|
|
|
326
|
-
|
|
|
327
|
-
|
|
328
|
-
| **
|
|
329
|
-
| **
|
|
320
|
+
| Model Family | Variant Format |
|
|
321
|
+
|--------------|----------------|
|
|
322
|
+
| **Gemini 3** | `{ "thinkingLevel": "low" \| "medium" \| "high" }` |
|
|
323
|
+
| **Claude** | `{ "thinkingConfig": { "thinkingBudget": N } }` |
|
|
324
|
+
| **Gemini 2.5** | `{ "thinkingConfig": { "thinkingBudget": N } }` |
|
|
330
325
|
|
|
331
|
-
### Gemini 3
|
|
326
|
+
### Gemini 3 Thinking Levels
|
|
332
327
|
|
|
333
|
-
|
|
328
|
+
Gemini 3 models use string-based thinking levels. Available levels differ by model:
|
|
334
329
|
|
|
335
|
-
|
|
|
336
|
-
|
|
330
|
+
| Level | Flash | Pro | Description |
|
|
331
|
+
|-------|-------|-----|-------------|
|
|
332
|
+
| `minimal` | Yes | No | Minimal thinking, lowest latency |
|
|
333
|
+
| `low` | Yes | Yes | Light thinking |
|
|
334
|
+
| `medium` | Yes | No | Balanced thinking |
|
|
335
|
+
| `high` | Yes | Yes | Maximum thinking (default for both Pro and Flash) |
|
|
336
|
+
|
|
337
|
+
> **Note:** The API will reject invalid levels (e.g., `"minimal"` on Pro). Configure variants accordingly.
|
|
338
|
+
|
|
339
|
+
### Legacy Budget Format (Deprecated)
|
|
340
|
+
|
|
341
|
+
For Gemini 3 models, the old `thinkingBudget` format is still supported but deprecated:
|
|
342
|
+
|
|
343
|
+
| Budget Range | Maps to Level |
|
|
344
|
+
|--------------|---------------|
|
|
337
345
|
| ≤ 8192 | low |
|
|
338
346
|
| ≤ 16384 | medium |
|
|
339
347
|
| > 16384 | high |
|
|
@@ -443,6 +451,7 @@ Create `~/.config/opencode/antigravity.json` (or `.opencode/antigravity.json` in
|
|
|
443
451
|
| Option | Default | Description |
|
|
444
452
|
|--------|---------|-------------|
|
|
445
453
|
| `account_selection_strategy` | `"sticky"` | Strategy for distributing requests across accounts |
|
|
454
|
+
| `pid_offset_enabled` | `false` | Use PID-based offset for multi-session distribution |
|
|
446
455
|
|
|
447
456
|
**Available strategies:**
|
|
448
457
|
|
|
@@ -469,6 +478,7 @@ OPENCODE_ANTIGRAVITY_DEBUG=1 # debug
|
|
|
469
478
|
OPENCODE_ANTIGRAVITY_LOG_DIR=/path # log_dir
|
|
470
479
|
OPENCODE_ANTIGRAVITY_KEEP_THINKING=1 # keep_thinking
|
|
471
480
|
OPENCODE_ANTIGRAVITY_ACCOUNT_SELECTION_STRATEGY=round-robin # account_selection_strategy
|
|
481
|
+
OPENCODE_ANTIGRAVITY_PID_OFFSET_ENABLED=1 # pid_offset_enabled
|
|
472
482
|
```
|
|
473
483
|
|
|
474
484
|
<details>
|
|
@@ -495,6 +505,7 @@ OPENCODE_ANTIGRAVITY_ACCOUNT_SELECTION_STRATEGY=round-robin # account_selection
|
|
|
495
505
|
"max_rate_limit_wait_seconds": 300,
|
|
496
506
|
"quota_fallback": false,
|
|
497
507
|
"account_selection_strategy": "sticky",
|
|
508
|
+
"pid_offset_enabled": false,
|
|
498
509
|
"signature_cache": {
|
|
499
510
|
"enabled": true,
|
|
500
511
|
"memory_ttl_seconds": 3600,
|
|
@@ -506,6 +517,18 @@ OPENCODE_ANTIGRAVITY_ACCOUNT_SELECTION_STRATEGY=round-robin # account_selection
|
|
|
506
517
|
|
|
507
518
|
</details>
|
|
508
519
|
|
|
520
|
+
## Troubleshoot
|
|
521
|
+
|
|
522
|
+
### Multi account auth issues
|
|
523
|
+
If you encounter auth issue please try remove `antigravity-account.json` and auth again
|
|
524
|
+
|
|
525
|
+
### Gemini model not found
|
|
526
|
+
Try add this line to in `google` field under `provider`
|
|
527
|
+
`"npm": "@ai-sdk/google"`
|
|
528
|
+
|
|
529
|
+
### Error during the session
|
|
530
|
+
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
|
|
531
|
+
|
|
509
532
|
## Known Plugin Interactions
|
|
510
533
|
|
|
511
534
|
### @tarquinen/opencode-dcp
|
|
@@ -522,8 +545,19 @@ DCP creates synthetic assistant messages that lack thinking blocks. **Our plugin
|
|
|
522
545
|
```
|
|
523
546
|
|
|
524
547
|
### oh-my-opencode
|
|
548
|
+
When using opencode-antigravity-auth, disable the built-in auth and override agent models in oh-my-opencode.json:
|
|
549
|
+
```json
|
|
550
|
+
{
|
|
551
|
+
"google_auth": false,
|
|
552
|
+
"agents": {
|
|
553
|
+
"frontend-ui-ux-engineer": { "model": "google/gemini-3-pro-high" },
|
|
554
|
+
"document-writer": { "model": "google/gemini-3-flash" },
|
|
555
|
+
"multimodal-looker": { "model": "google/gemini-3-flash" }
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
```
|
|
525
559
|
|
|
526
|
-
When spawning parallel subagents, multiple processes may select the same account causing rate limit errors. **Workaround:**
|
|
560
|
+
When spawning parallel subagents, multiple processes may select the same account causing rate limit errors. **Workaround:** Enable `pid_offset_enabled: true` to distribute sessions across accounts, or add more accounts via `opencode auth login`.
|
|
527
561
|
|
|
528
562
|
### Plugins You Don't Need
|
|
529
563
|
|
|
@@ -555,9 +589,8 @@ v1.2.8+ introduces **model variants** for dynamic thinking configuration. Instea
|
|
|
555
589
|
"limit": { "context": 200000, "output": 64000 },
|
|
556
590
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
557
591
|
"variants": {
|
|
558
|
-
"low": { "
|
|
559
|
-
"
|
|
560
|
-
"max": { "providerOptions": { "google": { "thinkingConfig": { "thinkingBudget": 32768 } } } }
|
|
592
|
+
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
|
|
593
|
+
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
|
|
561
594
|
}
|
|
562
595
|
}
|
|
563
596
|
}
|
|
@@ -566,7 +599,7 @@ v1.2.8+ introduces **model variants** for dynamic thinking configuration. Instea
|
|
|
566
599
|
### Benefits
|
|
567
600
|
|
|
568
601
|
- **Cleaner model picker** - 4 models instead of 12+
|
|
569
|
-
- **Flexible budgets** - Define any budget, not just low/
|
|
602
|
+
- **Flexible budgets** - Define any budget, not just low/max
|
|
570
603
|
- **Future-proof** - Works with OpenCode's native variant system
|
|
571
604
|
|
|
572
605
|
### Backward Compatibility
|
package/dist/src/constants.d.ts
CHANGED
|
@@ -88,4 +88,10 @@ export declare const CLAUDE_TOOL_SYSTEM_INSTRUCTION = "CRITICAL TOOL USAGE INSTR
|
|
|
88
88
|
export declare const CLAUDE_DESCRIPTION_PROMPT = "\n\n\u26A0\uFE0F STRICT PARAMETERS: {params}.";
|
|
89
89
|
export declare const EMPTY_SCHEMA_PLACEHOLDER_NAME = "_placeholder";
|
|
90
90
|
export declare const EMPTY_SCHEMA_PLACEHOLDER_DESCRIPTION = "Placeholder. Always pass true.";
|
|
91
|
+
/**
|
|
92
|
+
* System instruction for Antigravity requests.
|
|
93
|
+
* This is injected into requests to match CLIProxyAPI v6.6.89 behavior.
|
|
94
|
+
* The instruction provides identity and guidelines for the Antigravity agent.
|
|
95
|
+
*/
|
|
96
|
+
export declare const ANTIGRAVITY_SYSTEM_INSTRUCTION = "<identity>\nYou are Antigravity, a powerful agentic AI coding assistant designed by the Google DeepMind team working on Advanced Agentic Coding.\nYou are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.\nThe USER will send you requests, which you must always prioritize addressing. Along with each USER request, we will attach additional metadata about their current state, such as what files they have open and where their cursor is.\nThis information may or may not be relevant to the coding task, it is up for you to decide.\n</identity>\n\n<tool_calling>\nCall tools as you normally would. The following list provides additional guidance to help you avoid errors:\n - **Absolute paths only**. When using tools that accept file path arguments, ALWAYS use the absolute file path.\n</tool_calling>\n\n<web_application_development>\n## Technology Stack\nYour web applications should be built using the following technologies:\n1. **Core**: Use HTML for structure and JavaScript for logic.\n2. **Styling (CSS)**: Use Vanilla CSS for maximum flexibility and control. Avoid using TailwindCSS unless the USER explicitly requests it; in this case, first confirm which TailwindCSS version to use.\n3. **Web App**: If the USER specifies that they want a more complex web app, use a framework like Next.js or Vite. Only do this if the USER explicitly requests a web app.\n4. **New Project Creation**: If you need to use a framework for a new app, use `npx` with the appropriate script, but there are some rules to follow:\n - Use `npx -y` to automatically install the script and its dependencies\n - You MUST run the command with `--help` flag to see all available options first\n - Initialize the app in the current directory with `./` (example: `npx -y create-vite-app@latest ./`)\n - You should run in non-interactive mode so that the user doesn't need to input anything\n5. **Running Locally**: When running locally, use `npm run dev` or equivalent dev server. Only build the production bundle if the USER explicitly requests it or you are validating the code for correctness.\n\n# Design Aesthetics\n1. **Use Rich Aesthetics**: The USER should be wowed at first glance by the design. Use best practices in modern web design (e.g. vibrant colors, dark modes, glassmorphism, and dynamic animations) to create a stunning first impression. Failure to do this is UNACCEPTABLE.\n2. **Prioritize Visual Excellence**: Implement designs that will WOW the user and feel extremely premium:\n - Avoid generic colors (plain red, blue, green). Use curated, harmonious color palettes (e.g., HSL tailored colors, sleek dark modes).\n - Using modern typography (e.g., from Google Fonts like Inter, Roboto, or Outfit) instead of browser defaults.\n - Use smooth gradients\n - Add subtle micro-animations for enhanced user experience\n3. **Use a Dynamic Design**: An interface that feels responsive and alive encourages interaction. Achieve this with hover effects and interactive elements. Micro-animations, in particular, are highly effective for improving user engagement.\n4. **Premium Designs**: Make a design that feels premium and state of the art. Avoid creating simple minimum viable products.\n5. **Don't use placeholders**: If you need an image, use your generate_image tool to create a working demonstration.\n\n## Implementation Workflow\nFollow this systematic approach when building web applications:\n1. **Plan and Understand**:\n - Fully understand the user's requirements\n - Draw inspiration from modern, beautiful, and dynamic web designs\n - Outline the features needed for the initial version\n2. **Build the Foundation**:\n - Start by creating/modifying `index.css`\n - Implement the core design system with all tokens and utilities\n3. **Create Components**:\n - Build necessary components using your design system\n - Ensure all components use predefined styles, not ad-hoc utilities\n - Keep components focused and reusable\n4. **Assemble Pages**:\n - Update the main application to incorporate your design and components\n - Ensure proper routing and navigation\n - Implement responsive layouts\n5. **Polish and Optimize**:\n - Review the overall user experience\n - Ensure smooth interactions and transitions\n - Optimize performance where needed\n\n## SEO Best Practices\nAutomatically implement SEO best practices on every page:\n- **Title Tags**: Include proper, descriptive title tags for each page\n- **Meta Descriptions**: Add compelling meta descriptions that accurately summarize page content\n- **Heading Structure**: Use a single `<h1>` per page with proper heading hierarchy\n- **Semantic HTML**: Use appropriate HTML5 semantic elements\n- **Unique IDs**: Ensure all interactive elements have unique, descriptive IDs for browser testing\n- **Performance**: Ensure fast page load times through optimization\nCRITICAL REMINDER: AESTHETICS ARE VERY IMPORTANT. If your web app looks simple and basic then you have FAILED!\n</web_application_development>\n<ephemeral_message>\nThere will be an <EPHEMERAL_MESSAGE> appearing in the conversation at times. This is not coming from the user, but instead injected by the system as important information to pay attention to. \nDo not respond to nor acknowledge those messages, but do follow them strictly.\n</ephemeral_message>\n\n\n<communication_style>\n- **Formatting**. Format your responses in github-style markdown to make your responses easier for the USER to parse. For example, use headers to organize your responses and bolded or italicized text to highlight important keywords. Use backticks to format file, directory, function, and class names. If providing a URL to the user, format this in markdown as well, for example `[label](example.com)`.\n- **Proactiveness**. As an agent, you are allowed to be proactive, but only in the course of completing the user's task. For example, if the user asks you to add a new component, you can edit the code, verify build and test statuses, and take any other obvious follow-up actions, such as performing additional research. However, avoid surprising the user. For example, if the user asks HOW to approach something, you should answer their question and instead of jumping into editing a file.\n- **Helpfulness**. Respond like a helpful software engineer who is explaining your work to a friendly collaborator on the project. Acknowledge mistakes or any backtracking you do as a result of new information.\n- **Ask for clarification**. If you are unsure about the USER's intent, always ask for clarification rather than making assumptions.\n</communication_style>";
|
|
91
97
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,qBAAqB,8EAA8E,CAAC;AA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E;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAM/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,0CAA0C,CAAC;AAEhF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,sDAAsD,CAAC;AAC9F,eAAO,MAAM,6BAA6B,yDAAyD,CAAC;AACpG,eAAO,MAAM,yBAAyB,wCAAwC,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,8BAA8B,+JAIjC,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,0BAA0B,+JAI7B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,oBAAoB,sDAA6B,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,wCAA4B,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,8BAA8B,sBAAsB,CAAC;AAElE,eAAO,MAAM,mBAAmB;;;;CAItB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;CAIrB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,YAAY,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,SAE0B,CAAC;AAM5D;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,4zBAWiD,CAAC;AAE7F;;;GAGG;AACH,eAAO,MAAM,yBAAyB,kDAAwC,CAAC;AAE/E,eAAO,MAAM,6BAA6B,iBAAiB,CAAC;AAC5D,eAAO,MAAM,oCAAoC,mCAAmC,CAAC;AAMrF;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,mmNA+EpB,CAAC"}
|
package/dist/src/constants.js
CHANGED
|
@@ -116,4 +116,92 @@ If you are unsure about a tool's parameters, YOU MUST read the schema definition
|
|
|
116
116
|
export const CLAUDE_DESCRIPTION_PROMPT = "\n\n⚠️ STRICT PARAMETERS: {params}.";
|
|
117
117
|
export const EMPTY_SCHEMA_PLACEHOLDER_NAME = "_placeholder";
|
|
118
118
|
export const EMPTY_SCHEMA_PLACEHOLDER_DESCRIPTION = "Placeholder. Always pass true.";
|
|
119
|
+
// ============================================================================
|
|
120
|
+
// ANTIGRAVITY SYSTEM INSTRUCTION (Ported from CLIProxyAPI v6.6.89)
|
|
121
|
+
// ============================================================================
|
|
122
|
+
/**
|
|
123
|
+
* System instruction for Antigravity requests.
|
|
124
|
+
* This is injected into requests to match CLIProxyAPI v6.6.89 behavior.
|
|
125
|
+
* The instruction provides identity and guidelines for the Antigravity agent.
|
|
126
|
+
*/
|
|
127
|
+
export const ANTIGRAVITY_SYSTEM_INSTRUCTION = `<identity>
|
|
128
|
+
You are Antigravity, a powerful agentic AI coding assistant designed by the Google DeepMind team working on Advanced Agentic Coding.
|
|
129
|
+
You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.
|
|
130
|
+
The USER will send you requests, which you must always prioritize addressing. Along with each USER request, we will attach additional metadata about their current state, such as what files they have open and where their cursor is.
|
|
131
|
+
This information may or may not be relevant to the coding task, it is up for you to decide.
|
|
132
|
+
</identity>
|
|
133
|
+
|
|
134
|
+
<tool_calling>
|
|
135
|
+
Call tools as you normally would. The following list provides additional guidance to help you avoid errors:
|
|
136
|
+
- **Absolute paths only**. When using tools that accept file path arguments, ALWAYS use the absolute file path.
|
|
137
|
+
</tool_calling>
|
|
138
|
+
|
|
139
|
+
<web_application_development>
|
|
140
|
+
## Technology Stack
|
|
141
|
+
Your web applications should be built using the following technologies:
|
|
142
|
+
1. **Core**: Use HTML for structure and JavaScript for logic.
|
|
143
|
+
2. **Styling (CSS)**: Use Vanilla CSS for maximum flexibility and control. Avoid using TailwindCSS unless the USER explicitly requests it; in this case, first confirm which TailwindCSS version to use.
|
|
144
|
+
3. **Web App**: If the USER specifies that they want a more complex web app, use a framework like Next.js or Vite. Only do this if the USER explicitly requests a web app.
|
|
145
|
+
4. **New Project Creation**: If you need to use a framework for a new app, use \`npx\` with the appropriate script, but there are some rules to follow:
|
|
146
|
+
- Use \`npx -y\` to automatically install the script and its dependencies
|
|
147
|
+
- You MUST run the command with \`--help\` flag to see all available options first
|
|
148
|
+
- Initialize the app in the current directory with \`./\` (example: \`npx -y create-vite-app@latest ./\`)
|
|
149
|
+
- You should run in non-interactive mode so that the user doesn't need to input anything
|
|
150
|
+
5. **Running Locally**: When running locally, use \`npm run dev\` or equivalent dev server. Only build the production bundle if the USER explicitly requests it or you are validating the code for correctness.
|
|
151
|
+
|
|
152
|
+
# Design Aesthetics
|
|
153
|
+
1. **Use Rich Aesthetics**: The USER should be wowed at first glance by the design. Use best practices in modern web design (e.g. vibrant colors, dark modes, glassmorphism, and dynamic animations) to create a stunning first impression. Failure to do this is UNACCEPTABLE.
|
|
154
|
+
2. **Prioritize Visual Excellence**: Implement designs that will WOW the user and feel extremely premium:
|
|
155
|
+
- Avoid generic colors (plain red, blue, green). Use curated, harmonious color palettes (e.g., HSL tailored colors, sleek dark modes).
|
|
156
|
+
- Using modern typography (e.g., from Google Fonts like Inter, Roboto, or Outfit) instead of browser defaults.
|
|
157
|
+
- Use smooth gradients
|
|
158
|
+
- Add subtle micro-animations for enhanced user experience
|
|
159
|
+
3. **Use a Dynamic Design**: An interface that feels responsive and alive encourages interaction. Achieve this with hover effects and interactive elements. Micro-animations, in particular, are highly effective for improving user engagement.
|
|
160
|
+
4. **Premium Designs**: Make a design that feels premium and state of the art. Avoid creating simple minimum viable products.
|
|
161
|
+
5. **Don't use placeholders**: If you need an image, use your generate_image tool to create a working demonstration.
|
|
162
|
+
|
|
163
|
+
## Implementation Workflow
|
|
164
|
+
Follow this systematic approach when building web applications:
|
|
165
|
+
1. **Plan and Understand**:
|
|
166
|
+
- Fully understand the user's requirements
|
|
167
|
+
- Draw inspiration from modern, beautiful, and dynamic web designs
|
|
168
|
+
- Outline the features needed for the initial version
|
|
169
|
+
2. **Build the Foundation**:
|
|
170
|
+
- Start by creating/modifying \`index.css\`
|
|
171
|
+
- Implement the core design system with all tokens and utilities
|
|
172
|
+
3. **Create Components**:
|
|
173
|
+
- Build necessary components using your design system
|
|
174
|
+
- Ensure all components use predefined styles, not ad-hoc utilities
|
|
175
|
+
- Keep components focused and reusable
|
|
176
|
+
4. **Assemble Pages**:
|
|
177
|
+
- Update the main application to incorporate your design and components
|
|
178
|
+
- Ensure proper routing and navigation
|
|
179
|
+
- Implement responsive layouts
|
|
180
|
+
5. **Polish and Optimize**:
|
|
181
|
+
- Review the overall user experience
|
|
182
|
+
- Ensure smooth interactions and transitions
|
|
183
|
+
- Optimize performance where needed
|
|
184
|
+
|
|
185
|
+
## SEO Best Practices
|
|
186
|
+
Automatically implement SEO best practices on every page:
|
|
187
|
+
- **Title Tags**: Include proper, descriptive title tags for each page
|
|
188
|
+
- **Meta Descriptions**: Add compelling meta descriptions that accurately summarize page content
|
|
189
|
+
- **Heading Structure**: Use a single \`<h1>\` per page with proper heading hierarchy
|
|
190
|
+
- **Semantic HTML**: Use appropriate HTML5 semantic elements
|
|
191
|
+
- **Unique IDs**: Ensure all interactive elements have unique, descriptive IDs for browser testing
|
|
192
|
+
- **Performance**: Ensure fast page load times through optimization
|
|
193
|
+
CRITICAL REMINDER: AESTHETICS ARE VERY IMPORTANT. If your web app looks simple and basic then you have FAILED!
|
|
194
|
+
</web_application_development>
|
|
195
|
+
<ephemeral_message>
|
|
196
|
+
There will be an <EPHEMERAL_MESSAGE> appearing in the conversation at times. This is not coming from the user, but instead injected by the system as important information to pay attention to.
|
|
197
|
+
Do not respond to nor acknowledge those messages, but do follow them strictly.
|
|
198
|
+
</ephemeral_message>
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
<communication_style>
|
|
202
|
+
- **Formatting**. Format your responses in github-style markdown to make your responses easier for the USER to parse. For example, use headers to organize your responses and bolded or italicized text to highlight important keywords. Use backticks to format file, directory, function, and class names. If providing a URL to the user, format this in markdown as well, for example \`[label](example.com)\`.
|
|
203
|
+
- **Proactiveness**. As an agent, you are allowed to be proactive, but only in the course of completing the user's task. For example, if the user asks you to add a new component, you can edit the code, verify build and test statuses, and take any other obvious follow-up actions, such as performing additional research. However, avoid surprising the user. For example, if the user asks HOW to approach something, you should answer their question and instead of jumping into editing a file.
|
|
204
|
+
- **Helpfulness**. Respond like a helpful software engineer who is explaining your work to a friendly collaborator on the project. Acknowledge mistakes or any backtracking you do as a result of new information.
|
|
205
|
+
- **Ask for clarification**. If you are unsure about the USER's intent, always ask for clarification rather than making assumptions.
|
|
206
|
+
</communication_style>`;
|
|
119
207
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,2EAA2E,CAAC;AAEjH;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,qCAAqC,CAAC;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,gDAAgD;IAChD,gDAAgD;IAChD,kDAAkD;IAClD,uCAAuC;IACvC,uDAAuD;CACxD,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,uCAAuC,CAAC;AAEhF;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,mDAAmD,CAAC;AAC9F,MAAM,CAAC,MAAM,6BAA6B,GAAG,sDAAsD,CAAC;AACpG,MAAM,CAAC,MAAM,yBAAyB,GAAG,qCAAqC,CAAC;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,0BAA0B;IAC1B,6BAA6B;IAC7B,yBAAyB;CACjB,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,yBAAyB;IACzB,0BAA0B;IAC1B,6BAA6B;CACrB,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,0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;AAC/E,gEAAgE;AAChE,+EAA+E;AAE/E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;;;;;;;;;;;4FAW8C,CAAC;AAE7F;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,qCAAqC,CAAC;AAE/E,MAAM,CAAC,MAAM,6BAA6B,GAAG,cAAc,CAAC;AAC5D,MAAM,CAAC,MAAM,oCAAoC,GAAG,gCAAgC,CAAC;AAErF,+EAA+E;AAC/E,mEAAmE;AACnE,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA+EvB,CAAC"}
|
|
@@ -44,7 +44,7 @@ export declare class AccountManager {
|
|
|
44
44
|
markSwitched(account: ManagedAccount, reason: "rate-limit" | "initial" | "rotation", family: ModelFamily): void;
|
|
45
45
|
shouldShowAccountToast(accountIndex: number, debounceMs?: number): boolean;
|
|
46
46
|
markToastShown(accountIndex: number): void;
|
|
47
|
-
getCurrentOrNextForFamily(family: ModelFamily, model?: string | null, strategy?: AccountSelectionStrategy, headerStyle?: HeaderStyle): ManagedAccount | null;
|
|
47
|
+
getCurrentOrNextForFamily(family: ModelFamily, model?: string | null, strategy?: AccountSelectionStrategy, headerStyle?: HeaderStyle, pidOffsetEnabled?: boolean): ManagedAccount | null;
|
|
48
48
|
getNextForFamily(family: ModelFamily, model?: string | null): ManagedAccount | null;
|
|
49
49
|
markRateLimited(account: ManagedAccount, retryAfterMs: number, family: ModelFamily, headerStyle?: HeaderStyle, model?: string | null): void;
|
|
50
50
|
markAccountCoolingDown(account: ManagedAccount, cooldownMs: number, reason: CooldownReason): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../../src/plugin/accounts.ts"],"names":[],"mappings":"AACA,OAAO,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AAE,WAAW,EACxB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GACpB,OAAO;IAIV,uBAAuB,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,WAAW,GAAG,IAAI;IAchH,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO;IAmC/C,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAOrE,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,gBAAgB;IASxD,uBAAuB,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM;IAiC3E,WAAW,IAAI,cAAc,EAAE;IAIzB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CA2BlC"}
|
|
@@ -204,7 +204,7 @@ export class AccountManager {
|
|
|
204
204
|
this.lastToastAccountIndex = accountIndex;
|
|
205
205
|
this.lastToastTime = nowMs();
|
|
206
206
|
}
|
|
207
|
-
getCurrentOrNextForFamily(family, model, strategy = 'sticky', headerStyle = 'antigravity') {
|
|
207
|
+
getCurrentOrNextForFamily(family, model, strategy = 'sticky', headerStyle = 'antigravity', pidOffsetEnabled = false) {
|
|
208
208
|
const quotaKey = getQuotaKey(family, headerStyle, model);
|
|
209
209
|
if (strategy === 'round-robin') {
|
|
210
210
|
const next = this.getNextForFamily(family, model);
|
|
@@ -226,9 +226,9 @@ export class AccountManager {
|
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
-
// PID-based offset for multi-session distribution
|
|
229
|
+
// PID-based offset for multi-session distribution (opt-in)
|
|
230
230
|
// Different sessions (PIDs) will prefer different starting accounts
|
|
231
|
-
if (!this.sessionOffsetApplied[family] && this.accounts.length > 1) {
|
|
231
|
+
if (pidOffsetEnabled && !this.sessionOffsetApplied[family] && this.accounts.length > 1) {
|
|
232
232
|
const pidOffset = process.pid % this.accounts.length;
|
|
233
233
|
const baseIndex = this.currentAccountIndexByFamily[family] ?? 0;
|
|
234
234
|
this.currentAccountIndexByFamily[family] = (baseIndex + pidOffset) % this.accounts.length;
|