@google/gemini-cli 0.52.0-nightly.20260723.g9681621c6 → 0.52.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.
- package/bundle/{chunk-3XOIA5WR.js → chunk-24R3JJRB.js} +1 -1
- package/bundle/{chunk-UEI42N7R.js → chunk-6Z2GQGII.js} +3 -3
- package/bundle/{chunk-GJXPH6YT.js → chunk-7LQRUKPT.js} +81 -168
- package/bundle/{chunk-XH7QC2TB.js → chunk-ALVMXQYL.js} +2 -2
- package/bundle/{chunk-CPNBBB75.js → chunk-B54TROKV.js} +2 -2
- package/bundle/{chunk-27C6XFMY.js → chunk-BG2B4WV5.js} +87 -184
- package/bundle/{chunk-BDSSP5BZ.js → chunk-F7WLNK6O.js} +1 -1
- package/bundle/{chunk-MGWKBHYO.js → chunk-FBGJOW3X.js} +2 -2
- package/bundle/{chunk-IKE3IJFJ.js → chunk-ILANJJAD.js} +3 -3
- package/bundle/{chunk-NGVS6ZAJ.js → chunk-IQDAUFS5.js} +14275 -7764
- package/bundle/{chunk-GNNMAEXD.js → chunk-JB342GRK.js} +1 -1
- package/bundle/{chunk-PKFZO3SN.js → chunk-OFOMMM4A.js} +1 -1
- package/bundle/{chunk-IODN6H35.js → chunk-P4IYYRKC.js} +1 -1
- package/bundle/{chunk-ZEZVEPHU.js → chunk-PTIIH33O.js} +3 -3
- package/bundle/{chunk-4OVORMGE.js → chunk-RHQ5RWRW.js} +1 -1
- package/bundle/{chunk-H4LWAALI.js → chunk-SDT3SMSX.js} +7 -7
- package/bundle/{chunk-QSTUV3QH.js → chunk-SNUSRD5O.js} +7 -7
- package/bundle/{chunk-APLH5ANQ.js → chunk-SZMWXEEI.js} +5 -8
- package/bundle/{chunk-2EQTAQD4.js → chunk-THWSXFSH.js} +1 -1
- package/bundle/{chunk-DBBRJYJF.js → chunk-UB6EWNWI.js} +8 -9
- package/bundle/{chunk-KDCDG5VZ.js → chunk-Y5NBDPUP.js} +1 -1
- package/bundle/{chunk-2277V7JH.js → chunk-ZINRZXUN.js} +1 -1
- package/bundle/{chunk-IOKXRXYH.js → chunk-ZLL3UXFN.js} +1 -1
- package/bundle/{chunk-QWQ2TM4M.js → chunk-ZNHHIFQN.js} +54 -67
- package/bundle/{cleanup-FXLZG47P.js → cleanup-2EKCP4Q4.js} +2 -2
- package/bundle/{cleanup-HUYNLL74.js → cleanup-G4HKUFT2.js} +2 -2
- package/bundle/{cleanup-SZCNPC5U.js → cleanup-X3KOZTUK.js} +2 -2
- package/bundle/{core-PVG4D2MR.js → core-JDFTBJXX.js} +1 -3
- package/bundle/{dist-4MRXBLX6.js → core-ZIYDWN4V.js} +1 -3
- package/bundle/{devtoolsService-QYDPHHFN.js → devtoolsService-KJJEIBQ2.js} +2 -2
- package/bundle/{devtoolsService-UWV2FJ5W.js → devtoolsService-NFNYJGMS.js} +3 -4
- package/bundle/{devtoolsService-BLOOTSX5.js → devtoolsService-UB2E5377.js} +2 -2
- package/bundle/{dist-JKGOFUTJ.js → dist-WD2ZO2DC.js} +1 -3
- package/bundle/docs/CONTRIBUTING.md +3 -3
- package/bundle/docs/cli/sandbox.md +2 -3
- package/bundle/docs/reference/configuration.md +4 -4
- package/bundle/{gemini-RB4VRLKB.js → gemini-6K6USV55.js} +14 -14
- package/bundle/{gemini-E2E3U6PR.js → gemini-NJ7GQJ2G.js} +14 -14
- package/bundle/{gemini-6757TORA.js → gemini-Y4OW3GPV.js} +196 -212
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-FS3OVPXQ.js → interactiveCli-3B23G3WW.js} +8 -8
- package/bundle/{interactiveCli-YTSJUZI4.js → interactiveCli-3XBP73G4.js} +8 -8
- package/bundle/{interactiveCli-GSB4RL5O.js → interactiveCli-NNJDT7RS.js} +296 -315
- package/bundle/{liteRtServerManager-LW25SW2L.js → liteRtServerManager-A77B57ZY.js} +4 -4
- package/bundle/{liteRtServerManager-QQQFW2CP.js → liteRtServerManager-MQS4LI5P.js} +4 -4
- package/bundle/{liteRtServerManager-T2Z3RLS3.js → liteRtServerManager-PYCXZRAL.js} +4 -4
- package/bundle/{oauth2-provider-EAM256AQ.js → oauth2-provider-5JL2PKRR.js} +1 -1
- package/bundle/{oauth2-provider-DFVE3NYF.js → oauth2-provider-6EE3JV6M.js} +1 -1
- package/bundle/{oauth2-provider-LIH733TF.js → oauth2-provider-THDZ27ZX.js} +72 -38
- package/bundle/sandbox-macos-permissive-open.sb +4 -113
- package/bundle/sandbox-macos-permissive-proxied.sb +9 -111
- package/bundle/{start-5G2UDZZ6.js → start-K5QQG7K4.js} +6 -6
- package/bundle/{start-5PGXX77Z.js → start-SV5TPWOH.js} +6 -6
- package/bundle/{start-JRR6N5UF.js → start-YON746V5.js} +6 -6
- package/package.json +1 -1
- package/bundle/chunk-2PPBVVNC.js +0 -1571
- package/bundle/chunk-H56TFQ33.js +0 -398
- package/bundle/chunk-LFBOFVXO.js +0 -118
- package/bundle/chunk-TWHN6YWJ.js +0 -17332
- package/bundle/chunk-V37HWFI3.js +0 -154
- package/bundle/chunk-VDXWWVGC.js +0 -396898
- package/bundle/chunk-YNU3KMOW.js +0 -512
- package/bundle/chunk-ZEJHAENL.js +0 -102505
- package/bundle/cleanup-XETKRH7X.js +0 -32
- package/bundle/devtoolsService-YCULQ2T3.js +0 -4359
- package/bundle/dist-U3H5J2OD.js +0 -2154
- package/bundle/gemini-F4UJ3SXK.js +0 -16427
- package/bundle/interactiveCli-QWKN4PM7.js +0 -34816
- package/bundle/liteRtServerManager-VLV27PAS.js +0 -65
- package/bundle/oauth2-provider-WWQFEGLU.js +0 -235
- package/bundle/start-JVS5QRER.js +0 -18
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
|
|
2
2
|
import {
|
|
3
3
|
runExitCleanup
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Y5NBDPUP.js";
|
|
5
5
|
import {
|
|
6
6
|
__commonJS,
|
|
7
7
|
__require
|
|
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
|
|
|
2
2
|
import {
|
|
3
3
|
exitCli,
|
|
4
4
|
require_source
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-24R3JJRB.js";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_PORT,
|
|
8
8
|
SERVER_START_WAIT_MS,
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
isServerRunning,
|
|
15
15
|
resolveGemmaConfig,
|
|
16
16
|
writeServerProcessInfo
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ZINRZXUN.js";
|
|
18
18
|
import {
|
|
19
19
|
debugLogger
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-7LQRUKPT.js";
|
|
21
21
|
import {
|
|
22
22
|
__toESM
|
|
23
23
|
} from "./chunk-34MYV7JD.js";
|
|
@@ -278401,85 +278401,66 @@ var oauthClientPromises = /* @__PURE__ */ new Map();
|
|
|
278401
278401
|
function getUseEncryptedStorageFlag() {
|
|
278402
278402
|
return process.env[FORCE_ENCRYPTED_FILE_ENV_VAR] === "true";
|
|
278403
278403
|
}
|
|
278404
|
-
function isAdcCredentials(credentials3) {
|
|
278405
|
-
if (credentials3 && typeof credentials3 === "object" && "type" in credentials3) {
|
|
278406
|
-
const type2 = credentials3.type;
|
|
278407
|
-
return typeof type2 === "string" && type2 !== "authorized_user";
|
|
278408
|
-
}
|
|
278409
|
-
return false;
|
|
278410
|
-
}
|
|
278411
278404
|
async function initOauthClient(authType, config2) {
|
|
278412
|
-
|
|
278413
|
-
|
|
278414
|
-
|
|
278415
|
-
|
|
278416
|
-
transporterOptions: {
|
|
278417
|
-
proxy: config2.getProxy()
|
|
278418
|
-
}
|
|
278405
|
+
const credentials3 = await fetchCachedCredentials();
|
|
278406
|
+
if (credentials3 && typeof credentials3 === "object" && "type" in credentials3 && (credentials3.type === "external_account_authorized_user" || credentials3.type === "service_account")) {
|
|
278407
|
+
const auth2 = new import_google_auth_library3.GoogleAuth({
|
|
278408
|
+
scopes: OAUTH_SCOPE
|
|
278419
278409
|
});
|
|
278420
|
-
const
|
|
278421
|
-
|
|
278422
|
-
|
|
278423
|
-
await OAuthCredentialStorage.saveCredentials(tokens);
|
|
278424
|
-
} else {
|
|
278425
|
-
await cacheCredentials(tokens);
|
|
278426
|
-
}
|
|
278427
|
-
await triggerPostAuthCallbacks(tokens);
|
|
278410
|
+
const byoidClient = auth2.fromJSON({
|
|
278411
|
+
...credentials3,
|
|
278412
|
+
refresh_token: credentials3.refresh_token ?? void 0
|
|
278428
278413
|
});
|
|
278429
|
-
|
|
278414
|
+
const token2 = await byoidClient.getAccessToken();
|
|
278415
|
+
if (token2) {
|
|
278416
|
+
debugLogger.debug(`Created ${credentials3.type} auth client.`);
|
|
278417
|
+
return byoidClient;
|
|
278418
|
+
}
|
|
278430
278419
|
}
|
|
278420
|
+
const client = new import_google_auth_library3.OAuth2Client({
|
|
278421
|
+
clientId: OAUTH_CLIENT_ID,
|
|
278422
|
+
clientSecret: OAUTH_CLIENT_SECRET,
|
|
278423
|
+
transporterOptions: {
|
|
278424
|
+
proxy: config2.getProxy()
|
|
278425
|
+
}
|
|
278426
|
+
});
|
|
278427
|
+
const useEncryptedStorage = getUseEncryptedStorageFlag();
|
|
278431
278428
|
if (process.env["GOOGLE_GENAI_USE_GCA"] && process.env["GOOGLE_CLOUD_ACCESS_TOKEN"]) {
|
|
278432
|
-
|
|
278433
|
-
client2.setCredentials({
|
|
278429
|
+
client.setCredentials({
|
|
278434
278430
|
access_token: process.env["GOOGLE_CLOUD_ACCESS_TOKEN"]
|
|
278435
278431
|
});
|
|
278436
|
-
await fetchAndCacheUserInfo(
|
|
278437
|
-
return
|
|
278432
|
+
await fetchAndCacheUserInfo(client);
|
|
278433
|
+
return client;
|
|
278438
278434
|
}
|
|
278439
|
-
|
|
278440
|
-
|
|
278441
|
-
|
|
278442
|
-
|
|
278443
|
-
|
|
278444
|
-
|
|
278445
|
-
|
|
278446
|
-
|
|
278447
|
-
|
|
278448
|
-
|
|
278449
|
-
|
|
278450
|
-
|
|
278451
|
-
|
|
278452
|
-
|
|
278453
|
-
|
|
278454
|
-
|
|
278455
|
-
|
|
278456
|
-
|
|
278457
|
-
|
|
278458
|
-
}
|
|
278459
|
-
} else if (credentials3) {
|
|
278460
|
-
const client2 = createBaseOAuth2Client();
|
|
278461
|
-
client2.setCredentials(credentials3);
|
|
278462
|
-
try {
|
|
278463
|
-
const { token: token2 } = await client2.getAccessToken();
|
|
278464
|
-
if (token2) {
|
|
278465
|
-
await client2.getTokenInfo(token2);
|
|
278466
|
-
if (!userAccountManager2.getCachedGoogleAccount()) {
|
|
278467
|
-
try {
|
|
278468
|
-
await fetchAndCacheUserInfo(client2);
|
|
278469
|
-
} catch (error40) {
|
|
278470
|
-
debugLogger.warn("Failed to fetch user info:", getErrorMessage(error40));
|
|
278471
|
-
}
|
|
278435
|
+
client.on("tokens", async (tokens) => {
|
|
278436
|
+
if (useEncryptedStorage) {
|
|
278437
|
+
await OAuthCredentialStorage.saveCredentials(tokens);
|
|
278438
|
+
} else {
|
|
278439
|
+
await cacheCredentials(tokens);
|
|
278440
|
+
}
|
|
278441
|
+
await triggerPostAuthCallbacks(tokens);
|
|
278442
|
+
});
|
|
278443
|
+
if (credentials3) {
|
|
278444
|
+
client.setCredentials(credentials3);
|
|
278445
|
+
try {
|
|
278446
|
+
const { token: token2 } = await client.getAccessToken();
|
|
278447
|
+
if (token2) {
|
|
278448
|
+
await client.getTokenInfo(token2);
|
|
278449
|
+
if (!userAccountManager2.getCachedGoogleAccount()) {
|
|
278450
|
+
try {
|
|
278451
|
+
await fetchAndCacheUserInfo(client);
|
|
278452
|
+
} catch (error40) {
|
|
278453
|
+
debugLogger.warn("Failed to fetch user info:", getErrorMessage(error40));
|
|
278472
278454
|
}
|
|
278473
|
-
debugLogger.log("Loaded cached credentials.");
|
|
278474
|
-
await triggerPostAuthCallbacks(client2.credentials || credentials3);
|
|
278475
|
-
return client2;
|
|
278476
278455
|
}
|
|
278477
|
-
|
|
278478
|
-
|
|
278456
|
+
debugLogger.log("Loaded cached credentials.");
|
|
278457
|
+
await triggerPostAuthCallbacks(credentials3);
|
|
278458
|
+
return client;
|
|
278479
278459
|
}
|
|
278460
|
+
} catch (error40) {
|
|
278461
|
+
debugLogger.debug(`Cached credentials are not valid:`, getErrorMessage(error40));
|
|
278480
278462
|
}
|
|
278481
278463
|
}
|
|
278482
|
-
const client = createBaseOAuth2Client();
|
|
278483
278464
|
if (authType === AuthType2.COMPUTE_ADC) {
|
|
278484
278465
|
try {
|
|
278485
278466
|
debugLogger.log("Attempting to authenticate via metadata server application default credentials.");
|
|
@@ -278788,21 +278769,13 @@ function getAvailablePort() {
|
|
|
278788
278769
|
}
|
|
278789
278770
|
});
|
|
278790
278771
|
}
|
|
278791
|
-
async function
|
|
278792
|
-
const credentialsList = [];
|
|
278772
|
+
async function fetchCachedCredentials() {
|
|
278793
278773
|
const useEncryptedStorage = getUseEncryptedStorageFlag();
|
|
278794
278774
|
if (useEncryptedStorage) {
|
|
278795
|
-
|
|
278796
|
-
const creds = await OAuthCredentialStorage.loadCredentials();
|
|
278797
|
-
if (creds) {
|
|
278798
|
-
credentialsList.push(creds);
|
|
278799
|
-
}
|
|
278800
|
-
} catch (error40) {
|
|
278801
|
-
debugLogger.debug("Failed to load credentials from encrypted storage:", error40);
|
|
278802
|
-
}
|
|
278775
|
+
return OAuthCredentialStorage.loadCredentials();
|
|
278803
278776
|
}
|
|
278804
278777
|
const pathsToTry = [
|
|
278805
|
-
|
|
278778
|
+
Storage.getOAuthCredsPath(),
|
|
278806
278779
|
process.env["GOOGLE_APPLICATION_CREDENTIALS"]
|
|
278807
278780
|
].filter((p) => !!p);
|
|
278808
278781
|
for (const keyFile of pathsToTry) {
|
|
@@ -278811,15 +278784,14 @@ async function fetchCachedCredentialsList() {
|
|
|
278811
278784
|
const parsed = JSON.parse(keyFileString);
|
|
278812
278785
|
const isOAuthCreds = (val) => typeof val === "object" && val !== null;
|
|
278813
278786
|
if (isOAuthCreds(parsed)) {
|
|
278814
|
-
|
|
278815
|
-
} else {
|
|
278816
|
-
throw new Error("Invalid credentials format");
|
|
278787
|
+
return parsed;
|
|
278817
278788
|
}
|
|
278789
|
+
throw new Error("Invalid credentials format");
|
|
278818
278790
|
} catch (error40) {
|
|
278819
278791
|
debugLogger.debug(`Failed to load credentials from ${keyFile}:`, getErrorMessage(error40));
|
|
278820
278792
|
}
|
|
278821
278793
|
}
|
|
278822
|
-
return
|
|
278794
|
+
return null;
|
|
278823
278795
|
}
|
|
278824
278796
|
function clearOauthClientCache() {
|
|
278825
278797
|
oauthClientPromises.clear();
|
|
@@ -282493,8 +282465,8 @@ function isValidToolName(name3, options = {}) {
|
|
|
282493
282465
|
}
|
|
282494
282466
|
|
|
282495
282467
|
// packages/core/dist/src/generated/git-commit.js
|
|
282496
|
-
var GIT_COMMIT_INFO = "
|
|
282497
|
-
var CLI_VERSION = "0.52.0
|
|
282468
|
+
var GIT_COMMIT_INFO = "5de3b24af";
|
|
282469
|
+
var CLI_VERSION = "0.52.0";
|
|
282498
282470
|
|
|
282499
282471
|
// packages/core/dist/src/ide/detect-ide.js
|
|
282500
282472
|
var IDE_DEFINITIONS = {
|
|
@@ -289987,10 +289959,6 @@ function getDiffCommand(oldPath, newPath, editor) {
|
|
|
289987
289959
|
}
|
|
289988
289960
|
}
|
|
289989
289961
|
async function openDiff(oldPath, newPath, editor) {
|
|
289990
|
-
if (isHeadlessMode()) {
|
|
289991
|
-
debugLogger.warn("External editor spawning is disabled in headless/server mode.");
|
|
289992
|
-
return;
|
|
289993
|
-
}
|
|
289994
289962
|
const diffCommand = getDiffCommand(oldPath, newPath, editor);
|
|
289995
289963
|
if (!diffCommand) {
|
|
289996
289964
|
debugLogger.error("No diff tool available. Install a supported editor.");
|
|
@@ -305675,7 +305643,7 @@ function getVersion() {
|
|
|
305675
305643
|
}
|
|
305676
305644
|
versionPromise = (async () => {
|
|
305677
305645
|
const pkgJson = await getPackageJson(__dirname4);
|
|
305678
|
-
return "0.52.0
|
|
305646
|
+
return "0.52.0";
|
|
305679
305647
|
})();
|
|
305680
305648
|
return versionPromise;
|
|
305681
305649
|
}
|
|
@@ -310644,19 +310612,13 @@ async function createContentGeneratorConfig(config2, authType, apiKey, baseUrl,
|
|
|
310644
310612
|
customHeaders,
|
|
310645
310613
|
vertexAiRouting
|
|
310646
310614
|
};
|
|
310647
|
-
const getEnv3 = (key) => {
|
|
310648
|
-
if (config2?.env && config2.env[key] !== void 0) {
|
|
310649
|
-
return config2.env[key];
|
|
310650
|
-
}
|
|
310651
|
-
return process.env[key];
|
|
310652
|
-
};
|
|
310653
310615
|
if (authType === AuthType2.LOGIN_WITH_GOOGLE || authType === AuthType2.COMPUTE_ADC) {
|
|
310654
310616
|
return contentGeneratorConfig;
|
|
310655
310617
|
}
|
|
310656
|
-
const geminiApiKey = apiKey ||
|
|
310657
|
-
const googleApiKey =
|
|
310658
|
-
const googleCloudProject =
|
|
310659
|
-
const googleCloudLocation =
|
|
310618
|
+
const geminiApiKey = apiKey || process.env["GEMINI_API_KEY"] || await loadApiKey() || void 0;
|
|
310619
|
+
const googleApiKey = process.env["GOOGLE_API_KEY"] || void 0;
|
|
310620
|
+
const googleCloudProject = process.env["GOOGLE_CLOUD_PROJECT"] || process.env["GOOGLE_CLOUD_PROJECT_ID"] || void 0;
|
|
310621
|
+
const googleCloudLocation = process.env["GOOGLE_CLOUD_LOCATION"] || void 0;
|
|
310660
310622
|
if (authType === AuthType2.USE_GEMINI && geminiApiKey) {
|
|
310661
310623
|
contentGeneratorConfig.apiKey = geminiApiKey;
|
|
310662
310624
|
contentGeneratorConfig.vertexai = false;
|
|
@@ -310668,7 +310630,7 @@ async function createContentGeneratorConfig(config2, authType, apiKey, baseUrl,
|
|
|
310668
310630
|
return contentGeneratorConfig;
|
|
310669
310631
|
}
|
|
310670
310632
|
if (authType === AuthType2.GATEWAY) {
|
|
310671
|
-
contentGeneratorConfig.apiKey = apiKey ||
|
|
310633
|
+
contentGeneratorConfig.apiKey = apiKey || process.env["GEMINI_API_KEY"] || "";
|
|
310672
310634
|
contentGeneratorConfig.vertexai = false;
|
|
310673
310635
|
return contentGeneratorConfig;
|
|
310674
310636
|
}
|
|
@@ -320952,7 +320914,7 @@ import { TextDecoder as TextDecoder2 } from "node:util";
|
|
|
320952
320914
|
import os28 from "node:os";
|
|
320953
320915
|
import fs47, { mkdirSync as mkdirSync4 } from "node:fs";
|
|
320954
320916
|
import path57 from "node:path";
|
|
320955
|
-
var
|
|
320917
|
+
var import_headless2 = __toESM(require_xterm_headless(), 1);
|
|
320956
320918
|
|
|
320957
320919
|
// packages/core/dist/src/utils/terminalSerializer.js
|
|
320958
320920
|
var Attribute;
|
|
@@ -321827,7 +321789,7 @@ var ExecutionLifecycleService = class {
|
|
|
321827
321789
|
};
|
|
321828
321790
|
|
|
321829
321791
|
// packages/core/dist/src/services/shellExecutionService.js
|
|
321830
|
-
var { Terminal } =
|
|
321792
|
+
var { Terminal } = import_headless2.default;
|
|
321831
321793
|
var MAX_CHILD_PROCESS_BUFFER_SIZE = 16 * 1024 * 1024;
|
|
321832
321794
|
var GEMINI_CLI_IDENTIFICATION_ENV_VAR = "GEMINI_CLI";
|
|
321833
321795
|
var GEMINI_CLI_IDENTIFICATION_ENV_VAR_VALUE = "1";
|
|
@@ -322025,10 +321987,9 @@ ${truncated}`;
|
|
|
322025
321987
|
const guardedCommand = ensurePromptvarsDisabled(commandToExecute, shell);
|
|
322026
321988
|
const finalCommand = injectUtf8CodepageForPty(guardedCommand, shell, isWindows3, usingPty);
|
|
322027
321989
|
const spawnArgs = [...argsPrefix, finalCommand];
|
|
322028
|
-
const sourceEnv = shellExecutionConfig.env ?? process.env;
|
|
322029
321990
|
const gitConfigKeys = [];
|
|
322030
321991
|
if (!isInteractive) {
|
|
322031
|
-
for (const key in
|
|
321992
|
+
for (const key in process.env) {
|
|
322032
321993
|
if (key.startsWith("GIT_CONFIG_")) {
|
|
322033
321994
|
gitConfigKeys.push(key);
|
|
322034
321995
|
}
|
|
@@ -322041,7 +322002,7 @@ ${truncated}`;
|
|
|
322041
322002
|
...gitConfigKeys
|
|
322042
322003
|
]
|
|
322043
322004
|
};
|
|
322044
|
-
const sanitizedEnv = sanitizeEnvironment(
|
|
322005
|
+
const sanitizedEnv = sanitizeEnvironment(process.env, sanitizationConfig);
|
|
322045
322006
|
const baseEnv = {
|
|
322046
322007
|
...sanitizedEnv,
|
|
322047
322008
|
[GEMINI_CLI_IDENTIFICATION_ENV_VAR]: GEMINI_CLI_IDENTIFICATION_ENV_VAR_VALUE,
|
|
@@ -322051,7 +322012,7 @@ ${truncated}`;
|
|
|
322051
322012
|
};
|
|
322052
322013
|
if (!isInteractive) {
|
|
322053
322014
|
for (const key of gitConfigKeys) {
|
|
322054
|
-
baseEnv[key] =
|
|
322015
|
+
baseEnv[key] = process.env[key];
|
|
322055
322016
|
}
|
|
322056
322017
|
const gitConfigCount = parseInt(baseEnv["GIT_CONFIG_COUNT"] || "0", 10);
|
|
322057
322018
|
const newKey = `GIT_CONFIG_KEY_${gitConfigCount}`;
|
|
@@ -323424,7 +323385,6 @@ exit $__code`;
|
|
|
323424
323385
|
}
|
|
323425
323386
|
}, combinedController.signal, this.context.config.isInteractiveShellEnabled(), {
|
|
323426
323387
|
...shellExecutionConfig,
|
|
323427
|
-
env: this.context.config.env,
|
|
323428
323388
|
sessionId: this.context.config?.getSessionId?.() ?? "default",
|
|
323429
323389
|
pager: "cat",
|
|
323430
323390
|
sanitizationConfig: shellExecutionConfig?.sanitizationConfig ?? this.context.config.sanitizationConfig,
|
|
@@ -330566,8 +330526,7 @@ var GeminiChat = class {
|
|
|
330566
330526
|
return binaryParts.length > 0 ? binaryParts : void 0;
|
|
330567
330527
|
}
|
|
330568
330528
|
async makeApiCallAndProcessStream(modelConfigKey, requestHistory, prompt_id, abortSignal, role, apiHistoryOverride) {
|
|
330569
|
-
|
|
330570
|
-
scrubbedHistory = coalesceConsecutiveRoles(scrubbedHistory);
|
|
330529
|
+
const scrubbedHistory = this.context.config.isContextManagementEnabled() ? scrubHistory([...requestHistory]) : [...requestHistory];
|
|
330571
330530
|
const scrubbedContents = scrubbedHistory.map((h2) => h2.content);
|
|
330572
330531
|
const requestContents = apiHistoryOverride ? scrubContents(apiHistoryOverride) : scrubbedContents;
|
|
330573
330532
|
const contentsForPreviewModel = this.ensureActiveLoopHasThoughtSignatures(requestContents);
|
|
@@ -331087,29 +331046,6 @@ function stripToolCallIdPrefixes(contents) {
|
|
|
331087
331046
|
})
|
|
331088
331047
|
}));
|
|
331089
331048
|
}
|
|
331090
|
-
function coalesceConsecutiveRoles(history) {
|
|
331091
|
-
const result2 = [];
|
|
331092
|
-
for (const turn of history) {
|
|
331093
|
-
const lastIdx = result2.length - 1;
|
|
331094
|
-
const last2 = result2[lastIdx];
|
|
331095
|
-
if (last2 && last2.content.role && last2.content.role === turn.content.role) {
|
|
331096
|
-
const hasParts = last2.content.parts || turn.content.parts;
|
|
331097
|
-
result2[lastIdx] = {
|
|
331098
|
-
id: last2.id,
|
|
331099
|
-
content: {
|
|
331100
|
-
...last2.content,
|
|
331101
|
-
parts: hasParts ? [...last2.content.parts || [], ...turn.content.parts || []] : void 0
|
|
331102
|
-
}
|
|
331103
|
-
};
|
|
331104
|
-
} else {
|
|
331105
|
-
result2.push({
|
|
331106
|
-
id: turn.id,
|
|
331107
|
-
content: { ...turn.content }
|
|
331108
|
-
});
|
|
331109
|
-
}
|
|
331110
|
-
}
|
|
331111
|
-
return result2;
|
|
331112
|
-
}
|
|
331113
331049
|
|
|
331114
331050
|
// packages/core/dist/src/utils/ragLogger.js
|
|
331115
331051
|
import * as fs50 from "node:fs";
|
|
@@ -338237,7 +338173,7 @@ var A2AAuthProviderFactory = class _A2AAuthProviderFactory {
|
|
|
338237
338173
|
return provider;
|
|
338238
338174
|
}
|
|
338239
338175
|
case "oauth2": {
|
|
338240
|
-
const { OAuth2AuthProvider } = await import("./oauth2-provider-
|
|
338176
|
+
const { OAuth2AuthProvider } = await import("./oauth2-provider-5JL2PKRR.js");
|
|
338241
338177
|
const provider = new OAuth2AuthProvider(authConfig, options.agentName ?? "unknown", agentCard, options.agentCardUrl);
|
|
338242
338178
|
await provider.initialize();
|
|
338243
338179
|
return provider;
|
|
@@ -340384,7 +340320,8 @@ var LoopDetectionService = class {
|
|
|
340384
340320
|
promptId = "";
|
|
340385
340321
|
userPrompt = "";
|
|
340386
340322
|
// Tool call tracking
|
|
340387
|
-
|
|
340323
|
+
lastToolCallKey = null;
|
|
340324
|
+
toolCallRepetitionCount = 0;
|
|
340388
340325
|
// Content streaming tracking
|
|
340389
340326
|
streamContentHistory = "";
|
|
340390
340327
|
contentStats = /* @__PURE__ */ new Map();
|
|
@@ -340506,31 +340443,14 @@ var LoopDetectionService = class {
|
|
|
340506
340443
|
}
|
|
340507
340444
|
checkToolCallLoop(toolCall) {
|
|
340508
340445
|
const key = this.getToolCallKey(toolCall);
|
|
340509
|
-
this.
|
|
340510
|
-
|
|
340511
|
-
|
|
340512
|
-
this.
|
|
340513
|
-
|
|
340514
|
-
|
|
340515
|
-
|
|
340516
|
-
|
|
340517
|
-
const requiredLength = k * R;
|
|
340518
|
-
if (n3 >= requiredLength) {
|
|
340519
|
-
const cycle = this.toolCallHistory.slice(-k);
|
|
340520
|
-
let isPatternMatch = true;
|
|
340521
|
-
for (let i3 = 0; i3 < requiredLength; i3++) {
|
|
340522
|
-
const indexFromEnd = requiredLength - i3;
|
|
340523
|
-
const actualKey = this.toolCallHistory[n3 - indexFromEnd];
|
|
340524
|
-
const expectedKey = cycle[i3 % k];
|
|
340525
|
-
if (actualKey !== expectedKey) {
|
|
340526
|
-
isPatternMatch = false;
|
|
340527
|
-
break;
|
|
340528
|
-
}
|
|
340529
|
-
}
|
|
340530
|
-
if (isPatternMatch) {
|
|
340531
|
-
return true;
|
|
340532
|
-
}
|
|
340533
|
-
}
|
|
340446
|
+
if (this.lastToolCallKey === key) {
|
|
340447
|
+
this.toolCallRepetitionCount++;
|
|
340448
|
+
} else {
|
|
340449
|
+
this.lastToolCallKey = key;
|
|
340450
|
+
this.toolCallRepetitionCount = 1;
|
|
340451
|
+
}
|
|
340452
|
+
if (this.toolCallRepetitionCount >= TOOL_CALL_LOOP_THRESHOLD) {
|
|
340453
|
+
return true;
|
|
340534
340454
|
}
|
|
340535
340455
|
return false;
|
|
340536
340456
|
}
|
|
@@ -340788,7 +340708,8 @@ ${this.userPrompt}
|
|
|
340788
340708
|
this.loopDetected = false;
|
|
340789
340709
|
}
|
|
340790
340710
|
resetToolCallCount() {
|
|
340791
|
-
this.
|
|
340711
|
+
this.lastToolCallKey = null;
|
|
340712
|
+
this.toolCallRepetitionCount = 0;
|
|
340792
340713
|
}
|
|
340793
340714
|
resetContentTracking(resetHistory = true) {
|
|
340794
340715
|
if (resetHistory) {
|
|
@@ -363695,9 +363616,7 @@ var CheckerRunner = class _CheckerRunner {
|
|
|
363695
363616
|
executeCheckerProcess(checkerPath, input, checkerName) {
|
|
363696
363617
|
return new Promise((resolve29) => {
|
|
363697
363618
|
const child = spawn9(checkerPath, [], {
|
|
363698
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
363699
|
-
cwd: this.contextBuilder.config.getWorkingDir(),
|
|
363700
|
-
env: { ...process.env, ...this.contextBuilder.config.env }
|
|
363619
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
363701
363620
|
});
|
|
363702
363621
|
let stdout = "";
|
|
363703
363622
|
let stderr = "";
|
|
@@ -363804,9 +363723,6 @@ var ContextBuilder = class {
|
|
|
363804
363723
|
constructor(context2) {
|
|
363805
363724
|
this.context = context2;
|
|
363806
363725
|
}
|
|
363807
|
-
get config() {
|
|
363808
|
-
return this.context.config;
|
|
363809
|
-
}
|
|
363810
363726
|
/**
|
|
363811
363727
|
* Builds the full context object with all available data.
|
|
363812
363728
|
*/
|
|
@@ -375909,7 +375825,6 @@ var Config = class {
|
|
|
375909
375825
|
useTerminalBuffer;
|
|
375910
375826
|
useRenderProcess;
|
|
375911
375827
|
shellExecutionConfig;
|
|
375912
|
-
env;
|
|
375913
375828
|
extensionManagement = true;
|
|
375914
375829
|
extensionRegistryURI;
|
|
375915
375830
|
truncateToolOutputThreshold;
|
|
@@ -376076,7 +375991,6 @@ var Config = class {
|
|
|
376076
375991
|
this.checkpointing = params.checkpointing ?? false;
|
|
376077
375992
|
this.proxy = params.proxy;
|
|
376078
375993
|
this.cwd = params.cwd ?? process15.cwd();
|
|
376079
|
-
this.env = params.env;
|
|
376080
375994
|
this.fileDiscoveryService = params.fileDiscoveryService ?? null;
|
|
376081
375995
|
this.bugCommand = params.bugCommand;
|
|
376082
375996
|
this.model = params.model;
|
|
@@ -395937,7 +395851,6 @@ export {
|
|
|
395937
395851
|
isSchemaDepthError,
|
|
395938
395852
|
isInvalidArgumentError,
|
|
395939
395853
|
stripToolCallIdPrefixes,
|
|
395940
|
-
coalesceConsecutiveRoles,
|
|
395941
395854
|
populateToolDisplay,
|
|
395942
395855
|
toolResultDisplayToDisplayContent,
|
|
395943
395856
|
renderDisplayDiff,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
|
|
2
2
|
import {
|
|
3
3
|
runExitCleanup
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JB342GRK.js";
|
|
5
5
|
import {
|
|
6
6
|
RELEASE_CHANNEL_STABILITY,
|
|
7
7
|
debugLogger,
|
|
8
8
|
getChannelFromVersion,
|
|
9
9
|
isGitRepository
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IQDAUFS5.js";
|
|
11
11
|
|
|
12
12
|
// packages/cli/src/utils/installationInfo.ts
|
|
13
13
|
import * as fs from "node:fs";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
|
|
2
2
|
import {
|
|
3
3
|
runExitCleanup
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OFOMMM4A.js";
|
|
5
5
|
import {
|
|
6
6
|
RELEASE_CHANNEL_STABILITY,
|
|
7
7
|
debugLogger,
|
|
8
8
|
getChannelFromVersion,
|
|
9
9
|
isGitRepository
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BG2B4WV5.js";
|
|
11
11
|
|
|
12
12
|
// packages/cli/src/utils/installationInfo.ts
|
|
13
13
|
import * as fs from "node:fs";
|