@google/gemini-cli-a2a-server 0.15.0-nightly.20251110.c0b766ad → 0.15.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.
@@ -1973,7 +1973,7 @@ var require_ms2 = __commonJS({
1973
1973
  var require_pretty_print = __commonJS({
1974
1974
  "node_modules/logform/pretty-print.js"(exports2, module2) {
1975
1975
  "use strict";
1976
- var inspect4 = __require("util").inspect;
1976
+ var inspect5 = __require("util").inspect;
1977
1977
  var format2 = require_format();
1978
1978
  var { LEVEL, MESSAGE, SPLAT } = require_triple_beam();
1979
1979
  module2.exports = format2((info2, opts = {}) => {
@@ -1981,7 +1981,7 @@ var require_pretty_print = __commonJS({
1981
1981
  delete stripped[LEVEL];
1982
1982
  delete stripped[MESSAGE];
1983
1983
  delete stripped[SPLAT];
1984
- info2[MESSAGE] = inspect4(stripped, false, opts.depth || null, opts.colorize);
1984
+ info2[MESSAGE] = inspect5(stripped, false, opts.depth || null, opts.colorize);
1985
1985
  return info2;
1986
1986
  });
1987
1987
  }
@@ -3091,8 +3091,8 @@ var require_buffer_list = __commonJS({
3091
3091
  var _require = __require("buffer");
3092
3092
  var Buffer9 = _require.Buffer;
3093
3093
  var _require2 = __require("util");
3094
- var inspect4 = _require2.inspect;
3095
- var custom2 = inspect4 && inspect4.custom || "inspect";
3094
+ var inspect5 = _require2.inspect;
3095
+ var custom2 = inspect5 && inspect5.custom || "inspect";
3096
3096
  function copyBuffer(src, target, offset) {
3097
3097
  Buffer9.prototype.copy.call(src, target, offset);
3098
3098
  }
@@ -3249,7 +3249,7 @@ var require_buffer_list = __commonJS({
3249
3249
  }, {
3250
3250
  key: custom2,
3251
3251
  value: function value(_, options2) {
3252
- return inspect4(this, _objectSpread(_objectSpread({}, options2), {}, {
3252
+ return inspect5(this, _objectSpread(_objectSpread({}, options2), {}, {
3253
3253
  // Only inspect one level.
3254
3254
  depth: 0,
3255
3255
  // It should not recurse.
@@ -26452,7 +26452,7 @@ var require_object_inspect = __commonJS({
26452
26452
  } else if (indexOf(seen, obj) >= 0) {
26453
26453
  return "[Circular]";
26454
26454
  }
26455
- function inspect4(value, from, noIndent) {
26455
+ function inspect5(value, from, noIndent) {
26456
26456
  if (from) {
26457
26457
  seen = $arrSlice.call(seen);
26458
26458
  seen.push(from);
@@ -26470,7 +26470,7 @@ var require_object_inspect = __commonJS({
26470
26470
  }
26471
26471
  if (typeof obj === "function" && !isRegExp2(obj)) {
26472
26472
  var name4 = nameOf(obj);
26473
- var keys = arrObjKeys(obj, inspect4);
26473
+ var keys = arrObjKeys(obj, inspect5);
26474
26474
  return "[Function" + (name4 ? ": " + name4 : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : "");
26475
26475
  }
26476
26476
  if (isSymbol2(obj)) {
@@ -26494,16 +26494,16 @@ var require_object_inspect = __commonJS({
26494
26494
  if (obj.length === 0) {
26495
26495
  return "[]";
26496
26496
  }
26497
- var xs = arrObjKeys(obj, inspect4);
26497
+ var xs = arrObjKeys(obj, inspect5);
26498
26498
  if (indent && !singleLineValues(xs)) {
26499
26499
  return "[" + indentedJoin(xs, indent) + "]";
26500
26500
  }
26501
26501
  return "[ " + $join.call(xs, ", ") + " ]";
26502
26502
  }
26503
26503
  if (isError2(obj)) {
26504
- var parts2 = arrObjKeys(obj, inspect4);
26504
+ var parts2 = arrObjKeys(obj, inspect5);
26505
26505
  if (!("cause" in Error.prototype) && "cause" in obj && !isEnumerable.call(obj, "cause")) {
26506
- return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect4(obj.cause), parts2), ", ") + " }";
26506
+ return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect5(obj.cause), parts2), ", ") + " }";
26507
26507
  }
26508
26508
  if (parts2.length === 0) {
26509
26509
  return "[" + String(obj) + "]";
@@ -26521,7 +26521,7 @@ var require_object_inspect = __commonJS({
26521
26521
  var mapParts = [];
26522
26522
  if (mapForEach) {
26523
26523
  mapForEach.call(obj, function(value, key) {
26524
- mapParts.push(inspect4(key, obj, true) + " => " + inspect4(value, obj));
26524
+ mapParts.push(inspect5(key, obj, true) + " => " + inspect5(value, obj));
26525
26525
  });
26526
26526
  }
26527
26527
  return collectionOf("Map", mapSize.call(obj), mapParts, indent);
@@ -26530,7 +26530,7 @@ var require_object_inspect = __commonJS({
26530
26530
  var setParts = [];
26531
26531
  if (setForEach) {
26532
26532
  setForEach.call(obj, function(value) {
26533
- setParts.push(inspect4(value, obj));
26533
+ setParts.push(inspect5(value, obj));
26534
26534
  });
26535
26535
  }
26536
26536
  return collectionOf("Set", setSize.call(obj), setParts, indent);
@@ -26545,16 +26545,16 @@ var require_object_inspect = __commonJS({
26545
26545
  return weakCollectionOf("WeakRef");
26546
26546
  }
26547
26547
  if (isNumber4(obj)) {
26548
- return markBoxed(inspect4(Number(obj)));
26548
+ return markBoxed(inspect5(Number(obj)));
26549
26549
  }
26550
26550
  if (isBigInt(obj)) {
26551
- return markBoxed(inspect4(bigIntValueOf.call(obj)));
26551
+ return markBoxed(inspect5(bigIntValueOf.call(obj)));
26552
26552
  }
26553
26553
  if (isBoolean2(obj)) {
26554
26554
  return markBoxed(booleanValueOf.call(obj));
26555
26555
  }
26556
26556
  if (isString2(obj)) {
26557
- return markBoxed(inspect4(String(obj)));
26557
+ return markBoxed(inspect5(String(obj)));
26558
26558
  }
26559
26559
  if (typeof window !== "undefined" && obj === window) {
26560
26560
  return "{ [object Window] }";
@@ -26563,7 +26563,7 @@ var require_object_inspect = __commonJS({
26563
26563
  return "{ [object globalThis] }";
26564
26564
  }
26565
26565
  if (!isDate2(obj) && !isRegExp2(obj)) {
26566
- var ys = arrObjKeys(obj, inspect4);
26566
+ var ys = arrObjKeys(obj, inspect5);
26567
26567
  var isPlainObject4 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
26568
26568
  var protoTag = obj instanceof Object ? "" : "null prototype";
26569
26569
  var stringTag = !isPlainObject4 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
@@ -26817,13 +26817,13 @@ var require_object_inspect = __commonJS({
26817
26817
  var lineJoiner = "\n" + indent.prev + indent.base;
26818
26818
  return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev;
26819
26819
  }
26820
- function arrObjKeys(obj, inspect4) {
26820
+ function arrObjKeys(obj, inspect5) {
26821
26821
  var isArr = isArray2(obj);
26822
26822
  var xs = [];
26823
26823
  if (isArr) {
26824
26824
  xs.length = obj.length;
26825
26825
  for (var i3 = 0; i3 < obj.length; i3++) {
26826
- xs[i3] = has(obj, i3) ? inspect4(obj[i3], obj) : "";
26826
+ xs[i3] = has(obj, i3) ? inspect5(obj[i3], obj) : "";
26827
26827
  }
26828
26828
  }
26829
26829
  var syms = typeof gOPS === "function" ? gOPS(obj) : [];
@@ -26844,15 +26844,15 @@ var require_object_inspect = __commonJS({
26844
26844
  if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) {
26845
26845
  continue;
26846
26846
  } else if ($test.call(/[^\w$]/, key)) {
26847
- xs.push(inspect4(key, obj) + ": " + inspect4(obj[key], obj));
26847
+ xs.push(inspect5(key, obj) + ": " + inspect5(obj[key], obj));
26848
26848
  } else {
26849
- xs.push(key + ": " + inspect4(obj[key], obj));
26849
+ xs.push(key + ": " + inspect5(obj[key], obj));
26850
26850
  }
26851
26851
  }
26852
26852
  if (typeof gOPS === "function") {
26853
26853
  for (var j = 0; j < syms.length; j++) {
26854
26854
  if (isEnumerable.call(obj, syms[j])) {
26855
- xs.push("[" + inspect4(syms[j]) + "]: " + inspect4(obj[syms[j]], obj));
26855
+ xs.push("[" + inspect5(syms[j]) + "]: " + inspect5(obj[syms[j]], obj));
26856
26856
  }
26857
26857
  }
26858
26858
  }
@@ -26865,7 +26865,7 @@ var require_object_inspect = __commonJS({
26865
26865
  var require_side_channel_list = __commonJS({
26866
26866
  "node_modules/side-channel-list/index.js"(exports2, module2) {
26867
26867
  "use strict";
26868
- var inspect4 = require_object_inspect();
26868
+ var inspect5 = require_object_inspect();
26869
26869
  var $TypeError = require_type();
26870
26870
  var listGetNode = function(list3, key, isDelete) {
26871
26871
  var prev = list3;
@@ -26919,7 +26919,7 @@ var require_side_channel_list = __commonJS({
26919
26919
  var channel = {
26920
26920
  assert: function(key) {
26921
26921
  if (!channel.has(key)) {
26922
- throw new $TypeError("Side channel does not contain " + inspect4(key));
26922
+ throw new $TypeError("Side channel does not contain " + inspect5(key));
26923
26923
  }
26924
26924
  },
26925
26925
  "delete": function(key) {
@@ -27779,7 +27779,7 @@ var require_side_channel_map = __commonJS({
27779
27779
  "use strict";
27780
27780
  var GetIntrinsic = require_get_intrinsic();
27781
27781
  var callBound = require_call_bound();
27782
- var inspect4 = require_object_inspect();
27782
+ var inspect5 = require_object_inspect();
27783
27783
  var $TypeError = require_type();
27784
27784
  var $Map = GetIntrinsic("%Map%", true);
27785
27785
  var $mapGet = callBound("Map.prototype.get", true);
@@ -27793,7 +27793,7 @@ var require_side_channel_map = __commonJS({
27793
27793
  var channel = {
27794
27794
  assert: function(key) {
27795
27795
  if (!channel.has(key)) {
27796
- throw new $TypeError("Side channel does not contain " + inspect4(key));
27796
+ throw new $TypeError("Side channel does not contain " + inspect5(key));
27797
27797
  }
27798
27798
  },
27799
27799
  "delete": function(key) {
@@ -27835,7 +27835,7 @@ var require_side_channel_weakmap = __commonJS({
27835
27835
  "use strict";
27836
27836
  var GetIntrinsic = require_get_intrinsic();
27837
27837
  var callBound = require_call_bound();
27838
- var inspect4 = require_object_inspect();
27838
+ var inspect5 = require_object_inspect();
27839
27839
  var getSideChannelMap = require_side_channel_map();
27840
27840
  var $TypeError = require_type();
27841
27841
  var $WeakMap = GetIntrinsic("%WeakMap%", true);
@@ -27851,7 +27851,7 @@ var require_side_channel_weakmap = __commonJS({
27851
27851
  var channel = {
27852
27852
  assert: function(key) {
27853
27853
  if (!channel.has(key)) {
27854
- throw new $TypeError("Side channel does not contain " + inspect4(key));
27854
+ throw new $TypeError("Side channel does not contain " + inspect5(key));
27855
27855
  }
27856
27856
  },
27857
27857
  "delete": function(key) {
@@ -27907,7 +27907,7 @@ var require_side_channel = __commonJS({
27907
27907
  "node_modules/side-channel/index.js"(exports2, module2) {
27908
27908
  "use strict";
27909
27909
  var $TypeError = require_type();
27910
- var inspect4 = require_object_inspect();
27910
+ var inspect5 = require_object_inspect();
27911
27911
  var getSideChannelList = require_side_channel_list();
27912
27912
  var getSideChannelMap = require_side_channel_map();
27913
27913
  var getSideChannelWeakMap = require_side_channel_weakmap();
@@ -27917,7 +27917,7 @@ var require_side_channel = __commonJS({
27917
27917
  var channel = {
27918
27918
  assert: function(key) {
27919
27919
  if (!channel.has(key)) {
27920
- throw new $TypeError("Side channel does not contain " + inspect4(key));
27920
+ throw new $TypeError("Side channel does not contain " + inspect5(key));
27921
27921
  }
27922
27922
  },
27923
27923
  "delete": function(key) {
@@ -63543,11 +63543,11 @@ var require_XMLParser = __commonJS({
63543
63543
  // node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js
63544
63544
  var require_orderedJs2Xml = __commonJS({
63545
63545
  "node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports2, module2) {
63546
- var EOL4 = "\n";
63546
+ var EOL3 = "\n";
63547
63547
  function toXml(jArray, options2) {
63548
63548
  let indentation = "";
63549
63549
  if (options2.format && options2.indentBy.length > 0) {
63550
- indentation = EOL4;
63550
+ indentation = EOL3;
63551
63551
  }
63552
63552
  return arrToStr(jArray, options2, "", indentation);
63553
63553
  }
@@ -65770,10 +65770,10 @@ var require_universalify2 = __commonJS({
65770
65770
  // node_modules/jsonfile/utils.js
65771
65771
  var require_utils8 = __commonJS({
65772
65772
  "node_modules/jsonfile/utils.js"(exports2, module2) {
65773
- function stringify5(obj, { EOL: EOL4 = "\n", finalEOL = true, replacer = null, spaces } = {}) {
65774
- const EOF3 = finalEOL ? EOL4 : "";
65773
+ function stringify5(obj, { EOL: EOL3 = "\n", finalEOL = true, replacer = null, spaces } = {}) {
65774
+ const EOF3 = finalEOL ? EOL3 : "";
65775
65775
  const str = JSON.stringify(obj, replacer, spaces);
65776
- return str.replace(/\n/g, EOL4) + EOF3;
65776
+ return str.replace(/\n/g, EOL3) + EOF3;
65777
65777
  }
65778
65778
  function stripBom(content) {
65779
65779
  if (Buffer.isBuffer(content)) content = content.toString("utf8");
@@ -218884,7 +218884,7 @@ var require_data_url = __commonJS({
218884
218884
  var require_webidl = __commonJS({
218885
218885
  "node_modules/undici/lib/web/webidl/index.js"(exports2, module2) {
218886
218886
  "use strict";
218887
- var { types: types4, inspect: inspect4 } = __require("node:util");
218887
+ var { types: types4, inspect: inspect5 } = __require("node:util");
218888
218888
  var { markAsUncloneable } = __require("node:worker_threads");
218889
218889
  var UNDEFINED = 1;
218890
218890
  var BOOLEAN = 2;
@@ -219076,7 +219076,7 @@ var require_webidl = __commonJS({
219076
219076
  case SYMBOL:
219077
219077
  return `Symbol(${V2.description})`;
219078
219078
  case OBJECT:
219079
- return inspect4(V2);
219079
+ return inspect5(V2);
219080
219080
  case STRING:
219081
219081
  return `"${V2}"`;
219082
219082
  case BIGINT:
@@ -274152,6 +274152,7 @@ import { homedir as homedir5 } from "node:os";
274152
274152
 
274153
274153
  // packages/core/dist/src/config/config.js
274154
274154
  import * as path63 from "node:path";
274155
+ import { inspect as inspect4 } from "node:util";
274155
274156
  import process22 from "node:process";
274156
274157
 
274157
274158
  // node_modules/@google/genai/dist/node/index.mjs
@@ -294032,6 +294033,7 @@ function getCommonAttributes(config2) {
294032
294033
  return {
294033
294034
  "session.id": config2.getSessionId(),
294034
294035
  "installation.id": installationManager.getInstallationId(),
294036
+ interactive: config2.isInteractive(),
294035
294037
  ...email && { "user.email": email }
294036
294038
  };
294037
294039
  }
@@ -295871,6 +295873,7 @@ var EventMetadataKey;
295871
295873
  EventMetadataKey2[EventMetadataKey2["GEMINI_CLI_AGENT_RECOVERY_REASON"] = 122] = "GEMINI_CLI_AGENT_RECOVERY_REASON";
295872
295874
  EventMetadataKey2[EventMetadataKey2["GEMINI_CLI_AGENT_RECOVERY_DURATION_MS"] = 123] = "GEMINI_CLI_AGENT_RECOVERY_DURATION_MS";
295873
295875
  EventMetadataKey2[EventMetadataKey2["GEMINI_CLI_AGENT_RECOVERY_SUCCESS"] = 124] = "GEMINI_CLI_AGENT_RECOVERY_SUCCESS";
295876
+ EventMetadataKey2[EventMetadataKey2["GEMINI_CLI_INTERACTIVE"] = 125] = "GEMINI_CLI_INTERACTIVE";
295874
295877
  })(EventMetadataKey || (EventMetadataKey = {}));
295875
295878
 
295876
295879
  // node_modules/mnemonist/index.mjs
@@ -295896,8 +295899,8 @@ var Float64Vector = import_vector.default.Float64Vector;
295896
295899
  var PointerVector = import_vector.default.PointerVector;
295897
295900
 
295898
295901
  // packages/core/dist/src/generated/git-commit.js
295899
- var GIT_COMMIT_INFO = "c0b766ad";
295900
- var CLI_VERSION = "0.15.0-nightly.20251110.c0b766ad";
295902
+ var GIT_COMMIT_INFO = "2abc288c";
295903
+ var CLI_VERSION = "0.15.0-preview.0";
295901
295904
 
295902
295905
  // packages/core/dist/src/ide/detect-ide.js
295903
295906
  var IDE_DEFINITIONS = {
@@ -296071,7 +296074,8 @@ var ClearcutLogger = class _ClearcutLogger {
296071
296074
  this.events.push([
296072
296075
  {
296073
296076
  event_time_ms: Date.now(),
296074
- source_extension_json: safeJsonStringify(event)
296077
+ source_extension_json: safeJsonStringify(event),
296078
+ gws_experiment: this.config?.getExperiments()?.experimentIds ?? []
296075
296079
  }
296076
296080
  ]);
296077
296081
  if (wasAtCapacity && this.config?.getDebugMode()) {
@@ -296954,6 +296958,10 @@ var ClearcutLogger = class _ClearcutLogger {
296954
296958
  {
296955
296959
  gemini_cli_key: EventMetadataKey.GEMINI_CLI_USER_SETTINGS,
296956
296960
  value: this.getConfigJson()
296961
+ },
296962
+ {
296963
+ gemini_cli_key: EventMetadataKey.GEMINI_CLI_INTERACTIVE,
296964
+ value: this.config?.isInteractive().toString() ?? "false"
296957
296965
  }
296958
296966
  ];
296959
296967
  return [...data, ...defaultLogMetadata];
@@ -298697,7 +298705,7 @@ async function createContentGenerator(config2, gcConfig, sessionId2) {
298697
298705
  if (gcConfig.fakeResponses) {
298698
298706
  return FakeContentGenerator.fromFile(gcConfig.fakeResponses);
298699
298707
  }
298700
- const version3 = "0.15.0-nightly.20251110.c0b766ad";
298708
+ const version3 = "0.15.0-preview.0";
298701
298709
  const userAgent = `GeminiCLI/${version3} (${process.platform}; ${process.arch})`;
298702
298710
  const baseHeaders = {
298703
298711
  "User-Agent": userAgent
@@ -307601,7 +307609,6 @@ var GrepTool = class _GrepTool extends BaseDeclarativeTool {
307601
307609
  // packages/core/dist/src/tools/ripGrep.js
307602
307610
  import fs31 from "node:fs";
307603
307611
  import path33 from "node:path";
307604
- import { EOL as EOL2 } from "node:os";
307605
307612
  import { spawn as spawn4 } from "node:child_process";
307606
307613
 
307607
307614
  // node_modules/@joshua.litt/get-ripgrep/dist/index.js
@@ -320734,46 +320741,37 @@ var GrepToolInvocation2 = class extends BaseToolInvocation {
320734
320741
  };
320735
320742
  }
320736
320743
  }
320737
- parseRipgrepOutput(output, basePath) {
320744
+ parseRipgrepJsonOutput(output, basePath) {
320738
320745
  const results = [];
320739
320746
  if (!output)
320740
320747
  return results;
320741
- const lines = output.split(EOL2);
320748
+ const lines = output.trim().split("\n");
320742
320749
  for (const line of lines) {
320743
320750
  if (!line.trim())
320744
320751
  continue;
320745
- const firstColonIndex = line.indexOf(":");
320746
- if (firstColonIndex === -1)
320747
- continue;
320748
- const secondColonIndex = line.indexOf(":", firstColonIndex + 1);
320749
- if (secondColonIndex === -1)
320750
- continue;
320751
- const filePathRaw = line.substring(0, firstColonIndex);
320752
- const lineNumberStr = line.substring(firstColonIndex + 1, secondColonIndex);
320753
- const lineContent = line.substring(secondColonIndex + 1);
320754
- const lineNumber = parseInt(lineNumberStr, 10);
320755
- if (!isNaN(lineNumber)) {
320756
- const absoluteFilePath = path33.resolve(basePath, filePathRaw);
320757
- const relativeFilePath = path33.relative(basePath, absoluteFilePath);
320758
- results.push({
320759
- filePath: relativeFilePath || path33.basename(absoluteFilePath),
320760
- lineNumber,
320761
- line: lineContent
320762
- });
320752
+ try {
320753
+ const json = JSON.parse(line);
320754
+ if (json.type === "match") {
320755
+ const match2 = json.data;
320756
+ if (match2.path?.text && match2.lines?.text) {
320757
+ const absoluteFilePath = path33.resolve(basePath, match2.path.text);
320758
+ const relativeFilePath = path33.relative(basePath, absoluteFilePath);
320759
+ results.push({
320760
+ filePath: relativeFilePath || path33.basename(absoluteFilePath),
320761
+ lineNumber: match2.line_number,
320762
+ line: match2.lines.text.trimEnd()
320763
+ });
320764
+ }
320765
+ }
320766
+ } catch (error) {
320767
+ debugLogger.warn(`Failed to parse ripgrep JSON line: ${line}`, error);
320763
320768
  }
320764
320769
  }
320765
320770
  return results;
320766
320771
  }
320767
320772
  async performRipgrepSearch(options2) {
320768
320773
  const { pattern, path: absolutePath, include } = options2;
320769
- const rgArgs = [
320770
- "--line-number",
320771
- "--no-heading",
320772
- "--with-filename",
320773
- "--ignore-case",
320774
- "--regexp",
320775
- pattern
320776
- ];
320774
+ const rgArgs = ["--json", "--ignore-case", "--regexp", pattern];
320777
320775
  if (include) {
320778
320776
  rgArgs.push("--glob", include);
320779
320777
  }
@@ -320825,7 +320823,7 @@ var GrepToolInvocation2 = class extends BaseToolInvocation {
320825
320823
  }
320826
320824
  });
320827
320825
  });
320828
- return this.parseRipgrepOutput(output, absolutePath);
320826
+ return this.parseRipgrepJsonOutput(output, absolutePath);
320829
320827
  } catch (error) {
320830
320828
  console.error(`GrepLogic: ripgrep failed: ${getErrorMessage(error)}`);
320831
320829
  throw error;
@@ -329868,19 +329866,27 @@ function isModifiableDeclarativeTool(tool) {
329868
329866
  return "getModifyContext" in tool;
329869
329867
  }
329870
329868
  function createTempFilesForModify(currentContent, proposedContent, file_path) {
329871
- const tempDir = os11.tmpdir();
329872
- const diffDir = path38.join(tempDir, "gemini-cli-tool-modify-diffs");
329873
- if (!fs36.existsSync(diffDir)) {
329874
- fs36.mkdirSync(diffDir, { recursive: true });
329869
+ const diffDir = fs36.mkdtempSync(path38.join(os11.tmpdir(), "gemini-cli-tool-modify-"));
329870
+ try {
329871
+ fs36.chmodSync(diffDir, 448);
329872
+ } catch (e2) {
329873
+ debugLogger.error(`Error setting permissions on temp diff directory: ${diffDir}`, e2);
329874
+ throw e2;
329875
329875
  }
329876
329876
  const ext2 = path38.extname(file_path);
329877
329877
  const fileName = path38.basename(file_path, ext2);
329878
329878
  const timestamp = Date.now();
329879
329879
  const tempOldPath = path38.join(diffDir, `gemini-cli-modify-${fileName}-old-${timestamp}${ext2}`);
329880
329880
  const tempNewPath = path38.join(diffDir, `gemini-cli-modify-${fileName}-new-${timestamp}${ext2}`);
329881
- fs36.writeFileSync(tempOldPath, currentContent, "utf8");
329882
- fs36.writeFileSync(tempNewPath, proposedContent, "utf8");
329883
- return { oldPath: tempOldPath, newPath: tempNewPath };
329881
+ fs36.writeFileSync(tempOldPath, currentContent, {
329882
+ encoding: "utf8",
329883
+ mode: 384
329884
+ });
329885
+ fs36.writeFileSync(tempNewPath, proposedContent, {
329886
+ encoding: "utf8",
329887
+ mode: 384
329888
+ });
329889
+ return { oldPath: tempOldPath, newPath: tempNewPath, dirPath: diffDir };
329884
329890
  }
329885
329891
  function getUpdatedParams(tmpOldPath, tempNewPath, originalParams, modifyContext) {
329886
329892
  let oldContent = "";
@@ -329903,7 +329909,7 @@ function getUpdatedParams(tmpOldPath, tempNewPath, originalParams, modifyContext
329903
329909
  const updatedDiff = createPatch(path38.basename(modifyContext.getFilePath(originalParams)), oldContent, newContent, "Current", "Proposed", DEFAULT_DIFF_OPTIONS);
329904
329910
  return { updatedParams, updatedDiff };
329905
329911
  }
329906
- function deleteTempFiles(oldPath, newPath) {
329912
+ function deleteTempFiles(oldPath, newPath, dirPath) {
329907
329913
  try {
329908
329914
  fs36.unlinkSync(oldPath);
329909
329915
  } catch {
@@ -329914,17 +329920,24 @@ function deleteTempFiles(oldPath, newPath) {
329914
329920
  } catch {
329915
329921
  debugLogger.error(`Error deleting temp diff file: ${newPath}`);
329916
329922
  }
329923
+ try {
329924
+ fs36.rmdirSync(dirPath);
329925
+ } catch {
329926
+ debugLogger.error(`Error deleting temp diff directory: ${dirPath}`);
329927
+ }
329917
329928
  }
329918
- async function modifyWithEditor(originalParams, modifyContext, editorType, _abortSignal, onEditorClose) {
329919
- const currentContent = await modifyContext.getCurrentContent(originalParams);
329920
- const proposedContent = await modifyContext.getProposedContent(originalParams);
329921
- const { oldPath, newPath } = createTempFilesForModify(currentContent, proposedContent, modifyContext.getFilePath(originalParams));
329929
+ async function modifyWithEditor(originalParams, modifyContext, editorType, _abortSignal, onEditorClose, overrides) {
329930
+ const hasCurrentOverride = overrides !== void 0 && "currentContent" in overrides;
329931
+ const hasProposedOverride = overrides !== void 0 && "proposedContent" in overrides;
329932
+ const currentContent = hasCurrentOverride ? overrides.currentContent ?? "" : await modifyContext.getCurrentContent(originalParams);
329933
+ const proposedContent = hasProposedOverride ? overrides.proposedContent ?? "" : await modifyContext.getProposedContent(originalParams);
329934
+ const { oldPath, newPath, dirPath } = createTempFilesForModify(currentContent ?? "", proposedContent ?? "", modifyContext.getFilePath(originalParams));
329922
329935
  try {
329923
329936
  await openDiff(oldPath, newPath, editorType, onEditorClose);
329924
329937
  const result = getUpdatedParams(oldPath, newPath, originalParams, modifyContext);
329925
329938
  return result;
329926
329939
  } finally {
329927
- deleteTempFiles(oldPath, newPath);
329940
+ deleteTempFiles(oldPath, newPath, dirPath);
329928
329941
  }
329929
329942
  }
329930
329943
 
@@ -330906,14 +330919,7 @@ var EditToolInvocation2 = class extends BaseToolInvocation {
330906
330919
  currentContent: contentForLlmEditFixer,
330907
330920
  abortSignal
330908
330921
  });
330909
- const secondError = getErrorReplaceResult(
330910
- params,
330911
- secondAttemptResult.occurrences,
330912
- 1,
330913
- // expectedReplacements is always 1 for smart_edit
330914
- secondAttemptResult.finalOldString,
330915
- secondAttemptResult.finalNewString
330916
- );
330922
+ const secondError = getErrorReplaceResult(params, secondAttemptResult.occurrences, params.expected_replacements ?? 1, secondAttemptResult.finalOldString, secondAttemptResult.finalNewString);
330917
330923
  if (secondError) {
330918
330924
  const event2 = new SmartEditCorrectionEvent("failure");
330919
330925
  logSmartEditCorrectionEvent(this.config, event2);
@@ -330944,7 +330950,7 @@ var EditToolInvocation2 = class extends BaseToolInvocation {
330944
330950
  * @throws File system errors if reading the file fails unexpectedly (e.g., permissions)
330945
330951
  */
330946
330952
  async calculateEdit(params, abortSignal) {
330947
- const expectedReplacements = 1;
330953
+ const expectedReplacements = params.expected_replacements ?? 1;
330948
330954
  let currentContent = null;
330949
330955
  let fileExists2 = false;
330950
330956
  let originalLineEnding = "\n";
@@ -331195,7 +331201,7 @@ var SmartEditTool = class _SmartEditTool extends BaseDeclarativeTool {
331195
331201
  super(
331196
331202
  _SmartEditTool.Name,
331197
331203
  "Edit",
331198
- `Replaces text within a file. Replaces a single occurrence. This tool requires providing significant context around the change to ensure precise targeting. Always use the ${READ_FILE_TOOL_NAME} tool to examine the file's current content before attempting a text replacement.
331204
+ `Replaces text within a file. By default, replaces a single occurrence, but can replace multiple occurrences when \`expected_replacements\` is specified. This tool requires providing significant context around the change to ensure precise targeting. Always use the ${READ_FILE_TOOL_NAME} tool to examine the file's current content before attempting a text replacement.
331199
331205
 
331200
331206
  The user has the ability to modify the \`new_string\` content. If modified, this will be stated in the response.
331201
331207
 
@@ -331206,7 +331212,7 @@ var SmartEditTool = class _SmartEditTool extends BaseDeclarativeTool {
331206
331212
  4. NEVER escape \`old_string\` or \`new_string\`, that would break the exact literal text requirement.
331207
331213
  **Important:** If ANY of the above are not satisfied, the tool will fail. CRITICAL for \`old_string\`: Must uniquely identify the single instance to change. Include at least 3 lines of context BEFORE and AFTER the target text, matching whitespace and indentation precisely. If this string matches multiple locations, or does not match exactly, the tool will fail.
331208
331214
  5. Prefer to break down complex and long changes into multiple smaller atomic calls to this tool. Always check the content of the file after changes or not finding a string to match.
331209
- **Multiple replacements:** If there are multiple and ambiguous occurences of the \`old_string\` in the file, the tool will also fail.`,
331215
+ **Multiple replacements:** Set \`expected_replacements\` to the number of occurrences you want to replace. The tool will replace ALL occurrences that match \`old_string\` exactly. Ensure the number of replacements matches your expectation.`,
331210
331216
  Kind.Edit,
331211
331217
  {
331212
331218
  properties: {
@@ -331233,12 +331239,17 @@ A good instruction should concisely answer:
331233
331239
  type: "string"
331234
331240
  },
331235
331241
  old_string: {
331236
- description: "The exact literal text to replace, preferably unescaped. Include at least 3 lines of context BEFORE and AFTER the target text, matching whitespace and indentation precisely. If this string is not the exact literal text (i.e. you escaped it) or does not match exactly, the tool will fail.",
331242
+ description: "The exact literal text to replace, preferably unescaped. For single replacements (default), include at least 3 lines of context BEFORE and AFTER the target text, matching whitespace and indentation precisely. If this string is not the exact literal text (i.e. you escaped it) or does not match exactly, the tool will fail.",
331237
331243
  type: "string"
331238
331244
  },
331239
331245
  new_string: {
331240
331246
  description: "The exact literal text to replace `old_string` with, preferably unescaped. Provide the EXACT text. Ensure the resulting code is correct and idiomatic.",
331241
331247
  type: "string"
331248
+ },
331249
+ expected_replacements: {
331250
+ type: "number",
331251
+ description: "Number of replacements expected. Defaults to 1 if not specified. Use when you want to replace multiple occurrences.",
331252
+ minimum: 1
331242
331253
  }
331243
331254
  },
331244
331255
  required: ["file_path", "instruction", "old_string", "new_string"],
@@ -331319,26 +331330,9 @@ A good instruction should concisely answer:
331319
331330
  // packages/core/dist/src/tools/shell.js
331320
331331
  import fs40 from "node:fs";
331321
331332
  import path42 from "node:path";
331322
- import os16, { EOL as EOL3 } from "node:os";
331333
+ import os16, { EOL as EOL2 } from "node:os";
331323
331334
  import crypto20 from "node:crypto";
331324
331335
 
331325
- // packages/core/dist/src/config/models.js
331326
- var DEFAULT_GEMINI_MODEL = "gemini-2.5-pro";
331327
- var DEFAULT_GEMINI_FLASH_MODEL = "gemini-2.5-flash";
331328
- var DEFAULT_GEMINI_FLASH_LITE_MODEL = "gemini-2.5-flash-lite";
331329
- var DEFAULT_GEMINI_MODEL_AUTO = "auto";
331330
- var DEFAULT_GEMINI_EMBEDDING_MODEL = "gemini-embedding-001";
331331
- var DEFAULT_THINKING_MODE = 8192;
331332
- function getEffectiveModel(isInFallbackMode, requestedModel) {
331333
- if (!isInFallbackMode) {
331334
- return requestedModel;
331335
- }
331336
- if (requestedModel.includes("lite")) {
331337
- return requestedModel;
331338
- }
331339
- return DEFAULT_GEMINI_FLASH_MODEL;
331340
- }
331341
-
331342
331336
  // packages/core/dist/src/utils/summarizer.js
331343
331337
  var SUMMARIZE_TOOL_OUTPUT_PROMPT = `Summarize the following tool output to be a maximum of {maxOutputTokens} tokens. The summary should be concise and capture the main points of the tool output.
331344
331338
 
@@ -331353,17 +331347,15 @@ Text to summarize:
331353
331347
 
331354
331348
  Return the summary string which should first contain an overall summarization of text followed by the full stack trace of errors and warnings in the tool output.
331355
331349
  `;
331356
- async function summarizeToolOutput(textToSummarize, geminiClient, abortSignal, maxOutputTokens = 2e3) {
331350
+ async function summarizeToolOutput(config2, modelConfigKey, textToSummarize, geminiClient, abortSignal) {
331351
+ const maxOutputTokens = config2.modelConfigService.getResolvedConfig(modelConfigKey).generateContentConfig.maxOutputTokens ?? 2e3;
331357
331352
  if (!textToSummarize || textToSummarize.length < maxOutputTokens) {
331358
331353
  return textToSummarize;
331359
331354
  }
331360
331355
  const prompt = SUMMARIZE_TOOL_OUTPUT_PROMPT.replace("{maxOutputTokens}", String(maxOutputTokens)).replace("{textToSummarize}", textToSummarize);
331361
331356
  const contents = [{ role: "user", parts: [{ text: prompt }] }];
331362
- const toolOutputSummarizerConfig = {
331363
- maxOutputTokens
331364
- };
331365
331357
  try {
331366
- const parsedResponse = await geminiClient.generateContent(contents, toolOutputSummarizerConfig, abortSignal, DEFAULT_GEMINI_FLASH_LITE_MODEL);
331358
+ const parsedResponse = await geminiClient.generateContent(modelConfigKey, contents, abortSignal);
331367
331359
  return getResponseText(parsedResponse) || textToSummarize;
331368
331360
  } catch (error) {
331369
331361
  debugLogger.warn("Failed to summarize tool output.", error);
@@ -337065,7 +337057,7 @@ var ShellToolInvocation = class extends BaseToolInvocation {
337065
337057
  const backgroundPIDs = [];
337066
337058
  if (os16.platform() !== "win32") {
337067
337059
  if (fs40.existsSync(tempFilePath)) {
337068
- const pgrepLines = fs40.readFileSync(tempFilePath, "utf8").split(EOL3).filter(Boolean);
337060
+ const pgrepLines = fs40.readFileSync(tempFilePath, "utf8").split(EOL2).filter(Boolean);
337069
337061
  for (const line of pgrepLines) {
337070
337062
  if (!/^\d+$/.test(line)) {
337071
337063
  debugLogger.error(`pgrep: ${line}`);
@@ -337130,7 +337122,7 @@ ${result.output}`;
337130
337122
  }
337131
337123
  } : {};
337132
337124
  if (summarizeConfig && summarizeConfig[SHELL_TOOL_NAME]) {
337133
- const summary = await summarizeToolOutput(llmContent, this.config.getGeminiClient(), signal, summarizeConfig[SHELL_TOOL_NAME].tokenBudget);
337125
+ const summary = await summarizeToolOutput(this.config, { model: "summarizer-shell" }, llmContent, this.config.getGeminiClient(), signal);
337134
337126
  return {
337135
337127
  llmContent: summary,
337136
337128
  returnDisplay: returnDisplayMessage,
@@ -342556,7 +342548,7 @@ I was unable to access the URL directly. Instead, I have fetched the raw content
342556
342548
  ${textContent2}
342557
342549
  ---
342558
342550
  `;
342559
- const result = await geminiClient.generateContent([{ role: "user", parts: [{ text: fallbackPrompt }] }], {}, signal, DEFAULT_GEMINI_FLASH_MODEL);
342551
+ const result = await geminiClient.generateContent({ model: "web-fetch-fallback" }, [{ role: "user", parts: [{ text: fallbackPrompt }] }], signal);
342560
342552
  const resultText = getResponseText(result) || "";
342561
342553
  return {
342562
342554
  llmContent: resultText,
@@ -342614,13 +342606,7 @@ ${textContent2}
342614
342606
  }
342615
342607
  const geminiClient = this.config.getGeminiClient();
342616
342608
  try {
342617
- const response = await geminiClient.generateContent(
342618
- [{ role: "user", parts: [{ text: userPrompt }] }],
342619
- { tools: [{ urlContext: {} }] },
342620
- signal,
342621
- // Pass signal
342622
- DEFAULT_GEMINI_FLASH_MODEL
342623
- );
342609
+ const response = await geminiClient.generateContent({ model: "web-fetch" }, [{ role: "user", parts: [{ text: userPrompt }] }], signal);
342624
342610
  debugLogger.debug(`[WebFetchTool] Full response for prompt "${userPrompt.substring(0, 50)}...":`, JSON.stringify(response, null, 2));
342625
342611
  let responseText = getResponseText(response) || "";
342626
342612
  const urlContextMeta = response.candidates?.[0]?.urlContextMetadata;
@@ -343078,7 +343064,7 @@ var WebSearchToolInvocation = class extends BaseToolInvocation {
343078
343064
  async execute(signal) {
343079
343065
  const geminiClient = this.config.getGeminiClient();
343080
343066
  try {
343081
- const response = await geminiClient.generateContent([{ role: "user", parts: [{ text: this.params.query }] }], { tools: [{ googleSearch: {} }] }, signal, DEFAULT_GEMINI_FLASH_MODEL);
343067
+ const response = await geminiClient.generateContent({ model: "web-search" }, [{ role: "user", parts: [{ text: this.params.query }] }], signal);
343082
343068
  const responseText = getResponseText(response);
343083
343069
  const groundingMetadata = response.candidates?.[0]?.groundingMetadata;
343084
343070
  const sources = groundingMetadata?.groundingChunks;
@@ -343407,10 +343393,12 @@ async function getEnvironmentContext(config2) {
343407
343393
  });
343408
343394
  const platform10 = process.platform;
343409
343395
  const directoryContext = await getDirectoryContextString(config2);
343396
+ const tempDir = config2.storage.getProjectTempDir();
343410
343397
  const context2 = `
343411
343398
  This is the Gemini CLI. We are setting up the context for our chat.
343412
343399
  Today's date is ${today} (formatted according to the user's locale).
343413
343400
  My operating system is: ${platform10}
343401
+ The project's temporary directory is: ${tempDir}
343414
343402
  ${directoryContext}
343415
343403
  `.trim();
343416
343404
  const initialParts = [{ text: context2 }];
@@ -343435,6 +343423,22 @@ My setup is complete. I will provide my first command in the next turn.
343435
343423
  ];
343436
343424
  }
343437
343425
 
343426
+ // packages/core/dist/src/config/models.js
343427
+ var DEFAULT_GEMINI_MODEL = "gemini-2.5-pro";
343428
+ var DEFAULT_GEMINI_FLASH_MODEL = "gemini-2.5-flash";
343429
+ var DEFAULT_GEMINI_MODEL_AUTO = "auto";
343430
+ var DEFAULT_GEMINI_EMBEDDING_MODEL = "gemini-embedding-001";
343431
+ var DEFAULT_THINKING_MODE = 8192;
343432
+ function getEffectiveModel(isInFallbackMode, requestedModel) {
343433
+ if (!isInFallbackMode) {
343434
+ return requestedModel;
343435
+ }
343436
+ if (requestedModel.includes("lite")) {
343437
+ return requestedModel;
343438
+ }
343439
+ return DEFAULT_GEMINI_FLASH_MODEL;
343440
+ }
343441
+
343438
343442
  // packages/core/dist/src/utils/generateContentResponseUtilities.js
343439
343443
  function getResponseTextFromParts(parts2) {
343440
343444
  if (!parts2) {
@@ -343958,7 +343962,11 @@ var CoreToolScheduler = class _CoreToolScheduler {
343958
343962
  ...waitingToolCall.confirmationDetails,
343959
343963
  isModifying: true
343960
343964
  });
343961
- const { updatedParams, updatedDiff } = await modifyWithEditor(waitingToolCall.request.args, modifyContext, editorType, signal, this.onEditorClose);
343965
+ const contentOverrides = waitingToolCall.confirmationDetails.type === "edit" ? {
343966
+ currentContent: waitingToolCall.confirmationDetails.originalContent,
343967
+ proposedContent: waitingToolCall.confirmationDetails.newContent
343968
+ } : void 0;
343969
+ const { updatedParams, updatedDiff } = await modifyWithEditor(waitingToolCall.request.args, modifyContext, editorType, signal, this.onEditorClose, contentOverrides);
343962
343970
  this.setArgsInternal(callId, updatedParams);
343963
343971
  this.setStatusInternal(callId, "awaiting_approval", signal, {
343964
343972
  ...waitingToolCall.confirmationDetails,
@@ -344613,13 +344621,13 @@ var GeminiChat = class {
344613
344621
  sendPromise = Promise.resolve();
344614
344622
  chatRecordingService;
344615
344623
  lastPromptTokenCount;
344616
- constructor(config2, generationConfig = {}, history = []) {
344624
+ constructor(config2, generationConfig = {}, history = [], resumedSessionData) {
344617
344625
  this.config = config2;
344618
344626
  this.generationConfig = generationConfig;
344619
344627
  this.history = history;
344620
344628
  validateHistory2(history);
344621
344629
  this.chatRecordingService = new ChatRecordingService(config2);
344622
- this.chatRecordingService.initialize();
344630
+ this.chatRecordingService.initialize(resumedSessionData);
344623
344631
  this.lastPromptTokenCount = Math.ceil(JSON.stringify(this.history).length / 4);
344624
344632
  }
344625
344633
  setSystemInstruction(sysInstr) {
@@ -345425,7 +345433,7 @@ function getCoreSystemPrompt(config2, userMemory) {
345425
345433
  ## Software Engineering Tasks
345426
345434
  When requested to perform tasks like fixing bugs, adding features, refactoring, or explaining code, follow this sequence:
345427
345435
  1. **Understand:** Think about the user's request and the relevant codebase context. Use '${GREP_TOOL_NAME}' and '${GLOB_TOOL_NAME}' search tools extensively (in parallel if independent) to understand file structures, existing code patterns, and conventions.
345428
- Use '${READ_FILE_TOOL_NAME}' and '${READ_MANY_FILES_TOOL_NAME}' to understand context and validate any assumptions you may have.
345436
+ Use '${READ_FILE_TOOL_NAME}' to understand context and validate any assumptions you may have. If you need to read multiple files, you should make multiple parallel calls to '${READ_FILE_TOOL_NAME}'.
345429
345437
  2. **Plan:** Build a coherent and grounded (based on the understanding in step 1) plan for how you intend to resolve the user's task. Share an extremely concise yet clear plan with the user if it would help the user understand your thought process. As part of the plan, you should use an iterative development process that includes writing unit tests to verify your changes. Use output logs or debug statements as part of this process to arrive at a solution.`,
345430
345438
  primaryWorkflows_prefix_ci: `
345431
345439
  # Primary Workflows
@@ -345446,7 +345454,7 @@ When requested to perform tasks like fixing bugs, adding features, refactoring,
345446
345454
 
345447
345455
  ## Software Engineering Tasks
345448
345456
  When requested to perform tasks like fixing bugs, adding features, refactoring, or explaining code, follow this sequence:
345449
- 1. **Understand:** Think about the user's request and the relevant codebase context. Use '${GREP_TOOL_NAME}' and '${GLOB_TOOL_NAME}' search tools extensively (in parallel if independent) to understand file structures, existing code patterns, and conventions. Use '${READ_FILE_TOOL_NAME}' and '${READ_MANY_FILES_TOOL_NAME}' to understand context and validate any assumptions you may have.
345457
+ 1. **Understand:** Think about the user's request and the relevant codebase context. Use '${GREP_TOOL_NAME}' and '${GLOB_TOOL_NAME}' search tools extensively (in parallel if independent) to understand file structures, existing code patterns, and conventions. Use '${READ_FILE_TOOL_NAME}' to understand context and validate any assumptions you may have. If you need to read multiple files, you should make multiple parallel calls to '${READ_FILE_TOOL_NAME}'.
345450
345458
  2. **Plan:** Build a coherent and grounded (based on the understanding in step 1) plan for how you intend to resolve the user's task. For complex tasks, break them down into smaller, manageable subtasks and use the \`${WRITE_TODOS_TOOL_NAME}\` tool to track your progress. Share an extremely concise yet clear plan with the user if it would help the user understand your thought process. As part of the plan, you should use an iterative development process that includes writing unit tests to verify your changes. Use output logs or debug statements as part of this process to arrive at a solution.`,
345451
345459
  primaryWorkflows_suffix: `3. **Implement:** Use the available tools (e.g., '${EDIT_TOOL_NAME}', '${WRITE_FILE_TOOL_NAME}' '${SHELL_TOOL_NAME}' ...) to act on the plan, strictly adhering to the project's established conventions (detailed under 'Core
345452
345460
  Mandates').
@@ -345461,9 +345469,9 @@ Mandates').
345461
345469
  1. **Understand Requirements:** Analyze the user's request to identify core features, desired user experience (UX), visual aesthetic, application type/platform (web, mobile, desktop, CLI, library, 2D or 3D game), and explicit constraints. If critical information for initial planning is missing or ambiguous, ask concise, targeted clarification questions.
345462
345470
  2. **Propose Plan:** Formulate an internal development plan. Present a clear, concise, high-level summary to the user. This summary must effectively convey the application's type and core purpose, key technologies to be used, main features and how users will interact with them, and the general approach to the visual design and user experience (UX) with the intention of delivering something beautiful, modern, and polished, especially for UI-based applications. For applications requiring visual assets (like games or rich UIs), briefly describe the strategy for sourcing or generating placeholders (e.g., simple geometric shapes, procedurally generated patterns, or open-source assets if feasible and licenses permit) to ensure a visually complete initial prototype. Ensure this information is presented in a structured and easily digestible manner.
345463
345471
  - When key technologies aren't specified, prefer the following:
345464
- - **Websites (Frontend):** React (JavaScript/TypeScript) with Bootstrap CSS, incorporating Material Design principles for UI/UX.
345472
+ - **Websites (Frontend):** React (JavaScript/TypeScript) or Angular with Bootstrap CSS, incorporating Material Design principles for UI/UX.
345465
345473
  - **Back-End APIs:** Node.js with Express.js (JavaScript/TypeScript) or Python with FastAPI.
345466
- - **Full-stack:** Next.js (React/Node.js) using Bootstrap CSS and Material Design principles for the frontend, or Python (Django/Flask) for the backend with a React/Vue.js frontend styled with Bootstrap CSS and Material Design principles.
345474
+ - **Full-stack:** Next.js (React/Node.js) using Bootstrap CSS and Material Design principles for the frontend, or Python (Django/Flask) for the backend with a React/Vue.js/Angular frontend styled with Bootstrap CSS and Material Design principles.
345467
345475
  - **CLIs:** Python or Go.
345468
345476
  - **Mobile App:** Compose Multiplatform (Kotlin Multiplatform) or Flutter (Dart) using Material Design libraries and principles, when sharing code between Android and iOS. Jetpack Compose (Kotlin JVM) with Material Design principles or SwiftUI (Swift) for native apps targeted at either Android or iOS, respectively.
345469
345477
  - **3d Games:** HTML/CSS/JavaScript with Three.js.
@@ -345476,7 +345484,6 @@ Mandates').
345476
345484
  # Operational Guidelines
345477
345485
  ${function() {
345478
345486
  if (config2.getEnableShellOutputEfficiency()) {
345479
- const tempDir = config2.storage.getProjectTempDir();
345480
345487
  return `
345481
345488
  ## Shell tool output token efficiency:
345482
345489
 
@@ -345486,8 +345493,8 @@ IT IS CRITICAL TO FOLLOW THESE GUIDELINES TO AVOID EXCESSIVE TOKEN CONSUMPTION.
345486
345493
  - Aim to minimize tool output tokens while still capturing necessary information.
345487
345494
  - If a command is expected to produce a lot of output, use quiet or silent flags where available and appropriate.
345488
345495
  - Always consider the trade-off between output verbosity and the need for information. If a command's full output is essential for understanding the result, avoid overly aggressive quieting that might obscure important details.
345489
- - If a command does not have quiet/silent flags or for commands with potentially long output that may not be useful, redirect stdout and stderr to temp files in the project's temporary directory: ${tempDir}. For example: 'command > ${path48.posix.join(tempDir, "out.log")} 2> ${path48.posix.join(tempDir, "err.log")}'.
345490
- - After the command runs, inspect the temp files (e.g. '${path48.posix.join(tempDir, "out.log")}' and '${path48.posix.join(tempDir, "err.log")}') using commands like 'grep', 'tail', 'head', ... (or platform equivalents). Remove the temp files when done.
345496
+ - If a command does not have quiet/silent flags or for commands with potentially long output that may not be useful, redirect stdout and stderr to temp files in the project's temporary directory. For example: 'command > <temp_dir>/out.log 2> <temp_dir>/err.log'.
345497
+ - After the command runs, inspect the temp files (e.g. '<temp_dir>/out.log' and '<temp_dir>/err.log') using commands like 'grep', 'tail', 'head', ... (or platform equivalents). Remove the temp files when done.
345491
345498
  `;
345492
345499
  }
345493
345500
  return "";
@@ -345568,7 +345575,7 @@ ${function() {
345568
345575
  }()}`,
345569
345576
  finalReminder: `
345570
345577
  # Final Reminder
345571
- Your core function is efficient and safe assistance. Balance extreme conciseness with the crucial need for clarity, especially regarding safety and potential system modifications. Always prioritize user control and project conventions. Never make assumptions about the contents of files; instead use '${READ_FILE_TOOL_NAME}' or '${READ_MANY_FILES_TOOL_NAME}' to ensure you aren't making broad assumptions. Finally, you are an agent - please keep going until the user's query is completely resolved.`
345578
+ Your core function is efficient and safe assistance. Balance extreme conciseness with the crucial need for clarity, especially regarding safety and potential system modifications. Always prioritize user control and project conventions. Never make assumptions about the contents of files; instead use '${READ_FILE_TOOL_NAME}' to ensure you aren't making broad assumptions. Finally, you are an agent - please keep going until the user's query is completely resolved.`
345572
345579
  };
345573
345580
  const orderedPrompts = [
345574
345581
  "preamble",
@@ -346281,6 +346288,9 @@ var GeminiClient = class {
346281
346288
  this.chat = await this.startChat();
346282
346289
  this.updateTelemetryTokenCount();
346283
346290
  }
346291
+ async resumeChat(history, resumedSessionData) {
346292
+ this.chat = await this.startChat(history, resumedSessionData);
346293
+ }
346284
346294
  getChatRecordingService() {
346285
346295
  return this.chat?.getChatRecordingService();
346286
346296
  }
@@ -346299,7 +346309,7 @@ var GeminiClient = class {
346299
346309
  parts: [{ text: await getDirectoryContextString(this.config) }]
346300
346310
  });
346301
346311
  }
346302
- async startChat(extraHistory) {
346312
+ async startChat(extraHistory, resumedSessionData) {
346303
346313
  this.forceFullIdeContext = true;
346304
346314
  this.hasFailedCompressionAttempt = false;
346305
346315
  const toolRegistry = this.config.getToolRegistry();
@@ -346321,7 +346331,7 @@ var GeminiClient = class {
346321
346331
  systemInstruction,
346322
346332
  ...config2,
346323
346333
  tools
346324
- }, history);
346334
+ }, history, resumedSessionData);
346325
346335
  } catch (error) {
346326
346336
  await reportError(error, "Error initializing Gemini chat session.", history, "startChat");
346327
346337
  throw new Error(`Failed to initialize chat: ${getErrorMessage(error)}`);
@@ -346573,25 +346583,27 @@ var GeminiClient = class {
346573
346583
  }
346574
346584
  return turn;
346575
346585
  }
346576
- async generateContent(contents, generationConfig, abortSignal, model) {
346577
- let currentAttemptModel = model;
346578
- const configToUse = {
346579
- ...this.generateContentConfig,
346580
- ...generationConfig
346581
- };
346586
+ async generateContent(modelConfigKey, contents, abortSignal) {
346587
+ const desiredModelConfig = this.config.modelConfigService.getResolvedConfig(modelConfigKey);
346588
+ let { model: currentAttemptModel, generateContentConfig: currentAttemptGenerateContentConfig } = desiredModelConfig;
346589
+ const fallbackModelConfig = this.config.modelConfigService.getResolvedConfig({
346590
+ ...modelConfigKey,
346591
+ model: DEFAULT_GEMINI_FLASH_MODEL
346592
+ });
346582
346593
  try {
346583
346594
  const userMemory = this.config.getUserMemory();
346584
346595
  const systemInstruction = getCoreSystemPrompt(this.config, userMemory);
346585
- const requestConfig = {
346586
- abortSignal,
346587
- ...configToUse,
346588
- systemInstruction
346589
- };
346590
346596
  const apiCall = () => {
346591
- const modelToUse = this.config.isInFallbackMode() ? DEFAULT_GEMINI_FLASH_MODEL : model;
346592
- currentAttemptModel = modelToUse;
346597
+ const modelConfigToUse = this.config.isInFallbackMode() ? fallbackModelConfig : desiredModelConfig;
346598
+ currentAttemptModel = modelConfigToUse.model;
346599
+ currentAttemptGenerateContentConfig = modelConfigToUse.generateContentConfig;
346600
+ const requestConfig = {
346601
+ ...currentAttemptGenerateContentConfig,
346602
+ abortSignal,
346603
+ systemInstruction
346604
+ };
346593
346605
  return this.getContentGeneratorOrFail().generateContent({
346594
- model: modelToUse,
346606
+ model: currentAttemptModel,
346595
346607
  config: requestConfig,
346596
346608
  contents
346597
346609
  }, this.lastPromptId);
@@ -346611,7 +346623,7 @@ var GeminiClient = class {
346611
346623
  }
346612
346624
  await reportError(error, `Error generating content via API with model ${currentAttemptModel}.`, {
346613
346625
  requestContents: contents,
346614
- requestConfig: configToUse
346626
+ requestConfig: currentAttemptGenerateContentConfig
346615
346627
  }, "generateContent-api");
346616
346628
  throw new Error(`Failed to generate content with model ${currentAttemptModel}: ${getErrorMessage(error)}`);
346617
346629
  }
@@ -352084,7 +352096,7 @@ var DEFAULT_MODEL_CONFIGS = {
352084
352096
  }
352085
352097
  }
352086
352098
  },
352087
- "web-search-tool": {
352099
+ "web-search": {
352088
352100
  extends: "gemini-2.5-flash-base",
352089
352101
  modelConfig: {
352090
352102
  generateContentConfig: {
@@ -352092,7 +352104,7 @@ var DEFAULT_MODEL_CONFIGS = {
352092
352104
  }
352093
352105
  }
352094
352106
  },
352095
- "web-fetch-tool": {
352107
+ "web-fetch": {
352096
352108
  extends: "gemini-2.5-flash-base",
352097
352109
  modelConfig: {
352098
352110
  generateContentConfig: {
@@ -352100,6 +352112,11 @@ var DEFAULT_MODEL_CONFIGS = {
352100
352112
  }
352101
352113
  }
352102
352114
  },
352115
+ // TODO(joshualitt): During cleanup, make modelConfig optional.
352116
+ "web-fetch-fallback": {
352117
+ extends: "gemini-2.5-flash-base",
352118
+ modelConfig: {}
352119
+ },
352103
352120
  "loop-detection": {
352104
352121
  extends: "gemini-2.5-flash-base",
352105
352122
  modelConfig: {}
@@ -354956,7 +354973,7 @@ async function getClientMetadata() {
354956
354973
  if (!clientMetadataPromise) {
354957
354974
  clientMetadataPromise = (async () => ({
354958
354975
  ideName: "GEMINI_CLI",
354959
- ideVersion: "0.15.0-nightly.20251110.c0b766ad",
354976
+ ideVersion: "0.15.0-preview.0",
354960
354977
  platform: getPlatform(),
354961
354978
  updateChannel: await getReleaseChannel(__dirname5)
354962
354979
  }))();
@@ -354990,6 +355007,12 @@ function parseExperiments(response) {
354990
355007
  };
354991
355008
  }
354992
355009
 
355010
+ // packages/core/dist/src/code_assist/experiments/flagNames.js
355011
+ var ExperimentFlags = {
355012
+ CONTEXT_COMPRESSION_THRESHOLD: "GeminiCLIContextCompression__threshold_fraction",
355013
+ USER_CACHING: "GcliUserCaching__user_caching"
355014
+ };
355015
+
354993
355016
  // packages/core/dist/src/utils/memoryDiscovery.js
354994
355017
  import * as fs54 from "node:fs/promises";
354995
355018
  import * as fsSync from "node:fs";
@@ -357847,8 +357870,8 @@ var ErrorEvent = class extends Event {
357847
357870
  * @param inspect - The inspect function to use (prevents having to import it from `util`)
357848
357871
  * @returns A string representation of the error
357849
357872
  */
357850
- [Symbol.for("nodejs.util.inspect.custom")](_depth, options2, inspect4) {
357851
- return inspect4(inspectableError(this), options2);
357873
+ [Symbol.for("nodejs.util.inspect.custom")](_depth, options2, inspect5) {
357874
+ return inspect5(inspectableError(this), options2);
357852
357875
  }
357853
357876
  /**
357854
357877
  * Deno "hides" the `message` and `code` properties of the `ErrorEvent` instance,
@@ -357861,8 +357884,8 @@ var ErrorEvent = class extends Event {
357861
357884
  * @param options - The options passed to `Deno.inspect`
357862
357885
  * @returns A string representation of the error
357863
357886
  */
357864
- [Symbol.for("Deno.customInspect")](inspect4, options2) {
357865
- return inspect4(inspectableError(this), options2);
357887
+ [Symbol.for("Deno.customInspect")](inspect5, options2) {
357888
+ return inspect5(inspectableError(this), options2);
357866
357889
  }
357867
357890
  };
357868
357891
  function syntaxError(message) {
@@ -359725,26 +359748,28 @@ async function handleAutomaticOAuth(mcpServerName, mcpServerConfig, wwwAuthentic
359725
359748
  return false;
359726
359749
  }
359727
359750
  }
359751
+ function createTransportRequestInit(mcpServerConfig, headers) {
359752
+ return {
359753
+ headers: {
359754
+ ...mcpServerConfig.headers,
359755
+ ...headers
359756
+ }
359757
+ };
359758
+ }
359728
359759
  async function createTransportWithOAuth(mcpServerName, mcpServerConfig, accessToken) {
359729
359760
  try {
359730
359761
  if (mcpServerConfig.httpUrl) {
359731
359762
  const oauthTransportOptions = {
359732
- requestInit: {
359733
- headers: {
359734
- ...mcpServerConfig.headers,
359735
- Authorization: `Bearer ${accessToken}`
359736
- }
359737
- }
359763
+ requestInit: createTransportRequestInit(mcpServerConfig, {
359764
+ Authorization: `Bearer ${accessToken}`
359765
+ })
359738
359766
  };
359739
359767
  return new StreamableHTTPClientTransport(new URL(mcpServerConfig.httpUrl), oauthTransportOptions);
359740
359768
  } else if (mcpServerConfig.url) {
359741
359769
  return new SSEClientTransport(new URL(mcpServerConfig.url), {
359742
- requestInit: {
359743
- headers: {
359744
- ...mcpServerConfig.headers,
359745
- Authorization: `Bearer ${accessToken}`
359746
- }
359747
- }
359770
+ requestInit: createTransportRequestInit(mcpServerConfig, {
359771
+ Authorization: `Bearer ${accessToken}`
359772
+ })
359748
359773
  });
359749
359774
  }
359750
359775
  return null;
@@ -360050,6 +360075,7 @@ async function createTransport(mcpServerName, mcpServerConfig, debugMode) {
360050
360075
  if (mcpServerConfig.authProviderType === AuthProviderType.SERVICE_ACCOUNT_IMPERSONATION) {
360051
360076
  const provider = new ServiceAccountImpersonationProvider(mcpServerConfig);
360052
360077
  const transportOptions = {
360078
+ requestInit: createTransportRequestInit(mcpServerConfig, {}),
360053
360079
  authProvider: provider
360054
360080
  };
360055
360081
  if (mcpServerConfig.httpUrl) {
@@ -360062,6 +360088,7 @@ async function createTransport(mcpServerName, mcpServerConfig, debugMode) {
360062
360088
  if (mcpServerConfig.authProviderType === AuthProviderType.GOOGLE_CREDENTIALS) {
360063
360089
  const provider = new GoogleCredentialProvider(mcpServerConfig);
360064
360090
  const transportOptions = {
360091
+ requestInit: createTransportRequestInit(mcpServerConfig, {}),
360065
360092
  authProvider: provider
360066
360093
  };
360067
360094
  if (mcpServerConfig.httpUrl) {
@@ -360428,6 +360455,8 @@ var Config = class {
360428
360455
  ideMode;
360429
360456
  inFallbackMode = false;
360430
360457
  maxSessionTurns;
360458
+ listSessions;
360459
+ deleteSession;
360431
360460
  listExtensions;
360432
360461
  _extensionLoader;
360433
360462
  _enabledExtensions;
@@ -360524,6 +360553,8 @@ var Config = class {
360524
360553
  this.model = params.model;
360525
360554
  this.maxSessionTurns = params.maxSessionTurns ?? -1;
360526
360555
  this.experimentalZedIntegration = params.experimentalZedIntegration ?? false;
360556
+ this.listSessions = params.listSessions ?? false;
360557
+ this.deleteSession = params.deleteSession;
360527
360558
  this.listExtensions = params.listExtensions ?? false;
360528
360559
  this._extensionLoader = params.extensionLoader ?? new SimpleExtensionLoader([]);
360529
360560
  this._enabledExtensions = params.enabledExtensions ?? [];
@@ -360632,6 +360663,26 @@ var Config = class {
360632
360663
  await this.getExtensionLoader().start(this)
360633
360664
  ]);
360634
360665
  await this.geminiClient.initialize();
360666
+ this.checkDeprecatedTools();
360667
+ }
360668
+ checkDeprecatedTools() {
360669
+ const deprecatedTools = [
360670
+ {
360671
+ name: READ_MANY_FILES_TOOL_NAME,
360672
+ alternateName: "ReadManyFilesTool"
360673
+ }
360674
+ ];
360675
+ const checkList = (list3, listName) => {
360676
+ if (!list3)
360677
+ return;
360678
+ for (const tool of deprecatedTools) {
360679
+ if (list3.includes(tool.name) || list3.includes(tool.alternateName)) {
360680
+ coreEvents.emitFeedback("warning", `The tool '${tool.name}' (or '${tool.alternateName}') specified in '${listName}' is deprecated and will be removed in v0.14.0.`);
360681
+ }
360682
+ }
360683
+ };
360684
+ checkList(this.coreTools, "tools.core");
360685
+ checkList(this.allowedTools, "tools.allowed");
360635
360686
  }
360636
360687
  getContentGenerator() {
360637
360688
  return this.contentGenerator;
@@ -360683,6 +360734,9 @@ var Config = class {
360683
360734
  getSessionId() {
360684
360735
  return this.sessionId;
360685
360736
  }
360737
+ setSessionId(sessionId2) {
360738
+ this.sessionId = sessionId2;
360739
+ }
360686
360740
  shouldLoadMemoryFromIncludeDirectories() {
360687
360741
  return this.loadMemoryFromIncludeDirectories;
360688
360742
  }
@@ -360927,6 +360981,12 @@ var Config = class {
360927
360981
  getListExtensions() {
360928
360982
  return this.listExtensions;
360929
360983
  }
360984
+ getListSessions() {
360985
+ return this.listSessions;
360986
+ }
360987
+ getDeleteSession() {
360988
+ return this.deleteSession;
360989
+ }
360930
360990
  getExtensionManagement() {
360931
360991
  return this.extensionManagement;
360932
360992
  }
@@ -360992,19 +361052,27 @@ var Config = class {
360992
361052
  if (this.compressionThreshold) {
360993
361053
  return this.compressionThreshold;
360994
361054
  }
360995
- if (this.experimentsPromise) {
360996
- try {
360997
- await this.experimentsPromise;
360998
- } catch (e2) {
360999
- debugLogger.debug("Failed to fetch experiments", e2);
361000
- }
361001
- }
361002
- const remoteThreshold = this.experiments?.flags["GeminiCLIContextCompression__threshold_fraction"]?.floatValue;
361055
+ await this.ensureExperimentsLoaded();
361056
+ const remoteThreshold = this.experiments?.flags[ExperimentFlags.CONTEXT_COMPRESSION_THRESHOLD]?.floatValue;
361003
361057
  if (remoteThreshold === 0) {
361004
361058
  return void 0;
361005
361059
  }
361006
361060
  return remoteThreshold;
361007
361061
  }
361062
+ async getUserCaching() {
361063
+ await this.ensureExperimentsLoaded();
361064
+ return this.experiments?.flags[ExperimentFlags.USER_CACHING]?.boolValue;
361065
+ }
361066
+ async ensureExperimentsLoaded() {
361067
+ if (!this.experimentsPromise) {
361068
+ return;
361069
+ }
361070
+ try {
361071
+ await this.experimentsPromise;
361072
+ } catch (e2) {
361073
+ debugLogger.debug("Failed to fetch experiments", e2);
361074
+ }
361075
+ }
361008
361076
  isInteractiveShellEnabled() {
361009
361077
  return this.interactive && this.ptyInfo !== "child_process" && this.enableInteractiveShell;
361010
361078
  }
@@ -361183,6 +361251,42 @@ var Config = class {
361183
361251
  */
361184
361252
  setExperiments(experiments) {
361185
361253
  this.experiments = experiments;
361254
+ const flagSummaries = Object.entries(experiments.flags ?? {}).sort(([a2], [b]) => a2.localeCompare(b)).map(([name4, flag]) => {
361255
+ const summary2 = { name: name4 };
361256
+ if (flag.boolValue !== void 0) {
361257
+ summary2["boolValue"] = flag.boolValue;
361258
+ }
361259
+ if (flag.floatValue !== void 0) {
361260
+ summary2["floatValue"] = flag.floatValue;
361261
+ }
361262
+ if (flag.intValue !== void 0) {
361263
+ summary2["intValue"] = flag.intValue;
361264
+ }
361265
+ if (flag.stringValue !== void 0) {
361266
+ summary2["stringValue"] = flag.stringValue;
361267
+ }
361268
+ const int32Length = flag.int32ListValue?.values?.length ?? 0;
361269
+ if (int32Length > 0) {
361270
+ summary2["int32ListLength"] = int32Length;
361271
+ }
361272
+ const stringListLength = flag.stringListValue?.values?.length ?? 0;
361273
+ if (stringListLength > 0) {
361274
+ summary2["stringListLength"] = stringListLength;
361275
+ }
361276
+ return summary2;
361277
+ });
361278
+ const summary = {
361279
+ experimentIds: experiments.experimentIds ?? [],
361280
+ flags: flagSummaries
361281
+ };
361282
+ const summaryString = inspect4(summary, {
361283
+ depth: null,
361284
+ maxArrayLength: null,
361285
+ maxStringLength: null,
361286
+ breakLength: 80,
361287
+ compact: false
361288
+ });
361289
+ debugLogger.debug("Experiments loaded", summaryString);
361186
361290
  }
361187
361291
  };
361188
361292