@oh-my-pi/pi-catalog 17.3.1 → 17.3.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 CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [17.3.2] - 2026-08-13
6
+
7
+ ### Added
8
+
9
+ - Added support for the `deepseek-v4-pro:preview` model
10
+ - Added support for the `gemini-3.7-flash` model
11
+ - Added dynamic Antigravity client-version discovery from the official update manifest (darwin/arm64 channel), so version-gated models appear without a code change; `PI_AI_ANTIGRAVITY_VERSION` remains available as an override.
12
+
13
+ ### Fixed
14
+
15
+ - Fixed Antigravity discovery missing Gemini 3.7 Flash: Cloud Code Assist gates newer models on the client version in the `User-Agent`, and the pinned `antigravity/hub/2.1.4` was too old. The user-agent now matches the captured 2.8.0 client format (`antigravity/hub/2.8.0 (aidev_client; os_type=darwin; arch=arm64; cl=963137146)`); os_type/arch stay pinned to the darwin/arm64 reference client. Overridable via `PI_AI_ANTIGRAVITY_VERSION` / `PI_AI_ANTIGRAVITY_CL` / `PI_AI_ANTIGRAVITY_OS` / `PI_AI_ANTIGRAVITY_ARCH`.
16
+
17
+ ### Removed
18
+
19
+ - Removed `ANTIGRAVITY_SYSTEM_INSTRUCTION` from `wire/gemini-headers`; the Antigravity transport and web search no longer inject a fake identity prompt.
20
+
5
21
  ## [17.3.1] - 2026-08-13
6
22
 
7
23
  ### Added
@@ -1,3 +1,4 @@
1
+ import type { FetchImpl } from "@oh-my-pi/pi-utils";
1
2
  /**
2
3
  * Build a User-Agent string that identifies as Gemini CLI to unlock higher rate limits.
3
4
  * Uses the same format as the official Gemini CLI (v0.35+):
@@ -8,14 +9,38 @@ export declare const getGeminiCliHeaders: (modelId?: string) => {
8
9
  "User-Agent": string;
9
10
  "Client-Metadata": string;
10
11
  };
11
- export declare const ANTIGRAVITY_SYSTEM_INSTRUCTION: string;
12
12
  /**
13
13
  * Antigravity / Cloud Code Assist user agent. Lives in its own file so discovery
14
14
  * and usage code can read it without pulling the heavy google-gemini-cli provider
15
15
  * (and its @google/genai → google-auth-library dependency chain) into the startup
16
16
  * parse graph.
17
+ *
18
+ * Format captured from the real 2.8.0 `antigravity/hub` client:
19
+ * `antigravity/hub/2.8.0 (aidev_client; os_type=darwin; arch=arm64; cl=963137146)`.
20
+ * The backend gates newer models (e.g. gemini-3.7-flash) on the client version,
21
+ * so the version tracks the latest Antigravity release via the update manifest
22
+ * (see {@link ensureAntigravityVersion}) with `DEFAULT_ANTIGRAVITY_VERSION` as
23
+ * the offline fallback. os_type/arch are pinned to the darwin/arm64 reference
24
+ * client the version and manifest are captured from, independent of the host
25
+ * platform. Overrides: PI_AI_ANTIGRAVITY_VERSION / _CL / _OS / _ARCH.
17
26
  */
18
- export declare let getAntigravityUserAgent: () => string;
27
+ export declare const DEFAULT_ANTIGRAVITY_VERSION = "2.8.0";
28
+ /** Current Antigravity client version: env override → manifest-discovered → pinned fallback. */
29
+ export declare function getAntigravityVersion(): string;
30
+ /**
31
+ * Extracts the client version from an electron-builder update manifest.
32
+ * Returns null when no well-formed `version:` line is present.
33
+ */
34
+ export declare function parseAntigravityManifestVersion(yamlText: string): string | null;
35
+ /**
36
+ * Resolves the latest Antigravity release from the official update manifest.
37
+ * Success is cached for the process lifetime; failures are silent (the pinned
38
+ * fallback stays valid) and clear the in-flight cache so a later call retries.
39
+ * Skipped entirely when PI_AI_ANTIGRAVITY_VERSION is set.
40
+ */
41
+ export declare function ensureAntigravityVersion(fetcher?: FetchImpl, signal?: AbortSignal): Promise<void>;
42
+ /** Antigravity `User-Agent` header value; rebuilt when the discovered version changes. */
43
+ export declare function getAntigravityUserAgent(): string;
19
44
  /**
20
45
  * Per-wire-id Antigravity Cloud Code Assist request constants, captured from the
21
46
  * real `antigravity/hub` client against `daily-cloudcode-pa`. `modelEnum` is the
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-catalog",
4
- "version": "17.3.1",
4
+ "version": "17.3.2",
5
5
  "description": "Model catalog for omp: bundled model database, provider discovery descriptors, model identity, classification, and equivalence",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": "Can Boluk",
@@ -35,11 +35,11 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@bufbuild/protobuf": "^2.12.1",
38
- "@oh-my-pi/omptype": "17.3.1",
39
- "@oh-my-pi/pi-utils": "17.3.1"
38
+ "@oh-my-pi/omptype": "17.3.2",
39
+ "@oh-my-pi/pi-utils": "17.3.2"
40
40
  },
41
41
  "devDependencies": {
42
- "@oh-my-pi/pi-ai": "17.3.1",
42
+ "@oh-my-pi/pi-ai": "17.3.2",
43
43
  "@types/bun": "^1.3.14"
44
44
  },
45
45
  "engines": {
@@ -6,7 +6,7 @@ import {
6
6
  collapseEffortVariants,
7
7
  type VariantCollapseTable,
8
8
  } from "../variant-collapse";
9
- import { getAntigravityUserAgent } from "../wire/gemini-headers";
9
+ import { ensureAntigravityVersion, getAntigravityUserAgent } from "../wire/gemini-headers";
10
10
 
11
11
  export const ANTIGRAVITY_PRIMARY_ENDPOINT = "https://daily-cloudcode-pa.googleapis.com";
12
12
  export const ANTIGRAVITY_SANDBOX_ENDPOINT = "https://daily-cloudcode-pa.sandbox.googleapis.com";
@@ -161,6 +161,10 @@ export interface FetchAntigravityDiscoveryModelsOptions {
161
161
  export async function fetchAntigravityDiscoveryModels(
162
162
  options: FetchAntigravityDiscoveryModelsOptions,
163
163
  ): Promise<ModelSpec<"google-gemini-cli">[] | null> {
164
+ if (options.userAgent === undefined) {
165
+ await ensureAntigravityVersion(options.fetcher ?? fetch, options.signal);
166
+ }
167
+
164
168
  const fetcher = discoveryFetch(options.fetcher);
165
169
  const endpoints = options.endpoint
166
170
  ? [trimTrailingSlashes(options.endpoint)]
package/src/models.json CHANGED
@@ -25988,6 +25988,43 @@
25988
25988
  }
25989
25989
  }
25990
25990
  },
25991
+ "gemini-3.7-flash": {
25992
+ "id": "gemini-3.7-flash",
25993
+ "name": "Gemini 3.7 Flash",
25994
+ "api": "google-gemini-cli",
25995
+ "provider": "google-antigravity",
25996
+ "baseUrl": "https://daily-cloudcode-pa.googleapis.com",
25997
+ "reasoning": true,
25998
+ "input": [
25999
+ "text",
26000
+ "image"
26001
+ ],
26002
+ "cost": {
26003
+ "input": 0.75,
26004
+ "output": 3.75,
26005
+ "cacheRead": 0.075,
26006
+ "cacheWrite": 0
26007
+ },
26008
+ "contextWindow": 1048576,
26009
+ "maxTokens": 65536,
26010
+ "requestModelId": "gemini-3.7-flash-low",
26011
+ "thinking": {
26012
+ "mode": "google-level",
26013
+ "efforts": [
26014
+ "minimal",
26015
+ "low",
26016
+ "medium",
26017
+ "high"
26018
+ ],
26019
+ "requiresEffort": true,
26020
+ "effortRouting": {
26021
+ "minimal": "gemini-3.7-flash-low",
26022
+ "low": "gemini-3.7-flash-low",
26023
+ "medium": "gemini-3.7-flash-medium",
26024
+ "high": "gemini-3.7-flash-high"
26025
+ }
26026
+ }
26027
+ },
25991
26028
  "gpt-oss-120b": {
25992
26029
  "id": "gpt-oss-120b",
25993
26030
  "name": "GPT OSS 120B",
@@ -29128,12 +29165,12 @@
29128
29165
  "text"
29129
29166
  ],
29130
29167
  "cost": {
29131
- "input": 0.079996,
29132
- "output": 0.252,
29133
- "cacheRead": 0.0252,
29168
+ "input": 0.072,
29169
+ "output": 0.144,
29170
+ "cacheRead": 0.016,
29134
29171
  "cacheWrite": 0
29135
29172
  },
29136
- "contextWindow": 1048576,
29173
+ "contextWindow": 262144,
29137
29174
  "maxTokens": 262144,
29138
29175
  "thinking": {
29139
29176
  "mode": "effort",
@@ -29156,10 +29193,10 @@
29156
29193
  "image"
29157
29194
  ],
29158
29195
  "cost": {
29159
- "input": 1.5,
29160
- "output": 7.5,
29161
- "cacheRead": 0.15,
29162
- "cacheWrite": 0.083333
29196
+ "input": 0.375,
29197
+ "output": 1.875,
29198
+ "cacheRead": 0.0375,
29199
+ "cacheWrite": 0.020833
29163
29200
  },
29164
29201
  "contextWindow": 1048576,
29165
29202
  "maxTokens": 65536,
@@ -29216,13 +29253,13 @@
29216
29253
  "image"
29217
29254
  ],
29218
29255
  "cost": {
29219
- "input": 2.8,
29220
- "output": 14,
29221
- "cacheRead": 0.29,
29256
+ "input": 2.4,
29257
+ "output": 12,
29258
+ "cacheRead": 0.24,
29222
29259
  "cacheWrite": 0
29223
29260
  },
29224
- "contextWindow": 1048576,
29225
- "maxTokens": 1048576,
29261
+ "contextWindow": 974842,
29262
+ "maxTokens": 974842,
29226
29263
  "thinking": {
29227
29264
  "mode": "effort",
29228
29265
  "efforts": [
@@ -32370,10 +32407,10 @@
32370
32407
  "image"
32371
32408
  ],
32372
32409
  "cost": {
32373
- "input": 1.5,
32374
- "output": 7.5,
32375
- "cacheRead": 0.15,
32376
- "cacheWrite": 0.083333
32410
+ "input": 0.75,
32411
+ "output": 3.75,
32412
+ "cacheRead": 0.075,
32413
+ "cacheWrite": 0.041667
32377
32414
  },
32378
32415
  "contextWindow": 1048576,
32379
32416
  "maxTokens": 65536,
@@ -32394,19 +32431,29 @@
32394
32431
  "api": "openai-completions",
32395
32432
  "provider": "kilo",
32396
32433
  "baseUrl": "https://api.kilo.ai/api/gateway",
32397
- "reasoning": false,
32434
+ "reasoning": true,
32398
32435
  "input": [
32399
- "text"
32436
+ "text",
32437
+ "image"
32400
32438
  ],
32401
32439
  "cost": {
32402
- "input": 0,
32403
- "output": 0,
32404
- "cacheRead": 0,
32405
- "cacheWrite": 0
32440
+ "input": 0.75,
32441
+ "output": 3.75,
32442
+ "cacheRead": 0.075,
32443
+ "cacheWrite": 0.041667
32406
32444
  },
32407
32445
  "contextWindow": 1048576,
32408
32446
  "maxTokens": 65536,
32409
- "supportsComputerUse": false
32447
+ "thinking": {
32448
+ "mode": "effort",
32449
+ "efforts": [
32450
+ "minimal",
32451
+ "low",
32452
+ "medium",
32453
+ "high"
32454
+ ],
32455
+ "requiresEffort": true
32456
+ }
32410
32457
  },
32411
32458
  "google/gemma-2-27b-it": {
32412
32459
  "id": "google/gemma-2-27b-it",
@@ -41453,9 +41500,9 @@
41453
41500
  "text"
41454
41501
  ],
41455
41502
  "cost": {
41456
- "input": 0.55,
41457
- "output": 2.2,
41458
- "cacheRead": 0.11,
41503
+ "input": 0.5,
41504
+ "output": 2,
41505
+ "cacheRead": 0.1,
41459
41506
  "cacheWrite": 0
41460
41507
  },
41461
41508
  "contextWindow": 202752,
@@ -41533,9 +41580,9 @@
41533
41580
  "text"
41534
41581
  ],
41535
41582
  "cost": {
41536
- "input": 0.6,
41537
- "output": 2.2,
41538
- "cacheRead": 0.11,
41583
+ "input": 0.4,
41584
+ "output": 1.75,
41585
+ "cacheRead": 0.08,
41539
41586
  "cacheWrite": 0
41540
41587
  },
41541
41588
  "contextWindow": 202752,
@@ -41562,7 +41609,7 @@
41562
41609
  "text"
41563
41610
  ],
41564
41611
  "cost": {
41565
- "input": 0.07,
41612
+ "input": 0.06,
41566
41613
  "output": 0.4,
41567
41614
  "cacheRead": 0.01,
41568
41615
  "cacheWrite": 0
@@ -41591,8 +41638,8 @@
41591
41638
  "text"
41592
41639
  ],
41593
41640
  "cost": {
41594
- "input": 1,
41595
- "output": 3.2,
41641
+ "input": 0.95,
41642
+ "output": 2.55,
41596
41643
  "cacheRead": 0.2,
41597
41644
  "cacheWrite": 0
41598
41645
  },
@@ -41649,7 +41696,7 @@
41649
41696
  "text"
41650
41697
  ],
41651
41698
  "cost": {
41652
- "input": 1.38,
41699
+ "input": 1.4,
41653
41700
  "output": 4.4,
41654
41701
  "cacheRead": 0.26,
41655
41702
  "cacheWrite": 0
@@ -41683,7 +41730,7 @@
41683
41730
  "cacheRead": 0.26,
41684
41731
  "cacheWrite": 0
41685
41732
  },
41686
- "contextWindow": 262144,
41733
+ "contextWindow": 1048576,
41687
41734
  "maxTokens": 131072,
41688
41735
  "thinking": {
41689
41736
  "mode": "effort",
@@ -51050,7 +51097,7 @@
51050
51097
  "input": 1.5,
51051
51098
  "output": 9,
51052
51099
  "cacheRead": 0.15,
51053
- "cacheWrite": 0
51100
+ "cacheWrite": 0.083333
51054
51101
  },
51055
51102
  "contextWindow": 1048576,
51056
51103
  "maxTokens": 65536,
@@ -51110,7 +51157,37 @@
51110
51157
  "input": 1.5,
51111
51158
  "output": 7.5,
51112
51159
  "cacheRead": 0.15,
51113
- "cacheWrite": 0
51160
+ "cacheWrite": 0.041667
51161
+ },
51162
+ "contextWindow": 1048576,
51163
+ "maxTokens": 65536,
51164
+ "thinking": {
51165
+ "mode": "effort",
51166
+ "efforts": [
51167
+ "minimal",
51168
+ "low",
51169
+ "medium",
51170
+ "high"
51171
+ ],
51172
+ "requiresEffort": true
51173
+ }
51174
+ },
51175
+ "google/gemini-3.7-flash": {
51176
+ "id": "google/gemini-3.7-flash",
51177
+ "name": "Gemini 3.7 Flash",
51178
+ "api": "openai-completions",
51179
+ "provider": "nanogpt",
51180
+ "baseUrl": "https://nano-gpt.com/api/v1",
51181
+ "reasoning": true,
51182
+ "input": [
51183
+ "text",
51184
+ "image"
51185
+ ],
51186
+ "cost": {
51187
+ "input": 0.375,
51188
+ "output": 1.875,
51189
+ "cacheRead": 0.0375,
51190
+ "cacheWrite": 0.020833
51114
51191
  },
51115
51192
  "contextWindow": 1048576,
51116
51193
  "maxTokens": 65536,
@@ -71596,6 +71673,35 @@
71596
71673
  ]
71597
71674
  }
71598
71675
  },
71676
+ "deepseek-v4-pro:preview": {
71677
+ "id": "deepseek-v4-pro:preview",
71678
+ "name": "deepseek-v4-pro:preview",
71679
+ "api": "ollama-chat",
71680
+ "provider": "ollama-cloud",
71681
+ "baseUrl": "https://ollama.com",
71682
+ "reasoning": true,
71683
+ "thinking": {
71684
+ "mode": "effort",
71685
+ "efforts": [
71686
+ "low",
71687
+ "high",
71688
+ "max"
71689
+ ]
71690
+ },
71691
+ "input": [
71692
+ "text"
71693
+ ],
71694
+ "cost": {
71695
+ "input": 0,
71696
+ "output": 0,
71697
+ "cacheRead": 0,
71698
+ "cacheWrite": 0
71699
+ },
71700
+ "contextWindow": 524288,
71701
+ "maxTokens": 65536,
71702
+ "omitMaxOutputTokens": true,
71703
+ "supportsComputerUse": false
71704
+ },
71599
71705
  "devstral-2:123b": {
71600
71706
  "id": "devstral-2:123b",
71601
71707
  "name": "devstral-2:123b",
@@ -76127,6 +76233,36 @@
76127
76233
  "requiresEffort": true
76128
76234
  }
76129
76235
  },
76236
+ "gemini-3.7-flash": {
76237
+ "id": "gemini-3.7-flash",
76238
+ "name": "Gemini 3.7 Flash",
76239
+ "api": "google-generative-ai",
76240
+ "provider": "opencode-zen",
76241
+ "baseUrl": "https://opencode.ai/zen/v1",
76242
+ "reasoning": true,
76243
+ "input": [
76244
+ "text",
76245
+ "image"
76246
+ ],
76247
+ "cost": {
76248
+ "input": 1.5,
76249
+ "output": 7.5,
76250
+ "cacheRead": 0.15,
76251
+ "cacheWrite": 0
76252
+ },
76253
+ "contextWindow": 1048576,
76254
+ "maxTokens": 65536,
76255
+ "thinking": {
76256
+ "mode": "google-level",
76257
+ "efforts": [
76258
+ "minimal",
76259
+ "low",
76260
+ "medium",
76261
+ "high"
76262
+ ],
76263
+ "requiresEffort": true
76264
+ }
76265
+ },
76130
76266
  "glm-4.6": {
76131
76267
  "id": "glm-4.6",
76132
76268
  "name": "GLM-4.6",
@@ -77974,13 +78110,13 @@
77974
78110
  "text"
77975
78111
  ],
77976
78112
  "cost": {
77977
- "input": 0.079996,
77978
- "output": 0.252,
77979
- "cacheRead": 0.0252,
78113
+ "input": 0.072,
78114
+ "output": 0.144,
78115
+ "cacheRead": 0.016,
77980
78116
  "cacheWrite": 0
77981
78117
  },
77982
78118
  "contextWindow": 1048576,
77983
- "maxTokens": 131072,
78119
+ "maxTokens": 262144,
77984
78120
  "thinking": {
77985
78121
  "mode": "effort",
77986
78122
  "efforts": [
@@ -78007,7 +78143,7 @@
78007
78143
  "input": 0.375,
78008
78144
  "output": 1.875,
78009
78145
  "cacheRead": 0.0375,
78010
- "cacheWrite": 0.0416666666666667
78146
+ "cacheWrite": 0.0208333333333333
78011
78147
  },
78012
78148
  "contextWindow": 1048576,
78013
78149
  "maxTokens": 65536,
@@ -78066,13 +78202,13 @@
78066
78202
  "image"
78067
78203
  ],
78068
78204
  "cost": {
78069
- "input": 2.8,
78070
- "output": 14,
78071
- "cacheRead": 0.29,
78205
+ "input": 2.4,
78206
+ "output": 12,
78207
+ "cacheRead": 0.24,
78072
78208
  "cacheWrite": 0
78073
78209
  },
78074
78210
  "contextWindow": 1048576,
78075
- "maxTokens": 1048576,
78211
+ "maxTokens": 974842,
78076
78212
  "thinking": {
78077
78213
  "mode": "effort",
78078
78214
  "efforts": [
@@ -81235,10 +81371,10 @@
81235
81371
  "image"
81236
81372
  ],
81237
81373
  "cost": {
81238
- "input": 1.5,
81239
- "output": 7.5,
81240
- "cacheRead": 0.15,
81241
- "cacheWrite": 0.0833333333333333
81374
+ "input": 0.75,
81375
+ "output": 3.75,
81376
+ "cacheRead": 0.075,
81377
+ "cacheWrite": 0.0416666666666667
81242
81378
  },
81243
81379
  "contextWindow": 1048576,
81244
81380
  "maxTokens": 65536,
@@ -81267,10 +81403,10 @@
81267
81403
  "image"
81268
81404
  ],
81269
81405
  "cost": {
81270
- "input": 0.75,
81271
- "output": 3.75,
81272
- "cacheRead": 0.075,
81273
- "cacheWrite": 0.0833333333333333
81406
+ "input": 0.375,
81407
+ "output": 1.875,
81408
+ "cacheRead": 0.0375,
81409
+ "cacheWrite": 0.0416666666666667
81274
81410
  },
81275
81411
  "contextWindow": 1048576,
81276
81412
  "maxTokens": 65536,
@@ -81302,7 +81438,7 @@
81302
81438
  "input": 0.375,
81303
81439
  "output": 1.875,
81304
81440
  "cacheRead": 0.0375,
81305
- "cacheWrite": 0.0416666666666667
81441
+ "cacheWrite": 0.0208333333333333
81306
81442
  },
81307
81443
  "contextWindow": 1048576,
81308
81444
  "maxTokens": 65536,
@@ -81331,10 +81467,10 @@
81331
81467
  "image"
81332
81468
  ],
81333
81469
  "cost": {
81334
- "input": 0.375,
81335
- "output": 1.875,
81336
- "cacheRead": 0.0375,
81337
- "cacheWrite": 0.0416666666666667
81470
+ "input": 0.1875,
81471
+ "output": 0.9375,
81472
+ "cacheRead": 0.01875,
81473
+ "cacheWrite": 0.0208333333333333
81338
81474
  },
81339
81475
  "contextWindow": 1048576,
81340
81476
  "maxTokens": 65536,
@@ -83285,9 +83421,9 @@
83285
83421
  "image"
83286
83422
  ],
83287
83423
  "cost": {
83288
- "input": 0.5795,
83289
- "output": 2.44,
83290
- "cacheRead": 0.0976,
83424
+ "input": 0.5605,
83425
+ "output": 2.36,
83426
+ "cacheRead": 0.0944,
83291
83427
  "cacheWrite": 0
83292
83428
  },
83293
83429
  "contextWindow": 262144,
@@ -83915,7 +84051,7 @@
83915
84051
  "cacheRead": 0.049999999999999996,
83916
84052
  "cacheWrite": 0
83917
84053
  },
83918
- "contextWindow": 1048576,
84054
+ "contextWindow": 1000000,
83919
84055
  "maxTokens": 262144,
83920
84056
  "thinking": {
83921
84057
  "mode": "effort",
@@ -90620,9 +90756,9 @@
90620
90756
  "text"
90621
90757
  ],
90622
90758
  "cost": {
90623
- "input": 0.49,
90624
- "output": 1.54,
90625
- "cacheRead": 0.091,
90759
+ "input": 0.392,
90760
+ "output": 1.232,
90761
+ "cacheRead": 0.0728,
90626
90762
  "cacheWrite": 0
90627
90763
  },
90628
90764
  "contextWindow": 1048576,
@@ -96815,6 +96951,36 @@
96815
96951
  },
96816
96952
  "supportsComputerUse": false
96817
96953
  },
96954
+ "alibaba/qwen3.8-2.4t-a95b": {
96955
+ "id": "alibaba/qwen3.8-2.4t-a95b",
96956
+ "name": "Qwen3.8 2.4T A95B",
96957
+ "api": "anthropic-messages",
96958
+ "provider": "vercel-ai-gateway",
96959
+ "baseUrl": "https://ai-gateway.vercel.sh",
96960
+ "reasoning": true,
96961
+ "input": [
96962
+ "text"
96963
+ ],
96964
+ "cost": {
96965
+ "input": 2,
96966
+ "output": 6,
96967
+ "cacheRead": 0.25,
96968
+ "cacheWrite": 0
96969
+ },
96970
+ "contextWindow": 262144,
96971
+ "maxTokens": 131072,
96972
+ "thinking": {
96973
+ "mode": "budget",
96974
+ "efforts": [
96975
+ "minimal",
96976
+ "low",
96977
+ "medium",
96978
+ "high",
96979
+ "xhigh"
96980
+ ]
96981
+ },
96982
+ "supportsComputerUse": false
96983
+ },
96818
96984
  "alibaba/qwen3.8-max": {
96819
96985
  "id": "alibaba/qwen3.8-max",
96820
96986
  "name": "Qwen 3.8 Max",
@@ -98529,7 +98695,7 @@
98529
98695
  "cacheRead": 0,
98530
98696
  "cacheWrite": 0
98531
98697
  },
98532
- "contextWindow": 256000,
98698
+ "contextWindow": 262144,
98533
98699
  "maxTokens": 131072,
98534
98700
  "thinking": {
98535
98701
  "mode": "budget",
@@ -1,3 +1,5 @@
1
+ import type { FetchImpl } from "@oh-my-pi/pi-utils";
2
+
1
3
  /**
2
4
  * Build a User-Agent string that identifies as Gemini CLI to unlock higher rate limits.
3
5
  * Uses the same format as the official Gemini CLI (v0.35+):
@@ -15,30 +17,89 @@ export const getGeminiCliHeaders = (modelId?: string) => ({
15
17
  "Client-Metadata": "ideType=IDE_UNSPECIFIED,platform=PLATFORM_UNSPECIFIED,pluginType=GEMINI",
16
18
  });
17
19
 
18
- export const ANTIGRAVITY_SYSTEM_INSTRUCTION =
19
- "You are Antigravity, a powerful agentic AI coding assistant designed by the Google Deepmind team working on Advanced Agentic Coding." +
20
- "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." +
21
- "**Absolute paths only**" +
22
- "**Proactiveness**";
23
20
  /**
24
21
  * Antigravity / Cloud Code Assist user agent. Lives in its own file so discovery
25
22
  * and usage code can read it without pulling the heavy google-gemini-cli provider
26
23
  * (and its @google/genai → google-auth-library dependency chain) into the startup
27
24
  * parse graph.
25
+ *
26
+ * Format captured from the real 2.8.0 `antigravity/hub` client:
27
+ * `antigravity/hub/2.8.0 (aidev_client; os_type=darwin; arch=arm64; cl=963137146)`.
28
+ * The backend gates newer models (e.g. gemini-3.7-flash) on the client version,
29
+ * so the version tracks the latest Antigravity release via the update manifest
30
+ * (see {@link ensureAntigravityVersion}) with `DEFAULT_ANTIGRAVITY_VERSION` as
31
+ * the offline fallback. os_type/arch are pinned to the darwin/arm64 reference
32
+ * client the version and manifest are captured from, independent of the host
33
+ * platform. Overrides: PI_AI_ANTIGRAVITY_VERSION / _CL / _OS / _ARCH.
28
34
  */
29
- export let getAntigravityUserAgent = () => {
30
- const DEFAULT_ANTIGRAVITY_VERSION = "2.1.4";
31
- const version = process.env.PI_AI_ANTIGRAVITY_VERSION || DEFAULT_ANTIGRAVITY_VERSION;
32
- // Map Node.js platform/arch to Antigravity's expected format.
33
- // Verified against Antigravity source: _qn() and wqn() in main.js.
34
- // process.platform: win32→windows, others pass through (darwin, linux)
35
- // process.arch: x64→amd64, ia32→386, others pass through (arm64)
36
- const os = process.platform === "win32" ? "windows" : process.platform;
37
- const arch = process.arch === "x64" ? "amd64" : process.arch === "ia32" ? "386" : process.arch;
38
- const userAgent = `antigravity/hub/${version} ${os}/${arch}`;
39
- getAntigravityUserAgent = () => userAgent;
40
- return userAgent;
41
- };
35
+ export const DEFAULT_ANTIGRAVITY_VERSION = "2.8.0";
36
+
37
+ const ANTIGRAVITY_VERSION_MANIFEST_URL =
38
+ "https://antigravity-hub-auto-updater-974169037036.us-central1.run.app/manifest/latest-arm64-mac.yml";
39
+ const ANTIGRAVITY_VERSION_FETCH_TIMEOUT_MS = 5_000;
40
+
41
+ let discoveredAntigravityVersion: string | null = null;
42
+ let antigravityVersionFetch: Promise<void> | null = null;
43
+
44
+ /** Current Antigravity client version: env override → manifest-discovered → pinned fallback. */
45
+ export function getAntigravityVersion(): string {
46
+ return process.env.PI_AI_ANTIGRAVITY_VERSION || discoveredAntigravityVersion || DEFAULT_ANTIGRAVITY_VERSION;
47
+ }
48
+
49
+ /**
50
+ * Extracts the client version from an electron-builder update manifest.
51
+ * Returns null when no well-formed `version:` line is present.
52
+ */
53
+ export function parseAntigravityManifestVersion(yamlText: string): string | null {
54
+ for (const line of yamlText.split(/\r?\n/)) {
55
+ const match = /^\s*version\s*:\s*(?:"([^"]*)"|'([^']*)'|([^\s#]+))\s*(?:#.*)?$/.exec(line);
56
+ if (!match) continue;
57
+ const version = (match[1] ?? match[2] ?? match[3] ?? "").trim();
58
+ return /^\d+\.\d+\.\d+$/.test(version) ? version : null;
59
+ }
60
+ return null;
61
+ }
62
+
63
+ /**
64
+ * Resolves the latest Antigravity release from the official update manifest.
65
+ * Success is cached for the process lifetime; failures are silent (the pinned
66
+ * fallback stays valid) and clear the in-flight cache so a later call retries.
67
+ * Skipped entirely when PI_AI_ANTIGRAVITY_VERSION is set.
68
+ */
69
+ export function ensureAntigravityVersion(fetcher: FetchImpl = fetch, signal?: AbortSignal): Promise<void> {
70
+ if (process.env.PI_AI_ANTIGRAVITY_VERSION || discoveredAntigravityVersion) return Promise.resolve();
71
+ if (antigravityVersionFetch) return antigravityVersionFetch;
72
+
73
+ antigravityVersionFetch = (async () => {
74
+ try {
75
+ const timeoutSignal = AbortSignal.timeout(ANTIGRAVITY_VERSION_FETCH_TIMEOUT_MS);
76
+ const response = await fetcher(ANTIGRAVITY_VERSION_MANIFEST_URL, {
77
+ headers: { "Cache-Control": "no-cache", "User-Agent": "electron-builder" },
78
+ signal: signal ? AbortSignal.any([signal, timeoutSignal]) : timeoutSignal,
79
+ });
80
+ if (response.ok) {
81
+ discoveredAntigravityVersion = parseAntigravityManifestVersion(await response.text());
82
+ }
83
+ } catch {
84
+ // Silent: the pinned fallback remains valid when version discovery fails.
85
+ } finally {
86
+ if (!discoveredAntigravityVersion) antigravityVersionFetch = null;
87
+ }
88
+ })();
89
+ return antigravityVersionFetch;
90
+ }
91
+
92
+ /** Antigravity `User-Agent` header value; rebuilt when the discovered version changes. */
93
+ export function getAntigravityUserAgent(): string {
94
+ const version = getAntigravityVersion();
95
+ // The backend does not validate `cl` (verified live: stale, zero, and absent
96
+ // cl all pass model gating on daily-cloudcode-pa; only the version gates).
97
+ // The update manifest carries no changelist, so the captured value stays.
98
+ const cl = process.env.PI_AI_ANTIGRAVITY_CL || "963137146";
99
+ const os = process.env.PI_AI_ANTIGRAVITY_OS || "darwin";
100
+ const arch = process.env.PI_AI_ANTIGRAVITY_ARCH || "arm64";
101
+ return `antigravity/hub/${version} (aidev_client; os_type=${os}; arch=${arch}; cl=${cl})`;
102
+ }
42
103
 
43
104
  /**
44
105
  * Per-wire-id Antigravity Cloud Code Assist request constants, captured from the