@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
@@ -1,6 +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
  AuthProviderType,
4
+ AuthType,
4
5
  DEFAULT_MODEL_CONFIGS,
5
6
  DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD,
6
7
  EDITOR_OPTIONS,
@@ -30,7 +31,7 @@ import {
30
31
  partListUnionToString,
31
32
  require_strip_json_comments,
32
33
  sanitizeFilenamePart
33
- } from "./chunk-KRI5JA76.js";
34
+ } from "./chunk-KCB54UJ5.js";
34
35
  import {
35
36
  __commonJS,
36
37
  __require,
@@ -109,7 +110,7 @@ var require_package = __commonJS({
109
110
  var require_main = __commonJS({
110
111
  "node_modules/dotenv/lib/main.js"(exports, module) {
111
112
  var fs6 = __require("fs");
112
- var path6 = __require("path");
113
+ var path7 = __require("path");
113
114
  var os = __require("os");
114
115
  var crypto = __require("crypto");
115
116
  var packageJson = require_package();
@@ -246,7 +247,7 @@ var require_main = __commonJS({
246
247
  possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
247
248
  }
248
249
  } else {
249
- possibleVaultPath = path6.resolve(process.cwd(), ".env.vault");
250
+ possibleVaultPath = path7.resolve(process.cwd(), ".env.vault");
250
251
  }
251
252
  if (fs6.existsSync(possibleVaultPath)) {
252
253
  return possibleVaultPath;
@@ -254,7 +255,7 @@ var require_main = __commonJS({
254
255
  return null;
255
256
  }
256
257
  function _resolveHome(envPath) {
257
- return envPath[0] === "~" ? path6.join(os.homedir(), envPath.slice(1)) : envPath;
258
+ return envPath[0] === "~" ? path7.join(os.homedir(), envPath.slice(1)) : envPath;
258
259
  }
259
260
  function _configVault(options) {
260
261
  const debug = Boolean(options && options.debug);
@@ -271,7 +272,7 @@ var require_main = __commonJS({
271
272
  return { parsed };
272
273
  }
273
274
  function configDotenv(options) {
274
- const dotenvPath = path6.resolve(process.cwd(), ".env");
275
+ const dotenvPath = path7.resolve(process.cwd(), ".env");
275
276
  let encoding = "utf8";
276
277
  const debug = Boolean(options && options.debug);
277
278
  const quiet = Boolean(options && options.quiet);
@@ -295,13 +296,13 @@ var require_main = __commonJS({
295
296
  }
296
297
  let lastError;
297
298
  const parsedAll = {};
298
- for (const path7 of optionPaths) {
299
+ for (const path8 of optionPaths) {
299
300
  try {
300
- const parsed = DotenvModule.parse(fs6.readFileSync(path7, { encoding }));
301
+ const parsed = DotenvModule.parse(fs6.readFileSync(path8, { encoding }));
301
302
  DotenvModule.populate(parsedAll, parsed, options);
302
303
  } catch (e) {
303
304
  if (debug) {
304
- _debug(`Failed to load ${path7} ${e.message}`);
305
+ _debug(`Failed to load ${path8} ${e.message}`);
305
306
  }
306
307
  lastError = e;
307
308
  }
@@ -316,7 +317,7 @@ var require_main = __commonJS({
316
317
  const shortPaths = [];
317
318
  for (const filePath of optionPaths) {
318
319
  try {
319
- const relative = path6.relative(process.cwd(), filePath);
320
+ const relative = path7.relative(process.cwd(), filePath);
320
321
  shortPaths.push(relative);
321
322
  } catch (e) {
322
323
  if (debug) {
@@ -9453,10 +9454,10 @@ var require_stringify = __commonJS({
9453
9454
  replacer = null;
9454
9455
  indent = EMPTY;
9455
9456
  };
9456
- var join3 = (one, two, gap) => one ? two ? one + two.trim() + LF + gap : one.trimRight() + LF + gap : two ? two.trimRight() + LF + gap : EMPTY;
9457
+ var join4 = (one, two, gap) => one ? two ? one + two.trim() + LF + gap : one.trimRight() + LF + gap : two ? two.trimRight() + LF + gap : EMPTY;
9457
9458
  var join_content = (inside, value, gap) => {
9458
9459
  const comment = process_comments(value, PREFIX_BEFORE, gap + indent, true);
9459
- return join3(comment, inside, gap);
9460
+ return join4(comment, inside, gap);
9460
9461
  };
9461
9462
  var array_stringify = (value, gap) => {
9462
9463
  const deeper_gap = gap + indent;
@@ -9467,7 +9468,7 @@ var require_stringify = __commonJS({
9467
9468
  if (i !== 0) {
9468
9469
  inside += COMMA;
9469
9470
  }
9470
- const before = join3(
9471
+ const before = join4(
9471
9472
  after_comma,
9472
9473
  process_comments(value, BEFORE(i), deeper_gap),
9473
9474
  deeper_gap
@@ -9477,7 +9478,7 @@ var require_stringify = __commonJS({
9477
9478
  inside += process_comments(value, AFTER_VALUE(i), deeper_gap);
9478
9479
  after_comma = process_comments(value, AFTER(i), deeper_gap);
9479
9480
  }
9480
- inside += join3(
9481
+ inside += join4(
9481
9482
  after_comma,
9482
9483
  process_comments(value, PREFIX_AFTER, deeper_gap),
9483
9484
  deeper_gap
@@ -9502,7 +9503,7 @@ var require_stringify = __commonJS({
9502
9503
  inside += COMMA;
9503
9504
  }
9504
9505
  first = false;
9505
- const before = join3(
9506
+ const before = join4(
9506
9507
  after_comma,
9507
9508
  process_comments(value, BEFORE(key), deeper_gap),
9508
9509
  deeper_gap
@@ -9512,7 +9513,7 @@ var require_stringify = __commonJS({
9512
9513
  after_comma = process_comments(value, AFTER(key), deeper_gap);
9513
9514
  };
9514
9515
  keys.forEach(iteratee);
9515
- inside += join3(
9516
+ inside += join4(
9516
9517
  after_comma,
9517
9518
  process_comments(value, PREFIX_AFTER, deeper_gap),
9518
9519
  deeper_gap
@@ -10649,7 +10650,7 @@ async function cleanupToolOutputFiles(settings, debugMode = false, projectTempDi
10649
10650
  // packages/cli/src/config/settings.ts
10650
10651
  var dotenv = __toESM(require_main(), 1);
10651
10652
  import * as fs4 from "node:fs";
10652
- import * as path3 from "node:path";
10653
+ import * as path4 from "node:path";
10653
10654
  import { platform } from "node:os";
10654
10655
  import process2 from "node:process";
10655
10656
  var import_strip_json_comments = __toESM(require_strip_json_comments(), 1);
@@ -15716,7 +15717,7 @@ function resolveEnvVarsInObjectInternal(obj, visited, customEnv) {
15716
15717
  function isPlainObject(item) {
15717
15718
  return !!item && typeof item === "object" && !Array.isArray(item);
15718
15719
  }
15719
- function mergeRecursively(target, source, getMergeStrategyForPath2, path6 = []) {
15720
+ function mergeRecursively(target, source, getMergeStrategyForPath2, path7 = []) {
15720
15721
  for (const key of Object.keys(source)) {
15721
15722
  if (key === "__proto__" || key === "constructor" || key === "prototype") {
15722
15723
  continue;
@@ -15725,7 +15726,7 @@ function mergeRecursively(target, source, getMergeStrategyForPath2, path6 = [])
15725
15726
  if (srcValue === void 0) {
15726
15727
  continue;
15727
15728
  }
15728
- const newPath = [...path6, key];
15729
+ const newPath = [...path7, key];
15729
15730
  const objValue = target[key];
15730
15731
  const mergeStrategy = getMergeStrategyForPath2(newPath);
15731
15732
  if (mergeStrategy === "shallow_merge" /* SHALLOW_MERGE */ && objValue && srcValue) {
@@ -15775,16 +15776,60 @@ function customDeepMerge(getMergeStrategyForPath2, ...sources) {
15775
15776
  // packages/cli/src/utils/commentJson.ts
15776
15777
  var import_comment_json = __toESM(require_src2(), 1);
15777
15778
  import * as fs3 from "node:fs";
15779
+ import * as path3 from "node:path";
15780
+ function isDangerousKey(key) {
15781
+ return key === "__proto__" || key === "constructor" || key === "prototype";
15782
+ }
15783
+ var tempCounter = 0;
15784
+ function writeAtomicSync(filePath, content) {
15785
+ const dir = path3.dirname(filePath);
15786
+ if (!fs3.existsSync(dir)) {
15787
+ fs3.mkdirSync(dir, { recursive: true });
15788
+ }
15789
+ const tempPath = path3.join(
15790
+ dir,
15791
+ `.${path3.basename(filePath)}.${process.pid}.${Date.now()}.${tempCounter++}.tmp`
15792
+ );
15793
+ try {
15794
+ fs3.writeFileSync(tempPath, content, "utf-8");
15795
+ fs3.renameSync(tempPath, filePath);
15796
+ } catch {
15797
+ try {
15798
+ if (fs3.existsSync(tempPath)) {
15799
+ fs3.unlinkSync(tempPath);
15800
+ }
15801
+ } catch {
15802
+ }
15803
+ fs3.writeFileSync(filePath, content, "utf-8");
15804
+ }
15805
+ }
15778
15806
  function updateSettingsFilePreservingFormat(filePath, updates) {
15807
+ const dirPath = path3.dirname(filePath);
15808
+ if (!fs3.existsSync(dirPath)) {
15809
+ fs3.mkdirSync(dirPath, { recursive: true });
15810
+ }
15779
15811
  if (!fs3.existsSync(filePath)) {
15780
- fs3.writeFileSync(filePath, JSON.stringify(updates, null, 2), "utf-8");
15812
+ writeAtomicSync(filePath, JSON.stringify(updates, null, 2));
15781
15813
  return;
15782
15814
  }
15783
- const originalContent = fs3.readFileSync(filePath, "utf-8");
15784
15815
  let parsed;
15785
15816
  try {
15786
- parsed = (0, import_comment_json.parse)(originalContent);
15817
+ const originalContent = fs3.readFileSync(filePath, "utf-8");
15818
+ if (!originalContent.trim()) {
15819
+ parsed = {};
15820
+ } else {
15821
+ const rawParsed = (0, import_comment_json.parse)(originalContent);
15822
+ if (typeof rawParsed !== "object" || rawParsed === null || Array.isArray(rawParsed)) {
15823
+ parsed = {};
15824
+ } else {
15825
+ parsed = rawParsed;
15826
+ }
15827
+ }
15787
15828
  } catch (error) {
15829
+ if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
15830
+ writeAtomicSync(filePath, JSON.stringify(updates, null, 2));
15831
+ return;
15832
+ }
15788
15833
  coreEvents.emitFeedback(
15789
15834
  "error",
15790
15835
  "Error parsing settings file. Please check the JSON syntax.",
@@ -15794,9 +15839,12 @@ function updateSettingsFilePreservingFormat(filePath, updates) {
15794
15839
  }
15795
15840
  const updatedStructure = applyUpdates(parsed, updates);
15796
15841
  const updatedContent = (0, import_comment_json.stringify)(updatedStructure, null, 2);
15797
- fs3.writeFileSync(filePath, updatedContent, "utf-8");
15842
+ writeAtomicSync(filePath, updatedContent);
15798
15843
  }
15799
15844
  function preserveCommentsOnPropertyDeletion(container, propName) {
15845
+ if (isDangerousKey(propName)) {
15846
+ return;
15847
+ }
15800
15848
  const target = container;
15801
15849
  const beforeSym = Symbol.for(`before:${propName}`);
15802
15850
  const afterSym = Symbol.for(`after:${propName}`);
@@ -15835,12 +15883,18 @@ function preserveCommentsOnPropertyDeletion(container, propName) {
15835
15883
  }
15836
15884
  function applyKeyDiff(base, desired) {
15837
15885
  for (const existingKey of Object.getOwnPropertyNames(base)) {
15886
+ if (isDangerousKey(existingKey)) {
15887
+ continue;
15888
+ }
15838
15889
  if (!Object.prototype.hasOwnProperty.call(desired, existingKey)) {
15839
15890
  preserveCommentsOnPropertyDeletion(base, existingKey);
15840
15891
  delete base[existingKey];
15841
15892
  }
15842
15893
  }
15843
15894
  for (const nextKey of Object.getOwnPropertyNames(desired)) {
15895
+ if (isDangerousKey(nextKey)) {
15896
+ continue;
15897
+ }
15844
15898
  const nextVal = desired[nextKey];
15845
15899
  const baseVal = base[nextKey];
15846
15900
  const isObj = typeof nextVal === "object" && nextVal !== null && !Array.isArray(nextVal);
@@ -16076,11 +16130,11 @@ function formatValidationError(error, filePath) {
16076
16130
  const MAX_ERRORS_TO_DISPLAY = 5;
16077
16131
  const displayedIssues = error.issues.slice(0, MAX_ERRORS_TO_DISPLAY);
16078
16132
  for (const issue of displayedIssues) {
16079
- const path6 = issue.path.reduce(
16133
+ const path7 = issue.path.reduce(
16080
16134
  (acc, curr) => typeof curr === "number" ? `${acc}[${curr}]` : `${acc ? acc + "." : ""}${curr}`,
16081
16135
  ""
16082
16136
  );
16083
- lines.push(`Error in: ${path6 || "(root)"}`);
16137
+ lines.push(`Error in: ${path7 || "(root)"}`);
16084
16138
  lines.push(` ${issue.message}`);
16085
16139
  if (issue.code === "invalid_type") {
16086
16140
  const expected = issue.expected;
@@ -16101,11 +16155,11 @@ function formatValidationError(error, filePath) {
16101
16155
  }
16102
16156
 
16103
16157
  // packages/cli/src/config/settings.ts
16104
- function getMergeStrategyForPath(path6) {
16158
+ function getMergeStrategyForPath(path7) {
16105
16159
  let current = void 0;
16106
16160
  let currentSchema = getSettingsSchema();
16107
16161
  let parent = void 0;
16108
- for (const key of path6) {
16162
+ for (const key of path7) {
16109
16163
  if (!currentSchema || !currentSchema[key]) {
16110
16164
  if (parent?.additionalProperties?.mergeStrategy) {
16111
16165
  return parent.additionalProperties.mergeStrategy;
@@ -16119,7 +16173,7 @@ function getMergeStrategyForPath(path6) {
16119
16173
  return current?.mergeStrategy;
16120
16174
  }
16121
16175
  var USER_SETTINGS_PATH = Storage.getGlobalSettingsPath();
16122
- var USER_SETTINGS_DIR = path3.dirname(USER_SETTINGS_PATH);
16176
+ var USER_SETTINGS_DIR = path4.dirname(USER_SETTINGS_PATH);
16123
16177
  var DEFAULT_EXCLUDED_ENV_VARS = [
16124
16178
  "DEBUG",
16125
16179
  "DEBUG_MODE",
@@ -16151,8 +16205,8 @@ function getSystemDefaultsPath() {
16151
16205
  if (process2.env["GEMINI_CLI_SYSTEM_DEFAULTS_PATH"]) {
16152
16206
  return process2.env["GEMINI_CLI_SYSTEM_DEFAULTS_PATH"];
16153
16207
  }
16154
- return path3.join(
16155
- path3.dirname(getSystemSettingsPath()),
16208
+ return path4.join(
16209
+ path4.dirname(getSystemSettingsPath()),
16156
16210
  "system-defaults.json"
16157
16211
  );
16158
16212
  }
@@ -16173,8 +16227,8 @@ var _loadableSettingScopes = [
16173
16227
  function isLoadableSettingScope(scope) {
16174
16228
  return _loadableSettingScopes.includes(scope);
16175
16229
  }
16176
- function setNestedProperty(obj, path6, value) {
16177
- const keys = path6.split(".");
16230
+ function setNestedProperty(obj, path7, value) {
16231
+ const keys = path7.split(".");
16178
16232
  const lastKey = keys.pop();
16179
16233
  if (!lastKey) return;
16180
16234
  let current = obj;
@@ -16279,7 +16333,7 @@ var LoadedSettings = class {
16279
16333
  const adminSchema = adminSettingSchema.properties;
16280
16334
  const adminDefaults = getDefaultsFromSchema(adminSchema);
16281
16335
  merged.admin = customDeepMerge(
16282
- (path6) => getMergeStrategyForPath(["admin", ...path6]),
16336
+ (path7) => getMergeStrategyForPath(["admin", ...path7]),
16283
16337
  adminDefaults,
16284
16338
  this._remoteAdminSettings?.admin ?? {}
16285
16339
  );
@@ -16411,29 +16465,29 @@ var LoadedSettings = class {
16411
16465
  }
16412
16466
  };
16413
16467
  function findEnvFile(startDir, isTrusted, ignoreLocalEnv) {
16414
- let currentDir = path3.resolve(startDir);
16468
+ let currentDir = path4.resolve(startDir);
16415
16469
  while (true) {
16416
16470
  if (isTrusted) {
16417
- const geminiEnvPath = path3.join(currentDir, GEMINI_DIR, ".env");
16471
+ const geminiEnvPath = path4.join(currentDir, GEMINI_DIR, ".env");
16418
16472
  if (fs4.existsSync(geminiEnvPath)) {
16419
16473
  return geminiEnvPath;
16420
16474
  }
16421
16475
  }
16422
- const envPath = path3.join(currentDir, ".env");
16476
+ const envPath = path4.join(currentDir, ".env");
16423
16477
  if (fs4.existsSync(envPath)) {
16424
16478
  if (!ignoreLocalEnv || currentDir === homedir()) {
16425
16479
  return envPath;
16426
16480
  }
16427
16481
  }
16428
- const parentDir = path3.dirname(currentDir);
16482
+ const parentDir = path4.dirname(currentDir);
16429
16483
  if (parentDir === currentDir || !parentDir) {
16430
16484
  if (isTrusted) {
16431
- const homeGeminiEnvPath = path3.join(homedir(), GEMINI_DIR, ".env");
16485
+ const homeGeminiEnvPath = path4.join(homedir(), GEMINI_DIR, ".env");
16432
16486
  if (fs4.existsSync(homeGeminiEnvPath)) {
16433
16487
  return homeGeminiEnvPath;
16434
16488
  }
16435
16489
  }
16436
- const homeEnvPath = path3.join(homedir(), ".env");
16490
+ const homeEnvPath = path4.join(homedir(), ".env");
16437
16491
  if (fs4.existsSync(homeEnvPath)) {
16438
16492
  return homeEnvPath;
16439
16493
  }
@@ -16524,7 +16578,7 @@ function isWorktreeEnabled(settings) {
16524
16578
  return settings.merged.experimental.worktrees;
16525
16579
  }
16526
16580
  function loadSettings(workspaceDir = process2.cwd()) {
16527
- const normalizedWorkspaceDir = path3.resolve(workspaceDir);
16581
+ const normalizedWorkspaceDir = path4.resolve(workspaceDir);
16528
16582
  return settingsCache.getOrCreate(
16529
16583
  normalizedWorkspaceDir,
16530
16584
  () => _doLoadSettings(normalizedWorkspaceDir)
@@ -16634,6 +16688,31 @@ function _doLoadSettings(workspaceDir) {
16634
16688
  systemDefaultSettings = systemDefaultsResult.settings;
16635
16689
  userSettings = userResult.settings;
16636
16690
  workspaceSettings = workspaceResult.settings;
16691
+ const envAuthOverride = process2.env["GEMINI_CLI_AUTH_OVERRIDE"];
16692
+ if (envAuthOverride) {
16693
+ delete process2.env["GEMINI_CLI_AUTH_OVERRIDE"];
16694
+ }
16695
+ const authOverride = envAuthOverride && // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
16696
+ Object.values(AuthType).includes(envAuthOverride) ? (
16697
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
16698
+ envAuthOverride
16699
+ ) : void 0;
16700
+ if (authOverride) {
16701
+ if (!userSettings.security) {
16702
+ userSettings.security = {};
16703
+ }
16704
+ if (!userSettings.security.auth) {
16705
+ userSettings.security.auth = {};
16706
+ }
16707
+ userSettings.security.auth.selectedType = authOverride;
16708
+ if (!userOriginalSettings.security) {
16709
+ userOriginalSettings.security = {};
16710
+ }
16711
+ if (!userOriginalSettings.security.auth) {
16712
+ userOriginalSettings.security.auth = {};
16713
+ }
16714
+ userOriginalSettings.security.auth.selectedType = authOverride;
16715
+ }
16637
16716
  if (userSettings.ui?.theme === "VS") {
16638
16717
  userSettings.ui.theme = DefaultLight.name;
16639
16718
  } else if (userSettings.ui?.theme === "VS2015") {
@@ -16870,7 +16949,7 @@ function migrateDeprecatedSettings(loadedSettings, removeDeprecated = true) {
16870
16949
  function saveSettings(settingsFile) {
16871
16950
  settingsCache.clear();
16872
16951
  try {
16873
- const dirPath = path3.dirname(settingsFile.path);
16952
+ const dirPath = path4.dirname(settingsFile.path);
16874
16953
  if (!fs4.existsSync(dirPath)) {
16875
16954
  fs4.mkdirSync(dirPath, { recursive: true });
16876
16955
  }
@@ -16997,7 +17076,7 @@ function migrateExperimentalSettings(settings, loadedSettings, scope, removeDepr
16997
17076
  }
16998
17077
 
16999
17078
  // packages/cli/src/commands/gemma/constants.ts
17000
- import path4 from "node:path";
17079
+ import path5 from "node:path";
17001
17080
  var LITERT_RELEASE_VERSION = "v0.9.0-alpha03";
17002
17081
  var LITERT_RELEASE_BASE_URL = "https://github.com/google-ai-edge/LiteRT-LM/releases/download";
17003
17082
  var GEMMA_MODEL_NAME = "gemma3-1b-gpu-custom";
@@ -17016,18 +17095,18 @@ var PLATFORM_BINARY_SHA256 = {
17016
17095
  "lit.windows_x86_64.exe": "de82d2829d2fb1cbdb318e2d8a78dc2f9659ff14cb11b2894d1f30e0bfde2bf6"
17017
17096
  };
17018
17097
  function getLiteRtBinDir() {
17019
- return path4.join(Storage.getGlobalGeminiDir(), "bin", "litert");
17098
+ return path5.join(Storage.getGlobalGeminiDir(), "bin", "litert");
17020
17099
  }
17021
17100
  function getPidFilePath() {
17022
- return path4.join(Storage.getGlobalTempDir(), "litert-server.pid");
17101
+ return path5.join(Storage.getGlobalTempDir(), "litert-server.pid");
17023
17102
  }
17024
17103
  function getLogFilePath() {
17025
- return path4.join(Storage.getGlobalTempDir(), "litert-server.log");
17104
+ return path5.join(Storage.getGlobalTempDir(), "litert-server.log");
17026
17105
  }
17027
17106
 
17028
17107
  // packages/cli/src/commands/gemma/platform.ts
17029
17108
  import fs5 from "node:fs";
17030
- import path5 from "node:path";
17109
+ import path6 from "node:path";
17031
17110
  import { execFileSync } from "node:child_process";
17032
17111
  function getUserConfiguredBinaryPath(workspaceDir = process.cwd()) {
17033
17112
  try {
@@ -17087,7 +17166,7 @@ function getBinaryPath(binaryName) {
17087
17166
  }
17088
17167
  const name = binaryName ?? detectPlatform()?.binaryName;
17089
17168
  if (!name) return null;
17090
- return path5.join(getLiteRtBinDir(), name);
17169
+ return path6.join(getLiteRtBinDir(), name);
17091
17170
  }
17092
17171
  function getBinaryDownloadUrl(binaryName) {
17093
17172
  return `${LITERT_RELEASE_BASE_URL}/${LITERT_RELEASE_VERSION}/${binaryName}`;
@@ -17222,7 +17301,7 @@ function isExpectedLiteRtServerCommand(commandLine, options) {
17222
17301
  }
17223
17302
  const normalizedBinaryPath = normalizeProcessValue(options.binaryPath);
17224
17303
  const normalizedBinaryName = normalizeProcessValue(
17225
- path5.basename(options.binaryPath)
17304
+ path6.basename(options.binaryPath)
17226
17305
  );
17227
17306
  return normalizedCommandLine.includes(normalizedBinaryPath) || normalizedCommandLine.includes(normalizedBinaryName);
17228
17307
  }
@@ -5,7 +5,7 @@ import {
5
5
  isTelemetrySdkInitialized,
6
6
  resetBrowserSession,
7
7
  shutdownTelemetry
8
- } from "./chunk-ERMD62K5.js";
8
+ } from "./chunk-NWSCUKK3.js";
9
9
 
10
10
  // packages/cli/src/utils/cleanup.ts
11
11
  import { promises as fs } from "node:fs";
@@ -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-PGIM2K4Q.js";
4
+ } from "./chunk-CTL6DZSY.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-UOXIYBXB.js";
5
+ } from "./chunk-SNGNFODQ.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-DEI3TS7C.js";
17
+ } from "./chunk-RC6VJ6FT.js";
18
18
  import {
19
19
  debugLogger
20
- } from "./chunk-ERMD62K5.js";
20
+ } from "./chunk-KCB54UJ5.js";
21
21
  import {
22
22
  __toESM
23
23
  } from "./chunk-34MYV7JD.js";