@google/gemini-cli 0.57.0 → 0.58.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 (58) hide show
  1. package/bundle/{chunk-FYAMITQ2.js → chunk-2BLMLPHM.js} +1 -1
  2. package/bundle/{chunk-GAROUUGQ.js → chunk-2DH4DX65.js} +1 -1
  3. package/bundle/{chunk-AOE6E7MU.js → chunk-2XOTT2FI.js} +2 -2
  4. package/bundle/{chunk-4H4K2RBL.js → chunk-4FKXMALD.js} +3 -3
  5. package/bundle/{chunk-DFPYJMVX.js → chunk-4KFMA4KD.js} +242 -106
  6. package/bundle/{chunk-O7TOZUUB.js → chunk-6EGII27G.js} +3 -3
  7. package/bundle/{chunk-TAWZWX2B.js → chunk-7HQEQECM.js} +1 -1
  8. package/bundle/{chunk-HY6GN2F7.js → chunk-BOI2NL3I.js} +1 -1
  9. package/bundle/{chunk-RLDNVR77.js → chunk-CNAVMEMA.js} +1 -1
  10. package/bundle/{chunk-IKHAM2LG.js → chunk-E7K62ODO.js} +7 -7
  11. package/bundle/{chunk-GPOBVDAD.js → chunk-FJTXPUG2.js} +1 -1
  12. package/bundle/{chunk-7ZGWPQVZ.js → chunk-FMLOQLUD.js} +1 -1
  13. package/bundle/{chunk-ISXOUBN5.js → chunk-GNLIR4RW.js} +2 -2
  14. package/bundle/{chunk-XG56CL6B.js → chunk-JCGNL7TH.js} +1 -1
  15. package/bundle/{chunk-ASZFEU6C.js → chunk-JO5YRKX4.js} +7 -7
  16. package/bundle/{chunk-GAS2GAYB.js → chunk-JPMNKIVX.js} +1 -1
  17. package/bundle/{chunk-S3MXVTTY.js → chunk-M33HH4UA.js} +242 -106
  18. package/bundle/{chunk-FVC4WCSP.js → chunk-OEY2TDVE.js} +1 -1
  19. package/bundle/{chunk-MNBBUQQS.js → chunk-PGYTXBPD.js} +3 -3
  20. package/bundle/{chunk-YW7SDLZQ.js → chunk-PXFYRLFH.js} +1 -1
  21. package/bundle/{chunk-7IKUWYZO.js → chunk-RBQHWQSS.js} +1 -1
  22. package/bundle/{chunk-7HKQGPWB.js → chunk-TYMOJXZO.js} +181 -45
  23. package/bundle/{chunk-QJ33O2NH.js → chunk-WE4JKUV6.js} +7 -7
  24. package/bundle/{chunk-LQJHQ4BU.js → chunk-WHCFVERV.js} +2 -2
  25. package/bundle/{cleanup-2HUWGXK6.js → cleanup-KTXX3JEU.js} +2 -2
  26. package/bundle/{cleanup-7N2HFE2E.js → cleanup-NLNXSTS6.js} +2 -2
  27. package/bundle/{cleanup-DA7OSZS5.js → cleanup-RW3JYSTT.js} +2 -2
  28. package/bundle/{core-CFPIDJ4Z.js → core-SU4ABXSV.js} +3 -1
  29. package/bundle/{dist-AMP5W5P2.js → core-WFITWJMX.js} +3 -1
  30. package/bundle/{devtoolsService-WMEEEXY6.js → devtoolsService-BUAVSMN6.js} +2 -2
  31. package/bundle/{devtoolsService-7YYOUGVF.js → devtoolsService-MNBGW66M.js} +2 -2
  32. package/bundle/{devtoolsService-VQSLUOYF.js → devtoolsService-P42LXPJX.js} +2 -2
  33. package/bundle/{core-2NMRPWUN.js → dist-2CGQYGZC.js} +3 -1
  34. package/bundle/docs/changelogs/preview.md +78 -94
  35. package/bundle/{gemini-OYYGXMHL.js → gemini-3PHRRMWS.js} +266 -20
  36. package/bundle/{gemini-5LF4JAP7.js → gemini-BUCCXM4N.js} +266 -20
  37. package/bundle/{gemini-PSRJNVY5.js → gemini-VIRT6VT3.js} +266 -20
  38. package/bundle/gemini.js +7 -7
  39. package/bundle/{interactiveCli-5E2C3XOC.js → interactiveCli-BP2ZFGLX.js} +8 -9
  40. package/bundle/{interactiveCli-PP7WTUZL.js → interactiveCli-GGARXT6P.js} +8 -9
  41. package/bundle/{interactiveCli-5O6FZS57.js → interactiveCli-N6VXS5Z4.js} +8 -9
  42. package/bundle/{liteRtServerManager-LK6HOSMO.js → liteRtServerManager-L46MRFSW.js} +4 -4
  43. package/bundle/{liteRtServerManager-ZPDALIDY.js → liteRtServerManager-QUODN3RR.js} +4 -4
  44. package/bundle/{liteRtServerManager-5QBFCLBK.js → liteRtServerManager-YLOGF7RQ.js} +4 -4
  45. package/bundle/{oauth2-provider-CO22I6UM.js → oauth2-provider-BKWSLZJ6.js} +1 -1
  46. package/bundle/{oauth2-provider-BGMEA7RS.js → oauth2-provider-IIC2YPC5.js} +1 -1
  47. package/bundle/{oauth2-provider-BYKBBEKI.js → oauth2-provider-KVIL4ITH.js} +1 -1
  48. package/bundle/policies/write.toml +10 -2
  49. package/bundle/sandbox-macos-permissive-open.sb +50 -0
  50. package/bundle/sandbox-macos-permissive-proxied.sb +50 -0
  51. package/bundle/sandbox-macos-restrictive-open.sb +50 -1
  52. package/bundle/sandbox-macos-restrictive-proxied.sb +50 -0
  53. package/bundle/sandbox-macos-strict-open.sb +50 -0
  54. package/bundle/sandbox-macos-strict-proxied.sb +50 -0
  55. package/bundle/{start-KH6WSP5C.js → start-2365H4YX.js} +6 -6
  56. package/bundle/{start-O6LWZY6K.js → start-VPQOFEIR.js} +6 -6
  57. package/bundle/{start-JRTTCV3K.js → start-Y7LKFE47.js} +6 -6
  58. package/package.json +1 -1
@@ -48566,13 +48566,13 @@ var require_path = __commonJS({
48566
48566
  "node_modules/@protobufjs/path/index.js"(exports2) {
48567
48567
  "use strict";
48568
48568
  var path114 = exports2;
48569
- var isAbsolute10 = (
48569
+ var isAbsolute11 = (
48570
48570
  /**
48571
48571
  * Tests if the specified path is absolute.
48572
48572
  * @param {string} path Path to test
48573
48573
  * @returns {boolean} `true` if path is absolute
48574
48574
  */
48575
- path114.isAbsolute = function isAbsolute11(path115) {
48575
+ path114.isAbsolute = function isAbsolute12(path115) {
48576
48576
  return /^(?:\/|\w+:)/.test(path115);
48577
48577
  }
48578
48578
  );
@@ -48584,7 +48584,7 @@ var require_path = __commonJS({
48584
48584
  */
48585
48585
  path114.normalize = function normalize7(path115) {
48586
48586
  path115 = path115.replace(/\\/g, "/").replace(/\/{2,}/g, "/");
48587
- var parts2 = path115.split("/"), absolute = isAbsolute10(path115), prefix = "";
48587
+ var parts2 = path115.split("/"), absolute = isAbsolute11(path115), prefix = "";
48588
48588
  if (absolute)
48589
48589
  prefix = parts2.shift() + "/";
48590
48590
  for (var i3 = 0; i3 < parts2.length; ) {
@@ -48606,7 +48606,7 @@ var require_path = __commonJS({
48606
48606
  path114.resolve = function resolve29(originPath, includePath, alreadyNormalized) {
48607
48607
  if (!alreadyNormalized)
48608
48608
  includePath = normalize6(includePath);
48609
- if (isAbsolute10(includePath))
48609
+ if (isAbsolute11(includePath))
48610
48610
  return includePath;
48611
48611
  if (!alreadyNormalized)
48612
48612
  originPath = normalize6(originPath);
@@ -253732,11 +253732,38 @@ function getSupportedAudioMimeTypeForFile(filePath) {
253732
253732
  }
253733
253733
  return extensionMimeType;
253734
253734
  }
253735
+ function canonicalizeMacosPath(p) {
253736
+ if (process.platform === "darwin") {
253737
+ if (p === "/var" || p.startsWith("/var/")) {
253738
+ return "/private" + p;
253739
+ }
253740
+ if (p === "/tmp" || p.startsWith("/tmp/")) {
253741
+ return "/private" + p;
253742
+ }
253743
+ if (p === "/etc" || p.startsWith("/etc/")) {
253744
+ return "/private" + p;
253745
+ }
253746
+ }
253747
+ return p;
253748
+ }
253735
253749
  function isWithinRoot(pathToCheck, rootDirectory) {
253736
- const normalizedPathToCheck = path7.resolve(pathToCheck);
253737
- const normalizedRootDirectory = path7.resolve(rootDirectory);
253750
+ const normalizedPathToCheck = canonicalizeMacosPath(path7.resolve(pathToCheck));
253751
+ const normalizedRootDirectory = canonicalizeMacosPath(path7.resolve(rootDirectory));
253738
253752
  const rootWithSeparator = normalizedRootDirectory === path7.sep || normalizedRootDirectory.endsWith(path7.sep) ? normalizedRootDirectory : normalizedRootDirectory + path7.sep;
253739
- return normalizedPathToCheck === normalizedRootDirectory || normalizedPathToCheck.startsWith(rootWithSeparator);
253753
+ if (normalizedPathToCheck === normalizedRootDirectory || normalizedPathToCheck.startsWith(rootWithSeparator)) {
253754
+ return true;
253755
+ }
253756
+ if (process.platform === "darwin") {
253757
+ try {
253758
+ const realPathToCheck = resolveToRealPath(normalizedPathToCheck);
253759
+ const realRootDirectory = resolveToRealPath(normalizedRootDirectory);
253760
+ const realRootWithSeparator = realRootDirectory === path7.sep || realRootDirectory.endsWith(path7.sep) ? realRootDirectory : realRootDirectory + path7.sep;
253761
+ return realPathToCheck === realRootDirectory || realPathToCheck.startsWith(realRootWithSeparator);
253762
+ } catch {
253763
+ return false;
253764
+ }
253765
+ }
253766
+ return false;
253740
253767
  }
253741
253768
  function getRealPath(filePath) {
253742
253769
  try {
@@ -256237,6 +256264,54 @@ var BASE_SEATBELT_PROFILE = `(version 1)
256237
256264
  (subpath "/dev")
256238
256265
  )
256239
256266
 
256267
+ ; Block Docker & container daemon UNIX domain sockets (read & write)
256268
+ (deny file-read* file-write*
256269
+ (literal "/var/run/docker.sock")
256270
+ (literal "/var/run/docker.sock.raw")
256271
+ (literal "/private/var/run/docker.sock")
256272
+ (literal "/private/var/run/docker.sock.raw")
256273
+ (subpath "/var/run/docker")
256274
+ (subpath "/private/var/run/docker")
256275
+ (subpath "/Users/Shared/.docker")
256276
+ (regex #"^/Users/[^/]+/\\.docker/run/")
256277
+ (regex #"^/Users/[^/]+/\\.docker/desktop/")
256278
+ (regex #"^/Users/[^/]+/\\.colima/")
256279
+ (regex #"^/Users/[^/]+/\\.orbstack/run/")
256280
+ (regex #"^/Users/[^/]+/\\.rd/")
256281
+ )
256282
+
256283
+ ; Block container CLI and daemon binaries from execution
256284
+ (deny process-exec
256285
+ (literal "/usr/local/bin/docker")
256286
+ (literal "/usr/local/bin/dockerd")
256287
+ (literal "/usr/local/bin/docker-compose")
256288
+ (literal "/usr/bin/docker")
256289
+ (literal "/opt/homebrew/bin/docker")
256290
+ (literal "/opt/homebrew/bin/dockerd")
256291
+ (literal "/opt/homebrew/bin/docker-compose")
256292
+ (literal "/opt/homebrew/bin/podman")
256293
+ (literal "/usr/local/bin/podman")
256294
+ (literal "/opt/homebrew/bin/colima")
256295
+ (literal "/usr/local/bin/colima")
256296
+ (literal "/opt/homebrew/bin/orb")
256297
+ (literal "/Applications/Docker.app/Contents/Resources/bin/docker")
256298
+ (subpath "/Applications/Docker.app/Contents/MacOS/")
256299
+ (subpath "/Applications/OrbStack.app/Contents/MacOS/")
256300
+ (subpath "/Applications/Rancher Desktop.app/Contents/MacOS/")
256301
+ )
256302
+
256303
+ ; Block com.docker.* and container manager Mach lookup / XPC services
256304
+ (deny mach-lookup
256305
+ (xpc-service-name-prefix "com.docker.")
256306
+ (global-name-prefix "com.docker.")
256307
+ (global-name-prefix "dev.kdrag0n.OrbStack")
256308
+ )
256309
+
256310
+ ; Block Docker POSIX Shared Memory
256311
+ (deny ipc-posix-shm*
256312
+ (ipc-posix-name-prefix "docker")
256313
+ (ipc-posix-name-prefix "com.docker.")
256314
+ )
256240
256315
  `;
256241
256316
  var NETWORK_SEATBELT_PROFILE = `
256242
256317
  ; Network Access
@@ -282559,8 +282634,8 @@ function isValidToolName(name3, options = {}) {
282559
282634
  }
282560
282635
 
282561
282636
  // packages/core/dist/src/generated/git-commit.js
282562
- var GIT_COMMIT_INFO = "1110ce8bc";
282563
- var CLI_VERSION = "0.57.0";
282637
+ var GIT_COMMIT_INFO = "812f7a2bc";
282638
+ var CLI_VERSION = "0.58.0-preview.0";
282564
282639
 
282565
282640
  // packages/core/dist/src/ide/detect-ide.js
282566
282641
  var IDE_DEFINITIONS = {
@@ -305854,7 +305929,7 @@ function getVersion() {
305854
305929
  }
305855
305930
  versionPromise = (async () => {
305856
305931
  const pkgJson = await getPackageJson(__dirname4);
305857
- return "0.57.0";
305932
+ return "0.58.0-preview.0";
305858
305933
  })();
305859
305934
  return versionPromise;
305860
305935
  }
@@ -311975,7 +312050,18 @@ function getNormalizedRelativePath(projectRoot, filePath, isDirectory) {
311975
312050
  if (!isWithinRoot(absoluteFilePath, projectRoot)) {
311976
312051
  return null;
311977
312052
  }
311978
- const relativePath = path45.relative(projectRoot, absoluteFilePath);
312053
+ const canonicalRoot = canonicalizeMacosPath(projectRoot);
312054
+ const canonicalAbs = canonicalizeMacosPath(absoluteFilePath);
312055
+ let relativePath = path45.relative(canonicalRoot, canonicalAbs);
312056
+ if (process.platform === "darwin" && relativePath.startsWith("..")) {
312057
+ try {
312058
+ const crossPlatformRel = path45.relative(resolveToRealPath(projectRoot), resolveToRealPath(absoluteFilePath));
312059
+ if (!crossPlatformRel.startsWith("..")) {
312060
+ relativePath = crossPlatformRel;
312061
+ }
312062
+ } catch {
312063
+ }
312064
+ }
311979
312065
  let normalized2 = relativePath.replace(/\\/g, "/");
311980
312066
  if (isDirectory && !normalized2.endsWith("/") && normalized2 !== "") {
311981
312067
  normalized2 += "/";
@@ -312296,14 +312382,18 @@ var FileDiscoveryService = class {
312296
312382
  }
312297
312383
  await Promise.all(dirEntries.map(async (entry) => {
312298
312384
  const fullPath = path49.join(currentDir, entry.name);
312385
+ const entryOptions = {
312386
+ ...options,
312387
+ isSymbolicLink: entry.isSymbolicLink()
312388
+ };
312299
312389
  if (entry.isDirectory()) {
312300
- if (this.shouldIgnoreDirectory(fullPath, options)) {
312390
+ if (this.shouldIgnoreDirectory(fullPath, entryOptions)) {
312301
312391
  ignoredPaths.push(fullPath);
312302
312392
  } else {
312303
312393
  await walk(fullPath);
312304
312394
  }
312305
312395
  } else {
312306
- if (this.shouldIgnoreFile(fullPath, options)) {
312396
+ if (this.shouldIgnoreFile(fullPath, entryOptions)) {
312307
312397
  ignoredPaths.push(fullPath);
312308
312398
  }
312309
312399
  }
@@ -312364,10 +312454,7 @@ var FileDiscoveryService = class {
312364
312454
  shouldIgnoreDirectory(dirPath, options = {}) {
312365
312455
  return this._shouldIgnore(dirPath, true, options);
312366
312456
  }
312367
- /**
312368
- * Internal unified check for paths.
312369
- */
312370
- _shouldIgnore(filePath, isDirectory, options = {}) {
312457
+ _checkIgnoreFilters(filePath, isDirectory, options = {}) {
312371
312458
  const { respectGitIgnore = this.defaultFilterFileOptions.respectGitIgnore, respectGeminiIgnore = this.defaultFilterFileOptions.respectGeminiIgnore } = options;
312372
312459
  if (respectGitIgnore && respectGeminiIgnore && this.combinedIgnoreFilter) {
312373
312460
  return this.combinedIgnoreFilter.isIgnored(filePath, isDirectory);
@@ -312383,6 +312470,31 @@ var FileDiscoveryService = class {
312383
312470
  }
312384
312471
  return false;
312385
312472
  }
312473
+ /**
312474
+ * Internal unified check for paths.
312475
+ */
312476
+ _shouldIgnore(filePath, isDirectory, options = {}) {
312477
+ if (this._checkIgnoreFilters(filePath, isDirectory, options)) {
312478
+ return true;
312479
+ }
312480
+ try {
312481
+ const absolutePath = path49.isAbsolute(filePath) ? filePath : path49.resolve(this.projectRoot, filePath);
312482
+ const isSymlink = options.isSymbolicLink ?? fs42.lstatSync(absolutePath, { throwIfNoEntry: false })?.isSymbolicLink() ?? false;
312483
+ if (isSymlink) {
312484
+ const realPath = resolveToRealPath(absolutePath);
312485
+ let targetIsDir = isDirectory;
312486
+ try {
312487
+ targetIsDir = fs42.statSync(realPath).isDirectory();
312488
+ } catch {
312489
+ }
312490
+ if (this._checkIgnoreFilters(realPath, targetIsDir, options)) {
312491
+ return true;
312492
+ }
312493
+ }
312494
+ } catch {
312495
+ }
312496
+ return false;
312497
+ }
312386
312498
  /**
312387
312499
  * Returns the list of ignore files being used (e.g. .geminiignore) excluding .gitignore.
312388
312500
  */
@@ -312535,7 +312647,7 @@ var ReadFileTool = class _ReadFileTool extends BaseDeclarativeTool {
312535
312647
  return "start_line cannot be greater than end_line";
312536
312648
  }
312537
312649
  const fileFilteringOptions = this.config.getFileFilteringOptions();
312538
- if (this.fileDiscoveryService.shouldIgnoreFile(resolvedPath, fileFilteringOptions)) {
312650
+ if (this.fileDiscoveryService.shouldIgnoreFile(sanitizedPath, fileFilteringOptions) || this.fileDiscoveryService.shouldIgnoreFile(resolvedPath, fileFilteringOptions)) {
312539
312651
  return `File path '${resolvedPath}' is ignored by configured ignore patterns.`;
312540
312652
  }
312541
312653
  return null;
@@ -322672,6 +322784,8 @@ ${truncated}`;
322672
322784
  }
322673
322785
  let spawnedPty;
322674
322786
  let cmdCleanup;
322787
+ let headlessTerminal;
322788
+ const disposables = [];
322675
322789
  try {
322676
322790
  const cols = shellExecutionConfig.terminalWidth ?? 80;
322677
322791
  const rows = shellExecutionConfig.terminalHeight ?? 30;
@@ -322697,17 +322811,18 @@ ${truncated}`;
322697
322811
  ...isWindowsPlatform ? { useConpty: true } : {}
322698
322812
  });
322699
322813
  spawnedPty = ptyProcess;
322700
- const ptyPid = Number(ptyProcess.pid);
322701
- const headlessTerminal = new Terminal({
322814
+ const pty = spawnedPty;
322815
+ const ptyPid = Number(pty.pid);
322816
+ headlessTerminal = new Terminal({
322702
322817
  allowProposedApi: true,
322703
322818
  cols,
322704
322819
  rows,
322705
322820
  scrollback: shellExecutionConfig.scrollback ?? SCROLLBACK_LIMIT
322706
322821
  });
322707
322822
  headlessTerminal.scrollToTop();
322823
+ const terminal = headlessTerminal;
322708
322824
  this.activePtys.set(ptyPid, {
322709
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
322710
- ptyProcess,
322825
+ ptyProcess: pty,
322711
322826
  headlessTerminal,
322712
322827
  maxSerializedLines: shellExecutionConfig.maxSerializedLines,
322713
322828
  command: shellExecutionConfig.originalCommand ?? commandToExecute,
@@ -322719,13 +322834,12 @@ ${truncated}`;
322719
322834
  if (!ExecutionLifecycleService.isActive(ptyPid)) {
322720
322835
  return;
322721
322836
  }
322722
- ptyProcess.write(input);
322837
+ pty.write(input);
322723
322838
  },
322724
322839
  kill: () => {
322725
322840
  killProcessGroup({
322726
322841
  pid: ptyPid,
322727
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
322728
- pty: ptyProcess
322842
+ pty
322729
322843
  }).catch(() => {
322730
322844
  });
322731
322845
  },
@@ -322739,11 +322853,11 @@ ${truncated}`;
322739
322853
  return false;
322740
322854
  }
322741
322855
  },
322742
- getBackgroundOutput: () => getFullBufferText(headlessTerminal),
322856
+ getBackgroundOutput: () => getFullBufferText(terminal),
322743
322857
  getSubscriptionSnapshot: () => {
322744
- const endLine = headlessTerminal.buffer.active.length;
322858
+ const endLine = terminal.buffer.active.length;
322745
322859
  const startLine = Math.max(0, endLine - (shellExecutionConfig.maxSerializedLines ?? 2e3));
322746
- const bufferData = serializeTerminalToObject(headlessTerminal, startLine, endLine);
322860
+ const bufferData = serializeTerminalToObject(terminal, startLine, endLine);
322747
322861
  return bufferData.length > 0 ? bufferData : void 0;
322748
322862
  },
322749
322863
  formatInjection: (output2, error41) => _ShellExecutionService.formatShellBackgroundCompletion(ptyPid, shellExecutionConfig.backgroundCompletionBehavior || "silent", output2, error41 ?? void 0),
@@ -322769,21 +322883,21 @@ ${truncated}`;
322769
322883
  }
322770
322884
  if (!shellExecutionConfig.disableDynamicLineTrimming) {
322771
322885
  if (!hasStartedOutput) {
322772
- const bufferText = getFullBufferText(headlessTerminal);
322886
+ const bufferText = getFullBufferText(terminal);
322773
322887
  if (bufferText.trim().length === 0) {
322774
322888
  return;
322775
322889
  }
322776
322890
  hasStartedOutput = true;
322777
322891
  }
322778
322892
  }
322779
- const buffer = headlessTerminal.buffer.active;
322893
+ const buffer = terminal.buffer.active;
322780
322894
  const endLine = buffer.length;
322781
322895
  const startLine = Math.max(0, endLine - (shellExecutionConfig.maxSerializedLines ?? 2e3));
322782
322896
  let newOutput;
322783
322897
  if (shellExecutionConfig.showColor) {
322784
- newOutput = serializeTerminalToObject(headlessTerminal, startLine, endLine);
322898
+ newOutput = serializeTerminalToObject(terminal, startLine, endLine);
322785
322899
  } else {
322786
- newOutput = (serializeTerminalToObject(headlessTerminal, startLine, endLine) || []).map((line) => line.map((token2) => {
322900
+ newOutput = (serializeTerminalToObject(terminal, startLine, endLine) || []).map((line) => line.map((token2) => {
322787
322901
  token2.fg = "";
322788
322902
  token2.bg = "";
322789
322903
  return token2;
@@ -322866,7 +322980,7 @@ ${truncated}`;
322866
322980
  _ShellExecutionService.syncBackgroundLog(ptyPid, decodedChunk);
322867
322981
  }
322868
322982
  isWriting = true;
322869
- headlessTerminal.write(decodedChunk, () => {
322983
+ terminal.write(decodedChunk, () => {
322870
322984
  render3();
322871
322985
  isWriting = false;
322872
322986
  resolveChunk();
@@ -322883,17 +322997,24 @@ ${truncated}`;
322883
322997
  }
322884
322998
  }));
322885
322999
  };
322886
- ptyProcess.onData((data) => {
323000
+ const dataListener = pty.onData((data) => {
322887
323001
  const bufferData = Buffer.from(data, "utf-8");
322888
323002
  handleOutput(bufferData);
322889
323003
  });
322890
- ptyProcess.onExit(({ exitCode, signal }) => {
323004
+ disposables.push(dataListener);
323005
+ const exitListener = pty.onExit(({ exitCode, signal }) => {
322891
323006
  exited = true;
322892
323007
  abortSignal.removeEventListener("abort", abortHandler);
322893
- _ShellExecutionService.destroyPtyProcess(ptyProcess);
323008
+ _ShellExecutionService.destroyPtyProcess(pty);
322894
323009
  const finalize = () => {
322895
323010
  render3(true);
322896
323011
  cmdCleanup?.();
323012
+ disposables.forEach((d) => {
323013
+ try {
323014
+ d.dispose();
323015
+ } catch {
323016
+ }
323017
+ });
322897
323018
  const event = {
322898
323019
  type: "exit",
322899
323020
  exitCode,
@@ -322909,12 +323030,12 @@ ${truncated}`;
322909
323030
  historyItem.endTime = Date.now();
322910
323031
  }
322911
323032
  onOutputEvent(event);
322912
- const endLine = headlessTerminal.buffer.active.length;
323033
+ const endLine = headlessTerminal ? headlessTerminal.buffer.active.length : 0;
322913
323034
  const startLine = Math.max(0, endLine - (shellExecutionConfig.maxSerializedLines ?? 2e3));
322914
- const ansiOutputSnapshot = serializeTerminalToObject(headlessTerminal, startLine, endLine);
322915
- const finalOutput = getFullBufferText(headlessTerminal);
323035
+ const ansiOutputSnapshot = headlessTerminal ? serializeTerminalToObject(headlessTerminal, startLine, endLine) : [];
323036
+ const finalOutput = headlessTerminal ? getFullBufferText(headlessTerminal) : "";
322916
323037
  try {
322917
- headlessTerminal.dispose();
323038
+ headlessTerminal?.dispose();
322918
323039
  } catch {
322919
323040
  }
322920
323041
  _ShellExecutionService.cleanupLogStream(ptyPid).then(() => {
@@ -322950,6 +323071,7 @@ ${truncated}`;
322950
323071
  finalize();
322951
323072
  });
322952
323073
  });
323074
+ disposables.push(exitListener);
322953
323075
  const abortHandler = async () => {
322954
323076
  if (ptyProcess.pid && !exited) {
322955
323077
  await killProcessGroup({
@@ -322969,10 +323091,23 @@ ${truncated}`;
322969
323091
  if (spawnedPty) {
322970
323092
  _ShellExecutionService.destroyPtyProcess(spawnedPty);
322971
323093
  }
322972
- if (error40?.message?.includes("posix_spawnp failed")) {
323094
+ if (headlessTerminal) {
323095
+ try {
323096
+ headlessTerminal.dispose();
323097
+ } catch {
323098
+ }
323099
+ }
323100
+ disposables.forEach((d) => {
323101
+ try {
323102
+ d.dispose();
323103
+ } catch {
323104
+ }
323105
+ });
323106
+ const isPtyCreationFailure = error40?.message?.includes("posix_spawnp failed") || error40?.message?.includes("ENXIO") || isNodeError(error40) && error40.code === "ENXIO" || error40?.message?.includes("Device not configured");
323107
+ if (isPtyCreationFailure) {
322973
323108
  onOutputEvent({
322974
323109
  type: "data",
322975
- chunk: "[GEMINI_CLI_WARNING] PTY execution failed, falling back to child_process. This may be due to sandbox restrictions.\n"
323110
+ chunk: "[GEMINI_CLI_WARNING] PTY execution failed, falling back to child_process. This may be due to terminal exhaustion or sandbox restrictions.\n"
322976
323111
  });
322977
323112
  throw e2;
322978
323113
  } else {
@@ -331554,13 +331689,13 @@ function stripToolCallIdPrefixes(contents) {
331554
331689
  };
331555
331690
  }
331556
331691
  }
331557
- const hasOtherKeys = Object.keys(newPart).some((key) => key !== "text" && key !== "thought" && key !== "callIndex" && newPart[key] !== void 0);
331692
+ const hasOtherKeys = Object.keys(newPart).some((key) => key !== "text" && key !== "thought" && key !== "callIndex");
331558
331693
  if (newPart.text !== void 0 && newPart.text === "" && hasOtherKeys) {
331559
331694
  delete newPart.text;
331560
331695
  }
331561
331696
  return newPart;
331562
331697
  }).filter((part) => {
331563
- const hasOtherKeys = Object.keys(part).some((key) => key !== "text" && key !== "thought" && key !== "callIndex" && part[key] !== void 0);
331698
+ const hasOtherKeys = Object.keys(part).some((key) => key !== "text" && key !== "thought" && key !== "callIndex");
331564
331699
  if (part.text !== void 0 && part.text === "" && !hasOtherKeys) {
331565
331700
  return false;
331566
331701
  }
@@ -338785,7 +338920,7 @@ var A2AAuthProviderFactory = class _A2AAuthProviderFactory {
338785
338920
  return provider;
338786
338921
  }
338787
338922
  case "oauth2": {
338788
- const { OAuth2AuthProvider } = await import("./oauth2-provider-BYKBBEKI.js");
338923
+ const { OAuth2AuthProvider } = await import("./oauth2-provider-KVIL4ITH.js");
338789
338924
  const provider = new OAuth2AuthProvider(authConfig, options.agentName ?? "unknown", agentCard, options.agentCardUrl);
338790
338925
  await provider.initialize();
338791
338926
  return provider;
@@ -395932,6 +396067,7 @@ export {
395932
396067
  detectBOM,
395933
396068
  readFileWithEncoding,
395934
396069
  getSpecificMimeType,
396070
+ canonicalizeMacosPath,
395935
396071
  isWithinRoot,
395936
396072
  getRealPath,
395937
396073
  isEmpty,
@@ -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-YW7SDLZQ.js";
5
+ } from "./chunk-BOI2NL3I.js";
6
6
  import {
7
7
  AppEvent,
8
8
  appEvents
@@ -59,14 +59,14 @@ import {
59
59
  stripUnsafeCharacters,
60
60
  toCodePoints,
61
61
  validateCustomTheme
62
- } from "./chunk-7ZGWPQVZ.js";
62
+ } from "./chunk-FJTXPUG2.js";
63
63
  import {
64
64
  isDevelopment
65
- } from "./chunk-AOE6E7MU.js";
65
+ } from "./chunk-WHCFVERV.js";
66
66
  import {
67
67
  emptyIcon,
68
68
  require_react
69
- } from "./chunk-TAWZWX2B.js";
69
+ } from "./chunk-OEY2TDVE.js";
70
70
  import {
71
71
  ALL_EDITORS,
72
72
  ApprovalMode,
@@ -231,7 +231,7 @@ import {
231
231
  tokenLimit,
232
232
  uiTelemetryService,
233
233
  unescapePath
234
- } from "./chunk-S3MXVTTY.js";
234
+ } from "./chunk-4KFMA4KD.js";
235
235
  import {
236
236
  require_src
237
237
  } from "./chunk-TUDYL3X4.js";
@@ -77164,7 +77164,7 @@ var authCommand = {
77164
77164
  import process29 from "node:process";
77165
77165
 
77166
77166
  // packages/cli/src/generated/git-commit.ts
77167
- var GIT_COMMIT_INFO = "1110ce8bc";
77167
+ var GIT_COMMIT_INFO = "812f7a2bc";
77168
77168
 
77169
77169
  // packages/cli/src/ui/utils/historyExportUtils.ts
77170
77170
  import * as fsPromises from "node:fs/promises";
@@ -82945,7 +82945,7 @@ Use /mcp auth <server-name> to authenticate.`
82945
82945
  type: "info",
82946
82946
  text: `Starting OAuth authentication for MCP server '${serverName}'...`
82947
82947
  });
82948
- const { MCPOAuthProvider } = await import("./core-CFPIDJ4Z.js");
82948
+ const { MCPOAuthProvider } = await import("./core-SU4ABXSV.js");
82949
82949
  let oauthConfig = server.oauth;
82950
82950
  if (!oauthConfig) {
82951
82951
  oauthConfig = { enabled: false };
@@ -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-GAS2GAYB.js";
4
+ } from "./chunk-RBQHWQSS.js";
5
5
  import {
6
6
  RELEASE_CHANNEL_STABILITY,
7
7
  debugLogger,
8
8
  getChannelFromVersion,
9
9
  isGitRepository
10
- } from "./chunk-7HKQGPWB.js";
10
+ } from "./chunk-4KFMA4KD.js";
11
11
 
12
12
  // packages/cli/src/utils/installationInfo.ts
13
13
  import * as fs from "node:fs";
@@ -11,8 +11,8 @@ import {
11
11
  runSyncCleanup,
12
12
  setupSignalHandlers,
13
13
  setupTtyCheck
14
- } from "./chunk-RLDNVR77.js";
15
- import "./chunk-DFPYJMVX.js";
14
+ } from "./chunk-JPMNKIVX.js";
15
+ import "./chunk-M33HH4UA.js";
16
16
  import "./chunk-664ZODQF.js";
17
17
  import "./chunk-IUUIT4SU.js";
18
18
  import "./chunk-TUDYL3X4.js";
@@ -11,8 +11,8 @@ import {
11
11
  runSyncCleanup,
12
12
  setupSignalHandlers,
13
13
  setupTtyCheck
14
- } from "./chunk-7IKUWYZO.js";
15
- import "./chunk-S3MXVTTY.js";
14
+ } from "./chunk-RBQHWQSS.js";
15
+ import "./chunk-4KFMA4KD.js";
16
16
  import "./chunk-664ZODQF.js";
17
17
  import "./chunk-IUUIT4SU.js";
18
18
  import "./chunk-TUDYL3X4.js";
@@ -11,8 +11,8 @@ import {
11
11
  runSyncCleanup,
12
12
  setupSignalHandlers,
13
13
  setupTtyCheck
14
- } from "./chunk-GAS2GAYB.js";
15
- import "./chunk-7HKQGPWB.js";
14
+ } from "./chunk-CNAVMEMA.js";
15
+ import "./chunk-TYMOJXZO.js";
16
16
  import "./chunk-664ZODQF.js";
17
17
  import "./chunk-IUUIT4SU.js";
18
18
  import "./chunk-TUDYL3X4.js";
@@ -553,6 +553,7 @@ import {
553
553
  buildUserSteeringHintPrompt,
554
554
  bytesToMB,
555
555
  calculateReplacement,
556
+ canonicalizeMacosPath,
556
557
  captureHeapSnapshot,
557
558
  categorizeAndConcatenate,
558
559
  checkExhaustive,
@@ -1083,7 +1084,7 @@ import {
1083
1084
  wrapUntrusted,
1084
1085
  writeToStderr,
1085
1086
  writeToStdout
1086
- } from "./chunk-S3MXVTTY.js";
1087
+ } from "./chunk-4KFMA4KD.js";
1087
1088
  import "./chunk-664ZODQF.js";
1088
1089
  import {
1089
1090
  SpanStatusCode,
@@ -1647,6 +1648,7 @@ export {
1647
1648
  buildUserSteeringHintPrompt,
1648
1649
  bytesToMB,
1649
1650
  calculateReplacement,
1651
+ canonicalizeMacosPath,
1650
1652
  captureHeapSnapshot,
1651
1653
  categorizeAndConcatenate,
1652
1654
  checkExhaustive,
@@ -553,6 +553,7 @@ import {
553
553
  buildUserSteeringHintPrompt,
554
554
  bytesToMB,
555
555
  calculateReplacement,
556
+ canonicalizeMacosPath,
556
557
  captureHeapSnapshot,
557
558
  categorizeAndConcatenate,
558
559
  checkExhaustive,
@@ -1083,7 +1084,7 @@ import {
1083
1084
  wrapUntrusted,
1084
1085
  writeToStderr,
1085
1086
  writeToStdout
1086
- } from "./chunk-7HKQGPWB.js";
1087
+ } from "./chunk-M33HH4UA.js";
1087
1088
  import "./chunk-664ZODQF.js";
1088
1089
  import {
1089
1090
  SpanStatusCode,
@@ -1647,6 +1648,7 @@ export {
1647
1648
  buildUserSteeringHintPrompt,
1648
1649
  bytesToMB,
1649
1650
  calculateReplacement,
1651
+ canonicalizeMacosPath,
1650
1652
  captureHeapSnapshot,
1651
1653
  categorizeAndConcatenate,
1652
1654
  checkExhaustive,
@@ -3,7 +3,7 @@ import {
3
3
  CoreEvent,
4
4
  coreEvents,
5
5
  debugLogger
6
- } from "./chunk-7HKQGPWB.js";
6
+ } from "./chunk-TYMOJXZO.js";
7
7
  import "./chunk-664ZODQF.js";
8
8
  import "./chunk-IUUIT4SU.js";
9
9
  import "./chunk-TUDYL3X4.js";
@@ -4325,7 +4325,7 @@ async function toggleDevToolsPanel(config, isOpen, toggle, setOpen) {
4325
4325
  return;
4326
4326
  }
4327
4327
  try {
4328
- const { openBrowserSecurely, shouldLaunchBrowser } = await import("./dist-AMP5W5P2.js");
4328
+ const { openBrowserSecurely, shouldLaunchBrowser } = await import("./dist-2CGQYGZC.js");
4329
4329
  const url = await startDevToolsServer(config);
4330
4330
  if (shouldLaunchBrowser()) {
4331
4331
  try {
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  coreEvents,
4
4
  debugLogger
5
- } from "./chunk-DFPYJMVX.js";
5
+ } from "./chunk-4KFMA4KD.js";
6
6
  import "./chunk-664ZODQF.js";
7
7
  import "./chunk-IUUIT4SU.js";
8
8
  import "./chunk-TUDYL3X4.js";
@@ -4324,7 +4324,7 @@ async function toggleDevToolsPanel(config, isOpen, toggle, setOpen) {
4324
4324
  return;
4325
4325
  }
4326
4326
  try {
4327
- const { openBrowserSecurely, shouldLaunchBrowser } = await import("./core-2NMRPWUN.js");
4327
+ const { openBrowserSecurely, shouldLaunchBrowser } = await import("./core-SU4ABXSV.js");
4328
4328
  const url = await startDevToolsServer(config);
4329
4329
  if (shouldLaunchBrowser()) {
4330
4330
  try {
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  coreEvents,
4
4
  debugLogger
5
- } from "./chunk-S3MXVTTY.js";
5
+ } from "./chunk-M33HH4UA.js";
6
6
  import "./chunk-664ZODQF.js";
7
7
  import "./chunk-IUUIT4SU.js";
8
8
  import "./chunk-TUDYL3X4.js";
@@ -4324,7 +4324,7 @@ async function toggleDevToolsPanel(config, isOpen, toggle, setOpen) {
4324
4324
  return;
4325
4325
  }
4326
4326
  try {
4327
- const { openBrowserSecurely, shouldLaunchBrowser } = await import("./core-CFPIDJ4Z.js");
4327
+ const { openBrowserSecurely, shouldLaunchBrowser } = await import("./core-WFITWJMX.js");
4328
4328
  const url = await startDevToolsServer(config);
4329
4329
  if (shouldLaunchBrowser()) {
4330
4330
  try {