clawmoney 0.13.4 → 0.13.5
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.
|
@@ -309,7 +309,7 @@ async function callLoadCodeAssist(accessToken) {
|
|
|
309
309
|
pluginType: "GEMINI",
|
|
310
310
|
},
|
|
311
311
|
});
|
|
312
|
-
const headers =
|
|
312
|
+
const headers = antigravitySetupHeaders(accessToken);
|
|
313
313
|
for (const baseEndpoint of ANTIGRAVITY_LOAD_ENDPOINTS) {
|
|
314
314
|
try {
|
|
315
315
|
const resp = await fetchWithProxy(`${baseEndpoint}/v1internal:loadCodeAssist`, { method: "POST", headers, body });
|
|
@@ -344,7 +344,7 @@ async function callOnboardUser(accessToken, tierId) {
|
|
|
344
344
|
pluginType: "GEMINI",
|
|
345
345
|
},
|
|
346
346
|
});
|
|
347
|
-
const headers =
|
|
347
|
+
const headers = antigravitySetupHeaders(accessToken);
|
|
348
348
|
for (const baseEndpoint of ANTIGRAVITY_LOAD_ENDPOINTS) {
|
|
349
349
|
for (let attempt = 1; attempt <= 5; attempt++) {
|
|
350
350
|
try {
|
|
@@ -388,6 +388,10 @@ export async function resolveAntigravityProjectId(accessToken) {
|
|
|
388
388
|
`expect 403 errors until a real project is resolved.`);
|
|
389
389
|
return ANTIGRAVITY_DEFAULT_PROJECT_ID;
|
|
390
390
|
}
|
|
391
|
+
/**
|
|
392
|
+
* Headers used for the streamGenerateContent / generateContent calls. Real
|
|
393
|
+
* Antigravity UA + x-goog-api-client + client-metadata.
|
|
394
|
+
*/
|
|
391
395
|
function antigravityHeaders(accessToken) {
|
|
392
396
|
return {
|
|
393
397
|
"content-type": "application/json",
|
|
@@ -404,6 +408,27 @@ function antigravityHeaders(accessToken) {
|
|
|
404
408
|
}),
|
|
405
409
|
};
|
|
406
410
|
}
|
|
411
|
+
/**
|
|
412
|
+
* Headers for the setup calls (loadCodeAssist / onboardUser). These want a
|
|
413
|
+
* simpler Gemini-CLI-flavored header set — the Antigravity UA + the
|
|
414
|
+
* `x-goog-api-client` cloud-shell-editor fingerprint triggers a 400 on
|
|
415
|
+
* prod/daily/autopush hosts. opencode-antigravity-auth/src/antigravity/oauth.ts
|
|
416
|
+
* uses the same subset (authorization + content-type + gemini-cli UA +
|
|
417
|
+
* client-metadata) and it works in the wild.
|
|
418
|
+
*/
|
|
419
|
+
function antigravitySetupHeaders(accessToken) {
|
|
420
|
+
return {
|
|
421
|
+
"content-type": "application/json",
|
|
422
|
+
"accept": "application/json",
|
|
423
|
+
"authorization": `Bearer ${accessToken}`,
|
|
424
|
+
"user-agent": "google-api-nodejs-client/9.15.1",
|
|
425
|
+
"client-metadata": JSON.stringify({
|
|
426
|
+
ideType: "ANTIGRAVITY",
|
|
427
|
+
platform: process.platform === "win32" ? "WINDOWS" : "MACOS",
|
|
428
|
+
pluginType: "GEMINI",
|
|
429
|
+
}),
|
|
430
|
+
};
|
|
431
|
+
}
|
|
407
432
|
// ── Rate guard ──
|
|
408
433
|
let rateGuard = null;
|
|
409
434
|
export function configureAntigravityRateGuard(config) {
|