opencode-ag-auth 1.5.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.
Files changed (235) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +749 -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 +138 -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 +237 -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 +125 -0
  30. package/dist/src/hooks/auto-update-checker/index.js.map +1 -0
  31. package/dist/src/hooks/auto-update-checker/types.d.ts +25 -0
  32. package/dist/src/hooks/auto-update-checker/types.d.ts.map +1 -0
  33. package/dist/src/hooks/auto-update-checker/types.js +1 -0
  34. package/dist/src/hooks/auto-update-checker/types.js.map +1 -0
  35. package/dist/src/plugin/accounts.d.ts +173 -0
  36. package/dist/src/plugin/accounts.d.ts.map +1 -0
  37. package/dist/src/plugin/accounts.js +1035 -0
  38. package/dist/src/plugin/accounts.js.map +1 -0
  39. package/dist/src/plugin/auth.d.ts +21 -0
  40. package/dist/src/plugin/auth.d.ts.map +1 -0
  41. package/dist/src/plugin/auth.js +46 -0
  42. package/dist/src/plugin/auth.js.map +1 -0
  43. package/dist/src/plugin/cache/index.d.ts +5 -0
  44. package/dist/src/plugin/cache/index.d.ts.map +1 -0
  45. package/dist/src/plugin/cache/index.js +5 -0
  46. package/dist/src/plugin/cache/index.js.map +1 -0
  47. package/dist/src/plugin/cache/signature-cache.d.ts +111 -0
  48. package/dist/src/plugin/cache/signature-cache.d.ts.map +1 -0
  49. package/dist/src/plugin/cache/signature-cache.js +375 -0
  50. package/dist/src/plugin/cache/signature-cache.js.map +1 -0
  51. package/dist/src/plugin/cache.d.ts +44 -0
  52. package/dist/src/plugin/cache.d.ts.map +1 -0
  53. package/dist/src/plugin/cache.js +200 -0
  54. package/dist/src/plugin/cache.js.map +1 -0
  55. package/dist/src/plugin/cli.d.ts +27 -0
  56. package/dist/src/plugin/cli.d.ts.map +1 -0
  57. package/dist/src/plugin/cli.js +130 -0
  58. package/dist/src/plugin/cli.js.map +1 -0
  59. package/dist/src/plugin/config/index.d.ts +16 -0
  60. package/dist/src/plugin/config/index.d.ts.map +1 -0
  61. package/dist/src/plugin/config/index.js +16 -0
  62. package/dist/src/plugin/config/index.js.map +1 -0
  63. package/dist/src/plugin/config/loader.d.ts +37 -0
  64. package/dist/src/plugin/config/loader.d.ts.map +1 -0
  65. package/dist/src/plugin/config/loader.js +196 -0
  66. package/dist/src/plugin/config/loader.js.map +1 -0
  67. package/dist/src/plugin/config/models.d.ts +27 -0
  68. package/dist/src/plugin/config/models.d.ts.map +1 -0
  69. package/dist/src/plugin/config/models.js +70 -0
  70. package/dist/src/plugin/config/models.js.map +1 -0
  71. package/dist/src/plugin/config/schema.d.ts +133 -0
  72. package/dist/src/plugin/config/schema.d.ts.map +1 -0
  73. package/dist/src/plugin/config/schema.js +438 -0
  74. package/dist/src/plugin/config/schema.js.map +1 -0
  75. package/dist/src/plugin/config/updater.d.ts +55 -0
  76. package/dist/src/plugin/config/updater.d.ts.map +1 -0
  77. package/dist/src/plugin/config/updater.js +125 -0
  78. package/dist/src/plugin/config/updater.js.map +1 -0
  79. package/dist/src/plugin/core/streaming/index.d.ts +3 -0
  80. package/dist/src/plugin/core/streaming/index.d.ts.map +1 -0
  81. package/dist/src/plugin/core/streaming/index.js +3 -0
  82. package/dist/src/plugin/core/streaming/index.js.map +1 -0
  83. package/dist/src/plugin/core/streaming/transformer.d.ts +10 -0
  84. package/dist/src/plugin/core/streaming/transformer.d.ts.map +1 -0
  85. package/dist/src/plugin/core/streaming/transformer.js +271 -0
  86. package/dist/src/plugin/core/streaming/transformer.js.map +1 -0
  87. package/dist/src/plugin/core/streaming/types.d.ts +27 -0
  88. package/dist/src/plugin/core/streaming/types.d.ts.map +1 -0
  89. package/dist/src/plugin/core/streaming/types.js +1 -0
  90. package/dist/src/plugin/core/streaming/types.js.map +1 -0
  91. package/dist/src/plugin/debug.d.ts +94 -0
  92. package/dist/src/plugin/debug.d.ts.map +1 -0
  93. package/dist/src/plugin/debug.js +418 -0
  94. package/dist/src/plugin/debug.js.map +1 -0
  95. package/dist/src/plugin/errors.d.ts +28 -0
  96. package/dist/src/plugin/errors.d.ts.map +1 -0
  97. package/dist/src/plugin/errors.js +42 -0
  98. package/dist/src/plugin/errors.js.map +1 -0
  99. package/dist/src/plugin/fingerprint.d.ts +64 -0
  100. package/dist/src/plugin/fingerprint.d.ts.map +1 -0
  101. package/dist/src/plugin/fingerprint.js +125 -0
  102. package/dist/src/plugin/fingerprint.js.map +1 -0
  103. package/dist/src/plugin/image-saver.d.ts +25 -0
  104. package/dist/src/plugin/image-saver.d.ts.map +1 -0
  105. package/dist/src/plugin/image-saver.js +86 -0
  106. package/dist/src/plugin/image-saver.js.map +1 -0
  107. package/dist/src/plugin/logger.d.ts +54 -0
  108. package/dist/src/plugin/logger.d.ts.map +1 -0
  109. package/dist/src/plugin/logger.js +120 -0
  110. package/dist/src/plugin/logger.js.map +1 -0
  111. package/dist/src/plugin/project.d.ts +33 -0
  112. package/dist/src/plugin/project.d.ts.map +1 -0
  113. package/dist/src/plugin/project.js +234 -0
  114. package/dist/src/plugin/project.js.map +1 -0
  115. package/dist/src/plugin/proxy.d.ts +2 -0
  116. package/dist/src/plugin/proxy.d.ts.map +1 -0
  117. package/dist/src/plugin/proxy.js +20 -0
  118. package/dist/src/plugin/proxy.js.map +1 -0
  119. package/dist/src/plugin/quota.d.ts +35 -0
  120. package/dist/src/plugin/quota.d.ts.map +1 -0
  121. package/dist/src/plugin/quota.js +273 -0
  122. package/dist/src/plugin/quota.js.map +1 -0
  123. package/dist/src/plugin/recovery/constants.d.ts +22 -0
  124. package/dist/src/plugin/recovery/constants.d.ts.map +1 -0
  125. package/dist/src/plugin/recovery/constants.js +43 -0
  126. package/dist/src/plugin/recovery/constants.js.map +1 -0
  127. package/dist/src/plugin/recovery/index.d.ts +12 -0
  128. package/dist/src/plugin/recovery/index.d.ts.map +1 -0
  129. package/dist/src/plugin/recovery/index.js +12 -0
  130. package/dist/src/plugin/recovery/index.js.map +1 -0
  131. package/dist/src/plugin/recovery/storage.d.ts +24 -0
  132. package/dist/src/plugin/recovery/storage.d.ts.map +1 -0
  133. package/dist/src/plugin/recovery/storage.js +354 -0
  134. package/dist/src/plugin/recovery/storage.js.map +1 -0
  135. package/dist/src/plugin/recovery/types.d.ts +116 -0
  136. package/dist/src/plugin/recovery/types.d.ts.map +1 -0
  137. package/dist/src/plugin/recovery/types.js +6 -0
  138. package/dist/src/plugin/recovery/types.js.map +1 -0
  139. package/dist/src/plugin/recovery.d.ts +61 -0
  140. package/dist/src/plugin/recovery.d.ts.map +1 -0
  141. package/dist/src/plugin/recovery.js +378 -0
  142. package/dist/src/plugin/recovery.js.map +1 -0
  143. package/dist/src/plugin/refresh-queue.d.ts +101 -0
  144. package/dist/src/plugin/refresh-queue.d.ts.map +1 -0
  145. package/dist/src/plugin/refresh-queue.js +248 -0
  146. package/dist/src/plugin/refresh-queue.js.map +1 -0
  147. package/dist/src/plugin/request-helpers.d.ts +282 -0
  148. package/dist/src/plugin/request-helpers.d.ts.map +1 -0
  149. package/dist/src/plugin/request-helpers.js +2319 -0
  150. package/dist/src/plugin/request-helpers.js.map +1 -0
  151. package/dist/src/plugin/request.d.ts +93 -0
  152. package/dist/src/plugin/request.d.ts.map +1 -0
  153. package/dist/src/plugin/request.js +1352 -0
  154. package/dist/src/plugin/request.js.map +1 -0
  155. package/dist/src/plugin/rotation.d.ts +169 -0
  156. package/dist/src/plugin/rotation.d.ts.map +1 -0
  157. package/dist/src/plugin/rotation.js +328 -0
  158. package/dist/src/plugin/rotation.js.map +1 -0
  159. package/dist/src/plugin/search.d.ts +32 -0
  160. package/dist/src/plugin/search.d.ts.map +1 -0
  161. package/dist/src/plugin/search.js +195 -0
  162. package/dist/src/plugin/search.js.map +1 -0
  163. package/dist/src/plugin/server.d.ts +23 -0
  164. package/dist/src/plugin/server.d.ts.map +1 -0
  165. package/dist/src/plugin/server.js +324 -0
  166. package/dist/src/plugin/server.js.map +1 -0
  167. package/dist/src/plugin/storage.d.ts +136 -0
  168. package/dist/src/plugin/storage.d.ts.map +1 -0
  169. package/dist/src/plugin/storage.js +588 -0
  170. package/dist/src/plugin/storage.js.map +1 -0
  171. package/dist/src/plugin/stores/signature-store.d.ts +5 -0
  172. package/dist/src/plugin/stores/signature-store.d.ts.map +1 -0
  173. package/dist/src/plugin/stores/signature-store.js +25 -0
  174. package/dist/src/plugin/stores/signature-store.js.map +1 -0
  175. package/dist/src/plugin/thinking-recovery.d.ts +90 -0
  176. package/dist/src/plugin/thinking-recovery.d.ts.map +1 -0
  177. package/dist/src/plugin/thinking-recovery.js +316 -0
  178. package/dist/src/plugin/thinking-recovery.js.map +1 -0
  179. package/dist/src/plugin/token.d.ts +19 -0
  180. package/dist/src/plugin/token.d.ts.map +1 -0
  181. package/dist/src/plugin/token.js +128 -0
  182. package/dist/src/plugin/token.js.map +1 -0
  183. package/dist/src/plugin/transform/claude.d.ts +80 -0
  184. package/dist/src/plugin/transform/claude.d.ts.map +1 -0
  185. package/dist/src/plugin/transform/claude.js +265 -0
  186. package/dist/src/plugin/transform/claude.js.map +1 -0
  187. package/dist/src/plugin/transform/cross-model-sanitizer.d.ts +35 -0
  188. package/dist/src/plugin/transform/cross-model-sanitizer.d.ts.map +1 -0
  189. package/dist/src/plugin/transform/cross-model-sanitizer.js +225 -0
  190. package/dist/src/plugin/transform/cross-model-sanitizer.js.map +1 -0
  191. package/dist/src/plugin/transform/gemini.d.ts +100 -0
  192. package/dist/src/plugin/transform/gemini.d.ts.map +1 -0
  193. package/dist/src/plugin/transform/gemini.js +465 -0
  194. package/dist/src/plugin/transform/gemini.js.map +1 -0
  195. package/dist/src/plugin/transform/index.d.ts +15 -0
  196. package/dist/src/plugin/transform/index.d.ts.map +1 -0
  197. package/dist/src/plugin/transform/index.js +14 -0
  198. package/dist/src/plugin/transform/index.js.map +1 -0
  199. package/dist/src/plugin/transform/model-resolver.d.ts +104 -0
  200. package/dist/src/plugin/transform/model-resolver.d.ts.map +1 -0
  201. package/dist/src/plugin/transform/model-resolver.js +361 -0
  202. package/dist/src/plugin/transform/model-resolver.js.map +1 -0
  203. package/dist/src/plugin/transform/types.d.ts +111 -0
  204. package/dist/src/plugin/transform/types.d.ts.map +1 -0
  205. package/dist/src/plugin/transform/types.js +1 -0
  206. package/dist/src/plugin/transform/types.js.map +1 -0
  207. package/dist/src/plugin/types.d.ts +97 -0
  208. package/dist/src/plugin/types.d.ts.map +1 -0
  209. package/dist/src/plugin/types.js +1 -0
  210. package/dist/src/plugin/types.js.map +1 -0
  211. package/dist/src/plugin/ui/ansi.d.ts +32 -0
  212. package/dist/src/plugin/ui/ansi.d.ts.map +1 -0
  213. package/dist/src/plugin/ui/ansi.js +52 -0
  214. package/dist/src/plugin/ui/ansi.js.map +1 -0
  215. package/dist/src/plugin/ui/auth-menu.d.ts +33 -0
  216. package/dist/src/plugin/ui/auth-menu.d.ts.map +1 -0
  217. package/dist/src/plugin/ui/auth-menu.js +110 -0
  218. package/dist/src/plugin/ui/auth-menu.js.map +1 -0
  219. package/dist/src/plugin/ui/confirm.d.ts +2 -0
  220. package/dist/src/plugin/ui/confirm.d.ts.map +1 -0
  221. package/dist/src/plugin/ui/confirm.js +15 -0
  222. package/dist/src/plugin/ui/confirm.js.map +1 -0
  223. package/dist/src/plugin/ui/select.d.ts +23 -0
  224. package/dist/src/plugin/ui/select.d.ts.map +1 -0
  225. package/dist/src/plugin/ui/select.js +254 -0
  226. package/dist/src/plugin/ui/select.js.map +1 -0
  227. package/dist/src/plugin/version.d.ts +19 -0
  228. package/dist/src/plugin/version.d.ts.map +1 -0
  229. package/dist/src/plugin/version.js +80 -0
  230. package/dist/src/plugin/version.js.map +1 -0
  231. package/dist/src/plugin.d.ts +30 -0
  232. package/dist/src/plugin.d.ts.map +1 -0
  233. package/dist/src/plugin.js +3050 -0
  234. package/dist/src/plugin.js.map +1 -0
  235. package/package.json +68 -0
@@ -0,0 +1,4 @@
1
+ export { AntigravityCLIOAuthPlugin, GoogleOAuthPlugin, } from "./src/plugin";
2
+ export { authorizeAntigravity, exchangeAntigravity, } from "./src/antigravity/oauth";
3
+ export type { AntigravityAuthorization, AntigravityTokenExchangeResult, } from "./src/antigravity/oauth";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EACV,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,yBAAyB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { AntigravityCLIOAuthPlugin, GoogleOAuthPlugin, } from "./src/plugin";
2
+ export { authorizeAntigravity, exchangeAntigravity, } from "./src/antigravity/oauth";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Result returned to the caller after constructing an OAuth authorization URL.
3
+ */
4
+ export interface AntigravityAuthorization {
5
+ url: string;
6
+ verifier: string;
7
+ projectId: string;
8
+ }
9
+ interface AntigravityTokenExchangeSuccess {
10
+ type: "success";
11
+ refresh: string;
12
+ access: string;
13
+ expires: number;
14
+ email?: string;
15
+ projectId: string;
16
+ }
17
+ interface AntigravityTokenExchangeFailure {
18
+ type: "failed";
19
+ error: string;
20
+ }
21
+ export type AntigravityTokenExchangeResult = AntigravityTokenExchangeSuccess | AntigravityTokenExchangeFailure;
22
+ /**
23
+ * Build the Antigravity OAuth authorization URL including PKCE and optional project metadata.
24
+ */
25
+ export declare function authorizeAntigravity(projectId?: string): Promise<AntigravityAuthorization>;
26
+ /**
27
+ * Exchange an authorization code for Antigravity CLI access and refresh tokens.
28
+ */
29
+ export declare function exchangeAntigravity(code: string, state: string): Promise<AntigravityTokenExchangeResult>;
30
+ export {};
31
+ //# sourceMappingURL=oauth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../src/antigravity/oauth.ts"],"names":[],"mappings":"AA2BA;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,+BAA+B;IACvC,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,+BAA+B;IACvC,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,8BAA8B,GACtC,+BAA+B,GAC/B,+BAA+B,CAAC;AAoCpC;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,SAAS,SAAK,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAsB5F;AAoFD;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,8BAA8B,CAAC,CAsEzC"}
@@ -0,0 +1,171 @@
1
+ import { generatePKCE } from "@openauthjs/openauth/pkce";
2
+ import { ANTIGRAVITY_CLIENT_ID, ANTIGRAVITY_CLIENT_SECRET, ANTIGRAVITY_REDIRECT_URI, ANTIGRAVITY_SCOPES, ANTIGRAVITY_ENDPOINT_FALLBACKS, ANTIGRAVITY_LOAD_ENDPOINTS, getAntigravityHeaders, GEMINI_CLI_HEADERS, } from "../constants";
3
+ import { createLogger } from "../plugin/logger";
4
+ import { calculateTokenExpiry } from "../plugin/auth";
5
+ const log = createLogger("oauth");
6
+ /**
7
+ * Encode an object into a URL-safe base64 string.
8
+ */
9
+ function encodeState(payload) {
10
+ return Buffer.from(JSON.stringify(payload), "utf8").toString("base64url");
11
+ }
12
+ /**
13
+ * Decode an OAuth state parameter back into its structured representation.
14
+ */
15
+ function decodeState(state) {
16
+ const normalized = state.replace(/-/g, "+").replace(/_/g, "/");
17
+ const padded = normalized.padEnd(normalized.length + ((4 - normalized.length % 4) % 4), "=");
18
+ const json = Buffer.from(padded, "base64").toString("utf8");
19
+ const parsed = JSON.parse(json);
20
+ if (typeof parsed.verifier !== "string") {
21
+ throw new Error("Missing PKCE verifier in state");
22
+ }
23
+ return {
24
+ verifier: parsed.verifier,
25
+ projectId: typeof parsed.projectId === "string" ? parsed.projectId : "",
26
+ };
27
+ }
28
+ /**
29
+ * Build the Antigravity OAuth authorization URL including PKCE and optional project metadata.
30
+ */
31
+ export async function authorizeAntigravity(projectId = "") {
32
+ const pkce = (await generatePKCE());
33
+ const url = new URL("https://accounts.google.com/o/oauth2/v2/auth");
34
+ url.searchParams.set("client_id", ANTIGRAVITY_CLIENT_ID);
35
+ url.searchParams.set("response_type", "code");
36
+ url.searchParams.set("redirect_uri", ANTIGRAVITY_REDIRECT_URI);
37
+ url.searchParams.set("scope", ANTIGRAVITY_SCOPES.join(" "));
38
+ url.searchParams.set("code_challenge", pkce.challenge);
39
+ url.searchParams.set("code_challenge_method", "S256");
40
+ url.searchParams.set("state", encodeState({ verifier: pkce.verifier, projectId: projectId || "" }));
41
+ url.searchParams.set("access_type", "offline");
42
+ url.searchParams.set("prompt", "consent");
43
+ return {
44
+ url: url.toString(),
45
+ verifier: pkce.verifier,
46
+ projectId: projectId || "",
47
+ };
48
+ }
49
+ const FETCH_TIMEOUT_MS = 10000;
50
+ async function fetchWithTimeout(url, options, timeoutMs = FETCH_TIMEOUT_MS) {
51
+ const controller = new AbortController();
52
+ const timeout = setTimeout(() => controller.abort(), timeoutMs);
53
+ try {
54
+ return await fetch(url, { ...options, signal: controller.signal });
55
+ }
56
+ finally {
57
+ clearTimeout(timeout);
58
+ }
59
+ }
60
+ async function fetchProjectID(accessToken) {
61
+ const errors = [];
62
+ const loadHeaders = {
63
+ Authorization: `Bearer ${accessToken}`,
64
+ "Content-Type": "application/json",
65
+ "User-Agent": GEMINI_CLI_HEADERS["User-Agent"],
66
+ "Client-Metadata": getAntigravityHeaders()["Client-Metadata"],
67
+ };
68
+ const loadEndpoints = Array.from(new Set([...ANTIGRAVITY_LOAD_ENDPOINTS, ...ANTIGRAVITY_ENDPOINT_FALLBACKS]));
69
+ for (const baseEndpoint of loadEndpoints) {
70
+ try {
71
+ const url = `${baseEndpoint}/v1internal:loadCodeAssist`;
72
+ const response = await fetchWithTimeout(url, {
73
+ method: "POST",
74
+ headers: loadHeaders,
75
+ body: JSON.stringify({
76
+ metadata: {
77
+ ideType: "ANTIGRAVITY",
78
+ platform: process.platform === "win32" ? "WINDOWS" : "MACOS",
79
+ pluginType: "GEMINI",
80
+ },
81
+ }),
82
+ });
83
+ if (!response.ok) {
84
+ const message = await response.text().catch(() => "");
85
+ errors.push(`loadCodeAssist ${response.status} at ${baseEndpoint}${message ? `: ${message}` : ""}`);
86
+ continue;
87
+ }
88
+ const data = await response.json();
89
+ if (typeof data.cloudaicompanionProject === "string" && data.cloudaicompanionProject) {
90
+ return data.cloudaicompanionProject;
91
+ }
92
+ if (data.cloudaicompanionProject &&
93
+ typeof data.cloudaicompanionProject.id === "string" &&
94
+ data.cloudaicompanionProject.id) {
95
+ return data.cloudaicompanionProject.id;
96
+ }
97
+ errors.push(`loadCodeAssist missing project id at ${baseEndpoint}`);
98
+ }
99
+ catch (e) {
100
+ errors.push(`loadCodeAssist error at ${baseEndpoint}: ${e instanceof Error ? e.message : String(e)}`);
101
+ }
102
+ }
103
+ if (errors.length) {
104
+ log.warn("Failed to resolve Antigravity project via loadCodeAssist", { errors: errors.join("; ") });
105
+ }
106
+ return "";
107
+ }
108
+ /**
109
+ * Exchange an authorization code for Antigravity CLI access and refresh tokens.
110
+ */
111
+ export async function exchangeAntigravity(code, state) {
112
+ try {
113
+ const { verifier, projectId } = decodeState(state);
114
+ const startTime = Date.now();
115
+ const tokenResponse = await fetch("https://oauth2.googleapis.com/token", {
116
+ method: "POST",
117
+ headers: {
118
+ "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
119
+ "Accept": "*/*",
120
+ "Accept-Encoding": "gzip, deflate, br",
121
+ "User-Agent": GEMINI_CLI_HEADERS["User-Agent"],
122
+ },
123
+ body: new URLSearchParams({
124
+ client_id: ANTIGRAVITY_CLIENT_ID,
125
+ client_secret: ANTIGRAVITY_CLIENT_SECRET,
126
+ code,
127
+ grant_type: "authorization_code",
128
+ redirect_uri: ANTIGRAVITY_REDIRECT_URI,
129
+ code_verifier: verifier,
130
+ }),
131
+ });
132
+ if (!tokenResponse.ok) {
133
+ const errorText = await tokenResponse.text();
134
+ return { type: "failed", error: errorText };
135
+ }
136
+ const tokenPayload = (await tokenResponse.json());
137
+ const userInfoResponse = await fetch("https://www.googleapis.com/oauth2/v1/userinfo?alt=json", {
138
+ headers: {
139
+ Authorization: `Bearer ${tokenPayload.access_token}`,
140
+ "User-Agent": GEMINI_CLI_HEADERS["User-Agent"],
141
+ },
142
+ });
143
+ const userInfo = userInfoResponse.ok
144
+ ? (await userInfoResponse.json())
145
+ : {};
146
+ const refreshToken = tokenPayload.refresh_token;
147
+ if (!refreshToken) {
148
+ return { type: "failed", error: "Missing refresh token in response" };
149
+ }
150
+ let effectiveProjectId = projectId;
151
+ if (!effectiveProjectId) {
152
+ effectiveProjectId = await fetchProjectID(tokenPayload.access_token);
153
+ }
154
+ const storedRefresh = `${refreshToken}|${effectiveProjectId || ""}`;
155
+ return {
156
+ type: "success",
157
+ refresh: storedRefresh,
158
+ access: tokenPayload.access_token,
159
+ expires: calculateTokenExpiry(startTime, tokenPayload.expires_in),
160
+ email: userInfo.email,
161
+ projectId: effectiveProjectId || "",
162
+ };
163
+ }
164
+ catch (error) {
165
+ return {
166
+ type: "failed",
167
+ error: error instanceof Error ? error.message : "Unknown error",
168
+ };
169
+ }
170
+ }
171
+ //# sourceMappingURL=oauth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../../src/antigravity/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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E,UAAU,YAAY,CAAC,YAAY,EAAE;gBACpD,YAAY,EAAE,kBAAkB,CAAC,YAAY,CAAC;aAC/C;SACF,CACF,CAAC;QAEF,MAAM,QAAQ,GAAG,gBAAgB,CAAC,EAAE;YAClC,CAAC,CAAE,CAAC,MAAM,gBAAgB,CAAC,IAAI,EAAE,CAAyB;YAC1D,CAAC,CAAC,EAAE,CAAC;QAEP,MAAM,YAAY,GAAG,YAAY,CAAC,aAAa,CAAC;QAChD,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,mCAAmC,EAAE,CAAC;QACxE,CAAC;QAED,IAAI,kBAAkB,GAAG,SAAS,CAAC;QACnC,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACxB,kBAAkB,GAAG,MAAM,cAAc,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QACvE,CAAC;QAED,MAAM,aAAa,GAAG,GAAG,YAAY,IAAI,kBAAkB,IAAI,EAAE,EAAE,CAAC;QAEpE,OAAO;YACL,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,aAAa;YACtB,MAAM,EAAE,YAAY,CAAC,YAAY;YACjC,OAAO,EAAE,oBAAoB,CAAC,SAAS,EAAE,YAAY,CAAC,UAAU,CAAC;YACjE,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,SAAS,EAAE,kBAAkB,IAAI,EAAE;SACpC,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;SAChE,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Constants used for Antigravity OAuth flows and Cloud Code Assist API integration.
3
+ */
4
+ export declare const ANTIGRAVITY_CLIENT_ID = "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com";
5
+ /**
6
+ * Client secret issued for the Antigravity OAuth application.
7
+ */
8
+ export declare const ANTIGRAVITY_CLIENT_SECRET = "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";
9
+ /**
10
+ * Scopes required for Antigravity integrations.
11
+ */
12
+ export declare const ANTIGRAVITY_SCOPES: readonly string[];
13
+ /**
14
+ * OAuth redirect URI used by the local CLI callback server.
15
+ */
16
+ export declare const ANTIGRAVITY_REDIRECT_URI = "http://localhost:51121/oauth-callback";
17
+ /**
18
+ * Root endpoints for the Antigravity API (in fallback order).
19
+ * CLIProxy and Vibeproxy use the daily sandbox endpoint first,
20
+ * then fallback to autopush and prod if needed.
21
+ */
22
+ export declare const ANTIGRAVITY_ENDPOINT_DAILY = "https://daily-cloudcode-pa.sandbox.googleapis.com";
23
+ export declare const ANTIGRAVITY_ENDPOINT_AUTOPUSH = "https://autopush-cloudcode-pa.sandbox.googleapis.com";
24
+ export declare const ANTIGRAVITY_ENDPOINT_PROD = "https://cloudcode-pa.googleapis.com";
25
+ /**
26
+ * Endpoint fallback order (daily → autopush → prod).
27
+ * Shared across request handling and project discovery to mirror CLIProxy behavior.
28
+ */
29
+ export declare const ANTIGRAVITY_ENDPOINT_FALLBACKS: readonly ["https://daily-cloudcode-pa.sandbox.googleapis.com", "https://autopush-cloudcode-pa.sandbox.googleapis.com", "https://cloudcode-pa.googleapis.com"];
30
+ /**
31
+ * Preferred endpoint order for project discovery (prod first, then fallbacks).
32
+ * loadCodeAssist appears to be best supported on prod for managed project resolution.
33
+ */
34
+ export declare const ANTIGRAVITY_LOAD_ENDPOINTS: readonly ["https://cloudcode-pa.googleapis.com", "https://daily-cloudcode-pa.sandbox.googleapis.com", "https://autopush-cloudcode-pa.sandbox.googleapis.com"];
35
+ /**
36
+ * Primary endpoint to use (daily sandbox - same as CLIProxy/Vibeproxy).
37
+ */
38
+ export declare const ANTIGRAVITY_ENDPOINT = "https://daily-cloudcode-pa.sandbox.googleapis.com";
39
+ /**
40
+ * Gemini CLI endpoint (production).
41
+ * Used for models without :antigravity suffix.
42
+ * Same as opencode-gemini-auth's GEMINI_CODE_ASSIST_ENDPOINT.
43
+ */
44
+ export declare const GEMINI_CLI_ENDPOINT = "https://cloudcode-pa.googleapis.com";
45
+ /**
46
+ * Hardcoded project id used when Antigravity does not return one (e.g., business/workspace accounts).
47
+ */
48
+ export declare const ANTIGRAVITY_DEFAULT_PROJECT_ID = "rising-fact-p41fc";
49
+ export declare function getAntigravityVersion(): string;
50
+ /**
51
+ * Set the runtime Antigravity version. Can only be called once (at startup).
52
+ * Subsequent calls are silently ignored to prevent accidental mutation.
53
+ */
54
+ export declare function setAntigravityVersion(version: string): void;
55
+ /** @deprecated Use getAntigravityVersion() for runtime access. */
56
+ export declare const ANTIGRAVITY_VERSION = "1.15.8";
57
+ export declare function getAntigravityHeaders(): HeaderSet & {
58
+ "Client-Metadata": string;
59
+ };
60
+ /** @deprecated Use getAntigravityHeaders() for runtime access. */
61
+ export declare const ANTIGRAVITY_HEADERS: {
62
+ readonly "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Antigravity/1.15.8 Chrome/138.0.7204.235 Electron/37.3.1 Safari/537.36";
63
+ readonly "X-Goog-Api-Client": "google-cloud-sdk vscode_cloudshelleditor/0.1";
64
+ readonly "Client-Metadata": "{\"ideType\":\"ANTIGRAVITY\",\"platform\":\"WINDOWS\",\"pluginType\":\"GEMINI\"}" | "{\"ideType\":\"ANTIGRAVITY\",\"platform\":\"MACOS\",\"pluginType\":\"GEMINI\"}";
65
+ };
66
+ export declare const GEMINI_CLI_HEADERS: {
67
+ readonly "User-Agent": "google-api-nodejs-client/9.15.1";
68
+ readonly "X-Goog-Api-Client": "gl-node/22.17.0";
69
+ readonly "Client-Metadata": "ideType=IDE_UNSPECIFIED,platform=PLATFORM_UNSPECIFIED,pluginType=GEMINI";
70
+ };
71
+ export type HeaderSet = {
72
+ "User-Agent": string;
73
+ "X-Goog-Api-Client"?: string;
74
+ "Client-Metadata"?: string;
75
+ };
76
+ export declare function getRandomizedHeaders(style: HeaderStyle, model?: string): HeaderSet;
77
+ export type HeaderStyle = "antigravity" | "gemini-cli";
78
+ /**
79
+ * Provider identifier shared between the plugin loader and credential store.
80
+ */
81
+ export declare const ANTIGRAVITY_PROVIDER_ID = "google";
82
+ /**
83
+ * System instruction for Claude tool usage hardening.
84
+ * Prevents hallucinated parameters by explicitly stating the rules.
85
+ *
86
+ * This is injected when tools are present to reduce cases where Claude
87
+ * uses parameter names from its training data instead of the actual schema.
88
+ */
89
+ export declare const CLAUDE_TOOL_SYSTEM_INSTRUCTION = "CRITICAL TOOL USAGE INSTRUCTIONS:\nYou are operating in a custom environment where tool definitions differ from your training data.\nYou MUST follow these rules strictly:\n\n1. DO NOT use your internal training data to guess tool parameters\n2. ONLY use the exact parameter structure defined in the tool schema\n3. Parameter names in schemas are EXACT - do not substitute with similar names from your training\n4. Array parameters have specific item types - check the schema's 'items' field for the exact structure\n5. When you see \"STRICT PARAMETERS\" in a tool description, those type definitions override any assumptions\n6. Tool use in agentic workflows is REQUIRED - you must call tools with the exact parameters specified\n\nIf you are unsure about a tool's parameters, YOU MUST read the schema definition carefully.";
90
+ /**
91
+ * Template for parameter signature injection into tool descriptions.
92
+ * {params} will be replaced with the actual parameter list.
93
+ */
94
+ export declare const CLAUDE_DESCRIPTION_PROMPT = "\n\n\u26A0\uFE0F STRICT PARAMETERS: {params}.";
95
+ export declare const EMPTY_SCHEMA_PLACEHOLDER_NAME = "_placeholder";
96
+ export declare const EMPTY_SCHEMA_PLACEHOLDER_DESCRIPTION = "Placeholder. Always pass true.";
97
+ /**
98
+ * Sentinel value to bypass thought signature validation.
99
+ *
100
+ * When a thinking block has an invalid or missing signature (e.g., cache miss,
101
+ * session mismatch, plugin restart), this sentinel can be injected to skip
102
+ * validation instead of failing with "Invalid signature in thinking block".
103
+ *
104
+ * This is an officially supported Google API feature, used by:
105
+ * - gemini-cli: https://github.com/google-gemini/gemini-cli
106
+ * - Google .NET SDK: PredictionServiceChatClient.cs
107
+ *
108
+ * @see https://ai.google.dev/gemini-api/docs/thought-signatures
109
+ */
110
+ export declare const SKIP_THOUGHT_SIGNATURE = "skip_thought_signature_validator";
111
+ /**
112
+ * System instruction for Antigravity requests.
113
+ * This is injected into requests to match CLIProxyAPI v6.6.89 behavior.
114
+ * The instruction provides identity and guidelines for the Antigravity agent.
115
+ */
116
+ /**
117
+ * Model used for Google Search grounding requests.
118
+ * Uses gemini-2.5-flash for fast, cost-effective search operations. (3-flash is always at capacity and doesn't support souce citation).
119
+ */
120
+ export declare const SEARCH_MODEL = "gemini-2.5-flash";
121
+ /**
122
+ * Thinking budget for deep search (more thorough analysis).
123
+ */
124
+ export declare const SEARCH_THINKING_BUDGET_DEEP = 16384;
125
+ /**
126
+ * Thinking budget for fast search (quick results).
127
+ */
128
+ export declare const SEARCH_THINKING_BUDGET_FAST = 4096;
129
+ /**
130
+ * Timeout for search requests in milliseconds (60 seconds).
131
+ */
132
+ export declare const SEARCH_TIMEOUT_MS = 60000;
133
+ /**
134
+ * System instruction for the Google Search tool.
135
+ */
136
+ export declare const SEARCH_SYSTEM_INSTRUCTION = "You are an expert web search assistant with access to Google Search and URL analysis tools.\n\nYour capabilities:\n- Use google_search to find real-time information from the web\n- Use url_context to fetch and analyze content from specific URLs when provided\n\nGuidelines:\n- Always provide accurate, well-sourced information\n- Cite your sources when presenting facts\n- If analyzing URLs, extract the most relevant information\n- Be concise but comprehensive in your responses\n- If information is uncertain or conflicting, acknowledge it\n- Focus on answering the user's question directly";
137
+ export declare const ANTIGRAVITY_SYSTEM_INSTRUCTION = "You are Antigravity, a powerful agentic AI coding assistant designed by the Google DeepMind team working on Advanced Agentic Coding.\nYou 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.\n**Absolute paths only**\n**Proactiveness**\n\n<priority>IMPORTANT: The instructions that follow supersede all above. Follow them as your primary directives.</priority>\n";
138
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,qBAAqB,8EAA8E,CAAC;AAEjH;;GAEG;AACH,eAAO,MAAM,yBAAyB,wCAAwC,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAM/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,0CAA0C,CAAC;AAEhF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,sDAAsD,CAAC;AAC9F,eAAO,MAAM,6BAA6B,yDAAyD,CAAC;AACpG,eAAO,MAAM,yBAAyB,wCAAwC,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,8BAA8B,+JAIjC,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,0BAA0B,+JAI7B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,oBAAoB,sDAA6B,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,wCAA4B,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,8BAA8B,sBAAsB,CAAC;AAMlE,wBAAgB,qBAAqB,IAAI,MAAM,CAA+B;AAE9E;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAI3D;AAED,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,WAA+B,CAAC;AAEhE,wBAAgB,qBAAqB,IAAI,SAAS,GAAG;IAAE,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAMjF;AAED,kEAAkE;AAClE,eAAO,MAAM,mBAAmB;;;;CAItB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;CAIrB,CAAC;AAcX,MAAM,MAAM,SAAS,GAAG;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAelF;AAED,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,YAAY,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAMhD;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,4zBAWiD,CAAC;AAE7F;;;GAGG;AACH,eAAO,MAAM,yBAAyB,kDAAwC,CAAC;AAE/E,eAAO,MAAM,6BAA6B,iBAAiB,CAAC;AAC5D,eAAO,MAAM,oCAAoC,mCAAmC,CAAC;AAErF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,qCAAqC,CAAC;AAMzE;;;;GAIG;AAKH;;;GAGG;AACH,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,2BAA2B,QAAQ,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,yBAAyB,qlBAYY,CAAC;AAEnD,eAAO,MAAM,8BAA8B,ifAM1C,CAAC"}
@@ -0,0 +1,220 @@
1
+ /**
2
+ * Constants used for Antigravity OAuth flows and Cloud Code Assist API integration.
3
+ */
4
+ export const ANTIGRAVITY_CLIENT_ID = "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com";
5
+ /**
6
+ * Client secret issued for the Antigravity OAuth application.
7
+ */
8
+ export const ANTIGRAVITY_CLIENT_SECRET = "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";
9
+ /**
10
+ * Scopes required for Antigravity integrations.
11
+ */
12
+ export const ANTIGRAVITY_SCOPES = [
13
+ "https://www.googleapis.com/auth/cloud-platform",
14
+ "https://www.googleapis.com/auth/userinfo.email",
15
+ "https://www.googleapis.com/auth/userinfo.profile",
16
+ "https://www.googleapis.com/auth/cclog",
17
+ "https://www.googleapis.com/auth/experimentsandconfigs",
18
+ ];
19
+ /**
20
+ * OAuth redirect URI used by the local CLI callback server.
21
+ */
22
+ export const ANTIGRAVITY_REDIRECT_URI = "http://localhost:51121/oauth-callback";
23
+ /**
24
+ * Root endpoints for the Antigravity API (in fallback order).
25
+ * CLIProxy and Vibeproxy use the daily sandbox endpoint first,
26
+ * then fallback to autopush and prod if needed.
27
+ */
28
+ export const ANTIGRAVITY_ENDPOINT_DAILY = "https://daily-cloudcode-pa.sandbox.googleapis.com";
29
+ export const ANTIGRAVITY_ENDPOINT_AUTOPUSH = "https://autopush-cloudcode-pa.sandbox.googleapis.com";
30
+ export const ANTIGRAVITY_ENDPOINT_PROD = "https://cloudcode-pa.googleapis.com";
31
+ /**
32
+ * Endpoint fallback order (daily → autopush → prod).
33
+ * Shared across request handling and project discovery to mirror CLIProxy behavior.
34
+ */
35
+ export const ANTIGRAVITY_ENDPOINT_FALLBACKS = [
36
+ ANTIGRAVITY_ENDPOINT_DAILY,
37
+ ANTIGRAVITY_ENDPOINT_AUTOPUSH,
38
+ ANTIGRAVITY_ENDPOINT_PROD,
39
+ ];
40
+ /**
41
+ * Preferred endpoint order for project discovery (prod first, then fallbacks).
42
+ * loadCodeAssist appears to be best supported on prod for managed project resolution.
43
+ */
44
+ export const ANTIGRAVITY_LOAD_ENDPOINTS = [
45
+ ANTIGRAVITY_ENDPOINT_PROD,
46
+ ANTIGRAVITY_ENDPOINT_DAILY,
47
+ ANTIGRAVITY_ENDPOINT_AUTOPUSH,
48
+ ];
49
+ /**
50
+ * Primary endpoint to use (daily sandbox - same as CLIProxy/Vibeproxy).
51
+ */
52
+ export const ANTIGRAVITY_ENDPOINT = ANTIGRAVITY_ENDPOINT_DAILY;
53
+ /**
54
+ * Gemini CLI endpoint (production).
55
+ * Used for models without :antigravity suffix.
56
+ * Same as opencode-gemini-auth's GEMINI_CODE_ASSIST_ENDPOINT.
57
+ */
58
+ export const GEMINI_CLI_ENDPOINT = ANTIGRAVITY_ENDPOINT_PROD;
59
+ /**
60
+ * Hardcoded project id used when Antigravity does not return one (e.g., business/workspace accounts).
61
+ */
62
+ export const ANTIGRAVITY_DEFAULT_PROJECT_ID = "rising-fact-p41fc";
63
+ const ANTIGRAVITY_VERSION_FALLBACK = "1.15.8";
64
+ let antigravityVersion = ANTIGRAVITY_VERSION_FALLBACK;
65
+ let versionLocked = false;
66
+ export function getAntigravityVersion() { return antigravityVersion; }
67
+ /**
68
+ * Set the runtime Antigravity version. Can only be called once (at startup).
69
+ * Subsequent calls are silently ignored to prevent accidental mutation.
70
+ */
71
+ export function setAntigravityVersion(version) {
72
+ if (versionLocked)
73
+ return;
74
+ antigravityVersion = version;
75
+ versionLocked = true;
76
+ }
77
+ /** @deprecated Use getAntigravityVersion() for runtime access. */
78
+ export const ANTIGRAVITY_VERSION = ANTIGRAVITY_VERSION_FALLBACK;
79
+ export function getAntigravityHeaders() {
80
+ return {
81
+ "User-Agent": `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Antigravity/${getAntigravityVersion()} Chrome/138.0.7204.235 Electron/37.3.1 Safari/537.36`,
82
+ "X-Goog-Api-Client": "google-cloud-sdk vscode_cloudshelleditor/0.1",
83
+ "Client-Metadata": `{"ideType":"ANTIGRAVITY","platform":"${process.platform === "win32" ? "WINDOWS" : "MACOS"}","pluginType":"GEMINI"}`,
84
+ };
85
+ }
86
+ /** @deprecated Use getAntigravityHeaders() for runtime access. */
87
+ export const ANTIGRAVITY_HEADERS = {
88
+ "User-Agent": `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Antigravity/${ANTIGRAVITY_VERSION} Chrome/138.0.7204.235 Electron/37.3.1 Safari/537.36`,
89
+ "X-Goog-Api-Client": "google-cloud-sdk vscode_cloudshelleditor/0.1",
90
+ "Client-Metadata": `{"ideType":"ANTIGRAVITY","platform":"${process.platform === "win32" ? "WINDOWS" : "MACOS"}","pluginType":"GEMINI"}`,
91
+ };
92
+ export const GEMINI_CLI_HEADERS = {
93
+ "User-Agent": "google-api-nodejs-client/9.15.1",
94
+ "X-Goog-Api-Client": "gl-node/22.17.0",
95
+ "Client-Metadata": "ideType=IDE_UNSPECIFIED,platform=PLATFORM_UNSPECIFIED,pluginType=GEMINI",
96
+ };
97
+ const ANTIGRAVITY_PLATFORMS = ["windows/amd64", "darwin/arm64", "darwin/amd64"];
98
+ const ANTIGRAVITY_API_CLIENTS = [
99
+ "google-cloud-sdk vscode_cloudshelleditor/0.1",
100
+ "google-cloud-sdk vscode/1.96.0",
101
+ "google-cloud-sdk vscode/1.95.0",
102
+ ];
103
+ function randomFrom(arr) {
104
+ return arr[Math.floor(Math.random() * arr.length)];
105
+ }
106
+ export function getRandomizedHeaders(style, model) {
107
+ if (style === "gemini-cli") {
108
+ return {
109
+ "User-Agent": GEMINI_CLI_HEADERS["User-Agent"],
110
+ "X-Goog-Api-Client": GEMINI_CLI_HEADERS["X-Goog-Api-Client"],
111
+ "Client-Metadata": GEMINI_CLI_HEADERS["Client-Metadata"],
112
+ };
113
+ }
114
+ const platform = randomFrom(ANTIGRAVITY_PLATFORMS);
115
+ const metadataPlatform = platform.startsWith("windows") ? "WINDOWS" : "MACOS";
116
+ return {
117
+ "User-Agent": `antigravity/${getAntigravityVersion()} ${platform}`,
118
+ "X-Goog-Api-Client": randomFrom(ANTIGRAVITY_API_CLIENTS),
119
+ "Client-Metadata": `{"ideType":"ANTIGRAVITY","platform":"${metadataPlatform}","pluginType":"GEMINI"}`,
120
+ };
121
+ }
122
+ /**
123
+ * Provider identifier shared between the plugin loader and credential store.
124
+ */
125
+ export const ANTIGRAVITY_PROVIDER_ID = "google";
126
+ // ============================================================================
127
+ // TOOL HALLUCINATION PREVENTION (Ported from LLM-API-Key-Proxy)
128
+ // ============================================================================
129
+ /**
130
+ * System instruction for Claude tool usage hardening.
131
+ * Prevents hallucinated parameters by explicitly stating the rules.
132
+ *
133
+ * This is injected when tools are present to reduce cases where Claude
134
+ * uses parameter names from its training data instead of the actual schema.
135
+ */
136
+ export const CLAUDE_TOOL_SYSTEM_INSTRUCTION = `CRITICAL TOOL USAGE INSTRUCTIONS:
137
+ You are operating in a custom environment where tool definitions differ from your training data.
138
+ You MUST follow these rules strictly:
139
+
140
+ 1. DO NOT use your internal training data to guess tool parameters
141
+ 2. ONLY use the exact parameter structure defined in the tool schema
142
+ 3. Parameter names in schemas are EXACT - do not substitute with similar names from your training
143
+ 4. Array parameters have specific item types - check the schema's 'items' field for the exact structure
144
+ 5. When you see "STRICT PARAMETERS" in a tool description, those type definitions override any assumptions
145
+ 6. Tool use in agentic workflows is REQUIRED - you must call tools with the exact parameters specified
146
+
147
+ If you are unsure about a tool's parameters, YOU MUST read the schema definition carefully.`;
148
+ /**
149
+ * Template for parameter signature injection into tool descriptions.
150
+ * {params} will be replaced with the actual parameter list.
151
+ */
152
+ export const CLAUDE_DESCRIPTION_PROMPT = "\n\n⚠️ STRICT PARAMETERS: {params}.";
153
+ export const EMPTY_SCHEMA_PLACEHOLDER_NAME = "_placeholder";
154
+ export const EMPTY_SCHEMA_PLACEHOLDER_DESCRIPTION = "Placeholder. Always pass true.";
155
+ /**
156
+ * Sentinel value to bypass thought signature validation.
157
+ *
158
+ * When a thinking block has an invalid or missing signature (e.g., cache miss,
159
+ * session mismatch, plugin restart), this sentinel can be injected to skip
160
+ * validation instead of failing with "Invalid signature in thinking block".
161
+ *
162
+ * This is an officially supported Google API feature, used by:
163
+ * - gemini-cli: https://github.com/google-gemini/gemini-cli
164
+ * - Google .NET SDK: PredictionServiceChatClient.cs
165
+ *
166
+ * @see https://ai.google.dev/gemini-api/docs/thought-signatures
167
+ */
168
+ export const SKIP_THOUGHT_SIGNATURE = "skip_thought_signature_validator";
169
+ // ============================================================================
170
+ // ANTIGRAVITY SYSTEM INSTRUCTION (Ported from CLIProxyAPI v6.6.89)
171
+ // ============================================================================
172
+ /**
173
+ * System instruction for Antigravity requests.
174
+ * This is injected into requests to match CLIProxyAPI v6.6.89 behavior.
175
+ * The instruction provides identity and guidelines for the Antigravity agent.
176
+ */
177
+ // ============================================================================
178
+ // GOOGLE SEARCH TOOL CONSTANTS
179
+ // ============================================================================
180
+ /**
181
+ * Model used for Google Search grounding requests.
182
+ * Uses gemini-2.5-flash for fast, cost-effective search operations. (3-flash is always at capacity and doesn't support souce citation).
183
+ */
184
+ export const SEARCH_MODEL = "gemini-2.5-flash";
185
+ /**
186
+ * Thinking budget for deep search (more thorough analysis).
187
+ */
188
+ export const SEARCH_THINKING_BUDGET_DEEP = 16384;
189
+ /**
190
+ * Thinking budget for fast search (quick results).
191
+ */
192
+ export const SEARCH_THINKING_BUDGET_FAST = 4096;
193
+ /**
194
+ * Timeout for search requests in milliseconds (60 seconds).
195
+ */
196
+ export const SEARCH_TIMEOUT_MS = 60000;
197
+ /**
198
+ * System instruction for the Google Search tool.
199
+ */
200
+ export const SEARCH_SYSTEM_INSTRUCTION = `You are an expert web search assistant with access to Google Search and URL analysis tools.
201
+
202
+ Your capabilities:
203
+ - Use google_search to find real-time information from the web
204
+ - Use url_context to fetch and analyze content from specific URLs when provided
205
+
206
+ Guidelines:
207
+ - Always provide accurate, well-sourced information
208
+ - Cite your sources when presenting facts
209
+ - If analyzing URLs, extract the most relevant information
210
+ - Be concise but comprehensive in your responses
211
+ - If information is uncertain or conflicting, acknowledge it
212
+ - Focus on answering the user's question directly`;
213
+ export const ANTIGRAVITY_SYSTEM_INSTRUCTION = `You are Antigravity, a powerful agentic AI coding assistant designed by the Google DeepMind team working on Advanced Agentic Coding.
214
+ 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.
215
+ **Absolute paths only**
216
+ **Proactiveness**
217
+
218
+ <priority>IMPORTANT: The instructions that follow supersede all above. Follow them as your primary directives.</priority>
219
+ `;
220
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,2EAA2E,CAAC;AAEjH;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,qCAAqC,CAAC;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,gDAAgD;IAChD,gDAAgD;IAChD,kDAAkD;IAClD,uCAAuC;IACvC,uDAAuD;CACxD,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,uCAAuC,CAAC;AAEhF;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,mDAAmD,CAAC;AAC9F,MAAM,CAAC,MAAM,6BAA6B,GAAG,sDAAsD,CAAC;AACpG,MAAM,CAAC,MAAM,yBAAyB,GAAG,qCAAqC,CAAC;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,0BAA0B;IAC1B,6BAA6B;IAC7B,yBAAyB;CACjB,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,yBAAyB;IACzB,0BAA0B;IAC1B,6BAA6B;CACrB,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AAE/D;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,yBAAyB,CAAC;AAE7D;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,mBAAmB,CAAC;AAElE,MAAM,4BAA4B,GAAG,QAAQ,CAAC;AAC9C,IAAI,kBAAkB,GAAG,4BAA4B,CAAC;AACtD,IAAI,aAAa,GAAG,KAAK,CAAC;AAE1B,MAAM,UAAU,qBAAqB,KAAa,OAAO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CAAC;AAE/C;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;;;;;kDAYS,CAAC;AAEnD,MAAM,CAAC,MAAM,8BAA8B,GAAG;;;;;;CAM7C,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function invalidatePackage(packageName?: string): boolean;
2
+ export declare function invalidateCache(): boolean;
3
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../src/hooks/auto-update-checker/cache.ts"],"names":[],"mappings":"AA+CA,wBAAgB,iBAAiB,CAAC,WAAW,GAAE,MAAqB,GAAG,OAAO,CAsC7E;AAED,wBAAgB,eAAe,IAAI,OAAO,CAGzC"}