clawmoney 0.13.6 → 0.13.8

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.
@@ -57,27 +57,27 @@ export const ANTIGRAVITY_SCOPES = [
57
57
  export const ANTIGRAVITY_REDIRECT_URI = "http://localhost:51121/oauth-callback";
58
58
  const OAUTH_TOKEN_URL = "https://oauth2.googleapis.com/token";
59
59
  const OAUTH_USERINFO_URL = "https://www.googleapis.com/oauth2/v1/userinfo?alt=json";
60
- // Endpoint fallback order. Matches CLIProxy / opencode-antigravity-auth:
61
- // the Antigravity IDE talks to the `daily` sandbox first, with `autopush` and
62
- // prod as progressive fallbacks. We retry per request on connection errors,
63
- // 5xx, 429, or 404.
60
+ // Endpoint list. sub2api (production-tested Go relay) uses only prod + daily.
61
+ // We originally also included `autopush-cloudcode-pa.sandbox.googleapis.com`
62
+ // from opencode-antigravity-auth's list, but that host requires the
63
+ // `staging-cloudaicompanion` API to be manually enabled in Google Cloud
64
+ // Console — which is a setup step the real Antigravity IDE doesn't need, so
65
+ // it can't be the right path. Drop it.
64
66
  const ANTIGRAVITY_ENDPOINT_DAILY = "https://daily-cloudcode-pa.sandbox.googleapis.com";
65
- const ANTIGRAVITY_ENDPOINT_AUTOPUSH = "https://autopush-cloudcode-pa.sandbox.googleapis.com";
66
67
  const ANTIGRAVITY_ENDPOINT_PROD = "https://cloudcode-pa.googleapis.com";
68
+ // Generate-path fallback order: daily → prod. Matches sub2api's
69
+ // `ForwardBaseURLs()` — daily is the Antigravity IDE's primary forward
70
+ // target; prod is the fallback when daily 404/500s.
67
71
  const ANTIGRAVITY_ENDPOINTS = [
68
72
  ANTIGRAVITY_ENDPOINT_DAILY,
69
- ANTIGRAVITY_ENDPOINT_AUTOPUSH,
70
73
  ANTIGRAVITY_ENDPOINT_PROD,
71
74
  ];
72
- // For project discovery (loadCodeAssist / onboardUser) we hit PROD first.
73
- // sub2api and opencode-antigravity-auth both found that the sandbox daily/
74
- // autopush endpoints often 404 on these setup calls even though they handle
75
- // the generate path fine. Mirroring their order avoids the "no project →
76
- // fallback to hardcoded rising-fact-p41fc → 403 API not enabled" trap.
75
+ // Setup-path fallback order: prod daily. Matches sub2api's `BaseURLs`.
76
+ // loadCodeAssist / onboardUser are best supported on prod; daily is the
77
+ // backup for when prod has a temporary hiccup.
77
78
  const ANTIGRAVITY_LOAD_ENDPOINTS = [
78
79
  ANTIGRAVITY_ENDPOINT_PROD,
79
80
  ANTIGRAVITY_ENDPOINT_DAILY,
80
- ANTIGRAVITY_ENDPOINT_AUTOPUSH,
81
81
  ];
82
82
  const GENERATE_PATH = "/v1internal:generateContent";
83
83
  // Hardcoded fallback project ID used for workspace/business accounts that
@@ -302,11 +302,16 @@ function extractTierId(data) {
302
302
  return pick(data.paidTier) ?? pick(data.currentTier);
303
303
  }
304
304
  async function callLoadCodeAssist(accessToken) {
305
+ // loadCodeAssist metadata fields match sub2api exactly — Google's protobuf
306
+ // validator rejects "MACOS"/"WINDOWS" strings on the `platform` enum (it
307
+ // only accepts UPPERCASE enum values like PLATFORM_UNSPECIFIED / DARWIN /
308
+ // LINUX / WINDOWS_NT). sub2api sends ideVersion + ideName instead, which
309
+ // bypasses the platform field entirely.
305
310
  const body = JSON.stringify({
306
311
  metadata: {
307
312
  ideType: "ANTIGRAVITY",
308
- platform: process.platform === "win32" ? "WINDOWS" : "MACOS",
309
- pluginType: "GEMINI",
313
+ ideVersion: ANTIGRAVITY_VERSION,
314
+ ideName: "antigravity",
310
315
  },
311
316
  });
312
317
  const headers = antigravitySetupHeaders(accessToken);
@@ -337,6 +342,9 @@ async function callLoadCodeAssist(accessToken) {
337
342
  * onboarded first. Mirrors sub2api's Client.OnboardUser retry/poll logic.
338
343
  */
339
344
  async function callOnboardUser(accessToken, tierId) {
345
+ // onboardUser metadata: mirrors sub2api (client.go:519-522) exactly. Unlike
346
+ // loadCodeAssist, this call *does* take `platform` + `pluginType`, but it
347
+ // wants the protobuf enum values — "PLATFORM_UNSPECIFIED" not "MACOS".
340
348
  const body = JSON.stringify({
341
349
  tierId,
342
350
  metadata: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawmoney",
3
- "version": "0.13.6",
3
+ "version": "0.13.8",
4
4
  "description": "ClawMoney CLI -- Earn rewards with your AI agent",
5
5
  "type": "module",
6
6
  "bin": {