clawmoney 0.13.8 → 0.13.9

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.
@@ -80,6 +80,28 @@ const ANTIGRAVITY_LOAD_ENDPOINTS = [
80
80
  ANTIGRAVITY_ENDPOINT_DAILY,
81
81
  ];
82
82
  const GENERATE_PATH = "/v1internal:generateContent";
83
+ /**
84
+ * Map our `antigravity-*` market-facing model IDs to the real model names
85
+ * Google's v1internal endpoint accepts. The `antigravity-` prefix only
86
+ * exists in OUR namespace so buyers can pick the Antigravity quota pool
87
+ * vs the Gemini CLI quota pool for the same underlying model. Google's
88
+ * v1internal endpoint itself uses the bare names. Sources: sub2api
89
+ * migration 049_unify_antigravity_model_mapping.sql for canonical Google
90
+ * names.
91
+ */
92
+ const ANTIGRAVITY_MODEL_MAP = {
93
+ "antigravity-gemini-3-pro": "gemini-3-pro-high",
94
+ "antigravity-gemini-3.1-pro": "gemini-3-pro-high",
95
+ "antigravity-gemini-3-flash": "gemini-3-flash",
96
+ "antigravity-gemini-2.5-pro": "gemini-2.5-pro",
97
+ "antigravity-gemini-2.5-flash": "gemini-2.5-flash",
98
+ "antigravity-claude-sonnet-4-6": "claude-sonnet-4-5",
99
+ "antigravity-claude-opus-4-6-thinking": "claude-opus-4-5-thinking",
100
+ "antigravity-claude-opus-4-6": "claude-opus-4-6",
101
+ };
102
+ function resolveAntigravityUpstreamModel(model) {
103
+ return ANTIGRAVITY_MODEL_MAP[model] ?? model;
104
+ }
83
105
  // Hardcoded fallback project ID used for workspace/business accounts that
84
106
  // don't return their own `cloudaicompanionProject` from `loadCodeAssist`. Same
85
107
  // value used by opencode-antigravity-auth and sub2api — it's not account-
@@ -510,12 +532,16 @@ async function doCallAntigravityApi(opts) {
510
532
  const account = await getFreshAccount();
511
533
  const projectId = account.project_id || ANTIGRAVITY_DEFAULT_PROJECT_ID;
512
534
  const maxTokens = opts.maxTokens ?? 8192;
535
+ const upstreamModel = resolveAntigravityUpstreamModel(opts.model);
536
+ if (upstreamModel !== opts.model) {
537
+ logger.info(`[antigravity-api] model mapping: ${opts.model} → ${upstreamModel}`);
538
+ }
513
539
  const outerRequest = {
514
540
  project: projectId,
515
541
  requestId: `agent-${randomUUID()}`,
516
542
  userAgent: "antigravity",
517
543
  requestType: "agent",
518
- model: opts.model,
544
+ model: upstreamModel,
519
545
  request: {
520
546
  contents: [
521
547
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawmoney",
3
- "version": "0.13.8",
3
+ "version": "0.13.9",
4
4
  "description": "ClawMoney CLI -- Earn rewards with your AI agent",
5
5
  "type": "module",
6
6
  "bin": {