@google/gemini-cli 0.63.0-nightly.20260928.g2fe7c2d3f → 0.63.0-preview.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 (66) hide show
  1. package/bundle/{chunk-QX7M3XMQ.js → chunk-2J6RC447.js} +3 -3
  2. package/bundle/{chunk-DEI3TS7C.js → chunk-2NCBQURB.js} +125 -47
  3. package/bundle/{chunk-C2KZGMGL.js → chunk-2P4ETAEG.js} +1 -1
  4. package/bundle/{chunk-QYTRARRL.js → chunk-5VYF5TVF.js} +30 -3
  5. package/bundle/{chunk-EATZTV2L.js → chunk-B2C7BQ4Z.js} +7 -7
  6. package/bundle/{chunk-2AXHER6I.js → chunk-BVDTRESW.js} +1 -1
  7. package/bundle/{chunk-I5ZBUXWS.js → chunk-CTL6DZSY.js} +1 -1
  8. package/bundle/{chunk-7ZCWMSGJ.js → chunk-EIMVJG2V.js} +1 -1
  9. package/bundle/{chunk-4SQTLFVK.js → chunk-EWEUWTBB.js} +58 -71
  10. package/bundle/{chunk-LNPKSDNP.js → chunk-GRSO6OI3.js} +7 -7
  11. package/bundle/{chunk-SJFSOFYJ.js → chunk-H4WLRV6U.js} +30 -3
  12. package/bundle/{chunk-ERMD62K5.js → chunk-HBZBBLAV.js} +14860 -7829
  13. package/bundle/{chunk-YZPLV23A.js → chunk-JEUVKR2X.js} +3 -3
  14. package/bundle/{chunk-KRI5JA76.js → chunk-KCB54UJ5.js} +73 -17
  15. package/bundle/{chunk-ZAM747AR.js → chunk-KPPDDNGJ.js} +1 -1
  16. package/bundle/{chunk-SZK5XAFL.js → chunk-NTWFJ2RF.js} +30 -3
  17. package/bundle/{chunk-B3EF23HT.js → chunk-NWSCUKK3.js} +70 -19
  18. package/bundle/{chunk-I7XQQVIO.js → chunk-R6Q6D3UA.js} +1 -1
  19. package/bundle/{chunk-RFR5KZGU.js → chunk-RC6VJ6FT.js} +126 -47
  20. package/bundle/{chunk-PGIM2K4Q.js → chunk-RXHIISMM.js} +1 -1
  21. package/bundle/{chunk-UOXIYBXB.js → chunk-SNGNFODQ.js} +1 -1
  22. package/bundle/{chunk-KSWUQTWU.js → chunk-UEOEM4H5.js} +3 -3
  23. package/bundle/{chunk-4PBNRKYJ.js → chunk-Z5RCAIV5.js} +129 -53
  24. package/bundle/{chunk-BRTA6WWG.js → chunk-ZDQYLJYN.js} +8 -9
  25. package/bundle/{cleanup-5PD3O5L7.js → cleanup-EX2L3L3E.js} +2 -2
  26. package/bundle/{cleanup-6IDD7Q3X.js → cleanup-IT7XR7KS.js} +2 -2
  27. package/bundle/{cleanup-7UL3PRLF.js → cleanup-WWLYKZIX.js} +2 -2
  28. package/bundle/{core-IIFMZU4H.js → core-D5D4MF5H.js} +3 -1
  29. package/bundle/{dist-5HHK4577.js → core-GAJB2LOX.js} +3 -1
  30. package/bundle/{devtoolsService-AK7UU2FI.js → devtoolsService-4YTFHHPN.js} +2 -2
  31. package/bundle/{devtoolsService-A7VWEFDQ.js → devtoolsService-S4ZTRGJL.js} +3 -4
  32. package/bundle/{devtoolsService-67KG4JD7.js → devtoolsService-TJPENQSW.js} +2 -2
  33. package/bundle/{dist-I74UZ4GA.js → dist-MTMOCTIW.js} +3 -1
  34. package/bundle/{gemini-OFIYPHV5.js → gemini-5T5BS7L7.js} +14 -14
  35. package/bundle/{gemini-PGIEQLQD.js → gemini-FHORRYHM.js} +13 -13
  36. package/bundle/{gemini-PLPMSDXJ.js → gemini-UQRS6TBE.js} +198 -214
  37. package/bundle/gemini.js +20 -11
  38. package/bundle/{interactiveCli-JLFFVRVY.js → interactiveCli-5YNYZTMK.js} +18 -10
  39. package/bundle/{interactiveCli-JF6LE6RN.js → interactiveCli-I5K7O5Z6.js} +18 -10
  40. package/bundle/{interactiveCli-OG4JE4CU.js → interactiveCli-WOM6QZHM.js} +302 -313
  41. package/bundle/{liteRtServerManager-4LVWWKUV.js → liteRtServerManager-3N5KI6YS.js} +4 -4
  42. package/bundle/{liteRtServerManager-DVDNFJNH.js → liteRtServerManager-EH2L2UVH.js} +4 -4
  43. package/bundle/{liteRtServerManager-G4WG2Q45.js → liteRtServerManager-ZLIHBLZP.js} +4 -4
  44. package/bundle/{oauth2-provider-KPLVYPVA.js → oauth2-provider-5GFYTXFU.js} +1 -1
  45. package/bundle/{oauth2-provider-IBKEWCFT.js → oauth2-provider-NGSH2JQK.js} +72 -38
  46. package/bundle/{oauth2-provider-CEQ4PAUC.js → oauth2-provider-TA2KRXWQ.js} +1 -1
  47. package/bundle/{start-2A3VVOAH.js → start-CWI6OP6N.js} +6 -6
  48. package/bundle/{start-6PINHVUA.js → start-M3IUNCYH.js} +6 -6
  49. package/bundle/{start-BZAGKSC2.js → start-MWDNIQUY.js} +6 -6
  50. package/package.json +1 -1
  51. package/bundle/chunk-5G7FE6LZ.js +0 -102951
  52. package/bundle/chunk-EORMOPQX.js +0 -17368
  53. package/bundle/chunk-EYGY6SJV.js +0 -512
  54. package/bundle/chunk-KCZCDPS2.js +0 -398
  55. package/bundle/chunk-PAIQESPE.js +0 -118
  56. package/bundle/chunk-TXWIPUPY.js +0 -400484
  57. package/bundle/chunk-VAGYZO4R.js +0 -1571
  58. package/bundle/chunk-VNGBTT2C.js +0 -154
  59. package/bundle/cleanup-UTIIPF3A.js +0 -32
  60. package/bundle/devtoolsService-REQSIEPU.js +0 -4359
  61. package/bundle/dist-QMOHSH2B.js +0 -2248
  62. package/bundle/gemini-I47O5YI2.js +0 -17863
  63. package/bundle/interactiveCli-CJEDKYUL.js +0 -34907
  64. package/bundle/liteRtServerManager-MZO6JMNV.js +0 -65
  65. package/bundle/oauth2-provider-UHJTSOLD.js +0 -235
  66. package/bundle/start-ZRUVAD7P.js +0 -18
@@ -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-C2KZGMGL.js";
5
+ } from "./chunk-2P4ETAEG.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-4PBNRKYJ.js";
17
+ } from "./chunk-Z5RCAIV5.js";
18
18
  import {
19
19
  debugLogger
20
- } from "./chunk-TXWIPUPY.js";
20
+ } from "./chunk-HBZBBLAV.js";
21
21
  import {
22
22
  __toESM
23
23
  } from "./chunk-34MYV7JD.js";
@@ -33,7 +33,7 @@ import {
33
33
  partListUnionToString,
34
34
  require_strip_json_comments,
35
35
  sanitizeFilenamePart
36
- } from "./chunk-ERMD62K5.js";
36
+ } from "./chunk-NWSCUKK3.js";
37
37
  import {
38
38
  __commonJS,
39
39
  __require,
@@ -112,7 +112,7 @@ var require_package = __commonJS({
112
112
  var require_main = __commonJS({
113
113
  "node_modules/dotenv/lib/main.js"(exports, module) {
114
114
  var fs6 = __require("fs");
115
- var path6 = __require("path");
115
+ var path7 = __require("path");
116
116
  var os = __require("os");
117
117
  var crypto = __require("crypto");
118
118
  var packageJson = require_package();
@@ -249,7 +249,7 @@ var require_main = __commonJS({
249
249
  possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
250
250
  }
251
251
  } else {
252
- possibleVaultPath = path6.resolve(process.cwd(), ".env.vault");
252
+ possibleVaultPath = path7.resolve(process.cwd(), ".env.vault");
253
253
  }
254
254
  if (fs6.existsSync(possibleVaultPath)) {
255
255
  return possibleVaultPath;
@@ -257,7 +257,7 @@ var require_main = __commonJS({
257
257
  return null;
258
258
  }
259
259
  function _resolveHome(envPath) {
260
- return envPath[0] === "~" ? path6.join(os.homedir(), envPath.slice(1)) : envPath;
260
+ return envPath[0] === "~" ? path7.join(os.homedir(), envPath.slice(1)) : envPath;
261
261
  }
262
262
  function _configVault(options) {
263
263
  const debug = Boolean(options && options.debug);
@@ -274,7 +274,7 @@ var require_main = __commonJS({
274
274
  return { parsed };
275
275
  }
276
276
  function configDotenv(options) {
277
- const dotenvPath = path6.resolve(process.cwd(), ".env");
277
+ const dotenvPath = path7.resolve(process.cwd(), ".env");
278
278
  let encoding = "utf8";
279
279
  const debug = Boolean(options && options.debug);
280
280
  const quiet = Boolean(options && options.quiet);
@@ -298,13 +298,13 @@ var require_main = __commonJS({
298
298
  }
299
299
  let lastError;
300
300
  const parsedAll = {};
301
- for (const path7 of optionPaths) {
301
+ for (const path8 of optionPaths) {
302
302
  try {
303
- const parsed = DotenvModule.parse(fs6.readFileSync(path7, { encoding }));
303
+ const parsed = DotenvModule.parse(fs6.readFileSync(path8, { encoding }));
304
304
  DotenvModule.populate(parsedAll, parsed, options);
305
305
  } catch (e) {
306
306
  if (debug) {
307
- _debug(`Failed to load ${path7} ${e.message}`);
307
+ _debug(`Failed to load ${path8} ${e.message}`);
308
308
  }
309
309
  lastError = e;
310
310
  }
@@ -319,7 +319,7 @@ var require_main = __commonJS({
319
319
  const shortPaths = [];
320
320
  for (const filePath of optionPaths) {
321
321
  try {
322
- const relative = path6.relative(process.cwd(), filePath);
322
+ const relative = path7.relative(process.cwd(), filePath);
323
323
  shortPaths.push(relative);
324
324
  } catch (e) {
325
325
  if (debug) {
@@ -9456,10 +9456,10 @@ var require_stringify = __commonJS({
9456
9456
  replacer = null;
9457
9457
  indent = EMPTY;
9458
9458
  };
9459
- var join3 = (one, two, gap) => one ? two ? one + two.trim() + LF + gap : one.trimRight() + LF + gap : two ? two.trimRight() + LF + gap : EMPTY;
9459
+ var join4 = (one, two, gap) => one ? two ? one + two.trim() + LF + gap : one.trimRight() + LF + gap : two ? two.trimRight() + LF + gap : EMPTY;
9460
9460
  var join_content = (inside, value, gap) => {
9461
9461
  const comment = process_comments(value, PREFIX_BEFORE, gap + indent, true);
9462
- return join3(comment, inside, gap);
9462
+ return join4(comment, inside, gap);
9463
9463
  };
9464
9464
  var array_stringify = (value, gap) => {
9465
9465
  const deeper_gap = gap + indent;
@@ -9470,7 +9470,7 @@ var require_stringify = __commonJS({
9470
9470
  if (i !== 0) {
9471
9471
  inside += COMMA;
9472
9472
  }
9473
- const before = join3(
9473
+ const before = join4(
9474
9474
  after_comma,
9475
9475
  process_comments(value, BEFORE(i), deeper_gap),
9476
9476
  deeper_gap
@@ -9480,7 +9480,7 @@ var require_stringify = __commonJS({
9480
9480
  inside += process_comments(value, AFTER_VALUE(i), deeper_gap);
9481
9481
  after_comma = process_comments(value, AFTER(i), deeper_gap);
9482
9482
  }
9483
- inside += join3(
9483
+ inside += join4(
9484
9484
  after_comma,
9485
9485
  process_comments(value, PREFIX_AFTER, deeper_gap),
9486
9486
  deeper_gap
@@ -9505,7 +9505,7 @@ var require_stringify = __commonJS({
9505
9505
  inside += COMMA;
9506
9506
  }
9507
9507
  first = false;
9508
- const before = join3(
9508
+ const before = join4(
9509
9509
  after_comma,
9510
9510
  process_comments(value, BEFORE(key), deeper_gap),
9511
9511
  deeper_gap
@@ -9515,7 +9515,7 @@ var require_stringify = __commonJS({
9515
9515
  after_comma = process_comments(value, AFTER(key), deeper_gap);
9516
9516
  };
9517
9517
  keys.forEach(iteratee);
9518
- inside += join3(
9518
+ inside += join4(
9519
9519
  after_comma,
9520
9520
  process_comments(value, PREFIX_AFTER, deeper_gap),
9521
9521
  deeper_gap
@@ -10652,7 +10652,7 @@ async function cleanupToolOutputFiles(settings, debugMode = false, projectTempDi
10652
10652
  // packages/cli/src/config/settings.ts
10653
10653
  var dotenv = __toESM(require_main(), 1);
10654
10654
  import * as fs4 from "node:fs";
10655
- import * as path3 from "node:path";
10655
+ import * as path4 from "node:path";
10656
10656
  import { platform } from "node:os";
10657
10657
  import process2 from "node:process";
10658
10658
  var import_strip_json_comments = __toESM(require_strip_json_comments(), 1);
@@ -15719,7 +15719,7 @@ function resolveEnvVarsInObjectInternal(obj, visited, customEnv) {
15719
15719
  function isPlainObject(item) {
15720
15720
  return !!item && typeof item === "object" && !Array.isArray(item);
15721
15721
  }
15722
- function mergeRecursively(target, source, getMergeStrategyForPath2, path6 = []) {
15722
+ function mergeRecursively(target, source, getMergeStrategyForPath2, path7 = []) {
15723
15723
  for (const key of Object.keys(source)) {
15724
15724
  if (key === "__proto__" || key === "constructor" || key === "prototype") {
15725
15725
  continue;
@@ -15728,7 +15728,7 @@ function mergeRecursively(target, source, getMergeStrategyForPath2, path6 = [])
15728
15728
  if (srcValue === void 0) {
15729
15729
  continue;
15730
15730
  }
15731
- const newPath = [...path6, key];
15731
+ const newPath = [...path7, key];
15732
15732
  const objValue = target[key];
15733
15733
  const mergeStrategy = getMergeStrategyForPath2(newPath);
15734
15734
  if (mergeStrategy === "shallow_merge" /* SHALLOW_MERGE */ && objValue && srcValue) {
@@ -15778,16 +15778,60 @@ function customDeepMerge(getMergeStrategyForPath2, ...sources) {
15778
15778
  // packages/cli/src/utils/commentJson.ts
15779
15779
  var import_comment_json = __toESM(require_src2(), 1);
15780
15780
  import * as fs3 from "node:fs";
15781
+ import * as path3 from "node:path";
15782
+ function isDangerousKey(key) {
15783
+ return key === "__proto__" || key === "constructor" || key === "prototype";
15784
+ }
15785
+ var tempCounter = 0;
15786
+ function writeAtomicSync(filePath, content) {
15787
+ const dir = path3.dirname(filePath);
15788
+ if (!fs3.existsSync(dir)) {
15789
+ fs3.mkdirSync(dir, { recursive: true });
15790
+ }
15791
+ const tempPath = path3.join(
15792
+ dir,
15793
+ `.${path3.basename(filePath)}.${process.pid}.${Date.now()}.${tempCounter++}.tmp`
15794
+ );
15795
+ try {
15796
+ fs3.writeFileSync(tempPath, content, "utf-8");
15797
+ fs3.renameSync(tempPath, filePath);
15798
+ } catch {
15799
+ try {
15800
+ if (fs3.existsSync(tempPath)) {
15801
+ fs3.unlinkSync(tempPath);
15802
+ }
15803
+ } catch {
15804
+ }
15805
+ fs3.writeFileSync(filePath, content, "utf-8");
15806
+ }
15807
+ }
15781
15808
  function updateSettingsFilePreservingFormat(filePath, updates) {
15809
+ const dirPath = path3.dirname(filePath);
15810
+ if (!fs3.existsSync(dirPath)) {
15811
+ fs3.mkdirSync(dirPath, { recursive: true });
15812
+ }
15782
15813
  if (!fs3.existsSync(filePath)) {
15783
- fs3.writeFileSync(filePath, JSON.stringify(updates, null, 2), "utf-8");
15814
+ writeAtomicSync(filePath, JSON.stringify(updates, null, 2));
15784
15815
  return;
15785
15816
  }
15786
- const originalContent = fs3.readFileSync(filePath, "utf-8");
15787
15817
  let parsed;
15788
15818
  try {
15789
- parsed = (0, import_comment_json.parse)(originalContent);
15819
+ const originalContent = fs3.readFileSync(filePath, "utf-8");
15820
+ if (!originalContent.trim()) {
15821
+ parsed = {};
15822
+ } else {
15823
+ const rawParsed = (0, import_comment_json.parse)(originalContent);
15824
+ if (typeof rawParsed !== "object" || rawParsed === null || Array.isArray(rawParsed)) {
15825
+ parsed = {};
15826
+ } else {
15827
+ parsed = rawParsed;
15828
+ }
15829
+ }
15790
15830
  } catch (error) {
15831
+ if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
15832
+ writeAtomicSync(filePath, JSON.stringify(updates, null, 2));
15833
+ return;
15834
+ }
15791
15835
  coreEvents.emitFeedback(
15792
15836
  "error",
15793
15837
  "Error parsing settings file. Please check the JSON syntax.",
@@ -15797,9 +15841,12 @@ function updateSettingsFilePreservingFormat(filePath, updates) {
15797
15841
  }
15798
15842
  const updatedStructure = applyUpdates(parsed, updates);
15799
15843
  const updatedContent = (0, import_comment_json.stringify)(updatedStructure, null, 2);
15800
- fs3.writeFileSync(filePath, updatedContent, "utf-8");
15844
+ writeAtomicSync(filePath, updatedContent);
15801
15845
  }
15802
15846
  function preserveCommentsOnPropertyDeletion(container, propName) {
15847
+ if (isDangerousKey(propName)) {
15848
+ return;
15849
+ }
15803
15850
  const target = container;
15804
15851
  const beforeSym = Symbol.for(`before:${propName}`);
15805
15852
  const afterSym = Symbol.for(`after:${propName}`);
@@ -15838,12 +15885,18 @@ function preserveCommentsOnPropertyDeletion(container, propName) {
15838
15885
  }
15839
15886
  function applyKeyDiff(base, desired) {
15840
15887
  for (const existingKey of Object.getOwnPropertyNames(base)) {
15888
+ if (isDangerousKey(existingKey)) {
15889
+ continue;
15890
+ }
15841
15891
  if (!Object.prototype.hasOwnProperty.call(desired, existingKey)) {
15842
15892
  preserveCommentsOnPropertyDeletion(base, existingKey);
15843
15893
  delete base[existingKey];
15844
15894
  }
15845
15895
  }
15846
15896
  for (const nextKey of Object.getOwnPropertyNames(desired)) {
15897
+ if (isDangerousKey(nextKey)) {
15898
+ continue;
15899
+ }
15847
15900
  const nextVal = desired[nextKey];
15848
15901
  const baseVal = base[nextKey];
15849
15902
  const isObj = typeof nextVal === "object" && nextVal !== null && !Array.isArray(nextVal);
@@ -16079,11 +16132,11 @@ function formatValidationError(error, filePath) {
16079
16132
  const MAX_ERRORS_TO_DISPLAY = 5;
16080
16133
  const displayedIssues = error.issues.slice(0, MAX_ERRORS_TO_DISPLAY);
16081
16134
  for (const issue of displayedIssues) {
16082
- const path6 = issue.path.reduce(
16135
+ const path7 = issue.path.reduce(
16083
16136
  (acc, curr) => typeof curr === "number" ? `${acc}[${curr}]` : `${acc ? acc + "." : ""}${curr}`,
16084
16137
  ""
16085
16138
  );
16086
- lines.push(`Error in: ${path6 || "(root)"}`);
16139
+ lines.push(`Error in: ${path7 || "(root)"}`);
16087
16140
  lines.push(` ${issue.message}`);
16088
16141
  if (issue.code === "invalid_type") {
16089
16142
  const expected = issue.expected;
@@ -16104,11 +16157,11 @@ function formatValidationError(error, filePath) {
16104
16157
  }
16105
16158
 
16106
16159
  // packages/cli/src/config/settings.ts
16107
- function getMergeStrategyForPath(path6) {
16160
+ function getMergeStrategyForPath(path7) {
16108
16161
  let current = void 0;
16109
16162
  let currentSchema = getSettingsSchema();
16110
16163
  let parent = void 0;
16111
- for (const key of path6) {
16164
+ for (const key of path7) {
16112
16165
  if (!currentSchema || !currentSchema[key]) {
16113
16166
  if (parent?.additionalProperties?.mergeStrategy) {
16114
16167
  return parent.additionalProperties.mergeStrategy;
@@ -16122,7 +16175,7 @@ function getMergeStrategyForPath(path6) {
16122
16175
  return current?.mergeStrategy;
16123
16176
  }
16124
16177
  var USER_SETTINGS_PATH = Storage.getGlobalSettingsPath();
16125
- var USER_SETTINGS_DIR = path3.dirname(USER_SETTINGS_PATH);
16178
+ var USER_SETTINGS_DIR = path4.dirname(USER_SETTINGS_PATH);
16126
16179
  var DEFAULT_EXCLUDED_ENV_VARS = [
16127
16180
  "DEBUG",
16128
16181
  "DEBUG_MODE",
@@ -16154,8 +16207,8 @@ function getSystemDefaultsPath() {
16154
16207
  if (process2.env["GEMINI_CLI_SYSTEM_DEFAULTS_PATH"]) {
16155
16208
  return process2.env["GEMINI_CLI_SYSTEM_DEFAULTS_PATH"];
16156
16209
  }
16157
- return path3.join(
16158
- path3.dirname(getSystemSettingsPath()),
16210
+ return path4.join(
16211
+ path4.dirname(getSystemSettingsPath()),
16159
16212
  "system-defaults.json"
16160
16213
  );
16161
16214
  }
@@ -16176,8 +16229,8 @@ var _loadableSettingScopes = [
16176
16229
  function isLoadableSettingScope(scope) {
16177
16230
  return _loadableSettingScopes.includes(scope);
16178
16231
  }
16179
- function setNestedProperty(obj, path6, value) {
16180
- const keys = path6.split(".");
16232
+ function setNestedProperty(obj, path7, value) {
16233
+ const keys = path7.split(".");
16181
16234
  const lastKey = keys.pop();
16182
16235
  if (!lastKey) return;
16183
16236
  let current = obj;
@@ -16282,7 +16335,7 @@ var LoadedSettings = class {
16282
16335
  const adminSchema = adminSettingSchema.properties;
16283
16336
  const adminDefaults = getDefaultsFromSchema(adminSchema);
16284
16337
  merged.admin = customDeepMerge(
16285
- (path6) => getMergeStrategyForPath(["admin", ...path6]),
16338
+ (path7) => getMergeStrategyForPath(["admin", ...path7]),
16286
16339
  adminDefaults,
16287
16340
  this._remoteAdminSettings?.admin ?? {}
16288
16341
  );
@@ -16414,29 +16467,29 @@ var LoadedSettings = class {
16414
16467
  }
16415
16468
  };
16416
16469
  function findEnvFile(startDir, isTrusted, ignoreLocalEnv) {
16417
- let currentDir = path3.resolve(startDir);
16470
+ let currentDir = path4.resolve(startDir);
16418
16471
  while (true) {
16419
16472
  if (isTrusted) {
16420
- const geminiEnvPath = path3.join(currentDir, GEMINI_DIR, ".env");
16473
+ const geminiEnvPath = path4.join(currentDir, GEMINI_DIR, ".env");
16421
16474
  if (fs4.existsSync(geminiEnvPath)) {
16422
16475
  return geminiEnvPath;
16423
16476
  }
16424
16477
  }
16425
- const envPath = path3.join(currentDir, ".env");
16478
+ const envPath = path4.join(currentDir, ".env");
16426
16479
  if (fs4.existsSync(envPath)) {
16427
16480
  if (!ignoreLocalEnv || currentDir === homedir()) {
16428
16481
  return envPath;
16429
16482
  }
16430
16483
  }
16431
- const parentDir = path3.dirname(currentDir);
16484
+ const parentDir = path4.dirname(currentDir);
16432
16485
  if (parentDir === currentDir || !parentDir) {
16433
16486
  if (isTrusted) {
16434
- const homeGeminiEnvPath = path3.join(homedir(), GEMINI_DIR, ".env");
16487
+ const homeGeminiEnvPath = path4.join(homedir(), GEMINI_DIR, ".env");
16435
16488
  if (fs4.existsSync(homeGeminiEnvPath)) {
16436
16489
  return homeGeminiEnvPath;
16437
16490
  }
16438
16491
  }
16439
- const homeEnvPath = path3.join(homedir(), ".env");
16492
+ const homeEnvPath = path4.join(homedir(), ".env");
16440
16493
  if (fs4.existsSync(homeEnvPath)) {
16441
16494
  return homeEnvPath;
16442
16495
  }
@@ -16527,7 +16580,7 @@ function isWorktreeEnabled(settings) {
16527
16580
  return settings.merged.experimental.worktrees;
16528
16581
  }
16529
16582
  function loadSettings(workspaceDir = process2.cwd()) {
16530
- const normalizedWorkspaceDir = path3.resolve(workspaceDir);
16583
+ const normalizedWorkspaceDir = path4.resolve(workspaceDir);
16531
16584
  return settingsCache.getOrCreate(
16532
16585
  normalizedWorkspaceDir,
16533
16586
  () => _doLoadSettings(normalizedWorkspaceDir)
@@ -16637,6 +16690,31 @@ function _doLoadSettings(workspaceDir) {
16637
16690
  systemDefaultSettings = systemDefaultsResult.settings;
16638
16691
  userSettings = userResult.settings;
16639
16692
  workspaceSettings = workspaceResult.settings;
16693
+ const envAuthOverride = process2.env["GEMINI_CLI_AUTH_OVERRIDE"];
16694
+ if (envAuthOverride) {
16695
+ delete process2.env["GEMINI_CLI_AUTH_OVERRIDE"];
16696
+ }
16697
+ const authOverride = envAuthOverride && // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
16698
+ Object.values(AuthType).includes(envAuthOverride) ? (
16699
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
16700
+ envAuthOverride
16701
+ ) : void 0;
16702
+ if (authOverride) {
16703
+ if (!userSettings.security) {
16704
+ userSettings.security = {};
16705
+ }
16706
+ if (!userSettings.security.auth) {
16707
+ userSettings.security.auth = {};
16708
+ }
16709
+ userSettings.security.auth.selectedType = authOverride;
16710
+ if (!userOriginalSettings.security) {
16711
+ userOriginalSettings.security = {};
16712
+ }
16713
+ if (!userOriginalSettings.security.auth) {
16714
+ userOriginalSettings.security.auth = {};
16715
+ }
16716
+ userOriginalSettings.security.auth.selectedType = authOverride;
16717
+ }
16640
16718
  if (userSettings.ui?.theme === "VS") {
16641
16719
  userSettings.ui.theme = DefaultLight.name;
16642
16720
  } else if (userSettings.ui?.theme === "VS2015") {
@@ -16873,7 +16951,7 @@ function migrateDeprecatedSettings(loadedSettings, removeDeprecated = true) {
16873
16951
  function saveSettings(settingsFile) {
16874
16952
  settingsCache.clear();
16875
16953
  try {
16876
- const dirPath = path3.dirname(settingsFile.path);
16954
+ const dirPath = path4.dirname(settingsFile.path);
16877
16955
  if (!fs4.existsSync(dirPath)) {
16878
16956
  fs4.mkdirSync(dirPath, { recursive: true });
16879
16957
  }
@@ -17000,7 +17078,7 @@ function migrateExperimentalSettings(settings, loadedSettings, scope, removeDepr
17000
17078
  }
17001
17079
 
17002
17080
  // packages/cli/src/commands/gemma/constants.ts
17003
- import path4 from "node:path";
17081
+ import path5 from "node:path";
17004
17082
  var LITERT_RELEASE_VERSION = "v0.9.0-alpha03";
17005
17083
  var LITERT_RELEASE_BASE_URL = "https://github.com/google-ai-edge/LiteRT-LM/releases/download";
17006
17084
  var GEMMA_MODEL_NAME = "gemma3-1b-gpu-custom";
@@ -17019,18 +17097,18 @@ var PLATFORM_BINARY_SHA256 = {
17019
17097
  "lit.windows_x86_64.exe": "de82d2829d2fb1cbdb318e2d8a78dc2f9659ff14cb11b2894d1f30e0bfde2bf6"
17020
17098
  };
17021
17099
  function getLiteRtBinDir() {
17022
- return path4.join(Storage.getGlobalGeminiDir(), "bin", "litert");
17100
+ return path5.join(Storage.getGlobalGeminiDir(), "bin", "litert");
17023
17101
  }
17024
17102
  function getPidFilePath() {
17025
- return path4.join(Storage.getGlobalTempDir(), "litert-server.pid");
17103
+ return path5.join(Storage.getGlobalTempDir(), "litert-server.pid");
17026
17104
  }
17027
17105
  function getLogFilePath() {
17028
- return path4.join(Storage.getGlobalTempDir(), "litert-server.log");
17106
+ return path5.join(Storage.getGlobalTempDir(), "litert-server.log");
17029
17107
  }
17030
17108
 
17031
17109
  // packages/cli/src/commands/gemma/platform.ts
17032
17110
  import fs5 from "node:fs";
17033
- import path5 from "node:path";
17111
+ import path6 from "node:path";
17034
17112
  import { execFileSync } from "node:child_process";
17035
17113
  function getUserConfiguredBinaryPath(workspaceDir = process.cwd()) {
17036
17114
  try {
@@ -17090,7 +17168,7 @@ function getBinaryPath(binaryName) {
17090
17168
  }
17091
17169
  const name = binaryName ?? detectPlatform()?.binaryName;
17092
17170
  if (!name) return null;
17093
- return path5.join(getLiteRtBinDir(), name);
17171
+ return path6.join(getLiteRtBinDir(), name);
17094
17172
  }
17095
17173
  function getBinaryDownloadUrl(binaryName) {
17096
17174
  return `${LITERT_RELEASE_BASE_URL}/${LITERT_RELEASE_VERSION}/${binaryName}`;
@@ -17225,7 +17303,7 @@ function isExpectedLiteRtServerCommand(commandLine, options) {
17225
17303
  }
17226
17304
  const normalizedBinaryPath = normalizeProcessValue(options.binaryPath);
17227
17305
  const normalizedBinaryName = normalizeProcessValue(
17228
- path5.basename(options.binaryPath)
17306
+ path6.basename(options.binaryPath)
17229
17307
  );
17230
17308
  return normalizedCommandLine.includes(normalizedBinaryPath) || normalizedCommandLine.includes(normalizedBinaryName);
17231
17309
  }
@@ -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-2AXHER6I.js";
4
+ } from "./chunk-BVDTRESW.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __require
@@ -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-PGIM2K4Q.js";
4
+ } from "./chunk-CTL6DZSY.js";
5
5
  import {
6
6
  RELEASE_CHANNEL_STABILITY,
7
7
  debugLogger,
8
8
  getChannelFromVersion,
9
9
  isGitRepository
10
- } from "./chunk-ERMD62K5.js";
10
+ } from "./chunk-KCB54UJ5.js";
11
11
 
12
12
  // packages/cli/src/utils/installationInfo.ts
13
13
  import * as fs from "node:fs";
@@ -332,10 +332,37 @@ function setUpdateHandler(addItem, setUpdateInfo) {
332
332
  // packages/cli/src/utils/processUtils.ts
333
333
  var RELAUNCH_EXIT_CODE = 199;
334
334
  var isRelaunching = false;
335
- async function relaunchApp() {
335
+ async function relaunchApp(options) {
336
336
  if (isRelaunching) return;
337
337
  isRelaunching = true;
338
338
  await waitForUpdateCompletion();
339
+ if (process.send && !process.env["VITEST"] && options?.overrideAuthType) {
340
+ await new Promise((resolve) => {
341
+ let resolved = false;
342
+ const done = () => {
343
+ if (!resolved) {
344
+ resolved = true;
345
+ resolve();
346
+ }
347
+ };
348
+ const timeout = setTimeout(done, 500);
349
+ try {
350
+ process.send(
351
+ {
352
+ type: "auth-selected-type",
353
+ authType: options.overrideAuthType
354
+ },
355
+ () => {
356
+ clearTimeout(timeout);
357
+ done();
358
+ }
359
+ );
360
+ } catch {
361
+ clearTimeout(timeout);
362
+ done();
363
+ }
364
+ });
365
+ }
339
366
  await runExitCleanup();
340
367
  process.exit(RELAUNCH_EXIT_CODE);
341
368
  }
@@ -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-VAGYZO4R.js";
5
+ } from "./chunk-2P4ETAEG.js";
6
6
  import {
7
7
  AppEvent,
8
8
  appEvents
@@ -63,15 +63,15 @@ import {
63
63
  stripUnsafeCharacters,
64
64
  toCodePoints,
65
65
  validateCustomTheme
66
- } from "./chunk-RFR5KZGU.js";
66
+ } from "./chunk-Z5RCAIV5.js";
67
67
  import {
68
68
  isDevelopment
69
- } from "./chunk-SJFSOFYJ.js";
69
+ } from "./chunk-H4WLRV6U.js";
70
70
  import {
71
71
  emptyIcon,
72
72
  mapCoreStatusToDisplayStatus,
73
73
  require_react
74
- } from "./chunk-ZAM747AR.js";
74
+ } from "./chunk-KPPDDNGJ.js";
75
75
  import {
76
76
  ALL_EDITORS,
77
77
  ApprovalMode,
@@ -238,7 +238,7 @@ import {
238
238
  tokenLimit,
239
239
  uiTelemetryService,
240
240
  unescapePath
241
- } from "./chunk-KRI5JA76.js";
241
+ } from "./chunk-HBZBBLAV.js";
242
242
  import {
243
243
  require_src
244
244
  } from "./chunk-L6PII3GR.js";
@@ -77581,7 +77581,7 @@ var authCommand = {
77581
77581
  import process29 from "node:process";
77582
77582
 
77583
77583
  // packages/cli/src/generated/git-commit.ts
77584
- var GIT_COMMIT_INFO = "2fe7c2d3f";
77584
+ var GIT_COMMIT_INFO = "d75234cae";
77585
77585
 
77586
77586
  // packages/cli/src/ui/utils/historyExportUtils.ts
77587
77587
  import * as fsPromises from "node:fs/promises";
@@ -83362,7 +83362,7 @@ Use /mcp auth <server-name> to authenticate.`
83362
83362
  type: "info",
83363
83363
  text: `Starting OAuth authentication for MCP server '${serverName}'...`
83364
83364
  });
83365
- const { MCPOAuthProvider } = await import("./core-IIFMZU4H.js");
83365
+ const { MCPOAuthProvider } = await import("./core-GAJB2LOX.js");
83366
83366
  let oauthConfig = server.oauth;
83367
83367
  if (!oauthConfig) {
83368
83368
  oauthConfig = { enabled: false };
@@ -5,7 +5,7 @@ import {
5
5
  isTelemetrySdkInitialized,
6
6
  resetBrowserSession,
7
7
  shutdownTelemetry
8
- } from "./chunk-TXWIPUPY.js";
8
+ } from "./chunk-HBZBBLAV.js";
9
9
 
10
10
  // packages/cli/src/utils/cleanup.ts
11
11
  import { promises as fs } from "node:fs";
@@ -5,7 +5,7 @@ import {
5
5
  isTelemetrySdkInitialized,
6
6
  resetBrowserSession,
7
7
  shutdownTelemetry
8
- } from "./chunk-B3EF23HT.js";
8
+ } from "./chunk-KCB54UJ5.js";
9
9
 
10
10
  // packages/cli/src/utils/cleanup.ts
11
11
  import { promises as fs } from "node:fs";
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  CoreToolCallStatus,
4
4
  checkExhaustive
5
- } from "./chunk-ERMD62K5.js";
5
+ } from "./chunk-NWSCUKK3.js";
6
6
  import {
7
7
  __commonJS,
8
8
  __toESM