@cortexkit/antigravity-auth-core 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 (75) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +25 -0
  3. package/dist/agy-transport.d.ts +15 -0
  4. package/dist/agy-transport.d.ts.map +1 -0
  5. package/dist/agy-transport.js +380 -0
  6. package/dist/agy-transport.js.map +1 -0
  7. package/dist/antigravity/oauth.d.ts +42 -0
  8. package/dist/antigravity/oauth.d.ts.map +1 -0
  9. package/dist/antigravity/oauth.js +179 -0
  10. package/dist/antigravity/oauth.js.map +1 -0
  11. package/dist/auth-types.d.ts +26 -0
  12. package/dist/auth-types.d.ts.map +1 -0
  13. package/dist/auth-types.js +3 -0
  14. package/dist/auth-types.js.map +1 -0
  15. package/dist/auth.d.ts +21 -0
  16. package/dist/auth.d.ts.map +1 -0
  17. package/dist/auth.js +46 -0
  18. package/dist/auth.js.map +1 -0
  19. package/dist/constants.d.ts +146 -0
  20. package/dist/constants.d.ts.map +1 -0
  21. package/dist/constants.js +214 -0
  22. package/dist/constants.js.map +1 -0
  23. package/dist/fingerprint.d.ts +73 -0
  24. package/dist/fingerprint.d.ts.map +1 -0
  25. package/dist/fingerprint.js +129 -0
  26. package/dist/fingerprint.js.map +1 -0
  27. package/dist/index.d.ts +13 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +15 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/logger.d.ts +32 -0
  32. package/dist/logger.d.ts.map +1 -0
  33. package/dist/logger.js +67 -0
  34. package/dist/logger.js.map +1 -0
  35. package/dist/model-registry.d.ts +47 -0
  36. package/dist/model-registry.d.ts.map +1 -0
  37. package/dist/model-registry.js +214 -0
  38. package/dist/model-registry.js.map +1 -0
  39. package/dist/model-types.d.ts +8 -0
  40. package/dist/model-types.d.ts.map +1 -0
  41. package/dist/model-types.js +3 -0
  42. package/dist/model-types.js.map +1 -0
  43. package/dist/project.d.ts +34 -0
  44. package/dist/project.d.ts.map +1 -0
  45. package/dist/project.js +236 -0
  46. package/dist/project.js.map +1 -0
  47. package/dist/transform/claude.d.ts +92 -0
  48. package/dist/transform/claude.d.ts.map +1 -0
  49. package/dist/transform/claude.js +280 -0
  50. package/dist/transform/claude.js.map +1 -0
  51. package/dist/transform/cross-model-sanitizer.d.ts +35 -0
  52. package/dist/transform/cross-model-sanitizer.d.ts.map +1 -0
  53. package/dist/transform/cross-model-sanitizer.js +225 -0
  54. package/dist/transform/cross-model-sanitizer.js.map +1 -0
  55. package/dist/transform/gemini.d.ts +100 -0
  56. package/dist/transform/gemini.d.ts.map +1 -0
  57. package/dist/transform/gemini.js +446 -0
  58. package/dist/transform/gemini.js.map +1 -0
  59. package/dist/transform/index.d.ts +15 -0
  60. package/dist/transform/index.d.ts.map +1 -0
  61. package/dist/transform/index.js +14 -0
  62. package/dist/transform/index.js.map +1 -0
  63. package/dist/transform/model-resolver.d.ts +95 -0
  64. package/dist/transform/model-resolver.d.ts.map +1 -0
  65. package/dist/transform/model-resolver.js +398 -0
  66. package/dist/transform/model-resolver.js.map +1 -0
  67. package/dist/transform/types.d.ts +111 -0
  68. package/dist/transform/types.d.ts.map +1 -0
  69. package/dist/transform/types.js +2 -0
  70. package/dist/transform/types.js.map +1 -0
  71. package/dist/version.d.ts +26 -0
  72. package/dist/version.d.ts.map +1 -0
  73. package/dist/version.js +87 -0
  74. package/dist/version.js.map +1 -0
  75. package/package.json +44 -0
@@ -0,0 +1,179 @@
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, GEMINI_CLI_HEADERS, } from "../constants.js";
3
+ import { createLogger } from "../logger.js";
4
+ import { calculateTokenExpiry } from "../auth.js";
5
+ import { fetchWithAgyCliTransport } from "../agy-transport.js";
6
+ import { buildAntigravityHarnessBootstrapHeaders, buildAntigravityLoadCodeAssistMetadata, } from "../fingerprint.js";
7
+ const log = createLogger("oauth");
8
+ /**
9
+ * Refresh an Antigravity OAuth access token using a bare refresh token.
10
+ * Harness-agnostic: performs only the token POST and returns the new
11
+ * credentials. Persistence/caching is the caller's responsibility.
12
+ */
13
+ export async function refreshAntigravityToken(refreshToken) {
14
+ const startTime = Date.now();
15
+ const response = await fetch("https://oauth2.googleapis.com/token", {
16
+ method: "POST",
17
+ headers: { "Content-Type": "application/x-www-form-urlencoded" },
18
+ body: new URLSearchParams({
19
+ grant_type: "refresh_token",
20
+ refresh_token: refreshToken,
21
+ client_id: ANTIGRAVITY_CLIENT_ID,
22
+ client_secret: ANTIGRAVITY_CLIENT_SECRET,
23
+ }),
24
+ });
25
+ if (!response.ok) {
26
+ const errorText = await response.text().catch(() => "");
27
+ throw new Error(`Antigravity token refresh failed (${response.status} ${response.statusText})${errorText ? ` - ${errorText}` : ""}`);
28
+ }
29
+ const payload = (await response.json());
30
+ return {
31
+ access: payload.access_token,
32
+ refresh: payload.refresh_token ?? refreshToken,
33
+ expires: calculateTokenExpiry(startTime, payload.expires_in),
34
+ };
35
+ }
36
+ /**
37
+ * Encode an object into a URL-safe base64 string.
38
+ */
39
+ function encodeState(payload) {
40
+ return Buffer.from(JSON.stringify(payload), "utf8").toString("base64url");
41
+ }
42
+ /**
43
+ * Decode an OAuth state parameter back into its structured representation.
44
+ */
45
+ function decodeState(state) {
46
+ const normalized = state.replace(/-/g, "+").replace(/_/g, "/");
47
+ const padded = normalized.padEnd(normalized.length + ((4 - normalized.length % 4) % 4), "=");
48
+ const json = Buffer.from(padded, "base64").toString("utf8");
49
+ const parsed = JSON.parse(json);
50
+ if (typeof parsed.verifier !== "string") {
51
+ throw new Error("Missing PKCE verifier in state");
52
+ }
53
+ return {
54
+ verifier: parsed.verifier,
55
+ projectId: typeof parsed.projectId === "string" ? parsed.projectId : "",
56
+ };
57
+ }
58
+ /**
59
+ * Build the Antigravity OAuth authorization URL including PKCE and optional project metadata.
60
+ */
61
+ export async function authorizeAntigravity(projectId = "") {
62
+ const pkce = (await generatePKCE());
63
+ const url = new URL("https://accounts.google.com/o/oauth2/v2/auth");
64
+ url.searchParams.set("client_id", ANTIGRAVITY_CLIENT_ID);
65
+ url.searchParams.set("response_type", "code");
66
+ url.searchParams.set("redirect_uri", ANTIGRAVITY_REDIRECT_URI);
67
+ url.searchParams.set("scope", ANTIGRAVITY_SCOPES.join(" "));
68
+ url.searchParams.set("code_challenge", pkce.challenge);
69
+ url.searchParams.set("code_challenge_method", "S256");
70
+ url.searchParams.set("state", encodeState({ verifier: pkce.verifier, projectId: projectId || "" }));
71
+ url.searchParams.set("access_type", "offline");
72
+ url.searchParams.set("prompt", "consent");
73
+ return {
74
+ url: url.toString(),
75
+ verifier: pkce.verifier,
76
+ projectId: projectId || "",
77
+ };
78
+ }
79
+ async function fetchProjectID(accessToken) {
80
+ const errors = [];
81
+ const loadHeaders = buildAntigravityHarnessBootstrapHeaders(accessToken);
82
+ const loadEndpoints = Array.from(new Set([...ANTIGRAVITY_LOAD_ENDPOINTS, ...ANTIGRAVITY_ENDPOINT_FALLBACKS]));
83
+ for (const baseEndpoint of loadEndpoints) {
84
+ try {
85
+ const url = `${baseEndpoint}/v1internal:loadCodeAssist`;
86
+ const response = await fetchWithAgyCliTransport(url, {
87
+ method: "POST",
88
+ headers: loadHeaders,
89
+ body: JSON.stringify({ metadata: buildAntigravityLoadCodeAssistMetadata() }),
90
+ }, { timeoutMs: 10000 });
91
+ if (!response.ok) {
92
+ const message = await response.text().catch(() => "");
93
+ errors.push(`loadCodeAssist ${response.status} at ${baseEndpoint}${message ? `: ${message}` : ""}`);
94
+ continue;
95
+ }
96
+ const data = await response.json();
97
+ if (typeof data.cloudaicompanionProject === "string" && data.cloudaicompanionProject) {
98
+ return data.cloudaicompanionProject;
99
+ }
100
+ if (data.cloudaicompanionProject &&
101
+ typeof data.cloudaicompanionProject.id === "string" &&
102
+ data.cloudaicompanionProject.id) {
103
+ return data.cloudaicompanionProject.id;
104
+ }
105
+ errors.push(`loadCodeAssist missing project id at ${baseEndpoint}`);
106
+ }
107
+ catch (e) {
108
+ errors.push(`loadCodeAssist error at ${baseEndpoint}: ${e instanceof Error ? e.message : String(e)}`);
109
+ }
110
+ }
111
+ if (errors.length) {
112
+ log.warn("Failed to resolve Antigravity project via loadCodeAssist", { errors: errors.join("; ") });
113
+ }
114
+ return "";
115
+ }
116
+ /**
117
+ * Exchange an authorization code for Antigravity CLI access and refresh tokens.
118
+ */
119
+ export async function exchangeAntigravity(code, state) {
120
+ try {
121
+ const { verifier, projectId } = decodeState(state);
122
+ const startTime = Date.now();
123
+ const tokenResponse = await fetch("https://oauth2.googleapis.com/token", {
124
+ method: "POST",
125
+ headers: {
126
+ "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
127
+ "Accept": "*/*",
128
+ "Accept-Encoding": "gzip, deflate, br",
129
+ "User-Agent": GEMINI_CLI_HEADERS["User-Agent"],
130
+ },
131
+ body: new URLSearchParams({
132
+ client_id: ANTIGRAVITY_CLIENT_ID,
133
+ client_secret: ANTIGRAVITY_CLIENT_SECRET,
134
+ code,
135
+ grant_type: "authorization_code",
136
+ redirect_uri: ANTIGRAVITY_REDIRECT_URI,
137
+ code_verifier: verifier,
138
+ }),
139
+ });
140
+ if (!tokenResponse.ok) {
141
+ const errorText = await tokenResponse.text();
142
+ return { type: "failed", error: errorText };
143
+ }
144
+ const tokenPayload = (await tokenResponse.json());
145
+ const userInfoResponse = await fetch("https://www.googleapis.com/oauth2/v1/userinfo?alt=json", {
146
+ headers: {
147
+ Authorization: `Bearer ${tokenPayload.access_token}`,
148
+ "User-Agent": GEMINI_CLI_HEADERS["User-Agent"],
149
+ },
150
+ });
151
+ const userInfo = userInfoResponse.ok
152
+ ? (await userInfoResponse.json())
153
+ : {};
154
+ const refreshToken = tokenPayload.refresh_token;
155
+ if (!refreshToken) {
156
+ return { type: "failed", error: "Missing refresh token in response" };
157
+ }
158
+ let effectiveProjectId = projectId;
159
+ if (!effectiveProjectId) {
160
+ effectiveProjectId = await fetchProjectID(tokenPayload.access_token);
161
+ }
162
+ const storedRefresh = `${refreshToken}|${effectiveProjectId || ""}`;
163
+ return {
164
+ type: "success",
165
+ refresh: storedRefresh,
166
+ access: tokenPayload.access_token,
167
+ expires: calculateTokenExpiry(startTime, tokenPayload.expires_in),
168
+ email: userInfo.email,
169
+ projectId: effectiveProjectId || "",
170
+ };
171
+ }
172
+ catch (error) {
173
+ return {
174
+ type: "failed",
175
+ error: error instanceof Error ? error.message : "Unknown error",
176
+ };
177
+ }
178
+ }
179
+ //# sourceMappingURL=oauth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../src/antigravity/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,8BAA8B,EAC9B,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EACL,uCAAuC,EACvC,sCAAsC,GACvC,MAAM,mBAAmB,CAAC;AAE3B,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;AA6ClC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,YAAoB;IAEpB,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7B,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,qCAAqC,EAAE;QAClE,MAAM,EA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AAM,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,26 @@
1
+ export interface OAuthAuthDetails {
2
+ type: "oauth";
3
+ refresh: string;
4
+ access?: string;
5
+ expires?: number;
6
+ }
7
+ export interface ApiKeyAuthDetails {
8
+ type: "api_key";
9
+ key: string;
10
+ }
11
+ export interface NonOAuthAuthDetails {
12
+ type: string;
13
+ [key: string]: unknown;
14
+ }
15
+ export type AuthDetails = OAuthAuthDetails | ApiKeyAuthDetails | NonOAuthAuthDetails;
16
+ export type GetAuth = () => Promise<AuthDetails>;
17
+ export interface RefreshParts {
18
+ refreshToken: string;
19
+ projectId?: string;
20
+ managedProjectId?: string;
21
+ }
22
+ export interface ProjectContextResult {
23
+ auth: OAuthAuthDetails;
24
+ effectiveProjectId: string;
25
+ }
26
+ //# sourceMappingURL=auth-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-types.d.ts","sourceRoot":"","sources":["../src/auth-types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,SAAS,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,mBAAmB,CAAA;AAEpF,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAA;AAEhD,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,gBAAgB,CAAA;IACtB,kBAAkB,EAAE,MAAM,CAAA;CAC3B"}
@@ -0,0 +1,3 @@
1
+ // Harness-agnostic auth/credential types shared by core and harness packages.
2
+ export {};
3
+ //# sourceMappingURL=auth-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-types.js","sourceRoot":"","sources":["../src/auth-types.ts"],"names":[],"mappings":"AAAA,8EAA8E"}
package/dist/auth.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ import type { OAuthAuthDetails, RefreshParts } from "./auth-types.ts";
2
+ export declare function isOAuthAuth(auth: unknown): auth is OAuthAuthDetails;
3
+ /**
4
+ * Splits a packed refresh string into its constituent refresh token and project IDs.
5
+ */
6
+ export declare function parseRefreshParts(refresh: string): RefreshParts;
7
+ /**
8
+ * Serializes refresh token parts into the stored string format.
9
+ */
10
+ export declare function formatRefreshParts(parts: RefreshParts): string;
11
+ /**
12
+ * Determines whether an access token is expired or missing, with buffer for clock skew.
13
+ */
14
+ export declare function accessTokenExpired(auth: OAuthAuthDetails): boolean;
15
+ /**
16
+ * Calculates absolute expiry timestamp based on a duration.
17
+ * @param requestTimeMs The local time when the request was initiated
18
+ * @param expiresInSeconds The duration returned by the server
19
+ */
20
+ export declare function calculateTokenExpiry(requestTimeMs: number, expiresInSeconds: unknown): number;
21
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAItE,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,gBAAgB,CAEnE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAO/D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAI9D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAKlE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,GAAG,MAAM,CAO7F"}
package/dist/auth.js ADDED
@@ -0,0 +1,46 @@
1
+ const ACCESS_TOKEN_EXPIRY_BUFFER_MS = 60 * 1000;
2
+ export function isOAuthAuth(auth) {
3
+ return typeof auth === "object" && auth !== null && "type" in auth && auth.type === "oauth";
4
+ }
5
+ /**
6
+ * Splits a packed refresh string into its constituent refresh token and project IDs.
7
+ */
8
+ export function parseRefreshParts(refresh) {
9
+ const [refreshToken = "", projectId = "", managedProjectId = ""] = (refresh ?? "").split("|");
10
+ return {
11
+ refreshToken,
12
+ projectId: projectId || undefined,
13
+ managedProjectId: managedProjectId || undefined,
14
+ };
15
+ }
16
+ /**
17
+ * Serializes refresh token parts into the stored string format.
18
+ */
19
+ export function formatRefreshParts(parts) {
20
+ const projectSegment = parts.projectId ?? "";
21
+ const base = `${parts.refreshToken}|${projectSegment}`;
22
+ return parts.managedProjectId ? `${base}|${parts.managedProjectId}` : base;
23
+ }
24
+ /**
25
+ * Determines whether an access token is expired or missing, with buffer for clock skew.
26
+ */
27
+ export function accessTokenExpired(auth) {
28
+ if (!auth.access || typeof auth.expires !== "number") {
29
+ return true;
30
+ }
31
+ return auth.expires <= Date.now() + ACCESS_TOKEN_EXPIRY_BUFFER_MS;
32
+ }
33
+ /**
34
+ * Calculates absolute expiry timestamp based on a duration.
35
+ * @param requestTimeMs The local time when the request was initiated
36
+ * @param expiresInSeconds The duration returned by the server
37
+ */
38
+ export function calculateTokenExpiry(requestTimeMs, expiresInSeconds) {
39
+ const seconds = typeof expiresInSeconds === "number" ? expiresInSeconds : 3600;
40
+ // Safety check for bad data - if it's not a positive number, treat as immediately expired
41
+ if (isNaN(seconds) || seconds <= 0) {
42
+ return requestTimeMs;
43
+ }
44
+ return requestTimeMs + seconds * 1000;
45
+ }
46
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAEA,MAAM,6BAA6B,GAAG,EAAE,GAAG,IAAI,CAAC;AAEhD,MAAM,UAAU,WAAW,CAAC,IAAa;IACvC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,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,CAAC;IACvB,CAAC;IACD,OAAO,aAAa,GAAG,OAAO,GAAG,IAAI,CAAC;AACxC,CAAC"}
@@ -0,0 +1,146 @@
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
+ * Live agy CLI 1.0.4 traffic uses daily-cloudcode-pa.googleapis.com.
20
+ */
21
+ export declare const ANTIGRAVITY_ENDPOINT_DAILY = "https://daily-cloudcode-pa.googleapis.com";
22
+ export declare const ANTIGRAVITY_ENDPOINT_AUTOPUSH = "https://autopush-cloudcode-pa.sandbox.googleapis.com";
23
+ export declare const ANTIGRAVITY_ENDPOINT_PROD = "https://cloudcode-pa.googleapis.com";
24
+ /**
25
+ * Endpoint fallback order (daily → prod).
26
+ * Autopush removed to reduce unnecessary fallback API calls — it rarely works when daily fails.
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.googleapis.com", "https://cloudcode-pa.googleapis.com"];
30
+ /**
31
+ * Preferred endpoint order for project discovery.
32
+ * agy CLI probes daily-cloudcode-pa.googleapis.com first.
33
+ */
34
+ export declare const ANTIGRAVITY_LOAD_ENDPOINTS: readonly ["https://daily-cloudcode-pa.googleapis.com", "https://cloudcode-pa.googleapis.com"];
35
+ /**
36
+ * Primary endpoint to use (captured agy CLI daily endpoint).
37
+ */
38
+ export declare const ANTIGRAVITY_ENDPOINT = "https://daily-cloudcode-pa.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 const ANTIGRAVITY_VERSION_FALLBACK = "1.18.3";
50
+ export declare function getAntigravityVersion(): string;
51
+ /**
52
+ * Set the runtime Antigravity version. Can only be called once (at startup).
53
+ * Subsequent calls are silently ignored to prevent accidental mutation.
54
+ */
55
+ export declare function setAntigravityVersion(version: string): void;
56
+ /** @deprecated Use getAntigravityVersion() for runtime access. */
57
+ export declare const ANTIGRAVITY_VERSION = "1.18.3";
58
+ export declare function getAntigravityHeaders(): HeaderSet & {
59
+ "Client-Metadata": string;
60
+ };
61
+ /** @deprecated Use getAntigravityHeaders() for runtime access. */
62
+ export declare const ANTIGRAVITY_HEADERS: {
63
+ readonly "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Antigravity/1.18.3 Chrome/138.0.7204.235 Electron/37.3.1 Safari/537.36";
64
+ readonly "X-Goog-Api-Client": "google-cloud-sdk vscode_cloudshelleditor/0.1";
65
+ readonly "Client-Metadata": "{\"ideType\":\"ANTIGRAVITY\",\"platform\":\"WINDOWS\",\"pluginType\":\"GEMINI\"}" | "{\"ideType\":\"ANTIGRAVITY\",\"platform\":\"MACOS\",\"pluginType\":\"GEMINI\"}";
66
+ };
67
+ export declare const GEMINI_CLI_VERSION = "1.0.0";
68
+ /**
69
+ * Default model used in Gemini CLI User-Agent when no model is specified.
70
+ */
71
+ export declare const GEMINI_CLI_DEFAULT_MODEL = "gemini-2.5-pro";
72
+ /**
73
+ * Build Gemini CLI User-Agent string matching the official google-gemini/gemini-cli format.
74
+ * Format: `GeminiCLI/{version}/{model} ({platform}; {arch})`
75
+ *
76
+ * @see https://github.com/google-gemini/gemini-cli
77
+ */
78
+ export declare function buildGeminiCliUserAgent(model?: string): string;
79
+ /** @deprecated Use buildGeminiCliUserAgent() for runtime access. */
80
+ export declare const GEMINI_CLI_HEADERS: {
81
+ readonly "User-Agent": "google-api-nodejs-client/9.15.1";
82
+ readonly "X-Goog-Api-Client": "gl-node/22.17.0";
83
+ readonly "Client-Metadata": "ideType=IDE_UNSPECIFIED,platform=PLATFORM_UNSPECIFIED,pluginType=GEMINI";
84
+ };
85
+ export type HeaderSet = {
86
+ "User-Agent": string;
87
+ "X-Goog-Api-Client"?: string;
88
+ "Client-Metadata"?: string;
89
+ };
90
+ export declare function getRandomizedHeaders(style: HeaderStyle, model?: string): HeaderSet;
91
+ export type HeaderStyle = "antigravity" | "gemini-cli";
92
+ /**
93
+ * Provider identifier shared between the plugin loader and credential store.
94
+ */
95
+ export declare const ANTIGRAVITY_PROVIDER_ID = "google";
96
+ /**
97
+ * System instruction for Claude tool usage hardening.
98
+ * Prevents hallucinated parameters by explicitly stating the rules.
99
+ *
100
+ * This is injected when tools are present to reduce cases where Claude
101
+ * uses parameter names from its training data instead of the actual schema.
102
+ */
103
+ 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.";
104
+ /**
105
+ * Template for parameter signature injection into tool descriptions.
106
+ * {params} will be replaced with the actual parameter list.
107
+ */
108
+ export declare const CLAUDE_DESCRIPTION_PROMPT = "\n\n\u26A0\uFE0F STRICT PARAMETERS: {params}.";
109
+ export declare const EMPTY_SCHEMA_PLACEHOLDER_NAME = "_placeholder";
110
+ export declare const EMPTY_SCHEMA_PLACEHOLDER_DESCRIPTION = "Placeholder. Always pass true.";
111
+ /**
112
+ * Sentinel value to bypass thought signature validation.
113
+ *
114
+ * When a thinking block has an invalid or missing signature (e.g., cache miss,
115
+ * session mismatch, plugin restart), this sentinel can be injected to skip
116
+ * validation instead of failing with "Invalid signature in thinking block".
117
+ *
118
+ * This is an officially supported Google API feature, used by:
119
+ * - gemini-cli: https://github.com/google-gemini/gemini-cli
120
+ * - Google .NET SDK: PredictionServiceChatClient.cs
121
+ *
122
+ * @see https://ai.google.dev/gemini-api/docs/thought-signatures
123
+ */
124
+ export declare const SKIP_THOUGHT_SIGNATURE = "skip_thought_signature_validator";
125
+ /**
126
+ * Model used for Google Search grounding requests.
127
+ * Uses gemini-2.5-flash for fast, cost-effective search operations. (3-flash is always at capacity and doesn't support souce citation).
128
+ */
129
+ export declare const SEARCH_MODEL = "gemini-2.5-flash";
130
+ /**
131
+ * Thinking budget for deep search (more thorough analysis).
132
+ */
133
+ export declare const SEARCH_THINKING_BUDGET_DEEP = 16384;
134
+ /**
135
+ * Thinking budget for fast search (quick results).
136
+ */
137
+ export declare const SEARCH_THINKING_BUDGET_FAST = 4096;
138
+ /**
139
+ * Timeout for search requests in milliseconds (60 seconds).
140
+ */
141
+ export declare const SEARCH_TIMEOUT_MS = 60000;
142
+ /**
143
+ * System instruction for the Google Search tool.
144
+ */
145
+ 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";
146
+ //# 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;;;GAGG;AACH,eAAO,MAAM,0BAA0B,8CAA8C,CAAC;AACtF,eAAO,MAAM,6BAA6B,yDAAyD,CAAC;AACpG,eAAO,MAAM,yBAAyB,wCAAwC,CAAC;AAE/E;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,+FAGjC,CAAC;AACX;;;GAGG;AACH,eAAO,MAAM,0BAA0B,+FAG7B,CAAC;AACX;;GAEG;AACH,eAAO,MAAM,oBAAoB,8CAA6B,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,wCAA4B,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,8BAA8B,sBAAsB,CAAC;AAElE,eAAO,MAAM,4BAA4B,WAAW,CAAC;AAIrD,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,E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