@benjamolina/opencode-antigravity-guard 1.0.0

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.
Files changed (243) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +773 -0
  3. package/dist/index.d.ts +4 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +3 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/src/antigravity/oauth.d.ts +31 -0
  8. package/dist/src/antigravity/oauth.d.ts.map +1 -0
  9. package/dist/src/antigravity/oauth.js +171 -0
  10. package/dist/src/antigravity/oauth.js.map +1 -0
  11. package/dist/src/constants.d.ts +139 -0
  12. package/dist/src/constants.d.ts.map +1 -0
  13. package/dist/src/constants.js +220 -0
  14. package/dist/src/constants.js.map +1 -0
  15. package/dist/src/hooks/auto-update-checker/cache.d.ts +3 -0
  16. package/dist/src/hooks/auto-update-checker/cache.d.ts.map +1 -0
  17. package/dist/src/hooks/auto-update-checker/cache.js +71 -0
  18. package/dist/src/hooks/auto-update-checker/cache.js.map +1 -0
  19. package/dist/src/hooks/auto-update-checker/checker.d.ts +16 -0
  20. package/dist/src/hooks/auto-update-checker/checker.d.ts.map +1 -0
  21. package/dist/src/hooks/auto-update-checker/checker.js +234 -0
  22. package/dist/src/hooks/auto-update-checker/checker.js.map +1 -0
  23. package/dist/src/hooks/auto-update-checker/constants.d.ts +9 -0
  24. package/dist/src/hooks/auto-update-checker/constants.d.ts.map +1 -0
  25. package/dist/src/hooks/auto-update-checker/constants.js +23 -0
  26. package/dist/src/hooks/auto-update-checker/constants.js.map +1 -0
  27. package/dist/src/hooks/auto-update-checker/index.d.ts +34 -0
  28. package/dist/src/hooks/auto-update-checker/index.d.ts.map +1 -0
  29. package/dist/src/hooks/auto-update-checker/index.js +122 -0
  30. package/dist/src/hooks/auto-update-checker/index.js.map +1 -0
  31. package/dist/src/hooks/auto-update-checker/logging.d.ts +3 -0
  32. package/dist/src/hooks/auto-update-checker/logging.d.ts.map +1 -0
  33. package/dist/src/hooks/auto-update-checker/logging.js +9 -0
  34. package/dist/src/hooks/auto-update-checker/logging.js.map +1 -0
  35. package/dist/src/hooks/auto-update-checker/types.d.ts +25 -0
  36. package/dist/src/hooks/auto-update-checker/types.d.ts.map +1 -0
  37. package/dist/src/hooks/auto-update-checker/types.js +1 -0
  38. package/dist/src/hooks/auto-update-checker/types.js.map +1 -0
  39. package/dist/src/plugin/accounts.d.ts +180 -0
  40. package/dist/src/plugin/accounts.d.ts.map +1 -0
  41. package/dist/src/plugin/accounts.js +1045 -0
  42. package/dist/src/plugin/accounts.js.map +1 -0
  43. package/dist/src/plugin/api-key.d.ts +90 -0
  44. package/dist/src/plugin/api-key.d.ts.map +1 -0
  45. package/dist/src/plugin/api-key.js +544 -0
  46. package/dist/src/plugin/api-key.js.map +1 -0
  47. package/dist/src/plugin/auth.d.ts +21 -0
  48. package/dist/src/plugin/auth.d.ts.map +1 -0
  49. package/dist/src/plugin/auth.js +46 -0
  50. package/dist/src/plugin/auth.js.map +1 -0
  51. package/dist/src/plugin/cache/index.d.ts +5 -0
  52. package/dist/src/plugin/cache/index.d.ts.map +1 -0
  53. package/dist/src/plugin/cache/index.js +5 -0
  54. package/dist/src/plugin/cache/index.js.map +1 -0
  55. package/dist/src/plugin/cache/signature-cache.d.ts +111 -0
  56. package/dist/src/plugin/cache/signature-cache.d.ts.map +1 -0
  57. package/dist/src/plugin/cache/signature-cache.js +375 -0
  58. package/dist/src/plugin/cache/signature-cache.js.map +1 -0
  59. package/dist/src/plugin/cache.d.ts +44 -0
  60. package/dist/src/plugin/cache.d.ts.map +1 -0
  61. package/dist/src/plugin/cache.js +200 -0
  62. package/dist/src/plugin/cache.js.map +1 -0
  63. package/dist/src/plugin/cli.d.ts +31 -0
  64. package/dist/src/plugin/cli.d.ts.map +1 -0
  65. package/dist/src/plugin/cli.js +135 -0
  66. package/dist/src/plugin/cli.js.map +1 -0
  67. package/dist/src/plugin/config/index.d.ts +16 -0
  68. package/dist/src/plugin/config/index.d.ts.map +1 -0
  69. package/dist/src/plugin/config/index.js +16 -0
  70. package/dist/src/plugin/config/index.js.map +1 -0
  71. package/dist/src/plugin/config/loader.d.ts +36 -0
  72. package/dist/src/plugin/config/loader.d.ts.map +1 -0
  73. package/dist/src/plugin/config/loader.js +140 -0
  74. package/dist/src/plugin/config/loader.js.map +1 -0
  75. package/dist/src/plugin/config/models.d.ts +43 -0
  76. package/dist/src/plugin/config/models.d.ts.map +1 -0
  77. package/dist/src/plugin/config/models.js +176 -0
  78. package/dist/src/plugin/config/models.js.map +1 -0
  79. package/dist/src/plugin/config/schema.d.ts +177 -0
  80. package/dist/src/plugin/config/schema.d.ts.map +1 -0
  81. package/dist/src/plugin/config/schema.js +507 -0
  82. package/dist/src/plugin/config/schema.js.map +1 -0
  83. package/dist/src/plugin/config/updater.d.ts +55 -0
  84. package/dist/src/plugin/config/updater.d.ts.map +1 -0
  85. package/dist/src/plugin/config/updater.js +125 -0
  86. package/dist/src/plugin/config/updater.js.map +1 -0
  87. package/dist/src/plugin/core/streaming/index.d.ts +3 -0
  88. package/dist/src/plugin/core/streaming/index.d.ts.map +1 -0
  89. package/dist/src/plugin/core/streaming/index.js +3 -0
  90. package/dist/src/plugin/core/streaming/index.js.map +1 -0
  91. package/dist/src/plugin/core/streaming/transformer.d.ts +10 -0
  92. package/dist/src/plugin/core/streaming/transformer.d.ts.map +1 -0
  93. package/dist/src/plugin/core/streaming/transformer.js +271 -0
  94. package/dist/src/plugin/core/streaming/transformer.js.map +1 -0
  95. package/dist/src/plugin/core/streaming/types.d.ts +27 -0
  96. package/dist/src/plugin/core/streaming/types.d.ts.map +1 -0
  97. package/dist/src/plugin/core/streaming/types.js +1 -0
  98. package/dist/src/plugin/core/streaming/types.js.map +1 -0
  99. package/dist/src/plugin/debug.d.ts +99 -0
  100. package/dist/src/plugin/debug.d.ts.map +1 -0
  101. package/dist/src/plugin/debug.js +400 -0
  102. package/dist/src/plugin/debug.js.map +1 -0
  103. package/dist/src/plugin/errors.d.ts +28 -0
  104. package/dist/src/plugin/errors.d.ts.map +1 -0
  105. package/dist/src/plugin/errors.js +42 -0
  106. package/dist/src/plugin/errors.js.map +1 -0
  107. package/dist/src/plugin/fingerprint.d.ts +70 -0
  108. package/dist/src/plugin/fingerprint.d.ts.map +1 -0
  109. package/dist/src/plugin/fingerprint.js +138 -0
  110. package/dist/src/plugin/fingerprint.js.map +1 -0
  111. package/dist/src/plugin/image-saver.d.ts +25 -0
  112. package/dist/src/plugin/image-saver.d.ts.map +1 -0
  113. package/dist/src/plugin/image-saver.js +86 -0
  114. package/dist/src/plugin/image-saver.js.map +1 -0
  115. package/dist/src/plugin/logger.d.ts +36 -0
  116. package/dist/src/plugin/logger.d.ts.map +1 -0
  117. package/dist/src/plugin/logger.js +71 -0
  118. package/dist/src/plugin/logger.js.map +1 -0
  119. package/dist/src/plugin/logging-utils.d.ts +23 -0
  120. package/dist/src/plugin/logging-utils.d.ts.map +1 -0
  121. package/dist/src/plugin/logging-utils.js +92 -0
  122. package/dist/src/plugin/logging-utils.js.map +1 -0
  123. package/dist/src/plugin/project.d.ts +33 -0
  124. package/dist/src/plugin/project.d.ts.map +1 -0
  125. package/dist/src/plugin/project.js +234 -0
  126. package/dist/src/plugin/project.js.map +1 -0
  127. package/dist/src/plugin/quota.d.ts +59 -0
  128. package/dist/src/plugin/quota.d.ts.map +1 -0
  129. package/dist/src/plugin/quota.js +295 -0
  130. package/dist/src/plugin/quota.js.map +1 -0
  131. package/dist/src/plugin/recovery/constants.d.ts +22 -0
  132. package/dist/src/plugin/recovery/constants.d.ts.map +1 -0
  133. package/dist/src/plugin/recovery/constants.js +43 -0
  134. package/dist/src/plugin/recovery/constants.js.map +1 -0
  135. package/dist/src/plugin/recovery/index.d.ts +12 -0
  136. package/dist/src/plugin/recovery/index.d.ts.map +1 -0
  137. package/dist/src/plugin/recovery/index.js +12 -0
  138. package/dist/src/plugin/recovery/index.js.map +1 -0
  139. package/dist/src/plugin/recovery/storage.d.ts +24 -0
  140. package/dist/src/plugin/recovery/storage.d.ts.map +1 -0
  141. package/dist/src/plugin/recovery/storage.js +354 -0
  142. package/dist/src/plugin/recovery/storage.js.map +1 -0
  143. package/dist/src/plugin/recovery/types.d.ts +116 -0
  144. package/dist/src/plugin/recovery/types.d.ts.map +1 -0
  145. package/dist/src/plugin/recovery/types.js +6 -0
  146. package/dist/src/plugin/recovery/types.js.map +1 -0
  147. package/dist/src/plugin/recovery.d.ts +61 -0
  148. package/dist/src/plugin/recovery.d.ts.map +1 -0
  149. package/dist/src/plugin/recovery.js +381 -0
  150. package/dist/src/plugin/recovery.js.map +1 -0
  151. package/dist/src/plugin/refresh-queue.d.ts +100 -0
  152. package/dist/src/plugin/refresh-queue.d.ts.map +1 -0
  153. package/dist/src/plugin/refresh-queue.js +247 -0
  154. package/dist/src/plugin/refresh-queue.js.map +1 -0
  155. package/dist/src/plugin/request-helpers.d.ts +270 -0
  156. package/dist/src/plugin/request-helpers.d.ts.map +1 -0
  157. package/dist/src/plugin/request-helpers.js +2384 -0
  158. package/dist/src/plugin/request-helpers.js.map +1 -0
  159. package/dist/src/plugin/request.d.ts +116 -0
  160. package/dist/src/plugin/request.d.ts.map +1 -0
  161. package/dist/src/plugin/request.js +1626 -0
  162. package/dist/src/plugin/request.js.map +1 -0
  163. package/dist/src/plugin/rotation.d.ts +169 -0
  164. package/dist/src/plugin/rotation.d.ts.map +1 -0
  165. package/dist/src/plugin/rotation.js +328 -0
  166. package/dist/src/plugin/rotation.js.map +1 -0
  167. package/dist/src/plugin/search.d.ts +32 -0
  168. package/dist/src/plugin/search.d.ts.map +1 -0
  169. package/dist/src/plugin/search.js +195 -0
  170. package/dist/src/plugin/search.js.map +1 -0
  171. package/dist/src/plugin/server.d.ts +23 -0
  172. package/dist/src/plugin/server.d.ts.map +1 -0
  173. package/dist/src/plugin/server.js +324 -0
  174. package/dist/src/plugin/server.js.map +1 -0
  175. package/dist/src/plugin/storage.d.ts +137 -0
  176. package/dist/src/plugin/storage.d.ts.map +1 -0
  177. package/dist/src/plugin/storage.js +637 -0
  178. package/dist/src/plugin/storage.js.map +1 -0
  179. package/dist/src/plugin/stores/signature-store.d.ts +5 -0
  180. package/dist/src/plugin/stores/signature-store.d.ts.map +1 -0
  181. package/dist/src/plugin/stores/signature-store.js +25 -0
  182. package/dist/src/plugin/stores/signature-store.js.map +1 -0
  183. package/dist/src/plugin/thinking-recovery.d.ts +90 -0
  184. package/dist/src/plugin/thinking-recovery.d.ts.map +1 -0
  185. package/dist/src/plugin/thinking-recovery.js +316 -0
  186. package/dist/src/plugin/thinking-recovery.js.map +1 -0
  187. package/dist/src/plugin/token.d.ts +19 -0
  188. package/dist/src/plugin/token.d.ts.map +1 -0
  189. package/dist/src/plugin/token.js +128 -0
  190. package/dist/src/plugin/token.js.map +1 -0
  191. package/dist/src/plugin/transform/claude.d.ts +80 -0
  192. package/dist/src/plugin/transform/claude.d.ts.map +1 -0
  193. package/dist/src/plugin/transform/claude.js +265 -0
  194. package/dist/src/plugin/transform/claude.js.map +1 -0
  195. package/dist/src/plugin/transform/cross-model-sanitizer.d.ts +35 -0
  196. package/dist/src/plugin/transform/cross-model-sanitizer.d.ts.map +1 -0
  197. package/dist/src/plugin/transform/cross-model-sanitizer.js +225 -0
  198. package/dist/src/plugin/transform/cross-model-sanitizer.js.map +1 -0
  199. package/dist/src/plugin/transform/gemini.d.ts +100 -0
  200. package/dist/src/plugin/transform/gemini.d.ts.map +1 -0
  201. package/dist/src/plugin/transform/gemini.js +482 -0
  202. package/dist/src/plugin/transform/gemini.js.map +1 -0
  203. package/dist/src/plugin/transform/index.d.ts +15 -0
  204. package/dist/src/plugin/transform/index.d.ts.map +1 -0
  205. package/dist/src/plugin/transform/index.js +14 -0
  206. package/dist/src/plugin/transform/index.js.map +1 -0
  207. package/dist/src/plugin/transform/model-resolver.d.ts +96 -0
  208. package/dist/src/plugin/transform/model-resolver.d.ts.map +1 -0
  209. package/dist/src/plugin/transform/model-resolver.js +444 -0
  210. package/dist/src/plugin/transform/model-resolver.js.map +1 -0
  211. package/dist/src/plugin/transform/types.d.ts +111 -0
  212. package/dist/src/plugin/transform/types.d.ts.map +1 -0
  213. package/dist/src/plugin/transform/types.js +1 -0
  214. package/dist/src/plugin/transform/types.js.map +1 -0
  215. package/dist/src/plugin/types.d.ts +105 -0
  216. package/dist/src/plugin/types.d.ts.map +1 -0
  217. package/dist/src/plugin/types.js +1 -0
  218. package/dist/src/plugin/types.js.map +1 -0
  219. package/dist/src/plugin/ui/ansi.d.ts +32 -0
  220. package/dist/src/plugin/ui/ansi.d.ts.map +1 -0
  221. package/dist/src/plugin/ui/ansi.js +52 -0
  222. package/dist/src/plugin/ui/ansi.js.map +1 -0
  223. package/dist/src/plugin/ui/auth-menu.d.ts +33 -0
  224. package/dist/src/plugin/ui/auth-menu.d.ts.map +1 -0
  225. package/dist/src/plugin/ui/auth-menu.js +110 -0
  226. package/dist/src/plugin/ui/auth-menu.js.map +1 -0
  227. package/dist/src/plugin/ui/confirm.d.ts +2 -0
  228. package/dist/src/plugin/ui/confirm.d.ts.map +1 -0
  229. package/dist/src/plugin/ui/confirm.js +15 -0
  230. package/dist/src/plugin/ui/confirm.js.map +1 -0
  231. package/dist/src/plugin/ui/select.d.ts +23 -0
  232. package/dist/src/plugin/ui/select.d.ts.map +1 -0
  233. package/dist/src/plugin/ui/select.js +254 -0
  234. package/dist/src/plugin/ui/select.js.map +1 -0
  235. package/dist/src/plugin/version.d.ts +19 -0
  236. package/dist/src/plugin/version.d.ts.map +1 -0
  237. package/dist/src/plugin/version.js +80 -0
  238. package/dist/src/plugin/version.js.map +1 -0
  239. package/dist/src/plugin.d.ts +50 -0
  240. package/dist/src/plugin.d.ts.map +1 -0
  241. package/dist/src/plugin.js +3378 -0
  242. package/dist/src/plugin.js.map +1 -0
  243. package/package.json +70 -0
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Model Resolution with Thinking Tier Support
3
+ *
4
+ * Resolves model names with tier suffixes (e.g., gemini-3-pro-high, claude-opus-4-6-thinking-low)
5
+ * to their actual API model names and corresponding thinking configurations.
6
+ */
7
+ import type { ResolvedModel, GoogleSearchConfig } from "./types";
8
+ export interface ModelResolverOptions {
9
+ cli_first?: boolean;
10
+ }
11
+ /**
12
+ * Thinking tier budgets by model family.
13
+ * Claude and Gemini 2.5 Pro use numeric budgets.
14
+ */
15
+ export declare const THINKING_TIER_BUDGETS: {
16
+ readonly claude: {
17
+ readonly low: 8192;
18
+ readonly medium: 16384;
19
+ readonly high: 32768;
20
+ };
21
+ readonly "gemini-2.5-pro": {
22
+ readonly low: 8192;
23
+ readonly medium: 16384;
24
+ readonly high: 32768;
25
+ };
26
+ readonly "gemini-2.5-flash": {
27
+ readonly low: 6144;
28
+ readonly medium: 12288;
29
+ readonly high: 24576;
30
+ };
31
+ readonly default: {
32
+ readonly low: 4096;
33
+ readonly medium: 8192;
34
+ readonly high: 16384;
35
+ };
36
+ };
37
+ /**
38
+ * Gemini 3 uses thinkingLevel strings instead of numeric budgets.
39
+ * Flash supports: minimal, low, medium, high
40
+ * Pro supports: low, high (no minimal/medium)
41
+ */
42
+ export declare const GEMINI_3_THINKING_LEVELS: readonly ["minimal", "low", "medium", "high"];
43
+ /**
44
+ * Model aliases - maps user-friendly names to API model names.
45
+ *
46
+ * Format:
47
+ * - Gemini 3 Pro variants: gemini-3-pro-{low,medium,high}
48
+ * - Claude thinking variants: claude-{model}-thinking-{low,medium,high}
49
+ * - Claude non-thinking: claude-{model} (no -thinking suffix)
50
+ */
51
+ export declare const MODEL_ALIASES: Record<string, string>;
52
+ /**
53
+ * Cloud Code does not expose a bare `gemini-3.5-flash` backend id.
54
+ * Antigravity/agy resolves the UI model to these advertised ids instead.
55
+ */
56
+ export declare function resolveAntigravityGemini35FlashBackendModel(model: string, thinkingLevel?: string): string | undefined;
57
+ /**
58
+ * Resolves a model name with optional tier suffix and quota prefix to its actual API model name
59
+ * and corresponding thinking configuration.
60
+ *
61
+ * Quota routing:
62
+ * - Default to Antigravity quota unless cli_first is enabled for Gemini models
63
+ * - Fallback to Gemini CLI happens at account rotation level when Antigravity is exhausted
64
+ * - "antigravity-" prefix marks explicit quota (no fallback allowed)
65
+ * - Claude and image models always use Antigravity
66
+ *
67
+ * Examples:
68
+ * - "gemini-2.5-flash" → { quotaPreference: "antigravity" }
69
+ * - "gemini-3-pro-preview" → { quotaPreference: "antigravity" }
70
+ * - "antigravity-gemini-3-pro-high" → { quotaPreference: "antigravity", explicitQuota: true }
71
+ * - "claude-opus-4-6-thinking-medium" → { quotaPreference: "antigravity" }
72
+ *
73
+ * @param requestedModel - The model name from the request
74
+ * @param options - Optional configuration including cli_first preference
75
+ * @returns Resolved model with thinking configuration
76
+ */
77
+ export declare function resolveModelWithTier(requestedModel: string, options?: ModelResolverOptions): ResolvedModel;
78
+ /**
79
+ * Gets the model family for routing decisions.
80
+ */
81
+ export declare function getModelFamily(model: string): "claude" | "gemini-flash" | "gemini-pro";
82
+ /**
83
+ * Variant config from OpenCode's providerOptions.
84
+ */
85
+ export interface VariantConfig {
86
+ thinkingBudget?: number;
87
+ googleSearch?: GoogleSearchConfig;
88
+ }
89
+ export declare function mapAntigravityModelToPublicApi(model: string): string | undefined;
90
+ export declare function resolveModelForHeaderStyle(requestedModel: string, headerStyle: "antigravity" | "gemini-cli" | "agy-sdk"): ResolvedModel;
91
+ /**
92
+ * Resolves model with variant config from providerOptions.
93
+ * Variant config takes priority over tier suffix in model name.
94
+ */
95
+ export declare function resolveModelWithVariant(requestedModel: string, variantConfig?: VariantConfig): ResolvedModel;
96
+ //# sourceMappingURL=model-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-resolver.d.ts","sourceRoot":"","sources":["../../../../src/plugin/transform/model-resolver.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAgB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE/E,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;CAKxB,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,+CAK3B,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAoBhD,CAAC;AAoGF;;;GAGG;AACH,wBAAgB,2CAA2C,CACzD,KAAK,EAAE,MAAM,EACb,aAAa,CAAC,EAAE,MAAM,GACrB,MAAM,GAAG,SAAS,CASpB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,oBAAoB,CAClC,cAAc,EAAE,MAAM,EACtB,OAAO,GAAE,oBAAyB,GACjC,aAAa,CAqIf;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,GACZ,QAAQ,GAAG,cAAc,GAAG,YAAY,CAS1C;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,kBAAkB,CAAC;CACnC;AA2CD,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMhF;AAED,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,aAAa,GAAG,YAAY,GAAG,SAAS,GACpD,aAAa,CAwDf;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,MAAM,EACtB,aAAa,CAAC,EAAE,aAAa,GAC5B,aAAa,CA8Cf"}
@@ -0,0 +1,444 @@
1
+ /**
2
+ * Model Resolution with Thinking Tier Support
3
+ *
4
+ * Resolves model names with tier suffixes (e.g., gemini-3-pro-high, claude-opus-4-6-thinking-low)
5
+ * to their actual API model names and corresponding thinking configurations.
6
+ */
7
+ /**
8
+ * Thinking tier budgets by model family.
9
+ * Claude and Gemini 2.5 Pro use numeric budgets.
10
+ */
11
+ export const THINKING_TIER_BUDGETS = {
12
+ claude: { low: 8192, medium: 16384, high: 32768 },
13
+ "gemini-2.5-pro": { low: 8192, medium: 16384, high: 32768 },
14
+ "gemini-2.5-flash": { low: 6144, medium: 12288, high: 24576 },
15
+ default: { low: 4096, medium: 8192, high: 16384 },
16
+ };
17
+ /**
18
+ * Gemini 3 uses thinkingLevel strings instead of numeric budgets.
19
+ * Flash supports: minimal, low, medium, high
20
+ * Pro supports: low, high (no minimal/medium)
21
+ */
22
+ export const GEMINI_3_THINKING_LEVELS = [
23
+ "minimal",
24
+ "low",
25
+ "medium",
26
+ "high",
27
+ ];
28
+ /**
29
+ * Model aliases - maps user-friendly names to API model names.
30
+ *
31
+ * Format:
32
+ * - Gemini 3 Pro variants: gemini-3-pro-{low,medium,high}
33
+ * - Claude thinking variants: claude-{model}-thinking-{low,medium,high}
34
+ * - Claude non-thinking: claude-{model} (no -thinking suffix)
35
+ */
36
+ export const MODEL_ALIASES = {
37
+ // Gemini 3 variants - for Gemini CLI only (tier stripped, thinkingLevel used)
38
+ // For Antigravity, these are bypassed and full model name is kept
39
+ "gemini-3-pro-low": "gemini-3-pro",
40
+ "gemini-3-pro-high": "gemini-3-pro",
41
+ "gemini-3.1-pro-low": "gemini-3.1-pro",
42
+ "gemini-3.1-pro-high": "gemini-3.1-pro",
43
+ "gemini-3-flash-low": "gemini-3-flash",
44
+ "gemini-3-flash-medium": "gemini-3-flash",
45
+ "gemini-3-flash-high": "gemini-3-flash",
46
+ // Claude proxy names (gemini- prefix for compatibility)
47
+ "gemini-claude-opus-4-6-thinking-low": "claude-opus-4-6-thinking",
48
+ "gemini-claude-opus-4-6-thinking-medium": "claude-opus-4-6-thinking",
49
+ "gemini-claude-opus-4-6-thinking-high": "claude-opus-4-6-thinking",
50
+ "gemini-claude-sonnet-4-6": "claude-sonnet-4-6",
51
+ // Image generation models - only gemini-3-pro-image is available via Antigravity API
52
+ // Note: gemini-2.5-flash-image (Nano Banana) is NOT supported by Antigravity - only Google AI API
53
+ // Reference: Antigravity-Manager/src-tauri/src/proxy/common/model_mapping.rs
54
+ };
55
+ const TIER_REGEX = /-(minimal|low|medium|high)$/;
56
+ const QUOTA_PREFIX_REGEX = /^antigravity-/i;
57
+ const GEMINI_3_PRO_REGEX = /^gemini-3(?:\.\d+)?-pro/i;
58
+ const GEMINI_3_FLASH_REGEX = /^gemini-3(?:\.\d+)?-flash/i;
59
+ const GEMINI_3_BASE_PRO_REGEX = /^gemini-3-pro/i;
60
+ const GEMINI_35_FLASH_REGEX = /^gemini-3\.5-flash(?:-(minimal|low|medium|high))?$/i;
61
+ const GEMINI_35_FLASH_LOW_MODEL = "gemini-3.5-flash-low";
62
+ const GEMINI_35_FLASH_HIGH_MODEL = "gemini-3-flash-agent";
63
+ /**
64
+ * Dotted-minor Gemini generations (gemini-3.1, gemini-3.5, ...) use BARE model
65
+ * names on the Gemini CLI backend, unlike the legacy 3.0 line (gemini-3-pro) which
66
+ * uses a "-preview" suffix. Confirmed against the antigravity (`agy`) and `gemini`
67
+ * CLIs, which ship `gemini-3.1-pro` (no `-preview`).
68
+ */
69
+ const GEMINI_DOTTED_MINOR_REGEX = /^gemini-3\.(?:[1-9]\d*)/i;
70
+ // ANTIGRAVITY_ONLY_MODELS removed - all models now default to antigravity
71
+ /**
72
+ * Image generation models - always route to Antigravity.
73
+ * These models don't support thinking and require imageConfig.
74
+ */
75
+ const IMAGE_GENERATION_MODELS = /image|imagen/i;
76
+ // Legacy LEGACY_ANTIGRAVITY_GEMINI3 regex removed - all Gemini models now default to antigravity
77
+ /**
78
+ * Models that support thinking tier suffixes.
79
+ * Only these models should have -low/-medium/-high stripped as thinking tiers.
80
+ * GPT models like gpt-oss-120b-medium should NOT have -medium stripped.
81
+ */
82
+ function supportsThinkingTiers(model) {
83
+ const lower = model.toLowerCase();
84
+ return (lower.includes("gemini-3") ||
85
+ lower.includes("gemini-2.5") ||
86
+ (lower.includes("claude") && lower.includes("thinking")));
87
+ }
88
+ /**
89
+ * Extracts thinking tier from model name suffix.
90
+ * Only extracts tier for models that support thinking tiers.
91
+ */
92
+ function extractThinkingTierFromModel(model) {
93
+ // Only extract tier for models that support thinking tiers
94
+ if (!supportsThinkingTiers(model)) {
95
+ return undefined;
96
+ }
97
+ const tierMatch = model.match(TIER_REGEX);
98
+ return tierMatch?.[1];
99
+ }
100
+ /**
101
+ * Determines the budget family for a model.
102
+ */
103
+ function getBudgetFamily(model) {
104
+ if (model.includes("claude")) {
105
+ return "claude";
106
+ }
107
+ if (model.includes("gemini-2.5-pro")) {
108
+ return "gemini-2.5-pro";
109
+ }
110
+ if (model.includes("gemini-2.5-flash")) {
111
+ return "gemini-2.5-flash";
112
+ }
113
+ return "default";
114
+ }
115
+ /**
116
+ * Checks if a model is a thinking-capable model.
117
+ */
118
+ function isThinkingCapableModel(model) {
119
+ const lower = model.toLowerCase();
120
+ return (lower.includes("thinking") ||
121
+ lower.includes("gemini-3") ||
122
+ lower.includes("gemini-2.5"));
123
+ }
124
+ function isGemini3ProModel(model) {
125
+ return GEMINI_3_PRO_REGEX.test(model);
126
+ }
127
+ function isGemini3FlashModel(model) {
128
+ return GEMINI_3_FLASH_REGEX.test(model);
129
+ }
130
+ /**
131
+ * Checks if model is specifically gemini-3-pro (3.0 only, no minor version).
132
+ * Only gemini-3-pro supports tier suffixes in model name (gemini-3-pro-low/high).
133
+ * Models like gemini-3.1-pro use bare name + thinkingLevel parameter instead.
134
+ */
135
+ function isGemini3BaseProModel(model) {
136
+ return GEMINI_3_BASE_PRO_REGEX.test(model);
137
+ }
138
+ /**
139
+ * Cloud Code does not expose a bare `gemini-3.5-flash` backend id.
140
+ * Antigravity/agy resolves the UI model to these advertised ids instead.
141
+ */
142
+ export function resolveAntigravityGemini35FlashBackendModel(model, thinkingLevel) {
143
+ const modelWithoutQuota = model.replace(QUOTA_PREFIX_REGEX, "");
144
+ const match = modelWithoutQuota.match(GEMINI_35_FLASH_REGEX);
145
+ if (!match) {
146
+ return undefined;
147
+ }
148
+ const level = (thinkingLevel ?? match[1] ?? "low").toLowerCase();
149
+ return level === "high" ? GEMINI_35_FLASH_HIGH_MODEL : GEMINI_35_FLASH_LOW_MODEL;
150
+ }
151
+ /**
152
+ * Resolves a model name with optional tier suffix and quota prefix to its actual API model name
153
+ * and corresponding thinking configuration.
154
+ *
155
+ * Quota routing:
156
+ * - Default to Antigravity quota unless cli_first is enabled for Gemini models
157
+ * - Fallback to Gemini CLI happens at account rotation level when Antigravity is exhausted
158
+ * - "antigravity-" prefix marks explicit quota (no fallback allowed)
159
+ * - Claude and image models always use Antigravity
160
+ *
161
+ * Examples:
162
+ * - "gemini-2.5-flash" → { quotaPreference: "antigravity" }
163
+ * - "gemini-3-pro-preview" → { quotaPreference: "antigravity" }
164
+ * - "antigravity-gemini-3-pro-high" → { quotaPreference: "antigravity", explicitQuota: true }
165
+ * - "claude-opus-4-6-thinking-medium" → { quotaPreference: "antigravity" }
166
+ *
167
+ * @param requestedModel - The model name from the request
168
+ * @param options - Optional configuration including cli_first preference
169
+ * @returns Resolved model with thinking configuration
170
+ */
171
+ export function resolveModelWithTier(requestedModel, options = {}) {
172
+ const isAntigravity = QUOTA_PREFIX_REGEX.test(requestedModel);
173
+ const modelWithoutQuota = requestedModel.replace(QUOTA_PREFIX_REGEX, "");
174
+ const tier = extractThinkingTierFromModel(modelWithoutQuota);
175
+ const baseName = tier
176
+ ? modelWithoutQuota.replace(TIER_REGEX, "")
177
+ : modelWithoutQuota;
178
+ const isImageModel = IMAGE_GENERATION_MODELS.test(modelWithoutQuota);
179
+ const isClaudeModel = modelWithoutQuota.toLowerCase().includes("claude");
180
+ // All models default to Antigravity quota unless cli_first is enabled
181
+ // Fallback to gemini-cli happens at the account rotation level when Antigravity is exhausted
182
+ const preferGeminiCli = options.cli_first === true &&
183
+ !isAntigravity &&
184
+ !isImageModel &&
185
+ !isClaudeModel;
186
+ const quotaPreference = preferGeminiCli
187
+ ? "gemini-cli"
188
+ : "antigravity";
189
+ const explicitQuota = isAntigravity || isImageModel;
190
+ const isGemini3 = modelWithoutQuota.toLowerCase().startsWith("gemini-3");
191
+ const skipAlias = isAntigravity && isGemini3;
192
+ // For Antigravity Gemini 3 Pro models without explicit tier, append default tier.
193
+ // Antigravity API: gemini-3-pro requires tier suffix (gemini-3-pro-low/high)
194
+ // gemini-3.5-flash uses backend ids (gemini-3.5-flash-low / gemini-3-flash-agent)
195
+ // other gemini-3-flash models use bare name + thinkingLevel param
196
+ // Pro defaults to -low unless an explicit tier is provided
197
+ const isGemini3Pro = isGemini3ProModel(modelWithoutQuota);
198
+ const isGemini3Flash = isGemini3FlashModel(modelWithoutQuota);
199
+ const isBaseProOnly = isGemini3BaseProModel(modelWithoutQuota);
200
+ let antigravityModel = modelWithoutQuota;
201
+ if (skipAlias) {
202
+ const gemini35FlashBackendModel = resolveAntigravityGemini35FlashBackendModel(modelWithoutQuota, tier);
203
+ if (gemini35FlashBackendModel) {
204
+ antigravityModel = gemini35FlashBackendModel;
205
+ }
206
+ else if (isBaseProOnly && !tier && !isImageModel) {
207
+ // Only gemini-3-pro (3.0) uses tier suffix in model name.
208
+ antigravityModel = `${modelWithoutQuota}-low`;
209
+ }
210
+ else if ((isGemini3Pro && !isBaseProOnly) && tier) {
211
+ // gemini-3.1+-pro with explicit tier: strip tier suffix, use bare name
212
+ // (thinkingLevel parameter handles the tier)
213
+ antigravityModel = baseName;
214
+ }
215
+ else if (isGemini3Flash && tier) {
216
+ antigravityModel = baseName;
217
+ }
218
+ }
219
+ const actualModel = skipAlias
220
+ ? antigravityModel
221
+ : MODEL_ALIASES[modelWithoutQuota] || MODEL_ALIASES[baseName] || baseName;
222
+ const resolvedModel = actualModel;
223
+ const isThinking = isThinkingCapableModel(resolvedModel);
224
+ // Image generation models don't support thinking - return early without thinking config
225
+ if (isImageModel) {
226
+ return {
227
+ actualModel: resolvedModel,
228
+ isThinkingModel: false,
229
+ isImageModel: true,
230
+ quotaPreference,
231
+ explicitQuota,
232
+ };
233
+ }
234
+ // Check if this is a Gemini 3 model (works for both aliased and skipAlias paths)
235
+ const isEffectiveGemini3 = resolvedModel.toLowerCase().includes("gemini-3");
236
+ const isClaudeThinking = resolvedModel.toLowerCase().includes("claude") &&
237
+ resolvedModel.toLowerCase().includes("thinking");
238
+ if (!tier) {
239
+ // Gemini 3 models without explicit tier get a default thinkingLevel
240
+ if (isEffectiveGemini3) {
241
+ return {
242
+ actualModel: resolvedModel,
243
+ thinkingLevel: "low",
244
+ isThinkingModel: true,
245
+ quotaPreference,
246
+ explicitQuota,
247
+ };
248
+ }
249
+ // Claude thinking models without explicit tier get max budget (32768)
250
+ // Per Anthropic docs, budget_tokens is required when enabling extended thinking
251
+ if (isClaudeThinking) {
252
+ return {
253
+ actualModel: resolvedModel,
254
+ thinkingBudget: THINKING_TIER_BUDGETS.claude.high,
255
+ isThinkingModel: true,
256
+ quotaPreference,
257
+ explicitQuota,
258
+ };
259
+ }
260
+ return {
261
+ actualModel: resolvedModel,
262
+ isThinkingModel: isThinking,
263
+ quotaPreference,
264
+ explicitQuota,
265
+ };
266
+ }
267
+ // Gemini 3 models with tier always get thinkingLevel set
268
+ if (isEffectiveGemini3) {
269
+ return {
270
+ actualModel: resolvedModel,
271
+ thinkingLevel: tier,
272
+ tier,
273
+ isThinkingModel: true,
274
+ quotaPreference,
275
+ explicitQuota,
276
+ };
277
+ }
278
+ const budgetFamily = getBudgetFamily(resolvedModel);
279
+ const budgets = THINKING_TIER_BUDGETS[budgetFamily];
280
+ const thinkingBudget = budgets[tier];
281
+ return {
282
+ actualModel: resolvedModel,
283
+ thinkingBudget,
284
+ tier,
285
+ isThinkingModel: isThinking,
286
+ quotaPreference,
287
+ explicitQuota,
288
+ };
289
+ }
290
+ /**
291
+ * Gets the model family for routing decisions.
292
+ */
293
+ export function getModelFamily(model) {
294
+ const lower = model.toLowerCase();
295
+ if (lower.includes("claude")) {
296
+ return "claude";
297
+ }
298
+ if (lower.includes("flash")) {
299
+ return "gemini-flash";
300
+ }
301
+ return "gemini-pro";
302
+ }
303
+ /**
304
+ * Maps a thinking budget to Gemini 3 thinking level.
305
+ * ≤8192 → low, ≤16384 → medium, >16384 → high
306
+ */
307
+ function budgetToGemini3Level(budget) {
308
+ if (budget <= 8192)
309
+ return "low";
310
+ if (budget <= 16384)
311
+ return "medium";
312
+ return "high";
313
+ }
314
+ /**
315
+ * Resolves model name for a specific headerStyle (quota fallback support).
316
+ * Transforms model names when switching between gemini-cli and antigravity quotas.
317
+ *
318
+ * Issue #103: When quota fallback occurs, model names need to be transformed:
319
+ * - gemini-3-flash-preview (gemini-cli) → gemini-3-flash (antigravity)
320
+ * - gemini-3-pro-preview (gemini-cli) → gemini-3-pro-low (antigravity)
321
+ * - gemini-3-flash (antigravity) → gemini-3-flash-preview (gemini-cli)
322
+ */
323
+ /**
324
+ * Maps Antigravity-only bare Gemini ids to the public Gemini API equivalent
325
+ * served by `generativelanguage.googleapis.com/v1beta`. Verified live against
326
+ * GET /v1beta/models (May 2026).
327
+ *
328
+ * Used by `resolveModelForHeaderStyle(..., "agy-sdk")` so that when OAuth
329
+ * Antigravity quota is exhausted and the api-key fallback kicks in, requests
330
+ * for `antigravity-gemini-3.1-pro` (etc.) are rewritten to the public-API
331
+ * variant Google actually serves — instead of producing a deterministic 404
332
+ * on the bare id.
333
+ *
334
+ * Returns `undefined` when the model is Antigravity-only but has no known
335
+ * public-API equivalent (e.g. Claude models). Callers should treat that as
336
+ * "not servable via api-key path" and route accordingly.
337
+ */
338
+ const ANTIGRAVITY_TO_PUBLIC_API_MODEL_MAP = new Map([
339
+ ["gemini-3-pro", "gemini-3-pro-preview"],
340
+ ["gemini-3-flash", "gemini-3-flash-preview"],
341
+ ["gemini-3.1-pro", "gemini-3.1-pro-preview"],
342
+ ["gemini-3.1-flash", "gemini-3.1-flash-lite"],
343
+ ]);
344
+ export function mapAntigravityModelToPublicApi(model) {
345
+ const stripped = model.toLowerCase().replace(/^antigravity-/, "");
346
+ // Strip tier suffixes (-minimal/-low/-medium/-high) so
347
+ // `antigravity-gemini-3.1-pro-high` maps the same as `antigravity-gemini-3.1-pro`.
348
+ const base = stripped.replace(/-(minimal|low|medium|high)$/, "");
349
+ return ANTIGRAVITY_TO_PUBLIC_API_MODEL_MAP.get(base);
350
+ }
351
+ export function resolveModelForHeaderStyle(requestedModel, headerStyle) {
352
+ const lower = requestedModel.toLowerCase();
353
+ const isGemini3 = lower.includes("gemini-3");
354
+ if (headerStyle === "agy-sdk") {
355
+ const modelWithTier = requestedModel
356
+ .replace(/^antigravity-/i, "");
357
+ const stripped = modelWithTier.replace(/-(minimal|low|medium|high)$/i, "");
358
+ // Translate Antigravity-only ids (e.g. `gemini-3.1-pro`) to the public Gemini
359
+ // API equivalent (`gemini-3.1-pro-preview`). Falls back to the bare stripped
360
+ // name when no translation exists (covers `gemini-3.5-flash`, etc.).
361
+ const transformedModel = mapAntigravityModelToPublicApi(stripped) ?? stripped;
362
+ return {
363
+ ...resolveModelWithTier(modelWithTier),
364
+ actualModel: transformedModel,
365
+ quotaPreference: "agy-sdk",
366
+ explicitQuota: false,
367
+ };
368
+ }
369
+ if (!isGemini3) {
370
+ return resolveModelWithTier(requestedModel);
371
+ }
372
+ if (headerStyle === "antigravity") {
373
+ const transformedModel = requestedModel
374
+ .replace(/-preview-customtools$/i, "")
375
+ .replace(/-preview$/i, "")
376
+ .replace(/^antigravity-/i, "");
377
+ const prefixedModel = `antigravity-${transformedModel}`;
378
+ return resolveModelWithTier(prefixedModel);
379
+ }
380
+ if (headerStyle === "gemini-cli") {
381
+ let transformedModel = requestedModel
382
+ .replace(/^antigravity-/i, "")
383
+ .replace(/-(minimal|low|medium|high)$/i, "");
384
+ // Only the legacy 3.0 line takes a "-preview" suffix on the Gemini CLI backend.
385
+ // Dotted-minor generations (gemini-3.1+, gemini-3.5, ...) use bare names there.
386
+ const hasPreviewSuffix = /-preview($|-)/i.test(transformedModel);
387
+ const usesBareName = GEMINI_DOTTED_MINOR_REGEX.test(transformedModel);
388
+ if (usesBareName && /-preview$/i.test(transformedModel)) {
389
+ transformedModel = transformedModel.replace(/-preview$/i, "");
390
+ }
391
+ else if (!hasPreviewSuffix && !usesBareName) {
392
+ transformedModel = `${transformedModel}-preview`;
393
+ }
394
+ return {
395
+ ...resolveModelWithTier(transformedModel),
396
+ quotaPreference: "gemini-cli",
397
+ };
398
+ }
399
+ return resolveModelWithTier(requestedModel);
400
+ }
401
+ /**
402
+ * Resolves model with variant config from providerOptions.
403
+ * Variant config takes priority over tier suffix in model name.
404
+ */
405
+ export function resolveModelWithVariant(requestedModel, variantConfig) {
406
+ const base = resolveModelWithTier(requestedModel);
407
+ if (!variantConfig) {
408
+ return base;
409
+ }
410
+ // Apply Google Search config if present
411
+ if (variantConfig.googleSearch) {
412
+ base.googleSearch = variantConfig.googleSearch;
413
+ base.configSource = "variant";
414
+ }
415
+ if (!variantConfig.thinkingBudget) {
416
+ return base;
417
+ }
418
+ const budget = variantConfig.thinkingBudget;
419
+ const isGemini3 = base.actualModel.toLowerCase().includes("gemini-3");
420
+ if (isGemini3) {
421
+ const level = budgetToGemini3Level(budget);
422
+ const isAntigravityGemini3BasePro = base.quotaPreference === "antigravity" &&
423
+ isGemini3BaseProModel(base.actualModel);
424
+ let actualModel = base.actualModel;
425
+ if (isAntigravityGemini3BasePro) {
426
+ // Only gemini-3-pro (3.0) uses tier suffix in model name
427
+ const baseModel = base.actualModel.replace(/-(low|medium|high)$/, "");
428
+ actualModel = `${baseModel}-${level}`;
429
+ }
430
+ return {
431
+ ...base,
432
+ actualModel,
433
+ thinkingLevel: level,
434
+ thinkingBudget: undefined,
435
+ configSource: "variant",
436
+ };
437
+ }
438
+ return {
439
+ ...base,
440
+ thinkingBudget: budget,
441
+ configSource: "variant",
442
+ };
443
+ }
444
+ //# sourceMappingURL=model-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-resolver.js","sourceRoot":"","sources":["../../../../src/plugin/transform/model-resolver.ts"],"names":[],"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,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC;YACtE,WAAW,GAAG,GAAG,SAAS,IAAI,KAAK,EAAE,CAAC;QACxC,CAAC;QAED,OAAO;YACL,GAAG,IAAI;YACP,WAAW;YACX,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,SAAS;YACzB,YAAY,EAAE,SAAS;SACxB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,GAAG,IAAI;QACP,cAAc,EAAE,MAAM;QACtB,YAAY,EAAE,SAAS;KACxB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,111 @@
1
+ import type { HeaderStyle } from "../../constants";
2
+ export type ModelFamily = "claude" | "gemini-flash" | "gemini-pro";
3
+ export type ThinkingTier = "low" | "medium" | "high";
4
+ /**
5
+ * Context for request transformation.
6
+ * Contains all information needed to transform a request payload.
7
+ */
8
+ export interface TransformContext {
9
+ /** The resolved project ID for the API call */
10
+ projectId: string;
11
+ /** The resolved model name (after alias resolution) */
12
+ model: string;
13
+ /** The original model name from the request */
14
+ requestedModel: string;
15
+ /** Model family for routing decisions */
16
+ family: ModelFamily;
17
+ /** Whether this is a streaming request */
18
+ streaming: boolean;
19
+ /** Unique request ID for tracking */
20
+ requestId: string;
21
+ /** Session ID for signature caching */
22
+ sessionId?: string;
23
+ /** Thinking tier if specified via model suffix */
24
+ thinkingTier?: ThinkingTier;
25
+ /** Thinking budget for Claude models (derived from tier) */
26
+ thinkingBudget?: number;
27
+ /** Thinking level for Gemini 3 models (derived from tier) */
28
+ thinkingLevel?: string;
29
+ }
30
+ /**
31
+ * Result of request transformation.
32
+ */
33
+ export interface TransformResult {
34
+ /** The transformed request body as JSON string */
35
+ body: string;
36
+ /** Debug information about the transformation */
37
+ debugInfo: TransformDebugInfo;
38
+ }
39
+ /**
40
+ * Debug information from transformation.
41
+ */
42
+ export interface TransformDebugInfo {
43
+ /** Which transformer was used */
44
+ transformer: "claude" | "gemini";
45
+ /** Number of tools in the request */
46
+ toolCount: number;
47
+ /** Whether tools were transformed */
48
+ toolsTransformed?: boolean;
49
+ /** Thinking tier if resolved */
50
+ thinkingTier?: string;
51
+ /** Thinking budget if set */
52
+ thinkingBudget?: number;
53
+ /** Thinking level if set (Gemini 3) */
54
+ thinkingLevel?: string;
55
+ }
56
+ /**
57
+ * Generic request payload type.
58
+ * The actual structure varies between Claude and Gemini.
59
+ */
60
+ export type RequestPayload = Record<string, unknown>;
61
+ /**
62
+ * Thinking configuration normalized from various input formats.
63
+ */
64
+ export interface ThinkingConfig {
65
+ /** Numeric thinking budget (for Claude and Gemini 2.5) */
66
+ thinkingBudget?: number;
67
+ /** String thinking level (for Gemini 3: 'low', 'medium', 'high') */
68
+ thinkingLevel?: string;
69
+ /** Whether to include thinking in the response */
70
+ includeThoughts?: boolean;
71
+ /** Snake_case variant for Antigravity backend */
72
+ include_thoughts?: boolean;
73
+ }
74
+ /**
75
+ * Google Search Grounding configuration.
76
+ *
77
+ * Note: The new googleSearch API for Gemini 2.0+ does not support threshold
78
+ * configuration. The model automatically decides when to search.
79
+ * The threshold field is kept for backward compatibility but is ignored.
80
+ */
81
+ export interface GoogleSearchConfig {
82
+ mode?: 'auto' | 'off';
83
+ /** @deprecated No longer used - kept for backward compatibility */
84
+ threshold?: number;
85
+ }
86
+ /**
87
+ * Model resolution result with tier information.
88
+ */
89
+ export interface ResolvedModel {
90
+ /** The actual model name for the API call */
91
+ actualModel: string;
92
+ /** Thinking level for Gemini 3 models */
93
+ thinkingLevel?: string;
94
+ /** Thinking budget for Claude/Gemini 2.5 */
95
+ thinkingBudget?: number;
96
+ /** The tier suffix that was extracted */
97
+ tier?: ThinkingTier;
98
+ /** Whether this is a thinking-capable model */
99
+ isThinkingModel?: boolean;
100
+ /** Whether this is an image generation model */
101
+ isImageModel?: boolean;
102
+ /** Quota preference - all models default to antigravity, with CLI as fallback */
103
+ quotaPreference?: HeaderStyle;
104
+ /** Whether user explicitly specified quota via suffix (vs default selection) */
105
+ explicitQuota?: boolean;
106
+ /** Source of thinking config: "variant" (providerOptions) or "tier" (model suffix) */
107
+ configSource?: "variant" | "tier";
108
+ /** Google Search configuration from variant or global config */
109
+ googleSearch?: GoogleSearchConfig;
110
+ }
111
+ //# sourceMappingURL=types.d.ts.map