@google/gemini-cli 0.39.0-preview.0 → 0.39.0-preview.1

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 (40) hide show
  1. package/bundle/{chunk-LF246RTE.js → chunk-7SQF544H.js} +385 -301
  2. package/bundle/{chunk-5ZBBJS2A.js → chunk-D5PDFQWX.js} +1 -1
  3. package/bundle/{chunk-NMO6M2JW.js → chunk-EZUZYRLG.js} +4 -4
  4. package/bundle/{chunk-CB4IHCOV.js → chunk-F2GDXAAF.js} +332 -288
  5. package/bundle/{chunk-ZFUMNFZD.js → chunk-IP2YTTJH.js} +6514 -11862
  6. package/bundle/{chunk-UCJYTRQH.js → chunk-MJR464GS.js} +1 -1
  7. package/bundle/{chunk-DY3XSEN6.js → chunk-OS555R2T.js} +2 -2
  8. package/bundle/{chunk-L5FKR6GE.js → chunk-OXN7IRB7.js} +4 -4
  9. package/bundle/chunk-P2IAFIFP.js +360274 -0
  10. package/bundle/chunk-QHUP5MEL.js +156 -0
  11. package/bundle/{chunk-KMWY7IVQ.js → chunk-TULI5SFB.js} +72 -60
  12. package/bundle/chunk-WHPMO3WR.js +101702 -0
  13. package/bundle/{cleanup-INA6FKQG.js → cleanup-C647TEIA.js} +2 -2
  14. package/bundle/{cleanup-DKDGF4IA.js → cleanup-CZSIFJCD.js} +3 -3
  15. package/bundle/cleanup-MYBJ6ZHP.js +33 -0
  16. package/bundle/{cleanup-B7STSNY5.js → cleanup-T6HLM5JP.js} +2 -2
  17. package/bundle/{core-6MCGZ334.js → core-IZKTELTX.js} +3 -1
  18. package/bundle/{devtoolsService-BXBCDCC2.js → devtoolsService-2ROQ6LME.js} +2 -2
  19. package/bundle/{devtoolsService-DDDJINQW.js → devtoolsService-CR2UJLLC.js} +5 -4
  20. package/bundle/{devtoolsService-QN4BQSIF.js → devtoolsService-GHSBU5R5.js} +2 -2
  21. package/bundle/devtoolsService-OEBSPLJN.js +871 -0
  22. package/bundle/{dist-2M52ZJGU.js → dist-ADH7BOBF.js} +3 -1
  23. package/bundle/{core-MYQB6KXT.js → dist-OST42PZR.js} +4 -2
  24. package/bundle/dist-ZMA73RD7.js +2010 -0
  25. package/bundle/docs/cli/plan-mode.md +1 -2
  26. package/bundle/{gemini-JFTJVXU4.js → gemini-6BFSWN53.js} +184 -169
  27. package/bundle/{gemini-TS2LMZH4.js → gemini-GUA6PG6F.js} +7 -7
  28. package/bundle/gemini-HENMLXDS.js +15321 -0
  29. package/bundle/{gemini-BA3BDBJT.js → gemini-IENVNLLQ.js} +7 -7
  30. package/bundle/gemini.js +3 -3
  31. package/bundle/{interactiveCli-7ZBDFPFP.js → interactiveCli-FCDJTVQ3.js} +6 -5
  32. package/bundle/{interactiveCli-W43ANBCL.js → interactiveCli-FMNSXXHR.js} +6 -5
  33. package/bundle/{interactiveCli-K6QHA2GI.js → interactiveCli-P3PFIHWL.js} +277 -259
  34. package/bundle/interactiveCli-SEQ7RLOB.js +34493 -0
  35. package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
  36. package/bundle/{oauth2-provider-53ZABNLX.js → oauth2-provider-6TB4NGWJ.js} +1 -1
  37. package/bundle/{oauth2-provider-3YCIQHIN.js → oauth2-provider-AUIG7Q6O.js} +1 -1
  38. package/bundle/{oauth2-provider-T4YYJWZG.js → oauth2-provider-IXDXXQ6U.js} +39 -73
  39. package/bundle/oauth2-provider-UF547EKT.js +237 -0
  40. package/package.json +1 -1
@@ -74756,7 +74756,7 @@ var require_util7 = __commonJS({
74756
74756
  function getFilesInPath(source) {
74757
74757
  const lstatSync2 = fs78.lstatSync;
74758
74758
  const readdirSync2 = fs78.readdirSync;
74759
- const join33 = path95.join;
74759
+ const join32 = path95.join;
74760
74760
  function isDirectory(source2) {
74761
74761
  return lstatSync2(source2).isDirectory();
74762
74762
  }
@@ -74765,12 +74765,12 @@ var require_util7 = __commonJS({
74765
74765
  }
74766
74766
  function getDirectories(source2) {
74767
74767
  return readdirSync2(source2).map((name3) => {
74768
- return join33(source2, name3);
74768
+ return join32(source2, name3);
74769
74769
  }).filter(isDirectory);
74770
74770
  }
74771
74771
  function getFiles(source2) {
74772
74772
  return readdirSync2(source2).map((name3) => {
74773
- return join33(source2, name3);
74773
+ return join32(source2, name3);
74774
74774
  }).filter(isFile2);
74775
74775
  }
74776
74776
  function getFilesRecursively(source2) {
@@ -104881,7 +104881,7 @@ var require_buffer_list = __commonJS({
104881
104881
  }
104882
104882
  }, {
104883
104883
  key: "join",
104884
- value: function join33(s2) {
104884
+ value: function join32(s2) {
104885
104885
  if (this.length === 0) return "";
104886
104886
  var p = this.head;
104887
104887
  var ret = "" + p.data;
@@ -251823,8 +251823,8 @@ import { createHash } from "node:crypto";
251823
251823
  import * as os12 from "node:os";
251824
251824
 
251825
251825
  // packages/core/src/generated/git-commit.ts
251826
- var GIT_COMMIT_INFO = "5b1f7375a";
251827
- var CLI_VERSION = "0.39.0-nightly.20260408.e77b22e63";
251826
+ var GIT_COMMIT_INFO = "8d4bd62d3";
251827
+ var CLI_VERSION = "0.39.0-preview.0";
251828
251828
 
251829
251829
  // packages/core/src/ide/detect-ide.ts
251830
251830
  var IDE_DEFINITIONS = {
@@ -257664,7 +257664,7 @@ function getLanguageFromFilePath(filePath) {
257664
257664
 
257665
257665
  // packages/core/src/tools/edit.ts
257666
257666
  import * as fsPromises2 from "node:fs/promises";
257667
- import * as path27 from "node:path";
257667
+ import * as path28 from "node:path";
257668
257668
  import * as os18 from "node:os";
257669
257669
  import * as crypto13 from "node:crypto";
257670
257670
 
@@ -276878,6 +276878,71 @@ function appendJitContextToParts(llmContent, jitContext) {
276878
276878
  return [...existingParts, jitPart];
276879
276879
  }
276880
276880
 
276881
+ // packages/core/src/utils/planUtils.ts
276882
+ import path27 from "node:path";
276883
+ var PlanErrorMessages = {
276884
+ PATH_ACCESS_DENIED: (planPath, plansDir) => `Access denied: plan path (${planPath}) must be within the designated plans directory (${plansDir}).`,
276885
+ FILE_NOT_FOUND: (path95) => `Plan file does not exist: ${path95}. You must create the plan file before requesting approval.`,
276886
+ FILE_EMPTY: "Plan file is empty. You must write content to the plan file before requesting approval.",
276887
+ READ_FAILURE: (detail) => `Failed to read plan file: ${detail}`
276888
+ };
276889
+ function resolveAndValidatePlanPath(planPath, plansDir, projectRoot) {
276890
+ const trimmedPath = planPath.trim();
276891
+ if (!trimmedPath) {
276892
+ throw new Error("Plan file path must be non-empty.");
276893
+ }
276894
+ if (path27.isAbsolute(trimmedPath)) {
276895
+ if (isSubpath(resolveToRealPath(plansDir), resolveToRealPath(trimmedPath))) {
276896
+ return trimmedPath;
276897
+ }
276898
+ }
276899
+ const resolvedFromProjectRoot = path27.resolve(projectRoot, trimmedPath);
276900
+ if (isSubpath(
276901
+ resolveToRealPath(plansDir),
276902
+ resolveToRealPath(resolvedFromProjectRoot)
276903
+ )) {
276904
+ return resolvedFromProjectRoot;
276905
+ }
276906
+ const resolvedPath = path27.resolve(plansDir, trimmedPath);
276907
+ const realPath = resolveToRealPath(resolvedPath);
276908
+ const realPlansDir = resolveToRealPath(plansDir);
276909
+ if (!isSubpath(realPlansDir, realPath)) {
276910
+ throw new Error(
276911
+ PlanErrorMessages.PATH_ACCESS_DENIED(trimmedPath, plansDir)
276912
+ );
276913
+ }
276914
+ return resolvedPath;
276915
+ }
276916
+ async function validatePlanPath(planPath, plansDir, projectRoot) {
276917
+ try {
276918
+ const resolvedPath = resolveAndValidatePlanPath(
276919
+ planPath,
276920
+ plansDir,
276921
+ projectRoot
276922
+ );
276923
+ if (!await fileExists(resolvedPath)) {
276924
+ return PlanErrorMessages.FILE_NOT_FOUND(planPath);
276925
+ }
276926
+ return null;
276927
+ } catch {
276928
+ return PlanErrorMessages.PATH_ACCESS_DENIED(
276929
+ planPath,
276930
+ resolveToRealPath(plansDir)
276931
+ );
276932
+ }
276933
+ }
276934
+ async function validatePlanContent(planPath) {
276935
+ try {
276936
+ if (await isEmpty(planPath)) {
276937
+ return PlanErrorMessages.FILE_EMPTY;
276938
+ }
276939
+ return null;
276940
+ } catch (err2) {
276941
+ const message = err2 instanceof Error ? err2.message : String(err2);
276942
+ return PlanErrorMessages.READ_FAILURE(message);
276943
+ }
276944
+ }
276945
+
276881
276946
  // packages/core/src/tools/edit.ts
276882
276947
  var ENABLE_FUZZY_MATCH_RECOVERY = true;
276883
276948
  var FUZZY_MATCH_THRESHOLD = 0.1;
@@ -277109,17 +277174,25 @@ var EditToolInvocation = class extends BaseToolInvocation {
277109
277174
  );
277110
277175
  this.config = config2;
277111
277176
  if (this.config.isPlanMode()) {
277112
- const safeFilename = path27.basename(this.params.file_path);
277113
- this.resolvedPath = path27.join(
277114
- this.config.storage.getPlansDir(),
277115
- safeFilename
277116
- );
277117
- } else if (!path27.isAbsolute(this.params.file_path)) {
277177
+ try {
277178
+ this.resolvedPath = resolveAndValidatePlanPath(
277179
+ this.params.file_path,
277180
+ this.config.storage.getPlansDir(),
277181
+ this.config.getProjectRoot()
277182
+ );
277183
+ } catch (e2) {
277184
+ debugLogger.error(
277185
+ "Failed to resolve plan path during EditTool invocation setup",
277186
+ e2
277187
+ );
277188
+ this.resolvedPath = this.params.file_path;
277189
+ }
277190
+ } else if (!path28.isAbsolute(this.params.file_path)) {
277118
277191
  const result2 = correctPath(this.params.file_path, this.config);
277119
277192
  if (result2.success) {
277120
277193
  this.resolvedPath = result2.correctedPath;
277121
277194
  } else {
277122
- this.resolvedPath = path27.resolve(
277195
+ this.resolvedPath = path28.resolve(
277123
277196
  this.config.getTargetDir(),
277124
277197
  this.params.file_path
277125
277198
  );
@@ -277355,7 +277428,7 @@ var EditToolInvocation = class extends BaseToolInvocation {
277355
277428
  debugLogger.log(`Error: ${editData.error.display}`);
277356
277429
  return false;
277357
277430
  }
277358
- const fileName = path27.basename(this.resolvedPath);
277431
+ const fileName = path28.basename(this.resolvedPath);
277359
277432
  const fileDiff = createPatch(
277360
277433
  fileName,
277361
277434
  editData.currentContent ?? "",
@@ -277458,7 +277531,7 @@ var EditToolInvocation = class extends BaseToolInvocation {
277458
277531
  if (editData.isNewFile) {
277459
277532
  displayResult = `Created ${shortenPath(makeRelative(this.resolvedPath, this.config.getTargetDir()))}`;
277460
277533
  } else {
277461
- const fileName = path27.basename(this.resolvedPath);
277534
+ const fileName = path28.basename(this.resolvedPath);
277462
277535
  const fileDiff = createPatch(
277463
277536
  fileName,
277464
277537
  editData.currentContent ?? "",
@@ -277549,7 +277622,7 @@ ${snippet2}`);
277549
277622
  * Creates parent directories if they don't exist
277550
277623
  */
277551
277624
  async ensureParentDirectoriesExistAsync(filePath) {
277552
- const dirName = path27.dirname(filePath);
277625
+ const dirName = path28.dirname(filePath);
277553
277626
  try {
277554
277627
  await fsPromises2.access(dirName);
277555
277628
  } catch {
@@ -277584,12 +277657,22 @@ var EditTool = class _EditTool extends BaseDeclarativeTool {
277584
277657
  return "The 'file_path' parameter must be non-empty.";
277585
277658
  }
277586
277659
  let resolvedPath;
277587
- if (!path27.isAbsolute(params.file_path)) {
277660
+ if (this.config.isPlanMode()) {
277661
+ try {
277662
+ resolvedPath = resolveAndValidatePlanPath(
277663
+ params.file_path,
277664
+ this.config.storage.getPlansDir(),
277665
+ this.config.getProjectRoot()
277666
+ );
277667
+ } catch (err2) {
277668
+ return err2 instanceof Error ? err2.message : String(err2);
277669
+ }
277670
+ } else if (!path28.isAbsolute(params.file_path)) {
277588
277671
  const result2 = correctPath(params.file_path, this.config);
277589
277672
  if (result2.success) {
277590
277673
  resolvedPath = result2.correctedPath;
277591
277674
  } else {
277592
- resolvedPath = path27.resolve(
277675
+ resolvedPath = path28.resolve(
277593
277676
  this.config.getTargetDir(),
277594
277677
  params.file_path
277595
277678
  );
@@ -277770,7 +277853,7 @@ async function calculateFuzzyReplacement(config2, context2) {
277770
277853
  // packages/core/src/tools/write-file.ts
277771
277854
  import fs30 from "node:fs";
277772
277855
  import fsPromises3 from "node:fs/promises";
277773
- import path28 from "node:path";
277856
+ import path29 from "node:path";
277774
277857
  import os19 from "node:os";
277775
277858
 
277776
277859
  // packages/core/src/utils/editCorrector.ts
@@ -277957,13 +278040,21 @@ var WriteFileToolInvocation = class extends BaseToolInvocation {
277957
278040
  );
277958
278041
  this.config = config2;
277959
278042
  if (this.config.isPlanMode()) {
277960
- const safeFilename = path28.basename(this.params.file_path);
277961
- this.resolvedPath = path28.join(
277962
- this.config.storage.getPlansDir(),
277963
- safeFilename
277964
- );
278043
+ try {
278044
+ this.resolvedPath = resolveAndValidatePlanPath(
278045
+ this.params.file_path,
278046
+ this.config.storage.getPlansDir(),
278047
+ this.config.getProjectRoot()
278048
+ );
278049
+ } catch (e2) {
278050
+ debugLogger.error(
278051
+ "Failed to resolve plan path during WriteFileTool invocation setup",
278052
+ e2
278053
+ );
278054
+ this.resolvedPath = this.params.file_path;
278055
+ }
277965
278056
  } else {
277966
- this.resolvedPath = path28.resolve(
278057
+ this.resolvedPath = path29.resolve(
277967
278058
  this.config.getTargetDir(),
277968
278059
  this.params.file_path
277969
278060
  );
@@ -278000,7 +278091,7 @@ var WriteFileToolInvocation = class extends BaseToolInvocation {
278000
278091
  this.resolvedPath,
278001
278092
  this.config.getTargetDir()
278002
278093
  );
278003
- const fileName = path28.basename(this.resolvedPath);
278094
+ const fileName = path29.basename(this.resolvedPath);
278004
278095
  const fileDiff = createPatch(
278005
278096
  fileName,
278006
278097
  originalContent,
@@ -278073,7 +278164,7 @@ var WriteFileToolInvocation = class extends BaseToolInvocation {
278073
278164
  } = correctedContentResult;
278074
278165
  const isNewFile = !fileExists2 || correctedContentResult.error !== void 0 && !correctedContentResult.fileExists;
278075
278166
  try {
278076
- const dirName = path28.dirname(this.resolvedPath);
278167
+ const dirName = path29.dirname(this.resolvedPath);
278077
278168
  try {
278078
278169
  await fsPromises3.access(dirName);
278079
278170
  } catch {
@@ -278085,7 +278176,7 @@ var WriteFileToolInvocation = class extends BaseToolInvocation {
278085
278176
  finalContent = finalContent.replace(/\r?\n/g, "\r\n");
278086
278177
  }
278087
278178
  await this.config.getFileSystemService().writeTextFile(this.resolvedPath, finalContent);
278088
- const fileName = path28.basename(this.resolvedPath);
278179
+ const fileName = path29.basename(this.resolvedPath);
278089
278180
  const currentContentForDiff = correctedContentResult.error ? "" : originalContent;
278090
278181
  const fileDiff = createPatch(
278091
278182
  fileName,
@@ -278119,7 +278210,7 @@ var WriteFileToolInvocation = class extends BaseToolInvocation {
278119
278210
  ${snippet2}`);
278120
278211
  const mimetype = getSpecificMimeType(this.resolvedPath);
278121
278212
  const programmingLanguage = getLanguageFromFilePath(this.resolvedPath);
278122
- const extension = path28.extname(this.resolvedPath);
278213
+ const extension = path29.extname(this.resolvedPath);
278123
278214
  const operation = isNewFile ? "create" /* CREATE */ : "update" /* UPDATE */;
278124
278215
  logFileOperation(
278125
278216
  this.config,
@@ -278207,7 +278298,20 @@ var WriteFileTool = class _WriteFileTool extends BaseDeclarativeTool {
278207
278298
  if (!filePath) {
278208
278299
  return `Missing or empty "file_path"`;
278209
278300
  }
278210
- const resolvedPath = path28.resolve(this.config.getTargetDir(), filePath);
278301
+ let resolvedPath;
278302
+ if (this.config.isPlanMode()) {
278303
+ try {
278304
+ resolvedPath = resolveAndValidatePlanPath(
278305
+ filePath,
278306
+ this.config.storage.getPlansDir(),
278307
+ this.config.getProjectRoot()
278308
+ );
278309
+ } catch (err2) {
278310
+ return err2 instanceof Error ? err2.message : String(err2);
278311
+ }
278312
+ } else {
278313
+ resolvedPath = path29.resolve(this.config.getTargetDir(), filePath);
278314
+ }
278211
278315
  const validationError = this.config.validatePathAccess(resolvedPath);
278212
278316
  if (validationError) {
278213
278317
  return validationError;
@@ -278433,25 +278537,25 @@ function hasError(response) {
278433
278537
  }
278434
278538
 
278435
278539
  // node_modules/read-package-up/index.js
278436
- import path31 from "node:path";
278540
+ import path32 from "node:path";
278437
278541
 
278438
278542
  // node_modules/find-up-simple/index.js
278439
278543
  import process11 from "node:process";
278440
278544
  import fsPromises4 from "node:fs/promises";
278441
278545
  import { fileURLToPath as fileURLToPath4 } from "node:url";
278442
- import path29 from "node:path";
278546
+ import path30 from "node:path";
278443
278547
  var toPath = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath4(urlOrPath) : urlOrPath;
278444
278548
  async function findUp(name3, {
278445
278549
  cwd = process11.cwd(),
278446
278550
  type: type2 = "file",
278447
278551
  stopAt
278448
278552
  } = {}) {
278449
- let directory = path29.resolve(toPath(cwd) ?? "");
278450
- const { root } = path29.parse(directory);
278451
- stopAt = path29.resolve(directory, toPath(stopAt ?? root));
278452
- const isAbsoluteName = path29.isAbsolute(name3);
278553
+ let directory = path30.resolve(toPath(cwd) ?? "");
278554
+ const { root } = path30.parse(directory);
278555
+ stopAt = path30.resolve(directory, toPath(stopAt ?? root));
278556
+ const isAbsoluteName = path30.isAbsolute(name3);
278453
278557
  while (directory) {
278454
- const filePath = isAbsoluteName ? name3 : path29.join(directory, name3);
278558
+ const filePath = isAbsoluteName ? name3 : path30.join(directory, name3);
278455
278559
  try {
278456
278560
  const stats = await fsPromises4.stat(filePath);
278457
278561
  if (type2 === "file" && stats.isFile() || type2 === "directory" && stats.isDirectory()) {
@@ -278462,13 +278566,13 @@ async function findUp(name3, {
278462
278566
  if (directory === stopAt || directory === root) {
278463
278567
  break;
278464
278568
  }
278465
- directory = path29.dirname(directory);
278569
+ directory = path30.dirname(directory);
278466
278570
  }
278467
278571
  }
278468
278572
 
278469
278573
  // node_modules/read-pkg/index.js
278470
278574
  import fsPromises5 from "node:fs/promises";
278471
- import path30 from "node:path";
278575
+ import path31 from "node:path";
278472
278576
 
278473
278577
  // node_modules/parse-json/index.js
278474
278578
  var import_code_frame = __toESM(require_lib7(), 1);
@@ -278597,7 +278701,7 @@ function toPath2(urlOrPath) {
278597
278701
  }
278598
278702
 
278599
278703
  // node_modules/read-pkg/index.js
278600
- var getPackagePath = (cwd) => path30.resolve(toPath2(cwd) ?? ".", "package.json");
278704
+ var getPackagePath = (cwd) => path31.resolve(toPath2(cwd) ?? ".", "package.json");
278601
278705
  var _readPackage = (file2, normalize4) => {
278602
278706
  const json3 = typeof file2 === "string" ? parseJson(file2) : file2;
278603
278707
  if (normalize4) {
@@ -278617,7 +278721,7 @@ async function readPackageUp(options) {
278617
278721
  return;
278618
278722
  }
278619
278723
  return {
278620
- packageJson: await readPackage({ ...options, cwd: path31.dirname(filePath) }),
278724
+ packageJson: await readPackage({ ...options, cwd: path32.dirname(filePath) }),
278621
278725
  path: filePath
278622
278726
  };
278623
278727
  }
@@ -278676,13 +278780,13 @@ async function isStable(cwd) {
278676
278780
 
278677
278781
  // packages/core/src/code_assist/experiments/client_metadata.ts
278678
278782
  import { fileURLToPath as fileURLToPath7 } from "node:url";
278679
- import path33 from "node:path";
278783
+ import path34 from "node:path";
278680
278784
 
278681
278785
  // packages/core/src/utils/version.ts
278682
278786
  import { fileURLToPath as fileURLToPath6 } from "node:url";
278683
- import path32 from "node:path";
278787
+ import path33 from "node:path";
278684
278788
  var __filename3 = fileURLToPath6(import.meta.url);
278685
- var __dirname4 = path32.dirname(__filename3);
278789
+ var __dirname4 = path33.dirname(__filename3);
278686
278790
  var versionPromise;
278687
278791
  function getVersion() {
278688
278792
  if (versionPromise) {
@@ -278690,7 +278794,7 @@ function getVersion() {
278690
278794
  }
278691
278795
  versionPromise = (async () => {
278692
278796
  const pkgJson = await getPackageJson(__dirname4);
278693
- return "0.39.0-nightly.20260408.e77b22e63";
278797
+ return "0.39.0-preview.0";
278694
278798
  })();
278695
278799
  return versionPromise;
278696
278800
  }
@@ -278700,7 +278804,7 @@ function resetVersionCache() {
278700
278804
 
278701
278805
  // packages/core/src/code_assist/experiments/client_metadata.ts
278702
278806
  var __filename4 = fileURLToPath7(import.meta.url);
278703
- var __dirname5 = path33.dirname(__filename4);
278807
+ var __dirname5 = path34.dirname(__filename4);
278704
278808
  var clientMetadataPromise;
278705
278809
  function getPlatform() {
278706
278810
  const platform10 = process.platform;
@@ -281063,7 +281167,7 @@ var ToolRegistry = class _ToolRegistry {
281063
281167
 
281064
281168
  // packages/core/src/tools/ls.ts
281065
281169
  import fs31 from "node:fs/promises";
281066
- import path34 from "node:path";
281170
+ import path35 from "node:path";
281067
281171
  var LSToolInvocation = class extends BaseToolInvocation {
281068
281172
  constructor(config2, params, messageBus, _toolName, _toolDisplayName) {
281069
281173
  super(params, messageBus, _toolName, _toolDisplayName);
@@ -281120,7 +281224,7 @@ var LSToolInvocation = class extends BaseToolInvocation {
281120
281224
  * @returns Result of the LS operation
281121
281225
  */
281122
281226
  async execute({ abortSignal: _signal }) {
281123
- const resolvedDirPath = path34.resolve(
281227
+ const resolvedDirPath = path35.resolve(
281124
281228
  this.config.getTargetDir(),
281125
281229
  this.params.dir_path
281126
281230
  );
@@ -281162,9 +281266,9 @@ var LSToolInvocation = class extends BaseToolInvocation {
281162
281266
  };
281163
281267
  }
281164
281268
  const relativePaths = files.map(
281165
- (file2) => path34.relative(
281269
+ (file2) => path35.relative(
281166
281270
  this.config.getTargetDir(),
281167
- path34.join(resolvedDirPath, file2)
281271
+ path35.join(resolvedDirPath, file2)
281168
281272
  )
281169
281273
  );
281170
281274
  const fileDiscovery = this.config.getFileService();
@@ -281174,15 +281278,15 @@ var LSToolInvocation = class extends BaseToolInvocation {
281174
281278
  });
281175
281279
  const entries2 = [];
281176
281280
  for (const relativePath of filteredPaths) {
281177
- const fullPath = path34.resolve(this.config.getTargetDir(), relativePath);
281178
- if (this.shouldIgnore(path34.basename(fullPath), this.params.ignore)) {
281281
+ const fullPath = path35.resolve(this.config.getTargetDir(), relativePath);
281282
+ if (this.shouldIgnore(path35.basename(fullPath), this.params.ignore)) {
281179
281283
  continue;
281180
281284
  }
281181
281285
  try {
281182
281286
  const stats2 = await fs31.stat(fullPath);
281183
281287
  const isDir = stats2.isDirectory();
281184
281288
  entries2.push({
281185
- name: path34.basename(fullPath),
281289
+ name: path35.basename(fullPath),
281186
281290
  path: fullPath,
281187
281291
  isDirectory: isDir,
281188
281292
  size: isDir ? 0 : stats2.size,
@@ -281258,7 +281362,7 @@ var LSTool = class _LSTool extends BaseDeclarativeTool {
281258
281362
  * @returns An error message string if invalid, null otherwise
281259
281363
  */
281260
281364
  validateToolParamValues(params) {
281261
- const resolvedPath = path34.resolve(
281365
+ const resolvedPath = path35.resolve(
281262
281366
  this.config.getTargetDir(),
281263
281367
  params.dir_path
281264
281368
  );
@@ -281279,7 +281383,7 @@ var LSTool = class _LSTool extends BaseDeclarativeTool {
281279
281383
  };
281280
281384
 
281281
281385
  // packages/core/src/tools/read-file.ts
281282
- import path40 from "node:path";
281386
+ import path41 from "node:path";
281283
281387
 
281284
281388
  // packages/core/src/telemetry/telemetry-utils.ts
281285
281389
  function getProgrammingLanguage(args2) {
@@ -281293,19 +281397,19 @@ function getProgrammingLanguage(args2) {
281293
281397
  // packages/core/src/utils/gitIgnoreParser.ts
281294
281398
  var import_ignore = __toESM(require_ignore(), 1);
281295
281399
  import * as fs32 from "node:fs";
281296
- import * as path36 from "node:path";
281400
+ import * as path37 from "node:path";
281297
281401
 
281298
281402
  // packages/core/src/utils/ignorePathUtils.ts
281299
- import * as path35 from "node:path";
281403
+ import * as path36 from "node:path";
281300
281404
  function getNormalizedRelativePath(projectRoot, filePath, isDirectory) {
281301
281405
  if (!filePath || typeof filePath !== "string") {
281302
281406
  return null;
281303
281407
  }
281304
- const absoluteFilePath = path35.resolve(projectRoot, filePath);
281408
+ const absoluteFilePath = path36.resolve(projectRoot, filePath);
281305
281409
  if (!isWithinRoot(absoluteFilePath, projectRoot)) {
281306
281410
  return null;
281307
281411
  }
281308
- const relativePath = path35.relative(projectRoot, absoluteFilePath);
281412
+ const relativePath = path36.relative(projectRoot, absoluteFilePath);
281309
281413
  let normalized2 = relativePath.replace(/\\/g, "/");
281310
281414
  if (isDirectory && !normalized2.endsWith("/") && normalized2 !== "") {
281311
281415
  normalized2 += "/";
@@ -281323,7 +281427,7 @@ function getNormalizedRelativePath(projectRoot, filePath, isDirectory) {
281323
281427
  var GitIgnoreParser = class {
281324
281428
  constructor(projectRoot, extraPatterns) {
281325
281429
  this.extraPatterns = extraPatterns;
281326
- this.projectRoot = path36.resolve(projectRoot);
281430
+ this.projectRoot = path37.resolve(projectRoot);
281327
281431
  this.processedExtraPatterns = (0, import_ignore.default)();
281328
281432
  if (this.extraPatterns) {
281329
281433
  this.processedExtraPatterns.add(
@@ -281343,9 +281447,9 @@ var GitIgnoreParser = class {
281343
281447
  return (0, import_ignore.default)();
281344
281448
  }
281345
281449
  const isExcludeFile = patternsFilePath.endsWith(
281346
- path36.join(".git", "info", "exclude")
281450
+ path37.join(".git", "info", "exclude")
281347
281451
  );
281348
- const relativeBaseDir = isExcludeFile ? "." : path36.dirname(path36.relative(this.projectRoot, patternsFilePath)).split(path36.sep).join(path36.posix.sep);
281452
+ const relativeBaseDir = isExcludeFile ? "." : path37.dirname(path37.relative(this.projectRoot, patternsFilePath)).split(path37.sep).join(path37.posix.sep);
281349
281453
  const rawPatterns = content.split("\n");
281350
281454
  return (0, import_ignore.default)().add(this.processPatterns(rawPatterns, relativeBaseDir));
281351
281455
  }
@@ -281365,9 +281469,9 @@ var GitIgnoreParser = class {
281365
281469
  let newPattern = p;
281366
281470
  if (relativeBaseDir && relativeBaseDir !== ".") {
281367
281471
  if (!isAnchoredInFile && !p.includes("/")) {
281368
- newPattern = path36.posix.join("**", p);
281472
+ newPattern = path37.posix.join("**", p);
281369
281473
  }
281370
- newPattern = path36.posix.join(relativeBaseDir, newPattern);
281474
+ newPattern = path37.posix.join(relativeBaseDir, newPattern);
281371
281475
  if (!newPattern.startsWith("/")) {
281372
281476
  newPattern = "/" + newPattern;
281373
281477
  }
@@ -281393,7 +281497,7 @@ var GitIgnoreParser = class {
281393
281497
  try {
281394
281498
  const ig = (0, import_ignore.default)().add(".git");
281395
281499
  if (this.globalPatterns === void 0) {
281396
- const excludeFile = path36.join(
281500
+ const excludeFile = path37.join(
281397
281501
  this.projectRoot,
281398
281502
  ".git",
281399
281503
  "info",
@@ -281406,11 +281510,11 @@ var GitIgnoreParser = class {
281406
281510
  let currentAbsDir = this.projectRoot;
281407
281511
  const dirsToVisit = [this.projectRoot];
281408
281512
  for (let i3 = 0; i3 < pathParts.length - 1; i3++) {
281409
- currentAbsDir = path36.join(currentAbsDir, pathParts[i3]);
281513
+ currentAbsDir = path37.join(currentAbsDir, pathParts[i3]);
281410
281514
  dirsToVisit.push(currentAbsDir);
281411
281515
  }
281412
281516
  for (const dir of dirsToVisit) {
281413
- const relativeDir = path36.relative(this.projectRoot, dir);
281517
+ const relativeDir = path37.relative(this.projectRoot, dir);
281414
281518
  if (relativeDir) {
281415
281519
  const parentDirRelative = getNormalizedRelativePath(
281416
281520
  this.projectRoot,
@@ -281424,7 +281528,7 @@ var GitIgnoreParser = class {
281424
281528
  }
281425
281529
  let patterns = this.cache.get(dir);
281426
281530
  if (patterns === void 0) {
281427
- const gitignorePath = path36.join(dir, ".gitignore");
281531
+ const gitignorePath = path37.join(dir, ".gitignore");
281428
281532
  patterns = fs32.existsSync(gitignorePath) ? this.loadPatternsForFile(gitignorePath) : (0, import_ignore.default)();
281429
281533
  this.cache.set(dir, patterns);
281430
281534
  }
@@ -281440,14 +281544,14 @@ var GitIgnoreParser = class {
281440
281544
  // packages/core/src/utils/ignoreFileParser.ts
281441
281545
  var import_ignore2 = __toESM(require_ignore(), 1);
281442
281546
  import * as fs33 from "node:fs";
281443
- import * as path37 from "node:path";
281547
+ import * as path38 from "node:path";
281444
281548
  var IgnoreFileParser = class {
281445
281549
  projectRoot;
281446
281550
  patterns = [];
281447
281551
  ig = (0, import_ignore2.default)();
281448
281552
  fileNames;
281449
281553
  constructor(projectRoot, input, isPatterns = false) {
281450
- this.projectRoot = path37.resolve(projectRoot);
281554
+ this.projectRoot = path38.resolve(projectRoot);
281451
281555
  if (isPatterns) {
281452
281556
  this.fileNames = [];
281453
281557
  const patterns = Array.isArray(input) ? input : [input];
@@ -281466,7 +281570,7 @@ var IgnoreFileParser = class {
281466
281570
  }
281467
281571
  }
281468
281572
  parseIgnoreFile(fileName) {
281469
- const patternsFilePath = path37.join(this.projectRoot, fileName);
281573
+ const patternsFilePath = path38.join(this.projectRoot, fileName);
281470
281574
  let content;
281471
281575
  try {
281472
281576
  content = fs33.readFileSync(patternsFilePath, "utf-8");
@@ -281497,7 +281601,7 @@ var IgnoreFileParser = class {
281497
281601
  return this.patterns;
281498
281602
  }
281499
281603
  getIgnoreFilePaths() {
281500
- return this.fileNames.slice().reverse().map((fileName) => path37.join(this.projectRoot, fileName)).filter((filePath) => fs33.existsSync(filePath));
281604
+ return this.fileNames.slice().reverse().map((fileName) => path38.join(this.projectRoot, fileName)).filter((filePath) => fs33.existsSync(filePath));
281501
281605
  }
281502
281606
  /**
281503
281607
  * Returns true if at least one ignore file exists and has patterns.
@@ -281509,16 +281613,16 @@ var IgnoreFileParser = class {
281509
281613
 
281510
281614
  // packages/core/src/utils/gitUtils.ts
281511
281615
  import * as fs34 from "node:fs";
281512
- import * as path38 from "node:path";
281616
+ import * as path39 from "node:path";
281513
281617
  function isGitRepository(directory) {
281514
281618
  try {
281515
- let currentDir = path38.resolve(directory);
281619
+ let currentDir = path39.resolve(directory);
281516
281620
  while (true) {
281517
- const gitDir = path38.join(currentDir, ".git");
281621
+ const gitDir = path39.join(currentDir, ".git");
281518
281622
  if (fs34.existsSync(gitDir)) {
281519
281623
  return true;
281520
281624
  }
281521
- const parentDir = path38.dirname(currentDir);
281625
+ const parentDir = path39.dirname(currentDir);
281522
281626
  if (parentDir === currentDir) {
281523
281627
  break;
281524
281628
  }
@@ -281531,13 +281635,13 @@ function isGitRepository(directory) {
281531
281635
  }
281532
281636
  function findGitRoot(directory) {
281533
281637
  try {
281534
- let currentDir = path38.resolve(directory);
281638
+ let currentDir = path39.resolve(directory);
281535
281639
  while (true) {
281536
- const gitDir = path38.join(currentDir, ".git");
281640
+ const gitDir = path39.join(currentDir, ".git");
281537
281641
  if (fs34.existsSync(gitDir)) {
281538
281642
  return currentDir;
281539
281643
  }
281540
- const parentDir = path38.dirname(currentDir);
281644
+ const parentDir = path39.dirname(currentDir);
281541
281645
  if (parentDir === currentDir) {
281542
281646
  break;
281543
281647
  }
@@ -281551,7 +281655,7 @@ function findGitRoot(directory) {
281551
281655
 
281552
281656
  // packages/core/src/services/fileDiscoveryService.ts
281553
281657
  import fs35 from "node:fs";
281554
- import * as path39 from "node:path";
281658
+ import * as path40 from "node:path";
281555
281659
  var FileDiscoveryService = class {
281556
281660
  gitIgnoreFilter = null;
281557
281661
  geminiIgnoreFilter = null;
@@ -281564,7 +281668,7 @@ var FileDiscoveryService = class {
281564
281668
  };
281565
281669
  projectRoot;
281566
281670
  constructor(projectRoot, options) {
281567
- this.projectRoot = path39.resolve(projectRoot);
281671
+ this.projectRoot = path40.resolve(projectRoot);
281568
281672
  this.applyFilterFilesOptions(options);
281569
281673
  if (isGitRepository(this.projectRoot)) {
281570
281674
  this.gitIgnoreFilter = new GitIgnoreParser(this.projectRoot);
@@ -281619,7 +281723,7 @@ var FileDiscoveryService = class {
281619
281723
  }
281620
281724
  await Promise.all(
281621
281725
  dirEntries.map(async (entry) => {
281622
- const fullPath = path39.join(currentDir, entry.name);
281726
+ const fullPath = path40.join(currentDir, entry.name);
281623
281727
  if (entry.isDirectory()) {
281624
281728
  if (this.shouldIgnoreDirectory(fullPath, options)) {
281625
281729
  ignoredPaths.push(fullPath);
@@ -281729,7 +281833,7 @@ var FileDiscoveryService = class {
281729
281833
  getAllIgnoreFilePaths() {
281730
281834
  const paths = [];
281731
281835
  if (this.gitIgnoreFilter && this.defaultFilterFileOptions.respectGitIgnore) {
281732
- const gitIgnorePath = path39.join(this.projectRoot, ".gitignore");
281836
+ const gitIgnorePath = path40.join(this.projectRoot, ".gitignore");
281733
281837
  if (fs35.existsSync(gitIgnorePath)) {
281734
281838
  paths.push(gitIgnorePath);
281735
281839
  }
@@ -281743,7 +281847,7 @@ var ReadFileToolInvocation = class extends BaseToolInvocation {
281743
281847
  constructor(config2, params, messageBus, _toolName, _toolDisplayName) {
281744
281848
  super(params, messageBus, _toolName, _toolDisplayName);
281745
281849
  this.config = config2;
281746
- this.resolvedPath = path40.resolve(
281850
+ this.resolvedPath = path41.resolve(
281747
281851
  this.config.getTargetDir(),
281748
281852
  this.params.file_path
281749
281853
  );
@@ -281827,7 +281931,7 @@ ${result2.llmContent}`;
281827
281931
  "read" /* READ */,
281828
281932
  lines,
281829
281933
  mimetype,
281830
- path40.extname(this.resolvedPath),
281934
+ path41.extname(this.resolvedPath),
281831
281935
  programming_language
281832
281936
  )
281833
281937
  );
@@ -281869,7 +281973,7 @@ var ReadFileTool = class _ReadFileTool extends BaseDeclarativeTool {
281869
281973
  if (params.file_path.trim() === "") {
281870
281974
  return "The 'file_path' parameter must be non-empty.";
281871
281975
  }
281872
- const resolvedPath = path40.resolve(
281976
+ const resolvedPath = path41.resolve(
281873
281977
  this.config.getTargetDir(),
281874
281978
  params.file_path
281875
281979
  );
@@ -281915,7 +282019,7 @@ var ReadFileTool = class _ReadFileTool extends BaseDeclarativeTool {
281915
282019
  // packages/core/src/tools/grep.ts
281916
282020
  import fs36 from "node:fs";
281917
282021
  import fsPromises7 from "node:fs/promises";
281918
- import path42 from "node:path";
282022
+ import path43 from "node:path";
281919
282023
  import { spawn as spawn5 } from "node:child_process";
281920
282024
 
281921
282025
  // node_modules/balanced-match/dist/esm/index.js
@@ -282976,11 +283080,11 @@ var qmarksTestNoExtDot = ([$0]) => {
282976
283080
  return (f) => f.length === len && f !== "." && f !== "..";
282977
283081
  };
282978
283082
  var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
282979
- var path41 = {
283083
+ var path42 = {
282980
283084
  win32: { sep: "\\" },
282981
283085
  posix: { sep: "/" }
282982
283086
  };
282983
- var sep3 = defaultPlatform === "win32" ? path41.win32.sep : path41.posix.sep;
283087
+ var sep3 = defaultPlatform === "win32" ? path42.win32.sep : path42.posix.sep;
282984
283088
  minimatch.sep = sep3;
282985
283089
  var GLOBSTAR = Symbol("globstar **");
282986
283090
  minimatch.GLOBSTAR = GLOBSTAR;
@@ -288967,14 +289071,14 @@ var GrepToolInvocation = class extends BaseToolInvocation {
288967
289071
  const [, filePathRaw, lineNumberStr, lineContent] = match2;
288968
289072
  const lineNumber = parseInt(lineNumberStr, 10);
288969
289073
  if (!isNaN(lineNumber)) {
288970
- const absoluteFilePath = path42.resolve(basePath, filePathRaw);
288971
- const relativeCheck = path42.relative(basePath, absoluteFilePath);
288972
- if (relativeCheck === ".." || relativeCheck.startsWith(`..${path42.sep}`) || path42.isAbsolute(relativeCheck)) {
289074
+ const absoluteFilePath = path43.resolve(basePath, filePathRaw);
289075
+ const relativeCheck = path43.relative(basePath, absoluteFilePath);
289076
+ if (relativeCheck === ".." || relativeCheck.startsWith(`..${path43.sep}`) || path43.isAbsolute(relativeCheck)) {
288973
289077
  return null;
288974
289078
  }
288975
- const relativeFilePath = path42.relative(basePath, absoluteFilePath);
289079
+ const relativeFilePath = path43.relative(basePath, absoluteFilePath);
288976
289080
  return {
288977
- filePath: relativeFilePath || path42.basename(absoluteFilePath),
289081
+ filePath: relativeFilePath || path43.basename(absoluteFilePath),
288978
289082
  absolutePath: absoluteFilePath,
288979
289083
  lineNumber,
288980
289084
  line: lineContent
@@ -288988,7 +289092,7 @@ var GrepToolInvocation = class extends BaseToolInvocation {
288988
289092
  const pathParam = this.params.dir_path;
288989
289093
  let searchDirAbs = null;
288990
289094
  if (pathParam) {
288991
- searchDirAbs = path42.resolve(this.config.getTargetDir(), pathParam);
289095
+ searchDirAbs = path43.resolve(this.config.getTargetDir(), pathParam);
288992
289096
  const validationError = this.config.validatePathAccess(
288993
289097
  searchDirAbs,
288994
289098
  "read"
@@ -289072,9 +289176,9 @@ var GrepToolInvocation = class extends BaseToolInvocation {
289072
289176
  signal: timeoutController.signal
289073
289177
  });
289074
289178
  if (searchDirectories.length > 1) {
289075
- const dirName = path42.basename(searchDir);
289179
+ const dirName = path43.basename(searchDir);
289076
289180
  matches.forEach((match2) => {
289077
- match2.filePath = path42.join(dirName, match2.filePath);
289181
+ match2.filePath = path43.join(dirName, match2.filePath);
289078
289182
  });
289079
289183
  }
289080
289184
  allMatches = allMatches.concat(matches);
@@ -289329,8 +289433,8 @@ var GrepToolInvocation = class extends BaseToolInvocation {
289329
289433
  for await (const filePath of filesStream) {
289330
289434
  if (allMatches.length >= maxMatches) break;
289331
289435
  const fileAbsolutePath = filePath;
289332
- const relativePath = path42.relative(absolutePath, fileAbsolutePath);
289333
- if (relativePath === ".." || relativePath.startsWith(`..${path42.sep}`) || path42.isAbsolute(relativePath))
289436
+ const relativePath = path43.relative(absolutePath, fileAbsolutePath);
289437
+ if (relativePath === ".." || relativePath.startsWith(`..${path43.sep}`) || path43.isAbsolute(relativePath))
289334
289438
  continue;
289335
289439
  try {
289336
289440
  const content = await fsPromises7.readFile(fileAbsolutePath, "utf8");
@@ -289343,7 +289447,7 @@ var GrepToolInvocation = class extends BaseToolInvocation {
289343
289447
  continue;
289344
289448
  }
289345
289449
  allMatches.push({
289346
- filePath: path42.relative(absolutePath, fileAbsolutePath) || path42.basename(fileAbsolutePath),
289450
+ filePath: path43.relative(absolutePath, fileAbsolutePath) || path43.basename(fileAbsolutePath),
289347
289451
  absolutePath: fileAbsolutePath,
289348
289452
  lineNumber: index + 1,
289349
289453
  line
@@ -289381,7 +289485,7 @@ var GrepToolInvocation = class extends BaseToolInvocation {
289381
289485
  description += ` in ${this.params.include_pattern}`;
289382
289486
  }
289383
289487
  if (this.params.dir_path) {
289384
- const resolvedPath = path42.resolve(
289488
+ const resolvedPath = path43.resolve(
289385
289489
  this.config.getTargetDir(),
289386
289490
  this.params.dir_path
289387
289491
  );
@@ -289444,7 +289548,7 @@ var GrepTool = class _GrepTool extends BaseDeclarativeTool {
289444
289548
  return "total_max_matches must be at least 1.";
289445
289549
  }
289446
289550
  if (params.dir_path) {
289447
- const resolvedPath = path42.resolve(
289551
+ const resolvedPath = path43.resolve(
289448
289552
  this.config.getTargetDir(),
289449
289553
  params.dir_path
289450
289554
  );
@@ -289486,10 +289590,10 @@ var GrepTool = class _GrepTool extends BaseDeclarativeTool {
289486
289590
  // packages/core/src/tools/ripGrep.ts
289487
289591
  import fs38 from "node:fs";
289488
289592
  import fsPromises9 from "node:fs/promises";
289489
- import path50 from "node:path";
289593
+ import path51 from "node:path";
289490
289594
 
289491
289595
  // node_modules/@joshua.litt/get-ripgrep/dist/index.js
289492
- import { dirname as dirname9, join as join14 } from "node:path";
289596
+ import { dirname as dirname9, join as join13 } from "node:path";
289493
289597
  import { fileURLToPath as fileURLToPath13 } from "node:url";
289494
289598
 
289495
289599
  // node_modules/@lvce-editor/verror/dist/index.js
@@ -290390,12 +290494,12 @@ var handleCommand = (filePath, rawArguments, rawOptions) => {
290390
290494
 
290391
290495
  // node_modules/execa/lib/arguments/options.js
290392
290496
  var import_cross_spawn2 = __toESM(require_cross_spawn(), 1);
290393
- import path47 from "node:path";
290497
+ import path48 from "node:path";
290394
290498
  import process16 from "node:process";
290395
290499
 
290396
290500
  // node_modules/npm-run-path/index.js
290397
290501
  import process14 from "node:process";
290398
- import path44 from "node:path";
290502
+ import path45 from "node:path";
290399
290503
 
290400
290504
  // node_modules/npm-run-path/node_modules/path-key/index.js
290401
290505
  function pathKey(options = {}) {
@@ -290412,7 +290516,7 @@ function pathKey(options = {}) {
290412
290516
  // node_modules/npm-run-path/node_modules/unicorn-magic/node.js
290413
290517
  import { promisify as promisify8 } from "node:util";
290414
290518
  import { execFile as execFileCallback, execFileSync as execFileSyncOriginal } from "node:child_process";
290415
- import path43 from "node:path";
290519
+ import path44 from "node:path";
290416
290520
  import { fileURLToPath as fileURLToPath11 } from "node:url";
290417
290521
  var execFileOriginal = promisify8(execFileCallback);
290418
290522
  function toPath3(urlOrPath) {
@@ -290421,12 +290525,12 @@ function toPath3(urlOrPath) {
290421
290525
  function traversePathUp(startPath) {
290422
290526
  return {
290423
290527
  *[Symbol.iterator]() {
290424
- let currentPath = path43.resolve(toPath3(startPath));
290528
+ let currentPath = path44.resolve(toPath3(startPath));
290425
290529
  let previousPath;
290426
290530
  while (previousPath !== currentPath) {
290427
290531
  yield currentPath;
290428
290532
  previousPath = currentPath;
290429
- currentPath = path43.resolve(currentPath, "..");
290533
+ currentPath = path44.resolve(currentPath, "..");
290430
290534
  }
290431
290535
  }
290432
290536
  };
@@ -290441,27 +290545,27 @@ var npmRunPath = ({
290441
290545
  execPath: execPath2 = process14.execPath,
290442
290546
  addExecPath = true
290443
290547
  } = {}) => {
290444
- const cwdPath = path44.resolve(toPath3(cwd));
290548
+ const cwdPath = path45.resolve(toPath3(cwd));
290445
290549
  const result2 = [];
290446
- const pathParts = pathOption.split(path44.delimiter);
290550
+ const pathParts = pathOption.split(path45.delimiter);
290447
290551
  if (preferLocal) {
290448
290552
  applyPreferLocal(result2, pathParts, cwdPath);
290449
290553
  }
290450
290554
  if (addExecPath) {
290451
290555
  applyExecPath(result2, pathParts, execPath2, cwdPath);
290452
290556
  }
290453
- return pathOption === "" || pathOption === path44.delimiter ? `${result2.join(path44.delimiter)}${pathOption}` : [...result2, pathOption].join(path44.delimiter);
290557
+ return pathOption === "" || pathOption === path45.delimiter ? `${result2.join(path45.delimiter)}${pathOption}` : [...result2, pathOption].join(path45.delimiter);
290454
290558
  };
290455
290559
  var applyPreferLocal = (result2, pathParts, cwdPath) => {
290456
290560
  for (const directory of traversePathUp(cwdPath)) {
290457
- const pathPart = path44.join(directory, "node_modules/.bin");
290561
+ const pathPart = path45.join(directory, "node_modules/.bin");
290458
290562
  if (!pathParts.includes(pathPart)) {
290459
290563
  result2.push(pathPart);
290460
290564
  }
290461
290565
  }
290462
290566
  };
290463
290567
  var applyExecPath = (result2, pathParts, execPath2, cwdPath) => {
290464
- const pathPart = path44.resolve(cwdPath, toPath3(execPath2), "..");
290568
+ const pathPart = path45.resolve(cwdPath, toPath3(execPath2), "..");
290465
290569
  if (!pathParts.includes(pathPart)) {
290466
290570
  result2.push(pathPart);
290467
290571
  }
@@ -291616,7 +291720,7 @@ var killAfterTimeout = async (subprocess, timeout, context2, { signal }) => {
291616
291720
 
291617
291721
  // node_modules/execa/lib/methods/node.js
291618
291722
  import { execPath, execArgv } from "node:process";
291619
- import path45 from "node:path";
291723
+ import path46 from "node:path";
291620
291724
  var mapNode = ({ options }) => {
291621
291725
  if (options.node === false) {
291622
291726
  throw new TypeError('The "node" option cannot be false with `execaNode()`.');
@@ -291635,7 +291739,7 @@ var handleNodeOption = (file2, commandArguments, {
291635
291739
  throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');
291636
291740
  }
291637
291741
  const normalizedNodePath = safeNormalizeFileUrl(nodePath2, 'The "nodePath" option');
291638
- const resolvedNodePath = path45.resolve(cwd, normalizedNodePath);
291742
+ const resolvedNodePath = path46.resolve(cwd, normalizedNodePath);
291639
291743
  const newOptions = {
291640
291744
  ...options,
291641
291745
  nodePath: resolvedNodePath,
@@ -291645,7 +291749,7 @@ var handleNodeOption = (file2, commandArguments, {
291645
291749
  if (!shouldHandleNode) {
291646
291750
  return [file2, commandArguments, newOptions];
291647
291751
  }
291648
- if (path45.basename(file2, ".exe") === "node") {
291752
+ if (path46.basename(file2, ".exe") === "node") {
291649
291753
  throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');
291650
291754
  }
291651
291755
  return [
@@ -291735,11 +291839,11 @@ var serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encodin
291735
291839
 
291736
291840
  // node_modules/execa/lib/arguments/cwd.js
291737
291841
  import { statSync } from "node:fs";
291738
- import path46 from "node:path";
291842
+ import path47 from "node:path";
291739
291843
  import process15 from "node:process";
291740
291844
  var normalizeCwd = (cwd = getDefaultCwd()) => {
291741
291845
  const cwdString = safeNormalizeFileUrl(cwd, 'The "cwd" option');
291742
- return path46.resolve(cwdString);
291846
+ return path47.resolve(cwdString);
291743
291847
  };
291744
291848
  var getDefaultCwd = () => {
291745
291849
  try {
@@ -291786,7 +291890,7 @@ var normalizeOptions = (filePath, rawArguments, rawOptions) => {
291786
291890
  options.killSignal = normalizeKillSignal(options.killSignal);
291787
291891
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
291788
291892
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
291789
- if (process16.platform === "win32" && path47.basename(file2, ".exe") === "cmd") {
291893
+ if (process16.platform === "win32" && path48.basename(file2, ".exe") === "cmd") {
291790
291894
  commandArguments.unshift("/q");
291791
291895
  }
291792
291896
  return { file: file2, commandArguments, options };
@@ -302310,7 +302414,7 @@ var source_default2 = got;
302310
302414
 
302311
302415
  // node_modules/@joshua.litt/get-ripgrep/dist/downloadRipGrep.js
302312
302416
  import * as os23 from "node:os";
302313
- import { dirname as dirname8, join as join13 } from "node:path";
302417
+ import { dirname as dirname8, join as join12 } from "node:path";
302314
302418
 
302315
302419
  // node_modules/@joshua.litt/get-ripgrep/node_modules/path-exists/index.js
302316
302420
  import fs37, { promises as fsPromises8 } from "node:fs";
@@ -302329,13 +302433,13 @@ import { fileURLToPath as fileURLToPath12 } from "node:url";
302329
302433
 
302330
302434
  // node_modules/xdg-basedir/index.js
302331
302435
  import os22 from "os";
302332
- import path48 from "path";
302436
+ import path49 from "path";
302333
302437
  var homeDirectory = os22.homedir();
302334
302438
  var { env } = process;
302335
- var xdgData = env.XDG_DATA_HOME || (homeDirectory ? path48.join(homeDirectory, ".local", "share") : void 0);
302336
- var xdgConfig = env.XDG_CONFIG_HOME || (homeDirectory ? path48.join(homeDirectory, ".config") : void 0);
302337
- var xdgState = env.XDG_STATE_HOME || (homeDirectory ? path48.join(homeDirectory, ".local", "state") : void 0);
302338
- var xdgCache = env.XDG_CACHE_HOME || (homeDirectory ? path48.join(homeDirectory, ".cache") : void 0);
302439
+ var xdgData = env.XDG_DATA_HOME || (homeDirectory ? path49.join(homeDirectory, ".local", "share") : void 0);
302440
+ var xdgConfig = env.XDG_CONFIG_HOME || (homeDirectory ? path49.join(homeDirectory, ".config") : void 0);
302441
+ var xdgState = env.XDG_STATE_HOME || (homeDirectory ? path49.join(homeDirectory, ".local", "state") : void 0);
302442
+ var xdgCache = env.XDG_CACHE_HOME || (homeDirectory ? path49.join(homeDirectory, ".cache") : void 0);
302339
302443
  var xdgRuntime = env.XDG_RUNTIME_DIR || void 0;
302340
302444
  var xdgDataDirectories = (env.XDG_DATA_DIRS || "/usr/local/share/:/usr/share/").split(":");
302341
302445
  if (xdgData) {
@@ -302347,12 +302451,12 @@ if (xdgConfig) {
302347
302451
  }
302348
302452
 
302349
302453
  // node_modules/@joshua.litt/get-ripgrep/dist/downloadRipGrep.js
302350
- import path49 from "path";
302454
+ import path50 from "path";
302351
302455
  var { mkdir: mkdir2, createWriteStream: createWriteStream3, move } = import_fs_extra.default;
302352
302456
  var __dirname6 = dirname8(fileURLToPath12(import.meta.url));
302353
302457
  var REPOSITORY = `microsoft/ripgrep-prebuilt`;
302354
302458
  var VERSION2 = process.env.RIPGREP_VERSION || "v13.0.0-10";
302355
- var BIN_PATH = join13(__dirname6, "../bin");
302459
+ var BIN_PATH = join12(__dirname6, "../bin");
302356
302460
  var getTarget = () => {
302357
302461
  const arch4 = process.env.npm_config_arch || os23.arch();
302358
302462
  const platform10 = process.env.platform || os23.platform();
@@ -302396,8 +302500,8 @@ var getTarget = () => {
302396
302500
  var downloadFile = async (url3, outFile) => {
302397
302501
  let tmpDir = void 0;
302398
302502
  try {
302399
- tmpDir = await import_fs_extra.default.mkdtemp(path49.join(os23.tmpdir(), "download-ripgrep"));
302400
- const tmpFile = path49.join(tmpDir, "tmp-file");
302503
+ tmpDir = await import_fs_extra.default.mkdtemp(path50.join(os23.tmpdir(), "download-ripgrep"));
302504
+ const tmpFile = path50.join(tmpDir, "tmp-file");
302401
302505
  await pipeline(source_default2.stream(url3), createWriteStream3(tmpFile));
302402
302506
  await mkdir2(dirname8(outFile), { recursive: true });
302403
302507
  await move(tmpFile, outFile);
@@ -302446,7 +302550,7 @@ var downloadRipGrep = async (overrideBinPath) => {
302446
302550
 
302447
302551
  // node_modules/@joshua.litt/get-ripgrep/dist/index.js
302448
302552
  var __dirname7 = dirname9(fileURLToPath13(import.meta.url));
302449
- var rgPath = join14(__dirname7, "..", "bin", `rg${process.platform === "win32" ? ".exe" : ""}`);
302553
+ var rgPath = join13(__dirname7, "..", "bin", `rg${process.platform === "win32" ? ".exe" : ""}`);
302450
302554
 
302451
302555
  // packages/core/src/tools/ripGrep.ts
302452
302556
  function getRgCandidateFilenames() {
@@ -302455,7 +302559,7 @@ function getRgCandidateFilenames() {
302455
302559
  async function resolveExistingRgPath() {
302456
302560
  const binDir = Storage.getGlobalBinDir();
302457
302561
  for (const fileName of getRgCandidateFilenames()) {
302458
- const candidatePath = path50.join(binDir, fileName);
302562
+ const candidatePath = path51.join(binDir, fileName);
302459
302563
  if (await fileExists(candidatePath)) {
302460
302564
  return candidatePath;
302461
302565
  }
@@ -302499,7 +302603,7 @@ var GrepToolInvocation2 = class extends BaseToolInvocation {
302499
302603
  async execute({ abortSignal: signal }) {
302500
302604
  try {
302501
302605
  const pathParam = this.params.dir_path || ".";
302502
- const searchDirAbs = path50.resolve(this.config.getTargetDir(), pathParam);
302606
+ const searchDirAbs = path51.resolve(this.config.getTargetDir(), pathParam);
302503
302607
  const validationError = this.config.validatePathAccess(
302504
302608
  searchDirAbs,
302505
302609
  "read"
@@ -302588,12 +302692,12 @@ var GrepToolInvocation2 = class extends BaseToolInvocation {
302588
302692
  new Set(allMatches.map((m) => m.filePath))
302589
302693
  );
302590
302694
  const absoluteFilePaths = uniqueFiles.map(
302591
- (f) => path50.resolve(searchDirAbs, f)
302695
+ (f) => path51.resolve(searchDirAbs, f)
302592
302696
  );
302593
302697
  const allowedFiles = this.fileDiscoveryService.filterFiles(absoluteFilePaths);
302594
302698
  const allowedSet = new Set(allowedFiles);
302595
302699
  allMatches = allMatches.filter(
302596
- (m) => allowedSet.has(path50.resolve(searchDirAbs, m.filePath))
302700
+ (m) => allowedSet.has(path51.resolve(searchDirAbs, m.filePath))
302597
302701
  );
302598
302702
  }
302599
302703
  const matchCount = allMatches.filter((m) => !m.isContext).length;
@@ -302756,15 +302860,15 @@ var GrepToolInvocation2 = class extends BaseToolInvocation {
302756
302860
  if (json3.type === "match" || json3.type === "context") {
302757
302861
  const data = json3.data;
302758
302862
  if (data.path?.text && data.lines?.text) {
302759
- const absoluteFilePath = path50.resolve(basePath, data.path.text);
302760
- const relativeCheck = path50.relative(basePath, absoluteFilePath);
302761
- if (relativeCheck === ".." || relativeCheck.startsWith(`..${path50.sep}`) || path50.isAbsolute(relativeCheck)) {
302863
+ const absoluteFilePath = path51.resolve(basePath, data.path.text);
302864
+ const relativeCheck = path51.relative(basePath, absoluteFilePath);
302865
+ if (relativeCheck === ".." || relativeCheck.startsWith(`..${path51.sep}`) || path51.isAbsolute(relativeCheck)) {
302762
302866
  return null;
302763
302867
  }
302764
- const relativeFilePath = path50.relative(basePath, absoluteFilePath);
302868
+ const relativeFilePath = path51.relative(basePath, absoluteFilePath);
302765
302869
  return {
302766
302870
  absolutePath: absoluteFilePath,
302767
- filePath: relativeFilePath || path50.basename(absoluteFilePath),
302871
+ filePath: relativeFilePath || path51.basename(absoluteFilePath),
302768
302872
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
302769
302873
  lineNumber: data.line_number,
302770
302874
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
@@ -302794,7 +302898,7 @@ var GrepToolInvocation2 = class extends BaseToolInvocation {
302794
302898
  description += ` in ${this.params.include_pattern}`;
302795
302899
  }
302796
302900
  const pathParam = this.params.dir_path || ".";
302797
- const resolvedPath = path50.resolve(this.config.getTargetDir(), pathParam);
302901
+ const resolvedPath = path51.resolve(this.config.getTargetDir(), pathParam);
302798
302902
  if (resolvedPath === this.config.getTargetDir() || pathParam === ".") {
302799
302903
  description += ` within ./`;
302800
302904
  } else {
@@ -302856,7 +302960,7 @@ var RipGrepTool = class _RipGrepTool extends BaseDeclarativeTool {
302856
302960
  return "total_max_matches must be at least 1.";
302857
302961
  }
302858
302962
  if (params.dir_path) {
302859
- const resolvedPath = path50.resolve(
302963
+ const resolvedPath = path51.resolve(
302860
302964
  this.config.getTargetDir(),
302861
302965
  params.dir_path
302862
302966
  );
@@ -302898,7 +303002,7 @@ var RipGrepTool = class _RipGrepTool extends BaseDeclarativeTool {
302898
303002
 
302899
303003
  // packages/core/src/tools/glob.ts
302900
303004
  import fs39 from "node:fs";
302901
- import path51 from "node:path";
303005
+ import path52 from "node:path";
302902
303006
  function sortFileEntries(entries2, nowTimestamp, recencyThresholdMs) {
302903
303007
  const sortedEntries = [...entries2];
302904
303008
  sortedEntries.sort((a2, b) => {
@@ -302926,7 +303030,7 @@ var GlobToolInvocation = class extends BaseToolInvocation {
302926
303030
  getDescription() {
302927
303031
  let description = `'${this.params.pattern}'`;
302928
303032
  if (this.params.dir_path) {
302929
- const searchDir = path51.resolve(
303033
+ const searchDir = path52.resolve(
302930
303034
  this.config.getTargetDir(),
302931
303035
  this.params.dir_path || "."
302932
303036
  );
@@ -302946,7 +303050,7 @@ var GlobToolInvocation = class extends BaseToolInvocation {
302946
303050
  const workspaceDirectories = workspaceContext.getDirectories();
302947
303051
  let searchDirectories;
302948
303052
  if (this.params.dir_path) {
302949
- const searchDirAbsolute = path51.resolve(
303053
+ const searchDirAbsolute = path52.resolve(
302950
303054
  this.config.getTargetDir(),
302951
303055
  this.params.dir_path
302952
303056
  );
@@ -302972,7 +303076,7 @@ var GlobToolInvocation = class extends BaseToolInvocation {
302972
303076
  const allEntries = [];
302973
303077
  for (const searchDir of searchDirectories) {
302974
303078
  let pattern = this.params.pattern;
302975
- const fullPath = path51.join(searchDir, pattern);
303079
+ const fullPath = path52.join(searchDir, pattern);
302976
303080
  if (fs39.existsSync(fullPath)) {
302977
303081
  pattern = escape2(pattern);
302978
303082
  }
@@ -302990,14 +303094,14 @@ var GlobToolInvocation = class extends BaseToolInvocation {
302990
303094
  allEntries.push(...entries2);
302991
303095
  }
302992
303096
  const relativePaths = allEntries.map(
302993
- (p) => path51.relative(this.config.getTargetDir(), p.fullpath())
303097
+ (p) => path52.relative(this.config.getTargetDir(), p.fullpath())
302994
303098
  );
302995
303099
  const { filteredPaths, ignoredCount } = fileDiscovery.filterFilesWithReport(relativePaths, {
302996
303100
  respectGitIgnore: this.params?.respect_git_ignore ?? this.config.getFileFilteringOptions().respectGitIgnore ?? DEFAULT_FILE_FILTERING_OPTIONS.respectGitIgnore,
302997
303101
  respectGeminiIgnore: this.params?.respect_gemini_ignore ?? this.config.getFileFilteringOptions().respectGeminiIgnore ?? DEFAULT_FILE_FILTERING_OPTIONS.respectGeminiIgnore
302998
303102
  });
302999
303103
  const filteredAbsolutePaths = new Set(
303000
- filteredPaths.map((p) => path51.resolve(this.config.getTargetDir(), p))
303104
+ filteredPaths.map((p) => path52.resolve(this.config.getTargetDir(), p))
303001
303105
  );
303002
303106
  const filteredEntries = allEntries.filter(
303003
303107
  (entry) => filteredAbsolutePaths.has(entry.fullpath())
@@ -303078,7 +303182,7 @@ var GlobTool = class _GlobTool extends BaseDeclarativeTool {
303078
303182
  * Validates the parameters for the tool.
303079
303183
  */
303080
303184
  validateToolParamValues(params) {
303081
- const searchDirAbsolute = path51.resolve(
303185
+ const searchDirAbsolute = path52.resolve(
303082
303186
  this.config.getTargetDir(),
303083
303187
  params.dir_path || "."
303084
303188
  );
@@ -303120,11 +303224,11 @@ var GlobTool = class _GlobTool extends BaseDeclarativeTool {
303120
303224
  };
303121
303225
 
303122
303226
  // packages/core/src/tools/activate-skill.ts
303123
- import * as path53 from "node:path";
303227
+ import * as path54 from "node:path";
303124
303228
 
303125
303229
  // packages/core/src/utils/getFolderStructure.ts
303126
303230
  import * as fs40 from "node:fs/promises";
303127
- import * as path52 from "node:path";
303231
+ import * as path53 from "node:path";
303128
303232
  var MAX_ITEMS = 200;
303129
303233
  var TRUNCATION_INDICATOR = "...";
303130
303234
  var DEFAULT_IGNORED_FOLDERS = /* @__PURE__ */ new Set([
@@ -303134,7 +303238,7 @@ var DEFAULT_IGNORED_FOLDERS = /* @__PURE__ */ new Set([
303134
303238
  "__pycache__"
303135
303239
  ]);
303136
303240
  async function readFullStructure(rootPath, options) {
303137
- const rootName = path52.basename(rootPath);
303241
+ const rootName = path53.basename(rootPath);
303138
303242
  const rootNode = {
303139
303243
  name: rootName,
303140
303244
  path: rootPath,
@@ -303186,7 +303290,7 @@ async function readFullStructure(rootPath, options) {
303186
303290
  break;
303187
303291
  }
303188
303292
  const fileName = entry.name;
303189
- const filePath = path52.join(currentPath, fileName);
303293
+ const filePath = path53.join(currentPath, fileName);
303190
303294
  if (options.fileService?.shouldIgnoreFile(filePath, filterFileOptions)) {
303191
303295
  continue;
303192
303296
  }
@@ -303206,7 +303310,7 @@ async function readFullStructure(rootPath, options) {
303206
303310
  break;
303207
303311
  }
303208
303312
  const subFolderName = entry.name;
303209
- const subFolderPath = path52.join(currentPath, subFolderName);
303313
+ const subFolderPath = path53.join(currentPath, subFolderName);
303210
303314
  const isIgnored = options.fileService?.shouldIgnoreDirectory(
303211
303315
  subFolderPath,
303212
303316
  filterFileOptions
@@ -303248,7 +303352,7 @@ function formatStructure(node, currentIndent, isLastChildOfParent, isProcessingR
303248
303352
  const connector = isLastChildOfParent ? "\u2514\u2500\u2500\u2500" : "\u251C\u2500\u2500\u2500";
303249
303353
  if (!isProcessingRootNode || node.isIgnored) {
303250
303354
  builder.push(
303251
- `${currentIndent}${connector}${node.name}${path52.sep}${node.isIgnored ? TRUNCATION_INDICATOR : ""}`
303355
+ `${currentIndent}${connector}${node.name}${path53.sep}${node.isIgnored ? TRUNCATION_INDICATOR : ""}`
303252
303356
  );
303253
303357
  }
303254
303358
  const indentForChildren = isProcessingRootNode ? "" : currentIndent + (isLastChildOfParent ? " " : "\u2502 ");
@@ -303279,7 +303383,7 @@ function formatStructure(node, currentIndent, isLastChildOfParent, isProcessingR
303279
303383
  }
303280
303384
  }
303281
303385
  async function getFolderStructure(directory, options) {
303282
- const resolvedPath = path52.resolve(directory);
303386
+ const resolvedPath = path53.resolve(directory);
303283
303387
  const mergedOptions = {
303284
303388
  maxItems: options?.maxItems ?? MAX_ITEMS,
303285
303389
  ignoredFolders: options?.ignoredFolders ?? DEFAULT_IGNORED_FOLDERS,
@@ -303312,7 +303416,7 @@ async function getFolderStructure(directory, options) {
303312
303416
  }
303313
303417
  return `${summary}
303314
303418
 
303315
- ${resolvedPath}${path52.sep}
303419
+ ${resolvedPath}${path53.sep}
303316
303420
  ${structureLines.join("\n")}`;
303317
303421
  } catch (error40) {
303318
303422
  debugLogger.warn(
@@ -303341,7 +303445,7 @@ var ActivateSkillToolInvocation = class extends BaseToolInvocation {
303341
303445
  async getOrFetchFolderStructure(skillLocation) {
303342
303446
  if (this.cachedFolderStructure === void 0) {
303343
303447
  this.cachedFolderStructure = await getFolderStructure(
303344
- path53.dirname(skillLocation)
303448
+ path54.dirname(skillLocation)
303345
303449
  );
303346
303450
  }
303347
303451
  return this.cachedFolderStructure;
@@ -303395,7 +303499,7 @@ ${folderStructure}`,
303395
303499
  };
303396
303500
  }
303397
303501
  skillManager.activateSkill(skillName);
303398
- this.config.getWorkspaceContext().addDirectory(path53.dirname(skill.location));
303502
+ this.config.getWorkspaceContext().addDirectory(path54.dirname(skill.location));
303399
303503
  const folderStructure = await this.getOrFetchFolderStructure(
303400
303504
  skill.location
303401
303505
  );
@@ -303409,7 +303513,7 @@ ${folderStructure}`,
303409
303513
  ${folderStructure}
303410
303514
  </available_resources>
303411
303515
  </activated_skill>`,
303412
- returnDisplay: `Skill **${skillName}** activated. Resources loaded from \`${path53.dirname(skill.location)}\`:
303516
+ returnDisplay: `Skill **${skillName}** activated. Resources loaded from \`${path54.dirname(skill.location)}\`:
303413
303517
 
303414
303518
  ${folderStructure}`
303415
303519
  };
@@ -303455,7 +303559,7 @@ var ActivateSkillTool = class _ActivateSkillTool extends BaseDeclarativeTool {
303455
303559
  // packages/core/src/tools/shell.ts
303456
303560
  import fsPromises10 from "node:fs/promises";
303457
303561
  import fs43 from "node:fs";
303458
- import path56 from "node:path";
303562
+ import path57 from "node:path";
303459
303563
  import os28 from "node:os";
303460
303564
  import crypto15 from "node:crypto";
303461
303565
 
@@ -303540,7 +303644,7 @@ import { spawn as cpSpawn } from "node:child_process";
303540
303644
  import { TextDecoder as TextDecoder2 } from "node:util";
303541
303645
  import os26 from "node:os";
303542
303646
  import fs41, { mkdirSync as mkdirSync3 } from "node:fs";
303543
- import path54 from "node:path";
303647
+ import path55 from "node:path";
303544
303648
 
303545
303649
  // packages/core/src/utils/systemEncoding.ts
303546
303650
  var import_chardet = __toESM(require_lib10(), 1);
@@ -304618,7 +304722,7 @@ var ShellExecutionService = class _ShellExecutionService {
304618
304722
  static backgroundLogStreams = /* @__PURE__ */ new Map();
304619
304723
  static backgroundProcessHistory = /* @__PURE__ */ new Map();
304620
304724
  static getLogDir() {
304621
- return path54.join(Storage.getGlobalTempDir(), "background-processes");
304725
+ return path55.join(Storage.getGlobalTempDir(), "background-processes");
304622
304726
  }
304623
304727
  static formatShellBackgroundCompletion(pid, behavior, output, error40) {
304624
304728
  const logPath = _ShellExecutionService.getLogFilePath(pid);
@@ -304632,7 +304736,7 @@ ${truncated}`;
304632
304736
  return `[Background command completed ${status2}. Output saved to ${logPath}]`;
304633
304737
  }
304634
304738
  static getLogFilePath(pid) {
304635
- return path54.join(this.getLogDir(), `background-${pid}.log`);
304739
+ return path55.join(this.getLogDir(), `background-${pid}.log`);
304636
304740
  }
304637
304741
  static syncBackgroundLog(pid, content) {
304638
304742
  if (!this.backgroundLogPids.has(pid)) return;
@@ -305635,7 +305739,7 @@ ${truncated}`;
305635
305739
 
305636
305740
  // packages/core/src/sandbox/utils/proactivePermissions.ts
305637
305741
  import os27 from "node:os";
305638
- import path55 from "node:path";
305742
+ import path56 from "node:path";
305639
305743
  import fs42 from "node:fs";
305640
305744
  var NETWORK_RELIANT_TOOLS = /* @__PURE__ */ new Set([
305641
305745
  "npm",
@@ -305686,42 +305790,42 @@ async function getProactiveToolSuggestions(commandName) {
305686
305790
  const primaryCachePaths = [];
305687
305791
  const optionalCachePaths = [];
305688
305792
  if (normalizedCommand === "npm" || normalizedCommand === "npx") {
305689
- readOnlyPaths.push(path55.join(home, ".npmrc"));
305690
- primaryCachePaths.push(path55.join(home, ".npm"));
305691
- optionalCachePaths.push(path55.join(home, ".node-gyp"));
305692
- optionalCachePaths.push(path55.join(home, ".cache"));
305793
+ readOnlyPaths.push(path56.join(home, ".npmrc"));
305794
+ primaryCachePaths.push(path56.join(home, ".npm"));
305795
+ optionalCachePaths.push(path56.join(home, ".node-gyp"));
305796
+ optionalCachePaths.push(path56.join(home, ".cache"));
305693
305797
  } else if (normalizedCommand === "yarn") {
305694
- readOnlyPaths.push(path55.join(home, ".yarnrc"));
305695
- readOnlyPaths.push(path55.join(home, ".yarnrc.yml"));
305696
- primaryCachePaths.push(path55.join(home, ".yarn"));
305697
- primaryCachePaths.push(path55.join(home, ".config", "yarn"));
305698
- optionalCachePaths.push(path55.join(home, ".cache"));
305798
+ readOnlyPaths.push(path56.join(home, ".yarnrc"));
305799
+ readOnlyPaths.push(path56.join(home, ".yarnrc.yml"));
305800
+ primaryCachePaths.push(path56.join(home, ".yarn"));
305801
+ primaryCachePaths.push(path56.join(home, ".config", "yarn"));
305802
+ optionalCachePaths.push(path56.join(home, ".cache"));
305699
305803
  } else if (normalizedCommand === "pnpm") {
305700
- readOnlyPaths.push(path55.join(home, ".npmrc"));
305701
- primaryCachePaths.push(path55.join(home, ".pnpm-store"));
305702
- primaryCachePaths.push(path55.join(home, ".config", "pnpm"));
305703
- optionalCachePaths.push(path55.join(home, ".cache"));
305804
+ readOnlyPaths.push(path56.join(home, ".npmrc"));
305805
+ primaryCachePaths.push(path56.join(home, ".pnpm-store"));
305806
+ primaryCachePaths.push(path56.join(home, ".config", "pnpm"));
305807
+ optionalCachePaths.push(path56.join(home, ".cache"));
305704
305808
  } else if (normalizedCommand === "bun") {
305705
- readOnlyPaths.push(path55.join(home, ".bunfig.toml"));
305706
- primaryCachePaths.push(path55.join(home, ".bun"));
305707
- optionalCachePaths.push(path55.join(home, ".cache"));
305809
+ readOnlyPaths.push(path56.join(home, ".bunfig.toml"));
305810
+ primaryCachePaths.push(path56.join(home, ".bun"));
305811
+ optionalCachePaths.push(path56.join(home, ".cache"));
305708
305812
  } else if (normalizedCommand === "git") {
305709
- readOnlyPaths.push(path55.join(home, ".ssh"));
305710
- readOnlyPaths.push(path55.join(home, ".gitconfig"));
305711
- optionalCachePaths.push(path55.join(home, ".cache"));
305813
+ readOnlyPaths.push(path56.join(home, ".ssh"));
305814
+ readOnlyPaths.push(path56.join(home, ".gitconfig"));
305815
+ optionalCachePaths.push(path56.join(home, ".cache"));
305712
305816
  } else if (normalizedCommand === "ssh" || normalizedCommand === "scp" || normalizedCommand === "sftp") {
305713
- readOnlyPaths.push(path55.join(home, ".ssh"));
305817
+ readOnlyPaths.push(path56.join(home, ".ssh"));
305714
305818
  }
305715
305819
  if (os27.platform() === "win32") {
305716
305820
  const appData = process.env["AppData"];
305717
305821
  const localAppData = process.env["LocalAppData"];
305718
305822
  if (normalizedCommand === "npm" || normalizedCommand === "npx") {
305719
305823
  if (appData) {
305720
- primaryCachePaths.push(path55.join(appData, "npm"));
305721
- optionalCachePaths.push(path55.join(appData, "npm-cache"));
305824
+ primaryCachePaths.push(path56.join(appData, "npm"));
305825
+ optionalCachePaths.push(path56.join(appData, "npm-cache"));
305722
305826
  }
305723
305827
  if (localAppData) {
305724
- optionalCachePaths.push(path55.join(localAppData, "npm-cache"));
305828
+ optionalCachePaths.push(path56.join(localAppData, "npm-cache"));
305725
305829
  }
305726
305830
  }
305727
305831
  }
@@ -305832,7 +305936,7 @@ ${trimmed2}
305832
305936
  }
305833
305937
  const parentCounts = /* @__PURE__ */ new Map();
305834
305938
  for (const p of nonRedundant) {
305835
- const parent = path56.dirname(p);
305939
+ const parent = path57.dirname(p);
305836
305940
  if (!parentCounts.has(parent)) {
305837
305941
  parentCounts.set(parent, []);
305838
305942
  }
@@ -305841,23 +305945,23 @@ ${trimmed2}
305841
305945
  const finalPaths = /* @__PURE__ */ new Set();
305842
305946
  const sensitiveDirs = /* @__PURE__ */ new Set([
305843
305947
  os28.homedir(),
305844
- path56.dirname(os28.homedir()),
305845
- path56.sep,
305846
- path56.join(path56.sep, "etc"),
305847
- path56.join(path56.sep, "usr"),
305848
- path56.join(path56.sep, "var"),
305849
- path56.join(path56.sep, "bin"),
305850
- path56.join(path56.sep, "sbin"),
305851
- path56.join(path56.sep, "lib"),
305852
- path56.join(path56.sep, "root"),
305853
- path56.join(path56.sep, "home"),
305854
- path56.join(path56.sep, "Users")
305948
+ path57.dirname(os28.homedir()),
305949
+ path57.sep,
305950
+ path57.join(path57.sep, "etc"),
305951
+ path57.join(path57.sep, "usr"),
305952
+ path57.join(path57.sep, "var"),
305953
+ path57.join(path57.sep, "bin"),
305954
+ path57.join(path57.sep, "sbin"),
305955
+ path57.join(path57.sep, "lib"),
305956
+ path57.join(path57.sep, "root"),
305957
+ path57.join(path57.sep, "home"),
305958
+ path57.join(path57.sep, "Users")
305855
305959
  ]);
305856
305960
  if (os28.platform() === "win32") {
305857
305961
  const systemRoot = process.env["SystemRoot"];
305858
305962
  if (systemRoot) {
305859
305963
  sensitiveDirs.add(systemRoot);
305860
- sensitiveDirs.add(path56.join(systemRoot, "System32"));
305964
+ sensitiveDirs.add(path57.join(systemRoot, "System32"));
305861
305965
  }
305862
305966
  const programFiles = process.env["ProgramFiles"];
305863
305967
  if (programFiles) sensitiveDirs.add(programFiles);
@@ -306046,7 +306150,7 @@ ${trimmed2}
306046
306150
  }
306047
306151
  const isWindows2 = os28.platform() === "win32";
306048
306152
  const tempFileName = `shell_pgrep_${crypto15.randomBytes(6).toString("hex")}.tmp`;
306049
- const tempFilePath = path56.join(os28.tmpdir(), tempFileName);
306153
+ const tempFilePath = path57.join(os28.tmpdir(), tempFileName);
306050
306154
  const timeoutMs = this.context.config.getShellToolInactivityTimeout();
306051
306155
  const timeoutController = new AbortController();
306052
306156
  let timeoutTimer;
@@ -306058,7 +306162,7 @@ ${trimmed2}
306058
306162
  tempFilePath,
306059
306163
  isWindows2
306060
306164
  );
306061
- const cwd = this.params.dir_path ? path56.resolve(this.context.config.getTargetDir(), this.params.dir_path) : this.context.config.getTargetDir();
306165
+ const cwd = this.params.dir_path ? path57.resolve(this.context.config.getTargetDir(), this.params.dir_path) : this.context.config.getTargetDir();
306062
306166
  const validationError = this.context.config.validatePathAccess(cwd);
306063
306167
  if (validationError) {
306064
306168
  return {
@@ -306324,11 +306428,11 @@ ${result2.output}`;
306324
306428
  try {
306325
306429
  let currentPath = p;
306326
306430
  if (currentPath.startsWith("~")) {
306327
- currentPath = path56.join(os28.homedir(), currentPath.slice(1));
306431
+ currentPath = path57.join(os28.homedir(), currentPath.slice(1));
306328
306432
  }
306329
306433
  try {
306330
306434
  if (fs43.existsSync(currentPath) && fs43.statSync(currentPath).isFile()) {
306331
- currentPath = path56.dirname(currentPath);
306435
+ currentPath = path57.dirname(currentPath);
306332
306436
  }
306333
306437
  } catch {
306334
306438
  }
@@ -306345,7 +306449,7 @@ ${result2.output}`;
306345
306449
  }
306346
306450
  break;
306347
306451
  }
306348
- currentPath = path56.dirname(currentPath);
306452
+ currentPath = path57.dirname(currentPath);
306349
306453
  }
306350
306454
  } catch {
306351
306455
  }
@@ -306453,7 +306557,7 @@ var ShellTool = class _ShellTool extends BaseDeclarativeTool {
306453
306557
  return "Command cannot be empty.";
306454
306558
  }
306455
306559
  if (params.dir_path) {
306456
- const resolvedPath = path56.resolve(
306560
+ const resolvedPath = path57.resolve(
306457
306561
  this.context.config.getTargetDir(),
306458
306562
  params.dir_path
306459
306563
  );
@@ -307202,8 +307306,8 @@ function many(p) {
307202
307306
  function many1(p) {
307203
307307
  return ab(p, many(p), (head, tail) => [head, ...tail]);
307204
307308
  }
307205
- function ab(pa, pb, join33) {
307206
- return (data, i3) => mapOuter(pa(data, i3), (ma) => mapInner(pb(data, ma.position), (vb, j) => join33(ma.value, vb, data, i3, j)));
307309
+ function ab(pa, pb, join32) {
307310
+ return (data, i3) => mapOuter(pa(data, i3), (ma) => mapInner(pb(data, ma.position), (vb, j) => join32(ma.value, vb, data, i3, j)));
307207
307311
  }
307208
307312
  function left(pa, pb) {
307209
307313
  return ab(pa, pb, (va) => va);
@@ -307211,8 +307315,8 @@ function left(pa, pb) {
307211
307315
  function right(pa, pb) {
307212
307316
  return ab(pa, pb, (va, vb) => vb);
307213
307317
  }
307214
- function abc(pa, pb, pc, join33) {
307215
- return (data, i3) => mapOuter(pa(data, i3), (ma) => mapOuter(pb(data, ma.position), (mb) => mapInner(pc(data, mb.position), (vc, j) => join33(ma.value, mb.value, vc, data, i3, j))));
307318
+ function abc(pa, pb, pc, join32) {
307319
+ return (data, i3) => mapOuter(pa(data, i3), (ma) => mapOuter(pb(data, ma.position), (mb) => mapInner(pc(data, mb.position), (vc, j) => join32(ma.value, mb.value, vc, data, i3, j))));
307216
307320
  }
307217
307321
  function middle(pa, pb, pc) {
307218
307322
  return abc(pa, pb, pc, (ra, rb) => rb);
@@ -313629,7 +313733,7 @@ function tokenLimit(model) {
313629
313733
 
313630
313734
  // packages/core/src/prompts/promptProvider.ts
313631
313735
  import fs44 from "node:fs";
313632
- import path58 from "node:path";
313736
+ import path59 from "node:path";
313633
313737
  import process24 from "node:process";
313634
313738
 
313635
313739
  // packages/core/src/prompts/snippets.ts
@@ -314950,7 +315054,7 @@ The structure MUST be as follows:
314950
315054
  }
314951
315055
 
314952
315056
  // packages/core/src/prompts/utils.ts
314953
- import path57 from "node:path";
315057
+ import path58 from "node:path";
314954
315058
  import process23 from "node:process";
314955
315059
  function resolvePathFromEnv(envVar) {
314956
315060
  const trimmedEnvVar = envVar?.trim();
@@ -314969,7 +315073,7 @@ function resolvePathFromEnv(envVar) {
314969
315073
  if (customPath === "~") {
314970
315074
  customPath = home;
314971
315075
  } else {
314972
- customPath = path57.join(home, customPath.slice(2));
315076
+ customPath = path58.join(home, customPath.slice(2));
314973
315077
  }
314974
315078
  } catch (error40) {
314975
315079
  debugLogger.warn(
@@ -314981,7 +315085,7 @@ function resolvePathFromEnv(envVar) {
314981
315085
  }
314982
315086
  return {
314983
315087
  isSwitch: false,
314984
- value: path57.resolve(customPath),
315088
+ value: path58.resolve(customPath),
314985
315089
  isDisabled: false
314986
315090
  };
314987
315091
  }
@@ -315198,7 +315302,7 @@ var PromptProvider = class {
315198
315302
  }
315199
315303
  let basePrompt;
315200
315304
  if (systemMdResolution.value && !systemMdResolution.isDisabled) {
315201
- let systemMdPath = path58.resolve(path58.join(GEMINI_DIR, "system.md"));
315305
+ let systemMdPath = path59.resolve(path59.join(GEMINI_DIR, "system.md"));
315202
315306
  if (!systemMdResolution.isSwitch) {
315203
315307
  systemMdPath = systemMdResolution.value;
315204
315308
  }
@@ -315276,8 +315380,17 @@ var PromptProvider = class {
315276
315380
  () => ({
315277
315381
  interactive: interactiveMode,
315278
315382
  planModeToolsList,
315279
- plansDir: context2.config.storage.getPlansDir(),
315280
- approvedPlanPath: context2.config.getApprovedPlanPath()
315383
+ plansDir: makeRelative(
315384
+ context2.config.storage.getPlansDir(),
315385
+ context2.config.getProjectRoot()
315386
+ ).replaceAll("\\", "/"),
315387
+ approvedPlanPath: (() => {
315388
+ const approvedPath = context2.config.getApprovedPlanPath();
315389
+ return approvedPath ? makeRelative(
315390
+ approvedPath,
315391
+ context2.config.getProjectRoot()
315392
+ ).replaceAll("\\", "/") : void 0;
315393
+ })()
315281
315394
  }),
315282
315395
  isPlanMode
315283
315396
  ),
@@ -315330,7 +315443,7 @@ var PromptProvider = class {
315330
315443
  this.maybeWriteSystemMd(
315331
315444
  sanitizedPrompt,
315332
315445
  systemMdResolution,
315333
- path58.resolve(path58.join(GEMINI_DIR, "system.md"))
315446
+ path59.resolve(path59.join(GEMINI_DIR, "system.md"))
315334
315447
  );
315335
315448
  return sanitizedPrompt;
315336
315449
  }
@@ -315358,7 +315471,7 @@ var PromptProvider = class {
315358
315471
  );
315359
315472
  if (writeSystemMdResolution.value && !writeSystemMdResolution.isDisabled) {
315360
315473
  const writePath = writeSystemMdResolution.isSwitch ? defaultPath : writeSystemMdResolution.value;
315361
- fs44.mkdirSync(path58.dirname(writePath), { recursive: true });
315474
+ fs44.mkdirSync(path59.dirname(writePath), { recursive: true });
315362
315475
  fs44.writeFileSync(writePath, basePrompt);
315363
315476
  }
315364
315477
  }
@@ -318861,12 +318974,12 @@ var safeDump = renamed("safeDump", "dump");
318861
318974
 
318862
318975
  // packages/core/src/agents/agentLoader.ts
318863
318976
  import * as fs46 from "node:fs/promises";
318864
- import * as path60 from "node:path";
318977
+ import * as path61 from "node:path";
318865
318978
  import * as crypto16 from "node:crypto";
318866
318979
 
318867
318980
  // packages/core/src/skills/skillLoader.ts
318868
318981
  import * as fs45 from "node:fs/promises";
318869
- import * as path59 from "node:path";
318982
+ import * as path60 from "node:path";
318870
318983
  var FRONTMATTER_REGEX = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n([\s\S]*))?/;
318871
318984
  function parseFrontmatter(content) {
318872
318985
  try {
@@ -318920,7 +319033,7 @@ function parseSimpleFrontmatter(content) {
318920
319033
  async function loadSkillsFromDir(dir) {
318921
319034
  const discoveredSkills = [];
318922
319035
  try {
318923
- const absoluteSearchPath = path59.resolve(dir);
319036
+ const absoluteSearchPath = path60.resolve(dir);
318924
319037
  const stats = await fs45.stat(absoluteSearchPath).catch(() => null);
318925
319038
  if (!stats || !stats.isDirectory()) {
318926
319039
  return [];
@@ -319438,7 +319551,7 @@ async function loadAgentsFromDirectory(dir) {
319438
319551
  (entry) => entry.isFile() && !entry.name.startsWith("_") && entry.name.endsWith(".md")
319439
319552
  );
319440
319553
  for (const entry of files) {
319441
- const filePath = path60.join(dir, entry.name);
319554
+ const filePath = path61.join(dir, entry.name);
319442
319555
  try {
319443
319556
  const content = await fs46.readFile(filePath, "utf-8");
319444
319557
  const hash = crypto16.createHash("sha256").update(content).digest("hex");
@@ -319465,16 +319578,16 @@ async function loadAgentsFromDirectory(dir) {
319465
319578
 
319466
319579
  // packages/core/src/tools/get-internal-docs.ts
319467
319580
  import fs47 from "node:fs/promises";
319468
- import path61 from "node:path";
319581
+ import path62 from "node:path";
319469
319582
  import { fileURLToPath as fileURLToPath14 } from "node:url";
319470
319583
  async function getDocsRoot() {
319471
319584
  const currentFile = fileURLToPath14(import.meta.url);
319472
- let searchDir = path61.dirname(currentFile);
319585
+ let searchDir = path62.dirname(currentFile);
319473
319586
  const isDocsDir = async (dir) => {
319474
319587
  try {
319475
319588
  const stats = await fs47.stat(dir);
319476
319589
  if (stats.isDirectory()) {
319477
- const marker = path61.join(dir, "sidebar.json");
319590
+ const marker = path62.join(dir, "sidebar.json");
319478
319591
  await fs47.access(marker);
319479
319592
  return true;
319480
319593
  }
@@ -319483,11 +319596,11 @@ async function getDocsRoot() {
319483
319596
  return false;
319484
319597
  };
319485
319598
  while (true) {
319486
- const candidate = path61.join(searchDir, "docs");
319599
+ const candidate = path62.join(searchDir, "docs");
319487
319600
  if (await isDocsDir(candidate)) {
319488
319601
  return candidate;
319489
319602
  }
319490
- const parent = path61.dirname(searchDir);
319603
+ const parent = path62.dirname(searchDir);
319491
319604
  if (parent === searchDir) {
319492
319605
  break;
319493
319606
  }
@@ -319523,7 +319636,7 @@ ${fileList}`;
319523
319636
  returnDisplay: `Found ${files.length} documentation files.`
319524
319637
  };
319525
319638
  }
319526
- const resolvedPath = path61.resolve(docsRoot, this.params.path);
319639
+ const resolvedPath = path62.resolve(docsRoot, this.params.path);
319527
319640
  if (!resolvedPath.startsWith(docsRoot)) {
319528
319641
  throw new Error(
319529
319642
  "Access denied: Requested path is outside the documentation directory."
@@ -320677,7 +320790,7 @@ var A2AAuthProviderFactory = class _A2AAuthProviderFactory {
320677
320790
  return provider;
320678
320791
  }
320679
320792
  case "oauth2": {
320680
- const { OAuth2AuthProvider } = await import("./oauth2-provider-T4YYJWZG.js");
320793
+ const { OAuth2AuthProvider } = await import("./oauth2-provider-AUIG7Q6O.js");
320681
320794
  const provider = new OAuth2AuthProvider(
320682
320795
  authConfig,
320683
320796
  options.agentName ?? "unknown",
@@ -323804,7 +323917,7 @@ ${summary}
323804
323917
  };
323805
323918
 
323806
323919
  // packages/core/src/context/toolOutputMaskingService.ts
323807
- import path62 from "node:path";
323920
+ import path63 from "node:path";
323808
323921
  import * as fsPromises11 from "node:fs/promises";
323809
323922
  var DEFAULT_TOOL_PROTECTION_THRESHOLD = 5e4;
323810
323923
  var DEFAULT_MIN_PRUNABLE_TOKENS_THRESHOLD = 3e4;
@@ -323878,14 +323991,14 @@ var ToolOutputMaskingService = class {
323878
323991
  );
323879
323992
  const newHistory = [...history];
323880
323993
  let actualTokensSaved = 0;
323881
- let toolOutputsDir = path62.join(
323994
+ let toolOutputsDir = path63.join(
323882
323995
  config2.storage.getProjectTempDir(),
323883
323996
  TOOL_OUTPUTS_DIR3
323884
323997
  );
323885
323998
  const sessionId = config2.getSessionId();
323886
323999
  if (sessionId) {
323887
324000
  const safeSessionId = sanitizeFilenamePart(sessionId);
323888
- toolOutputsDir = path62.join(toolOutputsDir, `session-${safeSessionId}`);
324001
+ toolOutputsDir = path63.join(toolOutputsDir, `session-${safeSessionId}`);
323889
324002
  }
323890
324003
  await fsPromises11.mkdir(toolOutputsDir, { recursive: true });
323891
324004
  for (const item of prunableParts) {
@@ -323898,7 +324011,7 @@ var ToolOutputMaskingService = class {
323898
324011
  const safeToolName = sanitizeFilenamePart(toolName).toLowerCase();
323899
324012
  const safeCallId = sanitizeFilenamePart(callId).toLowerCase();
323900
324013
  const fileName = `${safeToolName}_${safeCallId}_${Math.random().toString(36).substring(7)}.txt`;
323901
- const filePath = path62.join(toolOutputsDir, fileName);
324014
+ const filePath = path63.join(toolOutputsDir, fileName);
323902
324015
  await fsPromises11.writeFile(filePath, content, "utf-8");
323903
324016
  const originalResponse = (
323904
324017
  // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
@@ -326438,11 +326551,11 @@ ${wrapInput(safeInput)}`;
326438
326551
 
326439
326552
  // packages/core/src/config/scoped-config.ts
326440
326553
  import { AsyncLocalStorage as AsyncLocalStorage3 } from "node:async_hooks";
326441
- import * as path64 from "node:path";
326554
+ import * as path65 from "node:path";
326442
326555
 
326443
326556
  // packages/core/src/utils/workspaceContext.ts
326444
326557
  import * as fs48 from "node:fs";
326445
- import * as path63 from "node:path";
326558
+ import * as path64 from "node:path";
326446
326559
  var WorkspaceContext = class {
326447
326560
  /**
326448
326561
  * Creates a new WorkspaceContext with the given initial directory and optional additional directories.
@@ -326532,14 +326645,14 @@ var WorkspaceContext = class {
326532
326645
  if (!fs48.existsSync(pathToAdd)) {
326533
326646
  return;
326534
326647
  }
326535
- const resolved = fs48.realpathSync(path63.resolve(this.targetDir, pathToAdd));
326648
+ const resolved = fs48.realpathSync(path64.resolve(this.targetDir, pathToAdd));
326536
326649
  this.readOnlyPaths.add(resolved);
326537
326650
  } catch (e2) {
326538
326651
  debugLogger.warn(`Failed to add read-only path ${pathToAdd}:`, e2);
326539
326652
  }
326540
326653
  }
326541
326654
  resolveAndValidateDir(directory) {
326542
- const absolutePath = path63.resolve(this.targetDir, directory);
326655
+ const absolutePath = path64.resolve(this.targetDir, directory);
326543
326656
  if (!fs48.existsSync(absolutePath)) {
326544
326657
  throw new Error(`Directory does not exist: ${absolutePath}`);
326545
326658
  }
@@ -326615,7 +326728,7 @@ var WorkspaceContext = class {
326615
326728
  * if it did exist.
326616
326729
  */
326617
326730
  fullyResolvedPath(pathToCheck) {
326618
- return resolveToRealPath(path63.resolve(this.targetDir, pathToCheck));
326731
+ return resolveToRealPath(path64.resolve(this.targetDir, pathToCheck));
326619
326732
  }
326620
326733
  /**
326621
326734
  * Checks if a path is within a given root directory.
@@ -326624,8 +326737,8 @@ var WorkspaceContext = class {
326624
326737
  * @returns True if the path is within the root directory, false otherwise
326625
326738
  */
326626
326739
  isPathWithinRoot(pathToCheck, rootDirectory) {
326627
- const relative8 = path63.relative(rootDirectory, pathToCheck);
326628
- return !relative8.startsWith(`..${path63.sep}`) && relative8 !== ".." && !path63.isAbsolute(relative8);
326740
+ const relative8 = path64.relative(rootDirectory, pathToCheck);
326741
+ return !relative8.startsWith(`..${path64.sep}`) && relative8 !== ".." && !path64.isAbsolute(relative8);
326629
326742
  }
326630
326743
  };
326631
326744
 
@@ -326648,7 +326761,7 @@ function createScopedWorkspaceContext(parentContext, additionalDirectories) {
326648
326761
  );
326649
326762
  }
326650
326763
  for (const dir of additionalDirectories) {
326651
- if (path64.resolve(dir) === path64.parse(path64.resolve(dir)).root) {
326764
+ if (path65.resolve(dir) === path65.parse(path65.resolve(dir)).root) {
326652
326765
  throw new Error(
326653
326766
  `Cannot add filesystem root "${dir}" as a workspace directory`
326654
326767
  );
@@ -328739,11 +328852,11 @@ import { randomUUID as randomUUID6 } from "node:crypto";
328739
328852
 
328740
328853
  // packages/core/src/utils/browserConsent.ts
328741
328854
  import * as fs49 from "node:fs/promises";
328742
- import * as path65 from "node:path";
328855
+ import * as path66 from "node:path";
328743
328856
  var BROWSER_CONSENT_FLAG_FILE = "browser-consent-acknowledged.txt";
328744
328857
  var BROWSER_PROFILE_DIR = "cli-browser-profile";
328745
328858
  async function getBrowserConsentIfNeeded() {
328746
- const consentFilePath = path65.join(
328859
+ const consentFilePath = path66.join(
328747
328860
  Storage.getGlobalGeminiDir(),
328748
328861
  BROWSER_PROFILE_DIR,
328749
328862
  BROWSER_CONSENT_FLAG_FILE
@@ -328771,7 +328884,7 @@ async function getBrowserConsentIfNeeded() {
328771
328884
  }
328772
328885
  async function markConsentAsAcknowledged(consentFilePath) {
328773
328886
  try {
328774
- await fs49.mkdir(path65.dirname(consentFilePath), { recursive: true });
328887
+ await fs49.mkdir(path66.dirname(consentFilePath), { recursive: true });
328775
328888
  await fs49.writeFile(
328776
328889
  consentFilePath,
328777
328890
  `Browser privacy consent acknowledged at ${(/* @__PURE__ */ new Date()).toISOString()}
@@ -328970,7 +329083,7 @@ async function resumeInputBlocker(browserManager, signal) {
328970
329083
  }
328971
329084
 
328972
329085
  // packages/core/src/agents/browser/browserManager.ts
328973
- import * as path66 from "node:path";
329086
+ import * as path67 from "node:path";
328974
329087
  import * as fs50 from "node:fs";
328975
329088
  import { fileURLToPath as fileURLToPath15 } from "node:url";
328976
329089
 
@@ -329054,7 +329167,7 @@ async function removeAutomationOverlay(browserManager, signal) {
329054
329167
 
329055
329168
  // packages/core/src/agents/browser/browserManager.ts
329056
329169
  var __filename5 = fileURLToPath15(import.meta.url);
329057
- var __dirname8 = path66.dirname(__filename5);
329170
+ var __dirname8 = path67.dirname(__filename5);
329058
329171
  var BROWSER_PROFILE_DIR2 = "cli-browser-profile";
329059
329172
  var DomainNotAllowedError = class extends Error {
329060
329173
  constructor(message) {
@@ -329501,7 +329614,7 @@ var BrowserManager = class _BrowserManager {
329501
329614
  if (browserConfig.customConfig.profilePath) {
329502
329615
  mcpArgs.push("--userDataDir", browserConfig.customConfig.profilePath);
329503
329616
  } else if (sessionMode === "persistent") {
329504
- const defaultProfilePath = path66.join(
329617
+ const defaultProfilePath = path67.join(
329505
329618
  Storage.getGlobalGeminiDir(),
329506
329619
  BROWSER_PROFILE_DIR2
329507
329620
  );
@@ -329524,14 +329637,14 @@ var BrowserManager = class _BrowserManager {
329524
329637
  debugLogger.log(
329525
329638
  `Launching bundled chrome-devtools-mcp (${sessionMode} mode) with args: ${mcpArgs.join(" ")}`
329526
329639
  );
329527
- let bundleMcpPath = path66.resolve(
329640
+ let bundleMcpPath = path67.resolve(
329528
329641
  __dirname8,
329529
329642
  "bundled/chrome-devtools-mcp.mjs"
329530
329643
  );
329531
329644
  if (!fs50.existsSync(bundleMcpPath)) {
329532
- bundleMcpPath = path66.resolve(
329645
+ bundleMcpPath = path67.resolve(
329533
329646
  __dirname8,
329534
- __dirname8.includes(`${path66.sep}dist${path66.sep}`) ? "../../../bundled/chrome-devtools-mcp.mjs" : "../../../dist/bundled/chrome-devtools-mcp.mjs"
329647
+ __dirname8.includes(`${path67.sep}dist${path67.sep}`) ? "../../../bundled/chrome-devtools-mcp.mjs" : "../../../dist/bundled/chrome-devtools-mcp.mjs"
329535
329648
  );
329536
329649
  }
329537
329650
  this.mcpTransport = new StdioClientTransport({
@@ -330830,39 +330943,6 @@ ${value}`
330830
330943
  // packages/core/src/tools/exit-plan-mode.ts
330831
330944
  import path68 from "node:path";
330832
330945
 
330833
- // packages/core/src/utils/planUtils.ts
330834
- import path67 from "node:path";
330835
- var PlanErrorMessages = {
330836
- PATH_ACCESS_DENIED: (planPath, plansDir) => `Access denied: plan path (${planPath}) must be within the designated plans directory (${plansDir}).`,
330837
- FILE_NOT_FOUND: (path95) => `Plan file does not exist: ${path95}. You must create the plan file before requesting approval.`,
330838
- FILE_EMPTY: "Plan file is empty. You must write content to the plan file before requesting approval.",
330839
- READ_FAILURE: (detail) => `Failed to read plan file: ${detail}`
330840
- };
330841
- async function validatePlanPath(planPath, plansDir) {
330842
- const safeFilename = path67.basename(planPath);
330843
- const resolvedPath = path67.join(plansDir, safeFilename);
330844
- const realPath = resolveToRealPath(resolvedPath);
330845
- const realPlansDir = resolveToRealPath(plansDir);
330846
- if (!isSubpath(realPlansDir, realPath)) {
330847
- return PlanErrorMessages.PATH_ACCESS_DENIED(planPath, realPlansDir);
330848
- }
330849
- if (!await fileExists(resolvedPath)) {
330850
- return PlanErrorMessages.FILE_NOT_FOUND(planPath);
330851
- }
330852
- return null;
330853
- }
330854
- async function validatePlanContent(planPath) {
330855
- try {
330856
- if (await isEmpty(planPath)) {
330857
- return PlanErrorMessages.FILE_EMPTY;
330858
- }
330859
- return null;
330860
- } catch (err2) {
330861
- const message = err2 instanceof Error ? err2.message : String(err2);
330862
- return PlanErrorMessages.READ_FAILURE(message);
330863
- }
330864
- }
330865
-
330866
330946
  // packages/core/src/utils/checks.ts
330867
330947
  function assumeExhaustive(_value) {
330868
330948
  }
@@ -330911,15 +330991,14 @@ var ExitPlanModeTool = class _ExitPlanModeTool extends BaseDeclarativeTool {
330911
330991
  if (!params.plan_filename || params.plan_filename.trim() === "") {
330912
330992
  return "plan_filename is required.";
330913
330993
  }
330914
- const safeFilename = path68.basename(params.plan_filename);
330915
- const plansDir = resolveToRealPath(this.config.storage.getPlansDir());
330916
- const resolvedPath = path68.join(
330917
- this.config.storage.getPlansDir(),
330918
- safeFilename
330919
- );
330920
- const realPath = resolveToRealPath(resolvedPath);
330921
- if (!isSubpath(plansDir, realPath)) {
330922
- return `Access denied: plan path (${resolvedPath}) must be within the designated plans directory (${plansDir}).`;
330994
+ try {
330995
+ resolveAndValidatePlanPath(
330996
+ params.plan_filename,
330997
+ this.config.storage.getPlansDir(),
330998
+ this.config.getProjectRoot()
330999
+ );
331000
+ } catch (e2) {
331001
+ return e2 instanceof Error ? e2.message : String(e2);
330923
331002
  }
330924
331003
  return null;
330925
331004
  }
@@ -330948,7 +331027,8 @@ var ExitPlanModeInvocation = class extends BaseToolInvocation {
330948
331027
  const resolvedPlanPath = this.getResolvedPlanPath();
330949
331028
  const pathError = await validatePlanPath(
330950
331029
  this.params.plan_filename,
330951
- this.config.storage.getPlansDir()
331030
+ this.config.storage.getPlansDir(),
331031
+ this.config.getProjectRoot()
330952
331032
  );
330953
331033
  if (pathError) {
330954
331034
  this.planValidationError = pathError;
@@ -330993,8 +331073,11 @@ var ExitPlanModeInvocation = class extends BaseToolInvocation {
330993
331073
  * Note: Validation is done in validateToolParamValues, so this assumes the path is valid.
330994
331074
  */
330995
331075
  getResolvedPlanPath() {
330996
- const safeFilename = path68.basename(this.params.plan_filename);
330997
- return path68.join(this.config.storage.getPlansDir(), safeFilename);
331076
+ return resolveAndValidatePlanPath(
331077
+ this.params.plan_filename,
331078
+ this.config.storage.getPlansDir(),
331079
+ this.config.getProjectRoot()
331080
+ );
330998
331081
  }
330999
331082
  async execute({ abortSignal: _signal }) {
331000
331083
  const resolvedPlanPath = this.getResolvedPlanPath();
@@ -364813,6 +364896,10 @@ export {
364813
364896
  BaseLlmClient,
364814
364897
  promptIdContext,
364815
364898
  getPromptIdWithFallback,
364899
+ PlanErrorMessages,
364900
+ resolveAndValidatePlanPath,
364901
+ validatePlanPath,
364902
+ validatePlanContent,
364816
364903
  applyReplacement,
364817
364904
  calculateReplacement,
364818
364905
  getErrorReplaceResult,
@@ -365037,9 +365124,6 @@ export {
365037
365124
  createUnauthorizedToolError,
365038
365125
  LocalAgentExecutor,
365039
365126
  resetBrowserSession,
365040
- PlanErrorMessages,
365041
- validatePlanPath,
365042
- validatePlanContent,
365043
365127
  assumeExhaustive,
365044
365128
  checkExhaustive,
365045
365129
  getApprovalModeDescription,