@google/gemini-cli-a2a-server 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.
@@ -1304,7 +1304,7 @@ var require_safe_stable_stringify = __commonJS({
1304
1304
  return circularValue;
1305
1305
  }
1306
1306
  let res = "";
1307
- let join38 = ",";
1307
+ let join37 = ",";
1308
1308
  const originalIndentation = indentation;
1309
1309
  if (Array.isArray(value)) {
1310
1310
  if (value.length === 0) {
@@ -1318,7 +1318,7 @@ var require_safe_stable_stringify = __commonJS({
1318
1318
  indentation += spacer;
1319
1319
  res += `
1320
1320
  ${indentation}`;
1321
- join38 = `,
1321
+ join37 = `,
1322
1322
  ${indentation}`;
1323
1323
  }
1324
1324
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -1326,13 +1326,13 @@ ${indentation}`;
1326
1326
  for (; i4 < maximumValuesToStringify - 1; i4++) {
1327
1327
  const tmp2 = stringifyFnReplacer(String(i4), value, stack, replacer, spacer, indentation);
1328
1328
  res += tmp2 !== void 0 ? tmp2 : "null";
1329
- res += join38;
1329
+ res += join37;
1330
1330
  }
1331
1331
  const tmp = stringifyFnReplacer(String(i4), value, stack, replacer, spacer, indentation);
1332
1332
  res += tmp !== void 0 ? tmp : "null";
1333
1333
  if (value.length - 1 > maximumBreadth) {
1334
1334
  const removedKeys = value.length - maximumBreadth - 1;
1335
- res += `${join38}"... ${getItemCount(removedKeys)} not stringified"`;
1335
+ res += `${join37}"... ${getItemCount(removedKeys)} not stringified"`;
1336
1336
  }
1337
1337
  if (spacer !== "") {
1338
1338
  res += `
@@ -1353,7 +1353,7 @@ ${originalIndentation}`;
1353
1353
  let separator = "";
1354
1354
  if (spacer !== "") {
1355
1355
  indentation += spacer;
1356
- join38 = `,
1356
+ join37 = `,
1357
1357
  ${indentation}`;
1358
1358
  whitespace = " ";
1359
1359
  }
@@ -1367,13 +1367,13 @@ ${indentation}`;
1367
1367
  const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
1368
1368
  if (tmp !== void 0) {
1369
1369
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
1370
- separator = join38;
1370
+ separator = join37;
1371
1371
  }
1372
1372
  }
1373
1373
  if (keyLength > maximumBreadth) {
1374
1374
  const removedKeys = keyLength - maximumBreadth;
1375
1375
  res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
1376
- separator = join38;
1376
+ separator = join37;
1377
1377
  }
1378
1378
  if (spacer !== "" && separator.length > 1) {
1379
1379
  res = `
@@ -1414,7 +1414,7 @@ ${originalIndentation}`;
1414
1414
  }
1415
1415
  const originalIndentation = indentation;
1416
1416
  let res = "";
1417
- let join38 = ",";
1417
+ let join37 = ",";
1418
1418
  if (Array.isArray(value)) {
1419
1419
  if (value.length === 0) {
1420
1420
  return "[]";
@@ -1427,7 +1427,7 @@ ${originalIndentation}`;
1427
1427
  indentation += spacer;
1428
1428
  res += `
1429
1429
  ${indentation}`;
1430
- join38 = `,
1430
+ join37 = `,
1431
1431
  ${indentation}`;
1432
1432
  }
1433
1433
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -1435,13 +1435,13 @@ ${indentation}`;
1435
1435
  for (; i4 < maximumValuesToStringify - 1; i4++) {
1436
1436
  const tmp2 = stringifyArrayReplacer(String(i4), value[i4], stack, replacer, spacer, indentation);
1437
1437
  res += tmp2 !== void 0 ? tmp2 : "null";
1438
- res += join38;
1438
+ res += join37;
1439
1439
  }
1440
1440
  const tmp = stringifyArrayReplacer(String(i4), value[i4], stack, replacer, spacer, indentation);
1441
1441
  res += tmp !== void 0 ? tmp : "null";
1442
1442
  if (value.length - 1 > maximumBreadth) {
1443
1443
  const removedKeys = value.length - maximumBreadth - 1;
1444
- res += `${join38}"... ${getItemCount(removedKeys)} not stringified"`;
1444
+ res += `${join37}"... ${getItemCount(removedKeys)} not stringified"`;
1445
1445
  }
1446
1446
  if (spacer !== "") {
1447
1447
  res += `
@@ -1454,7 +1454,7 @@ ${originalIndentation}`;
1454
1454
  let whitespace = "";
1455
1455
  if (spacer !== "") {
1456
1456
  indentation += spacer;
1457
- join38 = `,
1457
+ join37 = `,
1458
1458
  ${indentation}`;
1459
1459
  whitespace = " ";
1460
1460
  }
@@ -1463,7 +1463,7 @@ ${indentation}`;
1463
1463
  const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
1464
1464
  if (tmp !== void 0) {
1465
1465
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
1466
- separator = join38;
1466
+ separator = join37;
1467
1467
  }
1468
1468
  }
1469
1469
  if (spacer !== "" && separator.length > 1) {
@@ -1521,20 +1521,20 @@ ${originalIndentation}`;
1521
1521
  indentation += spacer;
1522
1522
  let res2 = `
1523
1523
  ${indentation}`;
1524
- const join39 = `,
1524
+ const join38 = `,
1525
1525
  ${indentation}`;
1526
1526
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
1527
1527
  let i4 = 0;
1528
1528
  for (; i4 < maximumValuesToStringify - 1; i4++) {
1529
1529
  const tmp2 = stringifyIndent(String(i4), value[i4], stack, spacer, indentation);
1530
1530
  res2 += tmp2 !== void 0 ? tmp2 : "null";
1531
- res2 += join39;
1531
+ res2 += join38;
1532
1532
  }
1533
1533
  const tmp = stringifyIndent(String(i4), value[i4], stack, spacer, indentation);
1534
1534
  res2 += tmp !== void 0 ? tmp : "null";
1535
1535
  if (value.length - 1 > maximumBreadth) {
1536
1536
  const removedKeys = value.length - maximumBreadth - 1;
1537
- res2 += `${join39}"... ${getItemCount(removedKeys)} not stringified"`;
1537
+ res2 += `${join38}"... ${getItemCount(removedKeys)} not stringified"`;
1538
1538
  }
1539
1539
  res2 += `
1540
1540
  ${originalIndentation}`;
@@ -1550,16 +1550,16 @@ ${originalIndentation}`;
1550
1550
  return '"[Object]"';
1551
1551
  }
1552
1552
  indentation += spacer;
1553
- const join38 = `,
1553
+ const join37 = `,
1554
1554
  ${indentation}`;
1555
1555
  let res = "";
1556
1556
  let separator = "";
1557
1557
  let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
1558
1558
  if (isTypedArrayWithEntries(value)) {
1559
- res += stringifyTypedArray(value, join38, maximumBreadth);
1559
+ res += stringifyTypedArray(value, join37, maximumBreadth);
1560
1560
  keys = keys.slice(value.length);
1561
1561
  maximumPropertiesToStringify -= value.length;
1562
- separator = join38;
1562
+ separator = join37;
1563
1563
  }
1564
1564
  if (deterministic) {
1565
1565
  keys = sort(keys, comparator);
@@ -1570,13 +1570,13 @@ ${indentation}`;
1570
1570
  const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
1571
1571
  if (tmp !== void 0) {
1572
1572
  res += `${separator}${strEscape(key2)}: ${tmp}`;
1573
- separator = join38;
1573
+ separator = join37;
1574
1574
  }
1575
1575
  }
1576
1576
  if (keyLength > maximumBreadth) {
1577
1577
  const removedKeys = keyLength - maximumBreadth;
1578
1578
  res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
1579
- separator = join38;
1579
+ separator = join37;
1580
1580
  }
1581
1581
  if (separator !== "") {
1582
1582
  res = `
@@ -3144,7 +3144,7 @@ var require_buffer_list = __commonJS({
3144
3144
  }
3145
3145
  }, {
3146
3146
  key: "join",
3147
- value: function join38(s5) {
3147
+ value: function join37(s5) {
3148
3148
  if (this.length === 0) return "";
3149
3149
  var p2 = this.head;
3150
3150
  var ret = "" + p2.data;
@@ -31282,7 +31282,7 @@ var require_view = __commonJS({
31282
31282
  var dirname25 = path98.dirname;
31283
31283
  var basename13 = path98.basename;
31284
31284
  var extname2 = path98.extname;
31285
- var join38 = path98.join;
31285
+ var join37 = path98.join;
31286
31286
  var resolve24 = path98.resolve;
31287
31287
  module2.exports = View;
31288
31288
  function View(name3, options) {
@@ -31344,12 +31344,12 @@ var require_view = __commonJS({
31344
31344
  };
31345
31345
  View.prototype.resolve = function resolve25(dir, file) {
31346
31346
  var ext2 = this.ext;
31347
- var path99 = join38(dir, file);
31347
+ var path99 = join37(dir, file);
31348
31348
  var stat5 = tryStat(path99);
31349
31349
  if (stat5 && stat5.isFile()) {
31350
31350
  return path99;
31351
31351
  }
31352
- path99 = join38(dir, basename13(file, ext2), "index" + ext2);
31352
+ path99 = join37(dir, basename13(file, ext2), "index" + ext2);
31353
31353
  stat5 = tryStat(path99);
31354
31354
  if (stat5 && stat5.isFile()) {
31355
31355
  return path99;
@@ -35008,7 +35008,7 @@ var require_send = __commonJS({
35008
35008
  var Stream4 = __require("stream");
35009
35009
  var util5 = __require("util");
35010
35010
  var extname2 = path98.extname;
35011
- var join38 = path98.join;
35011
+ var join37 = path98.join;
35012
35012
  var normalize6 = path98.normalize;
35013
35013
  var resolve24 = path98.resolve;
35014
35014
  var sep7 = path98.sep;
@@ -35180,7 +35180,7 @@ var require_send = __commonJS({
35180
35180
  return res;
35181
35181
  }
35182
35182
  parts2 = path99.split(sep7);
35183
- path99 = normalize6(join38(root, path99));
35183
+ path99 = normalize6(join37(root, path99));
35184
35184
  } else {
35185
35185
  if (UP_PATH_REGEXP.test(path99)) {
35186
35186
  debug2('malicious path "%s"', path99);
@@ -35313,7 +35313,7 @@ var require_send = __commonJS({
35313
35313
  if (err2) return self2.onStatError(err2);
35314
35314
  return self2.error(404);
35315
35315
  }
35316
- var p2 = join38(path99, self2._index[i4]);
35316
+ var p2 = join37(path99, self2._index[i4]);
35317
35317
  debug2('stat "%s"', p2);
35318
35318
  fs84.stat(p2, function(err3, stat5) {
35319
35319
  if (err3) return next(err3);
@@ -191435,7 +191435,7 @@ var require_util11 = __commonJS({
191435
191435
  function getFilesInPath(source) {
191436
191436
  const lstatSync3 = fs84.lstatSync;
191437
191437
  const readdirSync4 = fs84.readdirSync;
191438
- const join38 = path98.join;
191438
+ const join37 = path98.join;
191439
191439
  function isDirectory(source2) {
191440
191440
  return lstatSync3(source2).isDirectory();
191441
191441
  }
@@ -191444,12 +191444,12 @@ var require_util11 = __commonJS({
191444
191444
  }
191445
191445
  function getDirectories(source2) {
191446
191446
  return readdirSync4(source2).map((name3) => {
191447
- return join38(source2, name3);
191447
+ return join37(source2, name3);
191448
191448
  }).filter(isDirectory);
191449
191449
  }
191450
191450
  function getFiles(source2) {
191451
191451
  return readdirSync4(source2).map((name3) => {
191452
- return join38(source2, name3);
191452
+ return join37(source2, name3);
191453
191453
  }).filter(isFile2);
191454
191454
  }
191455
191455
  function getFilesRecursively(source2) {
@@ -208992,8 +208992,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
208992
208992
  var init_git_commit = __esm({
208993
208993
  "packages/core/dist/src/generated/git-commit.js"() {
208994
208994
  "use strict";
208995
- GIT_COMMIT_INFO = "5b1f7375a";
208996
- CLI_VERSION = "0.39.0-preview.0";
208995
+ GIT_COMMIT_INFO = "8d4bd62d3";
208996
+ CLI_VERSION = "0.39.0-preview.1";
208997
208997
  }
208998
208998
  });
208999
208999
 
@@ -325895,9 +325895,70 @@ var init_jit_context = __esm({
325895
325895
  }
325896
325896
  });
325897
325897
 
325898
+ // packages/core/dist/src/utils/planUtils.js
325899
+ import path35 from "node:path";
325900
+ function resolveAndValidatePlanPath(planPath, plansDir, projectRoot) {
325901
+ const trimmedPath = planPath.trim();
325902
+ if (!trimmedPath) {
325903
+ throw new Error("Plan file path must be non-empty.");
325904
+ }
325905
+ if (path35.isAbsolute(trimmedPath)) {
325906
+ if (isSubpath(resolveToRealPath(plansDir), resolveToRealPath(trimmedPath))) {
325907
+ return trimmedPath;
325908
+ }
325909
+ }
325910
+ const resolvedFromProjectRoot = path35.resolve(projectRoot, trimmedPath);
325911
+ if (isSubpath(resolveToRealPath(plansDir), resolveToRealPath(resolvedFromProjectRoot))) {
325912
+ return resolvedFromProjectRoot;
325913
+ }
325914
+ const resolvedPath = path35.resolve(plansDir, trimmedPath);
325915
+ const realPath = resolveToRealPath(resolvedPath);
325916
+ const realPlansDir = resolveToRealPath(plansDir);
325917
+ if (!isSubpath(realPlansDir, realPath)) {
325918
+ throw new Error(PlanErrorMessages.PATH_ACCESS_DENIED(trimmedPath, plansDir));
325919
+ }
325920
+ return resolvedPath;
325921
+ }
325922
+ async function validatePlanPath(planPath, plansDir, projectRoot) {
325923
+ try {
325924
+ const resolvedPath = resolveAndValidatePlanPath(planPath, plansDir, projectRoot);
325925
+ if (!await fileExists(resolvedPath)) {
325926
+ return PlanErrorMessages.FILE_NOT_FOUND(planPath);
325927
+ }
325928
+ return null;
325929
+ } catch {
325930
+ return PlanErrorMessages.PATH_ACCESS_DENIED(planPath, resolveToRealPath(plansDir));
325931
+ }
325932
+ }
325933
+ async function validatePlanContent(planPath) {
325934
+ try {
325935
+ if (await isEmpty(planPath)) {
325936
+ return PlanErrorMessages.FILE_EMPTY;
325937
+ }
325938
+ return null;
325939
+ } catch (err2) {
325940
+ const message = err2 instanceof Error ? err2.message : String(err2);
325941
+ return PlanErrorMessages.READ_FAILURE(message);
325942
+ }
325943
+ }
325944
+ var PlanErrorMessages;
325945
+ var init_planUtils = __esm({
325946
+ "packages/core/dist/src/utils/planUtils.js"() {
325947
+ "use strict";
325948
+ init_fileUtils();
325949
+ init_paths();
325950
+ PlanErrorMessages = {
325951
+ PATH_ACCESS_DENIED: (planPath, plansDir) => `Access denied: plan path (${planPath}) must be within the designated plans directory (${plansDir}).`,
325952
+ FILE_NOT_FOUND: (path98) => `Plan file does not exist: ${path98}. You must create the plan file before requesting approval.`,
325953
+ FILE_EMPTY: "Plan file is empty. You must write content to the plan file before requesting approval.",
325954
+ READ_FAILURE: (detail) => `Failed to read plan file: ${detail}`
325955
+ };
325956
+ }
325957
+ });
325958
+
325898
325959
  // packages/core/dist/src/tools/edit.js
325899
325960
  import * as fsPromises2 from "node:fs/promises";
325900
- import * as path35 from "node:path";
325961
+ import * as path36 from "node:path";
325901
325962
  import * as os23 from "node:os";
325902
325963
  import * as crypto18 from "node:crypto";
325903
325964
  function applyReplacement(currentContent, oldString, newString, isNewFile) {
@@ -326220,6 +326281,7 @@ var init_edit = __esm({
326220
326281
  init_resolver();
326221
326282
  init_omissionPlaceholderDetector();
326222
326283
  init_jit_context();
326284
+ init_planUtils();
326223
326285
  ENABLE_FUZZY_MATCH_RECOVERY = true;
326224
326286
  FUZZY_MATCH_THRESHOLD = 0.1;
326225
326287
  WHITESPACE_PENALTY_FACTOR = 0.1;
@@ -326230,14 +326292,18 @@ var init_edit = __esm({
326230
326292
  super(params, messageBus, toolName, displayName, void 0, void 0, true, () => this.config.getApprovalMode());
326231
326293
  this.config = config3;
326232
326294
  if (this.config.isPlanMode()) {
326233
- const safeFilename = path35.basename(this.params.file_path);
326234
- this.resolvedPath = path35.join(this.config.storage.getPlansDir(), safeFilename);
326235
- } else if (!path35.isAbsolute(this.params.file_path)) {
326295
+ try {
326296
+ this.resolvedPath = resolveAndValidatePlanPath(this.params.file_path, this.config.storage.getPlansDir(), this.config.getProjectRoot());
326297
+ } catch (e3) {
326298
+ debugLogger.error("Failed to resolve plan path during EditTool invocation setup", e3);
326299
+ this.resolvedPath = this.params.file_path;
326300
+ }
326301
+ } else if (!path36.isAbsolute(this.params.file_path)) {
326236
326302
  const result2 = correctPath(this.params.file_path, this.config);
326237
326303
  if (result2.success) {
326238
326304
  this.resolvedPath = result2.correctedPath;
326239
326305
  } else {
326240
- this.resolvedPath = path35.resolve(this.config.getTargetDir(), this.params.file_path);
326306
+ this.resolvedPath = path36.resolve(this.config.getTargetDir(), this.params.file_path);
326241
326307
  }
326242
326308
  } else {
326243
326309
  this.resolvedPath = this.params.file_path;
@@ -326445,7 +326511,7 @@ var init_edit = __esm({
326445
326511
  debugLogger.log(`Error: ${editData.error.display}`);
326446
326512
  return false;
326447
326513
  }
326448
- const fileName = path35.basename(this.resolvedPath);
326514
+ const fileName = path36.basename(this.resolvedPath);
326449
326515
  const fileDiff = createPatch(fileName, editData.currentContent ?? "", editData.newContent, "Current", "Proposed", DEFAULT_DIFF_OPTIONS);
326450
326516
  const ideClient = await IdeClient.getInstance();
326451
326517
  const ideConfirmation = this.config.getIdeMode() && ideClient.isDiffingEnabled() ? ideClient.openDiff(this.resolvedPath, editData.newContent) : void 0;
@@ -326538,7 +326604,7 @@ var init_edit = __esm({
326538
326604
  if (editData.isNewFile) {
326539
326605
  displayResult = `Created ${shortenPath(makeRelative(this.resolvedPath, this.config.getTargetDir()))}`;
326540
326606
  } else {
326541
- const fileName = path35.basename(this.resolvedPath);
326607
+ const fileName = path36.basename(this.resolvedPath);
326542
326608
  const fileDiff = createPatch(
326543
326609
  fileName,
326544
326610
  editData.currentContent ?? "",
@@ -326615,7 +326681,7 @@ ${snippet2}`);
326615
326681
  * Creates parent directories if they don't exist
326616
326682
  */
326617
326683
  async ensureParentDirectoriesExistAsync(filePath) {
326618
- const dirName = path35.dirname(filePath);
326684
+ const dirName = path36.dirname(filePath);
326619
326685
  try {
326620
326686
  await fsPromises2.access(dirName);
326621
326687
  } catch {
@@ -326650,12 +326716,18 @@ ${snippet2}`);
326650
326716
  return "The 'file_path' parameter must be non-empty.";
326651
326717
  }
326652
326718
  let resolvedPath;
326653
- if (!path35.isAbsolute(params.file_path)) {
326719
+ if (this.config.isPlanMode()) {
326720
+ try {
326721
+ resolvedPath = resolveAndValidatePlanPath(params.file_path, this.config.storage.getPlansDir(), this.config.getProjectRoot());
326722
+ } catch (err2) {
326723
+ return err2 instanceof Error ? err2.message : String(err2);
326724
+ }
326725
+ } else if (!path36.isAbsolute(params.file_path)) {
326654
326726
  const result2 = correctPath(params.file_path, this.config);
326655
326727
  if (result2.success) {
326656
326728
  resolvedPath = result2.correctedPath;
326657
326729
  } else {
326658
- resolvedPath = path35.resolve(this.config.getTargetDir(), params.file_path);
326730
+ resolvedPath = path36.resolve(this.config.getTargetDir(), params.file_path);
326659
326731
  }
326660
326732
  } else {
326661
326733
  resolvedPath = params.file_path;
@@ -326850,7 +326922,7 @@ Return ONLY the corrected snippet in the specified JSON format.
326850
326922
  // packages/core/dist/src/tools/write-file.js
326851
326923
  import fs42 from "node:fs";
326852
326924
  import fsPromises3 from "node:fs/promises";
326853
- import path36 from "node:path";
326925
+ import path37 from "node:path";
326854
326926
  import os24 from "node:os";
326855
326927
  async function getCorrectedFileContent(config3, filePath, proposedContent, abortSignal) {
326856
326928
  let originalContent = "";
@@ -326902,6 +326974,7 @@ var init_write_file = __esm({
326902
326974
  init_coreTools();
326903
326975
  init_resolver();
326904
326976
  init_omissionPlaceholderDetector();
326977
+ init_planUtils();
326905
326978
  init_models();
326906
326979
  init_jit_context();
326907
326980
  WriteFileToolInvocation = class extends BaseToolInvocation {
@@ -326911,10 +326984,14 @@ var init_write_file = __esm({
326911
326984
  super(params, messageBus, toolName, displayName, void 0, void 0, true, () => this.config.getApprovalMode());
326912
326985
  this.config = config3;
326913
326986
  if (this.config.isPlanMode()) {
326914
- const safeFilename = path36.basename(this.params.file_path);
326915
- this.resolvedPath = path36.join(this.config.storage.getPlansDir(), safeFilename);
326987
+ try {
326988
+ this.resolvedPath = resolveAndValidatePlanPath(this.params.file_path, this.config.storage.getPlansDir(), this.config.getProjectRoot());
326989
+ } catch (e3) {
326990
+ debugLogger.error("Failed to resolve plan path during WriteFileTool invocation setup", e3);
326991
+ this.resolvedPath = this.params.file_path;
326992
+ }
326916
326993
  } else {
326917
- this.resolvedPath = path36.resolve(this.config.getTargetDir(), this.params.file_path);
326994
+ this.resolvedPath = path37.resolve(this.config.getTargetDir(), this.params.file_path);
326918
326995
  }
326919
326996
  }
326920
326997
  toolLocations() {
@@ -326936,7 +327013,7 @@ var init_write_file = __esm({
326936
327013
  }
326937
327014
  const { originalContent, correctedContent } = correctedContentResult;
326938
327015
  const relativePath = makeRelative(this.resolvedPath, this.config.getTargetDir());
326939
- const fileName = path36.basename(this.resolvedPath);
327016
+ const fileName = path37.basename(this.resolvedPath);
326940
327017
  const fileDiff = createPatch(
326941
327018
  fileName,
326942
327019
  originalContent,
@@ -326998,7 +327075,7 @@ var init_write_file = __esm({
326998
327075
  const { originalContent, correctedContent: fileContent, fileExists: fileExists2 } = correctedContentResult;
326999
327076
  const isNewFile = !fileExists2 || correctedContentResult.error !== void 0 && !correctedContentResult.fileExists;
327000
327077
  try {
327001
- const dirName = path36.dirname(this.resolvedPath);
327078
+ const dirName = path37.dirname(this.resolvedPath);
327002
327079
  try {
327003
327080
  await fsPromises3.access(dirName);
327004
327081
  } catch {
@@ -327010,7 +327087,7 @@ var init_write_file = __esm({
327010
327087
  finalContent = finalContent.replace(/\r?\n/g, "\r\n");
327011
327088
  }
327012
327089
  await this.config.getFileSystemService().writeTextFile(this.resolvedPath, finalContent);
327013
- const fileName = path36.basename(this.resolvedPath);
327090
+ const fileName = path37.basename(this.resolvedPath);
327014
327091
  const currentContentForDiff = correctedContentResult.error ? "" : originalContent;
327015
327092
  const fileDiff = createPatch(fileName, currentContentForDiff, fileContent, "Original", "Written", DEFAULT_DIFF_OPTIONS);
327016
327093
  const originallyProposedContent = ai_proposed_content || content;
@@ -327026,7 +327103,7 @@ var init_write_file = __esm({
327026
327103
  ${snippet2}`);
327027
327104
  const mimetype = getSpecificMimeType(this.resolvedPath);
327028
327105
  const programmingLanguage = getLanguageFromFilePath(this.resolvedPath);
327029
- const extension = path36.extname(this.resolvedPath);
327106
+ const extension = path37.extname(this.resolvedPath);
327030
327107
  const operation = isNewFile ? FileOperation.CREATE : FileOperation.UPDATE;
327031
327108
  logFileOperation(this.config, new FileOperationEvent(WRITE_FILE_TOOL_NAME, operation, fileContent.split("\n").length, mimetype, extension, programmingLanguage));
327032
327109
  const displayResult = {
@@ -327093,7 +327170,16 @@ ${snippet2}`);
327093
327170
  if (!filePath) {
327094
327171
  return `Missing or empty "file_path"`;
327095
327172
  }
327096
- const resolvedPath = path36.resolve(this.config.getTargetDir(), filePath);
327173
+ let resolvedPath;
327174
+ if (this.config.isPlanMode()) {
327175
+ try {
327176
+ resolvedPath = resolveAndValidatePlanPath(filePath, this.config.storage.getPlansDir(), this.config.getProjectRoot());
327177
+ } catch (err2) {
327178
+ return err2 instanceof Error ? err2.message : String(err2);
327179
+ }
327180
+ } else {
327181
+ resolvedPath = path37.resolve(this.config.getTargetDir(), filePath);
327182
+ }
327097
327183
  const validationError = this.config.validatePathAccess(resolvedPath);
327098
327184
  if (validationError) {
327099
327185
  return validationError;
@@ -327239,18 +327325,18 @@ var init_telemetry2 = __esm({
327239
327325
  import process11 from "node:process";
327240
327326
  import fsPromises4 from "node:fs/promises";
327241
327327
  import { fileURLToPath as fileURLToPath5 } from "node:url";
327242
- import path37 from "node:path";
327328
+ import path38 from "node:path";
327243
327329
  async function findUp(name3, {
327244
327330
  cwd = process11.cwd(),
327245
327331
  type: type2 = "file",
327246
327332
  stopAt
327247
327333
  } = {}) {
327248
- let directory = path37.resolve(toPath(cwd) ?? "");
327249
- const { root } = path37.parse(directory);
327250
- stopAt = path37.resolve(directory, toPath(stopAt ?? root));
327251
- const isAbsoluteName = path37.isAbsolute(name3);
327334
+ let directory = path38.resolve(toPath(cwd) ?? "");
327335
+ const { root } = path38.parse(directory);
327336
+ stopAt = path38.resolve(directory, toPath(stopAt ?? root));
327337
+ const isAbsoluteName = path38.isAbsolute(name3);
327252
327338
  while (directory) {
327253
- const filePath = isAbsoluteName ? name3 : path37.join(directory, name3);
327339
+ const filePath = isAbsoluteName ? name3 : path38.join(directory, name3);
327254
327340
  try {
327255
327341
  const stats = await fsPromises4.stat(filePath);
327256
327342
  if (type2 === "file" && stats.isFile() || type2 === "directory" && stats.isDirectory()) {
@@ -327261,7 +327347,7 @@ async function findUp(name3, {
327261
327347
  if (directory === stopAt || directory === root) {
327262
327348
  break;
327263
327349
  }
327264
- directory = path37.dirname(directory);
327350
+ directory = path38.dirname(directory);
327265
327351
  }
327266
327352
  }
327267
327353
  var toPath;
@@ -332236,7 +332322,7 @@ var init_node3 = __esm({
332236
332322
 
332237
332323
  // node_modules/read-pkg/index.js
332238
332324
  import fsPromises5 from "node:fs/promises";
332239
- import path38 from "node:path";
332325
+ import path39 from "node:path";
332240
332326
  async function readPackage({ cwd, normalize: normalize6 = true } = {}) {
332241
332327
  const packageFile = await fsPromises5.readFile(getPackagePath(cwd), "utf8");
332242
332328
  return _readPackage(packageFile, normalize6);
@@ -332247,7 +332333,7 @@ var init_read_pkg = __esm({
332247
332333
  init_parse_json();
332248
332334
  import_normalize_package_data = __toESM(require_normalize2(), 1);
332249
332335
  init_node3();
332250
- getPackagePath = (cwd) => path38.resolve(toPath2(cwd) ?? ".", "package.json");
332336
+ getPackagePath = (cwd) => path39.resolve(toPath2(cwd) ?? ".", "package.json");
332251
332337
  _readPackage = (file, normalize6) => {
332252
332338
  const json2 = typeof file === "string" ? parseJson(file) : file;
332253
332339
  if (normalize6) {
@@ -332259,14 +332345,14 @@ var init_read_pkg = __esm({
332259
332345
  });
332260
332346
 
332261
332347
  // node_modules/read-package-up/index.js
332262
- import path39 from "node:path";
332348
+ import path40 from "node:path";
332263
332349
  async function readPackageUp(options) {
332264
332350
  const filePath = await findUp("package.json", options);
332265
332351
  if (!filePath) {
332266
332352
  return;
332267
332353
  }
332268
332354
  return {
332269
- packageJson: await readPackage({ ...options, cwd: path39.dirname(filePath) }),
332355
+ packageJson: await readPackage({ ...options, cwd: path40.dirname(filePath) }),
332270
332356
  path: filePath
332271
332357
  };
332272
332358
  }
@@ -332332,14 +332418,14 @@ var init_channel = __esm({
332332
332418
 
332333
332419
  // packages/core/dist/src/utils/version.js
332334
332420
  import { fileURLToPath as fileURLToPath7 } from "node:url";
332335
- import path40 from "node:path";
332421
+ import path41 from "node:path";
332336
332422
  function getVersion() {
332337
332423
  if (versionPromise) {
332338
332424
  return versionPromise;
332339
332425
  }
332340
332426
  versionPromise = (async () => {
332341
332427
  const pkgJson = await getPackageJson(__dirname4);
332342
- return "0.39.0-preview.0";
332428
+ return "0.39.0-preview.1";
332343
332429
  })();
332344
332430
  return versionPromise;
332345
332431
  }
@@ -332349,13 +332435,13 @@ var init_version5 = __esm({
332349
332435
  "use strict";
332350
332436
  init_package();
332351
332437
  __filename3 = fileURLToPath7(import.meta.url);
332352
- __dirname4 = path40.dirname(__filename3);
332438
+ __dirname4 = path41.dirname(__filename3);
332353
332439
  }
332354
332440
  });
332355
332441
 
332356
332442
  // packages/core/dist/src/code_assist/experiments/client_metadata.js
332357
332443
  import { fileURLToPath as fileURLToPath8 } from "node:url";
332358
- import path41 from "node:path";
332444
+ import path42 from "node:path";
332359
332445
  function getPlatform() {
332360
332446
  const platform11 = process.platform;
332361
332447
  const arch4 = process.arch;
@@ -332395,7 +332481,7 @@ var init_client_metadata = __esm({
332395
332481
  init_channel();
332396
332482
  init_version5();
332397
332483
  __filename4 = fileURLToPath8(import.meta.url);
332398
- __dirname5 = path41.dirname(__filename4);
332484
+ __dirname5 = path42.dirname(__filename4);
332399
332485
  }
332400
332486
  });
332401
332487
 
@@ -334535,7 +334621,7 @@ var init_constants4 = __esm({
334535
334621
 
334536
334622
  // packages/core/dist/src/tools/ls.js
334537
334623
  import fs43 from "node:fs/promises";
334538
- import path42 from "node:path";
334624
+ import path43 from "node:path";
334539
334625
  var LSToolInvocation, LSTool;
334540
334626
  var init_ls = __esm({
334541
334627
  "packages/core/dist/src/tools/ls.js"() {
@@ -334604,7 +334690,7 @@ var init_ls = __esm({
334604
334690
  * @returns Result of the LS operation
334605
334691
  */
334606
334692
  async execute({ abortSignal: _signal }) {
334607
- const resolvedDirPath = path42.resolve(this.config.getTargetDir(), this.params.dir_path);
334693
+ const resolvedDirPath = path43.resolve(this.config.getTargetDir(), this.params.dir_path);
334608
334694
  const validationError = this.config.validatePathAccess(resolvedDirPath, "read");
334609
334695
  if (validationError) {
334610
334696
  return {
@@ -334631,7 +334717,7 @@ var init_ls = __esm({
334631
334717
  returnDisplay: `Directory is empty.`
334632
334718
  };
334633
334719
  }
334634
- const relativePaths = files.map((file) => path42.relative(this.config.getTargetDir(), path42.join(resolvedDirPath, file)));
334720
+ const relativePaths = files.map((file) => path43.relative(this.config.getTargetDir(), path43.join(resolvedDirPath, file)));
334635
334721
  const fileDiscovery = this.config.getFileService();
334636
334722
  const { filteredPaths, ignoredCount } = fileDiscovery.filterFilesWithReport(relativePaths, {
334637
334723
  respectGitIgnore: this.params.file_filtering_options?.respect_git_ignore ?? this.config.getFileFilteringOptions().respectGitIgnore ?? DEFAULT_FILE_FILTERING_OPTIONS.respectGitIgnore,
@@ -334639,15 +334725,15 @@ var init_ls = __esm({
334639
334725
  });
334640
334726
  const entries2 = [];
334641
334727
  for (const relativePath of filteredPaths) {
334642
- const fullPath = path42.resolve(this.config.getTargetDir(), relativePath);
334643
- if (this.shouldIgnore(path42.basename(fullPath), this.params.ignore)) {
334728
+ const fullPath = path43.resolve(this.config.getTargetDir(), relativePath);
334729
+ if (this.shouldIgnore(path43.basename(fullPath), this.params.ignore)) {
334644
334730
  continue;
334645
334731
  }
334646
334732
  try {
334647
334733
  const stats2 = await fs43.stat(fullPath);
334648
334734
  const isDir = stats2.isDirectory();
334649
334735
  entries2.push({
334650
- name: path42.basename(fullPath),
334736
+ name: path43.basename(fullPath),
334651
334737
  path: fullPath,
334652
334738
  isDirectory: isDir,
334653
334739
  size: isDir ? 0 : stats2.size,
@@ -334711,7 +334797,7 @@ ${directoryContent}`;
334711
334797
  * @returns An error message string if invalid, null otherwise
334712
334798
  */
334713
334799
  validateToolParamValues(params) {
334714
- const resolvedPath = path42.resolve(this.config.getTargetDir(), params.dir_path);
334800
+ const resolvedPath = path43.resolve(this.config.getTargetDir(), params.dir_path);
334715
334801
  return this.config.validatePathAccess(resolvedPath, "read");
334716
334802
  }
334717
334803
  createInvocation(params, messageBus, _toolName, _toolDisplayName) {
@@ -335197,16 +335283,16 @@ var require_ignore = __commonJS({
335197
335283
  });
335198
335284
 
335199
335285
  // packages/core/dist/src/utils/ignorePathUtils.js
335200
- import * as path43 from "node:path";
335286
+ import * as path44 from "node:path";
335201
335287
  function getNormalizedRelativePath(projectRoot, filePath, isDirectory) {
335202
335288
  if (!filePath || typeof filePath !== "string") {
335203
335289
  return null;
335204
335290
  }
335205
- const absoluteFilePath = path43.resolve(projectRoot, filePath);
335291
+ const absoluteFilePath = path44.resolve(projectRoot, filePath);
335206
335292
  if (!isWithinRoot(absoluteFilePath, projectRoot)) {
335207
335293
  return null;
335208
335294
  }
335209
- const relativePath = path43.relative(projectRoot, absoluteFilePath);
335295
+ const relativePath = path44.relative(projectRoot, absoluteFilePath);
335210
335296
  let normalized = relativePath.replace(/\\/g, "/");
335211
335297
  if (isDirectory && !normalized.endsWith("/") && normalized !== "") {
335212
335298
  normalized += "/";
@@ -335228,7 +335314,7 @@ var init_ignorePathUtils = __esm({
335228
335314
 
335229
335315
  // packages/core/dist/src/utils/gitIgnoreParser.js
335230
335316
  import * as fs44 from "node:fs";
335231
- import * as path44 from "node:path";
335317
+ import * as path45 from "node:path";
335232
335318
  var import_ignore, GitIgnoreParser;
335233
335319
  var init_gitIgnoreParser = __esm({
335234
335320
  "packages/core/dist/src/utils/gitIgnoreParser.js"() {
@@ -335243,7 +335329,7 @@ var init_gitIgnoreParser = __esm({
335243
335329
  processedExtraPatterns;
335244
335330
  constructor(projectRoot, extraPatterns) {
335245
335331
  this.extraPatterns = extraPatterns;
335246
- this.projectRoot = path44.resolve(projectRoot);
335332
+ this.projectRoot = path45.resolve(projectRoot);
335247
335333
  this.processedExtraPatterns = (0, import_ignore.default)();
335248
335334
  if (this.extraPatterns) {
335249
335335
  this.processedExtraPatterns.add(this.processPatterns(this.extraPatterns, "."));
@@ -335256,8 +335342,8 @@ var init_gitIgnoreParser = __esm({
335256
335342
  } catch {
335257
335343
  return (0, import_ignore.default)();
335258
335344
  }
335259
- const isExcludeFile = patternsFilePath.endsWith(path44.join(".git", "info", "exclude"));
335260
- const relativeBaseDir = isExcludeFile ? "." : path44.dirname(path44.relative(this.projectRoot, patternsFilePath)).split(path44.sep).join(path44.posix.sep);
335345
+ const isExcludeFile = patternsFilePath.endsWith(path45.join(".git", "info", "exclude"));
335346
+ const relativeBaseDir = isExcludeFile ? "." : path45.dirname(path45.relative(this.projectRoot, patternsFilePath)).split(path45.sep).join(path45.posix.sep);
335261
335347
  const rawPatterns = content.split("\n");
335262
335348
  return (0, import_ignore.default)().add(this.processPatterns(rawPatterns, relativeBaseDir));
335263
335349
  }
@@ -335277,9 +335363,9 @@ var init_gitIgnoreParser = __esm({
335277
335363
  let newPattern = p2;
335278
335364
  if (relativeBaseDir && relativeBaseDir !== ".") {
335279
335365
  if (!isAnchoredInFile && !p2.includes("/")) {
335280
- newPattern = path44.posix.join("**", p2);
335366
+ newPattern = path45.posix.join("**", p2);
335281
335367
  }
335282
- newPattern = path44.posix.join(relativeBaseDir, newPattern);
335368
+ newPattern = path45.posix.join(relativeBaseDir, newPattern);
335283
335369
  if (!newPattern.startsWith("/")) {
335284
335370
  newPattern = "/" + newPattern;
335285
335371
  }
@@ -335301,7 +335387,7 @@ var init_gitIgnoreParser = __esm({
335301
335387
  try {
335302
335388
  const ig = (0, import_ignore.default)().add(".git");
335303
335389
  if (this.globalPatterns === void 0) {
335304
- const excludeFile = path44.join(this.projectRoot, ".git", "info", "exclude");
335390
+ const excludeFile = path45.join(this.projectRoot, ".git", "info", "exclude");
335305
335391
  this.globalPatterns = fs44.existsSync(excludeFile) ? this.loadPatternsForFile(excludeFile) : (0, import_ignore.default)();
335306
335392
  }
335307
335393
  ig.add(this.globalPatterns);
@@ -335309,11 +335395,11 @@ var init_gitIgnoreParser = __esm({
335309
335395
  let currentAbsDir = this.projectRoot;
335310
335396
  const dirsToVisit = [this.projectRoot];
335311
335397
  for (let i4 = 0; i4 < pathParts.length - 1; i4++) {
335312
- currentAbsDir = path44.join(currentAbsDir, pathParts[i4]);
335398
+ currentAbsDir = path45.join(currentAbsDir, pathParts[i4]);
335313
335399
  dirsToVisit.push(currentAbsDir);
335314
335400
  }
335315
335401
  for (const dir of dirsToVisit) {
335316
- const relativeDir = path44.relative(this.projectRoot, dir);
335402
+ const relativeDir = path45.relative(this.projectRoot, dir);
335317
335403
  if (relativeDir) {
335318
335404
  const parentDirRelative = getNormalizedRelativePath(this.projectRoot, dir, true);
335319
335405
  const currentIg = (0, import_ignore.default)().add(ig).add(this.processedExtraPatterns);
@@ -335323,7 +335409,7 @@ var init_gitIgnoreParser = __esm({
335323
335409
  }
335324
335410
  let patterns = this.cache.get(dir);
335325
335411
  if (patterns === void 0) {
335326
- const gitignorePath = path44.join(dir, ".gitignore");
335412
+ const gitignorePath = path45.join(dir, ".gitignore");
335327
335413
  patterns = fs44.existsSync(gitignorePath) ? this.loadPatternsForFile(gitignorePath) : (0, import_ignore.default)();
335328
335414
  this.cache.set(dir, patterns);
335329
335415
  }
@@ -335340,7 +335426,7 @@ var init_gitIgnoreParser = __esm({
335340
335426
 
335341
335427
  // packages/core/dist/src/utils/ignoreFileParser.js
335342
335428
  import * as fs45 from "node:fs";
335343
- import * as path45 from "node:path";
335429
+ import * as path46 from "node:path";
335344
335430
  var import_ignore2, IgnoreFileParser;
335345
335431
  var init_ignoreFileParser = __esm({
335346
335432
  "packages/core/dist/src/utils/ignoreFileParser.js"() {
@@ -335354,7 +335440,7 @@ var init_ignoreFileParser = __esm({
335354
335440
  ig = (0, import_ignore2.default)();
335355
335441
  fileNames;
335356
335442
  constructor(projectRoot, input, isPatterns = false) {
335357
- this.projectRoot = path45.resolve(projectRoot);
335443
+ this.projectRoot = path46.resolve(projectRoot);
335358
335444
  if (isPatterns) {
335359
335445
  this.fileNames = [];
335360
335446
  const patterns = Array.isArray(input) ? input : [input];
@@ -335373,7 +335459,7 @@ var init_ignoreFileParser = __esm({
335373
335459
  }
335374
335460
  }
335375
335461
  parseIgnoreFile(fileName) {
335376
- const patternsFilePath = path45.join(this.projectRoot, fileName);
335462
+ const patternsFilePath = path46.join(this.projectRoot, fileName);
335377
335463
  let content;
335378
335464
  try {
335379
335465
  content = fs45.readFileSync(patternsFilePath, "utf-8");
@@ -335398,7 +335484,7 @@ var init_ignoreFileParser = __esm({
335398
335484
  return this.patterns;
335399
335485
  }
335400
335486
  getIgnoreFilePaths() {
335401
- return this.fileNames.slice().reverse().map((fileName) => path45.join(this.projectRoot, fileName)).filter((filePath) => fs45.existsSync(filePath));
335487
+ return this.fileNames.slice().reverse().map((fileName) => path46.join(this.projectRoot, fileName)).filter((filePath) => fs45.existsSync(filePath));
335402
335488
  }
335403
335489
  /**
335404
335490
  * Returns true if at least one ignore file exists and has patterns.
@@ -335412,16 +335498,16 @@ var init_ignoreFileParser = __esm({
335412
335498
 
335413
335499
  // packages/core/dist/src/utils/gitUtils.js
335414
335500
  import * as fs46 from "node:fs";
335415
- import * as path46 from "node:path";
335501
+ import * as path47 from "node:path";
335416
335502
  function isGitRepository(directory) {
335417
335503
  try {
335418
- let currentDir = path46.resolve(directory);
335504
+ let currentDir = path47.resolve(directory);
335419
335505
  while (true) {
335420
- const gitDir = path46.join(currentDir, ".git");
335506
+ const gitDir = path47.join(currentDir, ".git");
335421
335507
  if (fs46.existsSync(gitDir)) {
335422
335508
  return true;
335423
335509
  }
335424
- const parentDir = path46.dirname(currentDir);
335510
+ const parentDir = path47.dirname(currentDir);
335425
335511
  if (parentDir === currentDir) {
335426
335512
  break;
335427
335513
  }
@@ -335440,7 +335526,7 @@ var init_gitUtils = __esm({
335440
335526
 
335441
335527
  // packages/core/dist/src/services/fileDiscoveryService.js
335442
335528
  import fs47 from "node:fs";
335443
- import * as path47 from "node:path";
335529
+ import * as path48 from "node:path";
335444
335530
  var FileDiscoveryService;
335445
335531
  var init_fileDiscoveryService = __esm({
335446
335532
  "packages/core/dist/src/services/fileDiscoveryService.js"() {
@@ -335463,7 +335549,7 @@ var init_fileDiscoveryService = __esm({
335463
335549
  };
335464
335550
  projectRoot;
335465
335551
  constructor(projectRoot, options) {
335466
- this.projectRoot = path47.resolve(projectRoot);
335552
+ this.projectRoot = path48.resolve(projectRoot);
335467
335553
  this.applyFilterFilesOptions(options);
335468
335554
  if (isGitRepository(this.projectRoot)) {
335469
335555
  this.gitIgnoreFilter = new GitIgnoreParser(this.projectRoot);
@@ -335505,7 +335591,7 @@ var init_fileDiscoveryService = __esm({
335505
335591
  throw error2;
335506
335592
  }
335507
335593
  await Promise.all(dirEntries.map(async (entry) => {
335508
- const fullPath = path47.join(currentDir, entry.name);
335594
+ const fullPath = path48.join(currentDir, entry.name);
335509
335595
  if (entry.isDirectory()) {
335510
335596
  if (this.shouldIgnoreDirectory(fullPath, options)) {
335511
335597
  ignoredPaths.push(fullPath);
@@ -335612,7 +335698,7 @@ var init_fileDiscoveryService = __esm({
335612
335698
  getAllIgnoreFilePaths() {
335613
335699
  const paths = [];
335614
335700
  if (this.gitIgnoreFilter && this.defaultFilterFileOptions.respectGitIgnore) {
335615
- const gitIgnorePath = path47.join(this.projectRoot, ".gitignore");
335701
+ const gitIgnorePath = path48.join(this.projectRoot, ".gitignore");
335616
335702
  if (fs47.existsSync(gitIgnorePath)) {
335617
335703
  paths.push(gitIgnorePath);
335618
335704
  }
@@ -335624,7 +335710,7 @@ var init_fileDiscoveryService = __esm({
335624
335710
  });
335625
335711
 
335626
335712
  // packages/core/dist/src/tools/read-file.js
335627
- import path48 from "node:path";
335713
+ import path49 from "node:path";
335628
335714
  var ReadFileToolInvocation, ReadFileTool;
335629
335715
  var init_read_file = __esm({
335630
335716
  "packages/core/dist/src/tools/read-file.js"() {
@@ -335649,7 +335735,7 @@ var init_read_file = __esm({
335649
335735
  constructor(config3, params, messageBus, _toolName, _toolDisplayName) {
335650
335736
  super(params, messageBus, _toolName, _toolDisplayName);
335651
335737
  this.config = config3;
335652
- this.resolvedPath = path48.resolve(this.config.getTargetDir(), this.params.file_path);
335738
+ this.resolvedPath = path49.resolve(this.config.getTargetDir(), this.params.file_path);
335653
335739
  }
335654
335740
  getDescription() {
335655
335741
  const relativePath = makeRelative(this.resolvedPath, this.config.getTargetDir());
@@ -335710,7 +335796,7 @@ ${result2.llmContent}`;
335710
335796
  const programming_language = getProgrammingLanguage({
335711
335797
  file_path: this.resolvedPath
335712
335798
  });
335713
- logFileOperation(this.config, new FileOperationEvent(READ_FILE_TOOL_NAME, FileOperation.READ, lines, mimetype, path48.extname(this.resolvedPath), programming_language));
335799
+ logFileOperation(this.config, new FileOperationEvent(READ_FILE_TOOL_NAME, FileOperation.READ, lines, mimetype, path49.extname(this.resolvedPath), programming_language));
335714
335800
  const jitContext = await discoverJitContext(this.config, this.resolvedPath);
335715
335801
  if (jitContext) {
335716
335802
  if (typeof llmContent === "string") {
@@ -335738,7 +335824,7 @@ ${result2.llmContent}`;
335738
335824
  if (params.file_path.trim() === "") {
335739
335825
  return "The 'file_path' parameter must be non-empty.";
335740
335826
  }
335741
- const resolvedPath = path48.resolve(this.config.getTargetDir(), params.file_path);
335827
+ const resolvedPath = path49.resolve(this.config.getTargetDir(), params.file_path);
335742
335828
  const validationError = this.config.validatePathAccess(resolvedPath, "read");
335743
335829
  if (validationError) {
335744
335830
  return validationError;
@@ -336805,7 +336891,7 @@ var init_escape = __esm({
336805
336891
  });
336806
336892
 
336807
336893
  // node_modules/minimatch/dist/esm/index.js
336808
- var minimatch, starDotExtRE, starDotExtTest, starDotExtTestDot, starDotExtTestNocase, starDotExtTestNocaseDot, starDotStarRE, starDotStarTest, starDotStarTestDot, dotStarRE, dotStarTest, starRE, starTest, starTestDot, qmarksRE, qmarksTestNocase, qmarksTestNocaseDot, qmarksTestDot, qmarksTest, qmarksTestNoExt, qmarksTestNoExtDot, defaultPlatform, path49, sep3, GLOBSTAR, qmark2, star2, twoStarDot, twoStarNoDot, filter, ext, defaults, braceExpand, makeRe, match, globMagic, regExpEscape2, Minimatch;
336894
+ var minimatch, starDotExtRE, starDotExtTest, starDotExtTestDot, starDotExtTestNocase, starDotExtTestNocaseDot, starDotStarRE, starDotStarTest, starDotStarTestDot, dotStarRE, dotStarTest, starRE, starTest, starTestDot, qmarksRE, qmarksTestNocase, qmarksTestNocaseDot, qmarksTestDot, qmarksTest, qmarksTestNoExt, qmarksTestNoExtDot, defaultPlatform, path50, sep3, GLOBSTAR, qmark2, star2, twoStarDot, twoStarNoDot, filter, ext, defaults, braceExpand, makeRe, match, globMagic, regExpEscape2, Minimatch;
336809
336895
  var init_esm7 = __esm({
336810
336896
  "node_modules/minimatch/dist/esm/index.js"() {
336811
336897
  init_esm6();
@@ -336874,11 +336960,11 @@ var init_esm7 = __esm({
336874
336960
  return (f4) => f4.length === len && f4 !== "." && f4 !== "..";
336875
336961
  };
336876
336962
  defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
336877
- path49 = {
336963
+ path50 = {
336878
336964
  win32: { sep: "\\" },
336879
336965
  posix: { sep: "/" }
336880
336966
  };
336881
- sep3 = defaultPlatform === "win32" ? path49.win32.sep : path49.posix.sep;
336967
+ sep3 = defaultPlatform === "win32" ? path50.win32.sep : path50.posix.sep;
336882
336968
  minimatch.sep = sep3;
336883
336969
  GLOBSTAR = Symbol("globstar **");
336884
336970
  minimatch.GLOBSTAR = GLOBSTAR;
@@ -342922,7 +343008,7 @@ var init_grep_utils = __esm({
342922
343008
  // packages/core/dist/src/tools/grep.js
342923
343009
  import fs48 from "node:fs";
342924
343010
  import fsPromises7 from "node:fs/promises";
342925
- import path50 from "node:path";
343011
+ import path51 from "node:path";
342926
343012
  import { spawn as spawn5 } from "node:child_process";
342927
343013
  var GrepToolInvocation, GrepTool;
342928
343014
  var init_grep = __esm({
@@ -342966,14 +343052,14 @@ var init_grep = __esm({
342966
343052
  const [, filePathRaw, lineNumberStr, lineContent] = match2;
342967
343053
  const lineNumber = parseInt(lineNumberStr, 10);
342968
343054
  if (!isNaN(lineNumber)) {
342969
- const absoluteFilePath = path50.resolve(basePath, filePathRaw);
342970
- const relativeCheck = path50.relative(basePath, absoluteFilePath);
342971
- if (relativeCheck === ".." || relativeCheck.startsWith(`..${path50.sep}`) || path50.isAbsolute(relativeCheck)) {
343055
+ const absoluteFilePath = path51.resolve(basePath, filePathRaw);
343056
+ const relativeCheck = path51.relative(basePath, absoluteFilePath);
343057
+ if (relativeCheck === ".." || relativeCheck.startsWith(`..${path51.sep}`) || path51.isAbsolute(relativeCheck)) {
342972
343058
  return null;
342973
343059
  }
342974
- const relativeFilePath = path50.relative(basePath, absoluteFilePath);
343060
+ const relativeFilePath = path51.relative(basePath, absoluteFilePath);
342975
343061
  return {
342976
- filePath: relativeFilePath || path50.basename(absoluteFilePath),
343062
+ filePath: relativeFilePath || path51.basename(absoluteFilePath),
342977
343063
  absolutePath: absoluteFilePath,
342978
343064
  lineNumber,
342979
343065
  line: lineContent
@@ -342987,7 +343073,7 @@ var init_grep = __esm({
342987
343073
  const pathParam = this.params.dir_path;
342988
343074
  let searchDirAbs = null;
342989
343075
  if (pathParam) {
342990
- searchDirAbs = path50.resolve(this.config.getTargetDir(), pathParam);
343076
+ searchDirAbs = path51.resolve(this.config.getTargetDir(), pathParam);
342991
343077
  const validationError = this.config.validatePathAccess(searchDirAbs, "read");
342992
343078
  if (validationError) {
342993
343079
  return {
@@ -343069,9 +343155,9 @@ var init_grep = __esm({
343069
343155
  signal: timeoutController.signal
343070
343156
  });
343071
343157
  if (searchDirectories.length > 1) {
343072
- const dirName = path50.basename(searchDir);
343158
+ const dirName = path51.basename(searchDir);
343073
343159
  matches.forEach((match2) => {
343074
- match2.filePath = path50.join(dirName, match2.filePath);
343160
+ match2.filePath = path51.join(dirName, match2.filePath);
343075
343161
  });
343076
343162
  }
343077
343163
  allMatches = allMatches.concat(matches);
@@ -343295,8 +343381,8 @@ var init_grep = __esm({
343295
343381
  if (allMatches.length >= maxMatches)
343296
343382
  break;
343297
343383
  const fileAbsolutePath = filePath;
343298
- const relativePath = path50.relative(absolutePath, fileAbsolutePath);
343299
- if (relativePath === ".." || relativePath.startsWith(`..${path50.sep}`) || path50.isAbsolute(relativePath))
343384
+ const relativePath = path51.relative(absolutePath, fileAbsolutePath);
343385
+ if (relativePath === ".." || relativePath.startsWith(`..${path51.sep}`) || path51.isAbsolute(relativePath))
343300
343386
  continue;
343301
343387
  try {
343302
343388
  const content = await fsPromises7.readFile(fileAbsolutePath, "utf8");
@@ -343309,7 +343395,7 @@ var init_grep = __esm({
343309
343395
  continue;
343310
343396
  }
343311
343397
  allMatches.push({
343312
- filePath: path50.relative(absolutePath, fileAbsolutePath) || path50.basename(fileAbsolutePath),
343398
+ filePath: path51.relative(absolutePath, fileAbsolutePath) || path51.basename(fileAbsolutePath),
343313
343399
  absolutePath: fileAbsolutePath,
343314
343400
  lineNumber: index + 1,
343315
343401
  line
@@ -343340,7 +343426,7 @@ var init_grep = __esm({
343340
343426
  description += ` in ${this.params.include_pattern}`;
343341
343427
  }
343342
343428
  if (this.params.dir_path) {
343343
- const resolvedPath = path50.resolve(this.config.getTargetDir(), this.params.dir_path);
343429
+ const resolvedPath = path51.resolve(this.config.getTargetDir(), this.params.dir_path);
343344
343430
  if (resolvedPath === this.config.getTargetDir() || this.params.dir_path === ".") {
343345
343431
  description += ` within ./`;
343346
343432
  } else {
@@ -343389,7 +343475,7 @@ var init_grep = __esm({
343389
343475
  return "total_max_matches must be at least 1.";
343390
343476
  }
343391
343477
  if (params.dir_path) {
343392
- const resolvedPath = path50.resolve(this.config.getTargetDir(), params.dir_path);
343478
+ const resolvedPath = path51.resolve(this.config.getTargetDir(), params.dir_path);
343393
343479
  const validationError = this.config.validatePathAccess(resolvedPath, "read");
343394
343480
  if (validationError) {
343395
343481
  return validationError;
@@ -344458,7 +344544,7 @@ var init_default4 = __esm({
344458
344544
  // node_modules/npm-run-path/node_modules/unicorn-magic/node.js
344459
344545
  import { promisify as promisify10 } from "node:util";
344460
344546
  import { execFile as execFileCallback, execFileSync as execFileSyncOriginal } from "node:child_process";
344461
- import path51 from "node:path";
344547
+ import path52 from "node:path";
344462
344548
  import { fileURLToPath as fileURLToPath12 } from "node:url";
344463
344549
  function toPath3(urlOrPath) {
344464
344550
  return urlOrPath instanceof URL ? fileURLToPath12(urlOrPath) : urlOrPath;
@@ -344466,12 +344552,12 @@ function toPath3(urlOrPath) {
344466
344552
  function traversePathUp(startPath) {
344467
344553
  return {
344468
344554
  *[Symbol.iterator]() {
344469
- let currentPath = path51.resolve(toPath3(startPath));
344555
+ let currentPath = path52.resolve(toPath3(startPath));
344470
344556
  let previousPath;
344471
344557
  while (previousPath !== currentPath) {
344472
344558
  yield currentPath;
344473
344559
  previousPath = currentPath;
344474
- currentPath = path51.resolve(currentPath, "..");
344560
+ currentPath = path52.resolve(currentPath, "..");
344475
344561
  }
344476
344562
  }
344477
344563
  };
@@ -344487,7 +344573,7 @@ var init_node4 = __esm({
344487
344573
 
344488
344574
  // node_modules/npm-run-path/index.js
344489
344575
  import process14 from "node:process";
344490
- import path52 from "node:path";
344576
+ import path53 from "node:path";
344491
344577
  var npmRunPath, applyPreferLocal, applyExecPath, npmRunPathEnv;
344492
344578
  var init_npm_run_path = __esm({
344493
344579
  "node_modules/npm-run-path/index.js"() {
@@ -344500,27 +344586,27 @@ var init_npm_run_path = __esm({
344500
344586
  execPath: execPath2 = process14.execPath,
344501
344587
  addExecPath = true
344502
344588
  } = {}) => {
344503
- const cwdPath = path52.resolve(toPath3(cwd));
344589
+ const cwdPath = path53.resolve(toPath3(cwd));
344504
344590
  const result2 = [];
344505
- const pathParts = pathOption.split(path52.delimiter);
344591
+ const pathParts = pathOption.split(path53.delimiter);
344506
344592
  if (preferLocal) {
344507
344593
  applyPreferLocal(result2, pathParts, cwdPath);
344508
344594
  }
344509
344595
  if (addExecPath) {
344510
344596
  applyExecPath(result2, pathParts, execPath2, cwdPath);
344511
344597
  }
344512
- return pathOption === "" || pathOption === path52.delimiter ? `${result2.join(path52.delimiter)}${pathOption}` : [...result2, pathOption].join(path52.delimiter);
344598
+ return pathOption === "" || pathOption === path53.delimiter ? `${result2.join(path53.delimiter)}${pathOption}` : [...result2, pathOption].join(path53.delimiter);
344513
344599
  };
344514
344600
  applyPreferLocal = (result2, pathParts, cwdPath) => {
344515
344601
  for (const directory of traversePathUp(cwdPath)) {
344516
- const pathPart = path52.join(directory, "node_modules/.bin");
344602
+ const pathPart = path53.join(directory, "node_modules/.bin");
344517
344603
  if (!pathParts.includes(pathPart)) {
344518
344604
  result2.push(pathPart);
344519
344605
  }
344520
344606
  }
344521
344607
  };
344522
344608
  applyExecPath = (result2, pathParts, execPath2, cwdPath) => {
344523
- const pathPart = path52.resolve(cwdPath, toPath3(execPath2), "..");
344609
+ const pathPart = path53.resolve(cwdPath, toPath3(execPath2), "..");
344524
344610
  if (!pathParts.includes(pathPart)) {
344525
344611
  result2.push(pathPart);
344526
344612
  }
@@ -345804,7 +345890,7 @@ var init_timeout = __esm({
345804
345890
 
345805
345891
  // node_modules/execa/lib/methods/node.js
345806
345892
  import { execPath, execArgv } from "node:process";
345807
- import path53 from "node:path";
345893
+ import path54 from "node:path";
345808
345894
  var mapNode, handleNodeOption;
345809
345895
  var init_node5 = __esm({
345810
345896
  "node_modules/execa/lib/methods/node.js"() {
@@ -345827,7 +345913,7 @@ var init_node5 = __esm({
345827
345913
  throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');
345828
345914
  }
345829
345915
  const normalizedNodePath = safeNormalizeFileUrl(nodePath2, 'The "nodePath" option');
345830
- const resolvedNodePath = path53.resolve(cwd, normalizedNodePath);
345916
+ const resolvedNodePath = path54.resolve(cwd, normalizedNodePath);
345831
345917
  const newOptions = {
345832
345918
  ...options,
345833
345919
  nodePath: resolvedNodePath,
@@ -345837,7 +345923,7 @@ var init_node5 = __esm({
345837
345923
  if (!shouldHandleNode) {
345838
345924
  return [file, commandArguments, newOptions];
345839
345925
  }
345840
- if (path53.basename(file, ".exe") === "node") {
345926
+ if (path54.basename(file, ".exe") === "node") {
345841
345927
  throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');
345842
345928
  }
345843
345929
  return [
@@ -345939,7 +346025,7 @@ Please rename it to one of: ${correctEncodings}.`);
345939
346025
 
345940
346026
  // node_modules/execa/lib/arguments/cwd.js
345941
346027
  import { statSync as statSync2 } from "node:fs";
345942
- import path54 from "node:path";
346028
+ import path55 from "node:path";
345943
346029
  import process15 from "node:process";
345944
346030
  var normalizeCwd, getDefaultCwd, fixCwdError;
345945
346031
  var init_cwd = __esm({
@@ -345947,7 +346033,7 @@ var init_cwd = __esm({
345947
346033
  init_file_url();
345948
346034
  normalizeCwd = (cwd = getDefaultCwd()) => {
345949
346035
  const cwdString = safeNormalizeFileUrl(cwd, 'The "cwd" option');
345950
- return path54.resolve(cwdString);
346036
+ return path55.resolve(cwdString);
345951
346037
  };
345952
346038
  getDefaultCwd = () => {
345953
346039
  try {
@@ -345980,7 +346066,7 @@ ${originalMessage}`;
345980
346066
  });
345981
346067
 
345982
346068
  // node_modules/execa/lib/arguments/options.js
345983
- import path55 from "node:path";
346069
+ import path56 from "node:path";
345984
346070
  import process16 from "node:process";
345985
346071
  var import_cross_spawn2, normalizeOptions, addDefaultOptions, getEnv2;
345986
346072
  var init_options = __esm({
@@ -346014,7 +346100,7 @@ var init_options = __esm({
346014
346100
  options.killSignal = normalizeKillSignal(options.killSignal);
346015
346101
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
346016
346102
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
346017
- if (process16.platform === "win32" && path55.basename(file, ".exe") === "cmd") {
346103
+ if (process16.platform === "win32" && path56.basename(file, ".exe") === "cmd") {
346018
346104
  commandArguments.unshift("/q");
346019
346105
  }
346020
346106
  return { file, commandArguments, options };
@@ -361858,16 +361944,16 @@ var init_path_exists = __esm({
361858
361944
 
361859
361945
  // node_modules/xdg-basedir/index.js
361860
361946
  import os27 from "os";
361861
- import path56 from "path";
361947
+ import path57 from "path";
361862
361948
  var homeDirectory, env, xdgData, xdgConfig, xdgState, xdgCache, xdgRuntime, xdgDataDirectories, xdgConfigDirectories;
361863
361949
  var init_xdg_basedir = __esm({
361864
361950
  "node_modules/xdg-basedir/index.js"() {
361865
361951
  homeDirectory = os27.homedir();
361866
361952
  ({ env } = process);
361867
- xdgData = env.XDG_DATA_HOME || (homeDirectory ? path56.join(homeDirectory, ".local", "share") : void 0);
361868
- xdgConfig = env.XDG_CONFIG_HOME || (homeDirectory ? path56.join(homeDirectory, ".config") : void 0);
361869
- xdgState = env.XDG_STATE_HOME || (homeDirectory ? path56.join(homeDirectory, ".local", "state") : void 0);
361870
- xdgCache = env.XDG_CACHE_HOME || (homeDirectory ? path56.join(homeDirectory, ".cache") : void 0);
361953
+ xdgData = env.XDG_DATA_HOME || (homeDirectory ? path57.join(homeDirectory, ".local", "share") : void 0);
361954
+ xdgConfig = env.XDG_CONFIG_HOME || (homeDirectory ? path57.join(homeDirectory, ".config") : void 0);
361955
+ xdgState = env.XDG_STATE_HOME || (homeDirectory ? path57.join(homeDirectory, ".local", "state") : void 0);
361956
+ xdgCache = env.XDG_CACHE_HOME || (homeDirectory ? path57.join(homeDirectory, ".cache") : void 0);
361871
361957
  xdgRuntime = env.XDG_RUNTIME_DIR || void 0;
361872
361958
  xdgDataDirectories = (env.XDG_DATA_DIRS || "/usr/local/share/:/usr/share/").split(":");
361873
361959
  if (xdgData) {
@@ -361882,10 +361968,10 @@ var init_xdg_basedir = __esm({
361882
361968
 
361883
361969
  // node_modules/@joshua.litt/get-ripgrep/dist/downloadRipGrep.js
361884
361970
  import * as os28 from "node:os";
361885
- import { dirname as dirname11, join as join17 } from "node:path";
361971
+ import { dirname as dirname11, join as join16 } from "node:path";
361886
361972
  import { pipeline as pipeline3 } from "node:stream/promises";
361887
361973
  import { fileURLToPath as fileURLToPath13 } from "node:url";
361888
- import path57 from "path";
361974
+ import path58 from "path";
361889
361975
  var import_extract_zip, import_fs_extra, mkdir3, createWriteStream6, move, __dirname6, REPOSITORY, VERSION3, BIN_PATH, getTarget, downloadFile2, unzip, untarGz, downloadRipGrep;
361890
361976
  var init_downloadRipGrep = __esm({
361891
361977
  "node_modules/@joshua.litt/get-ripgrep/dist/downloadRipGrep.js"() {
@@ -361900,7 +361986,7 @@ var init_downloadRipGrep = __esm({
361900
361986
  __dirname6 = dirname11(fileURLToPath13(import.meta.url));
361901
361987
  REPOSITORY = `microsoft/ripgrep-prebuilt`;
361902
361988
  VERSION3 = process.env.RIPGREP_VERSION || "v13.0.0-10";
361903
- BIN_PATH = join17(__dirname6, "../bin");
361989
+ BIN_PATH = join16(__dirname6, "../bin");
361904
361990
  getTarget = () => {
361905
361991
  const arch4 = process.env.npm_config_arch || os28.arch();
361906
361992
  const platform11 = process.env.platform || os28.platform();
@@ -361944,8 +362030,8 @@ var init_downloadRipGrep = __esm({
361944
362030
  downloadFile2 = async (url5, outFile) => {
361945
362031
  let tmpDir = void 0;
361946
362032
  try {
361947
- tmpDir = await import_fs_extra.default.mkdtemp(path57.join(os28.tmpdir(), "download-ripgrep"));
361948
- const tmpFile = path57.join(tmpDir, "tmp-file");
362033
+ tmpDir = await import_fs_extra.default.mkdtemp(path58.join(os28.tmpdir(), "download-ripgrep"));
362034
+ const tmpFile = path58.join(tmpDir, "tmp-file");
361949
362035
  await pipeline3(source_default2.stream(url5), createWriteStream6(tmpFile));
361950
362036
  await mkdir3(dirname11(outFile), { recursive: true });
361951
362037
  await move(tmpFile, outFile);
@@ -361995,28 +362081,28 @@ var init_downloadRipGrep = __esm({
361995
362081
  });
361996
362082
 
361997
362083
  // node_modules/@joshua.litt/get-ripgrep/dist/index.js
361998
- import { dirname as dirname12, join as join18 } from "node:path";
362084
+ import { dirname as dirname12, join as join17 } from "node:path";
361999
362085
  import { fileURLToPath as fileURLToPath14 } from "node:url";
362000
362086
  var __dirname7, rgPath;
362001
362087
  var init_dist5 = __esm({
362002
362088
  "node_modules/@joshua.litt/get-ripgrep/dist/index.js"() {
362003
362089
  init_downloadRipGrep();
362004
362090
  __dirname7 = dirname12(fileURLToPath14(import.meta.url));
362005
- rgPath = join18(__dirname7, "..", "bin", `rg${process.platform === "win32" ? ".exe" : ""}`);
362091
+ rgPath = join17(__dirname7, "..", "bin", `rg${process.platform === "win32" ? ".exe" : ""}`);
362006
362092
  }
362007
362093
  });
362008
362094
 
362009
362095
  // packages/core/dist/src/tools/ripGrep.js
362010
362096
  import fs50 from "node:fs";
362011
362097
  import fsPromises9 from "node:fs/promises";
362012
- import path58 from "node:path";
362098
+ import path59 from "node:path";
362013
362099
  function getRgCandidateFilenames() {
362014
362100
  return process.platform === "win32" ? ["rg.exe", "rg"] : ["rg"];
362015
362101
  }
362016
362102
  async function resolveExistingRgPath() {
362017
362103
  const binDir = Storage2.getGlobalBinDir();
362018
362104
  for (const fileName of getRgCandidateFilenames()) {
362019
- const candidatePath = path58.join(binDir, fileName);
362105
+ const candidatePath = path59.join(binDir, fileName);
362020
362106
  if (await fileExists(candidatePath)) {
362021
362107
  return candidatePath;
362022
362108
  }
@@ -362082,7 +362168,7 @@ var init_ripGrep = __esm({
362082
362168
  async execute({ abortSignal: signal }) {
362083
362169
  try {
362084
362170
  const pathParam = this.params.dir_path || ".";
362085
- const searchDirAbs = path58.resolve(this.config.getTargetDir(), pathParam);
362171
+ const searchDirAbs = path59.resolve(this.config.getTargetDir(), pathParam);
362086
362172
  const validationError = this.config.validatePathAccess(searchDirAbs, "read");
362087
362173
  if (validationError) {
362088
362174
  return {
@@ -362163,10 +362249,10 @@ var init_ripGrep = __esm({
362163
362249
  }
362164
362250
  if (!this.params.no_ignore) {
362165
362251
  const uniqueFiles = Array.from(new Set(allMatches.map((m3) => m3.filePath)));
362166
- const absoluteFilePaths = uniqueFiles.map((f4) => path58.resolve(searchDirAbs, f4));
362252
+ const absoluteFilePaths = uniqueFiles.map((f4) => path59.resolve(searchDirAbs, f4));
362167
362253
  const allowedFiles = this.fileDiscoveryService.filterFiles(absoluteFilePaths);
362168
362254
  const allowedSet = new Set(allowedFiles);
362169
- allMatches = allMatches.filter((m3) => allowedSet.has(path58.resolve(searchDirAbs, m3.filePath)));
362255
+ allMatches = allMatches.filter((m3) => allowedSet.has(path59.resolve(searchDirAbs, m3.filePath)));
362170
362256
  }
362171
362257
  const matchCount = allMatches.filter((m3) => !m3.isContext).length;
362172
362258
  allMatches = await this.enrichWithRipgrepAutoContext(allMatches, matchCount, totalMaxMatches, searchDirAbs, timeoutController.signal);
@@ -362299,15 +362385,15 @@ var init_ripGrep = __esm({
362299
362385
  if (json2.type === "match" || json2.type === "context") {
362300
362386
  const data = json2.data;
362301
362387
  if (data.path?.text && data.lines?.text) {
362302
- const absoluteFilePath = path58.resolve(basePath, data.path.text);
362303
- const relativeCheck = path58.relative(basePath, absoluteFilePath);
362304
- if (relativeCheck === ".." || relativeCheck.startsWith(`..${path58.sep}`) || path58.isAbsolute(relativeCheck)) {
362388
+ const absoluteFilePath = path59.resolve(basePath, data.path.text);
362389
+ const relativeCheck = path59.relative(basePath, absoluteFilePath);
362390
+ if (relativeCheck === ".." || relativeCheck.startsWith(`..${path59.sep}`) || path59.isAbsolute(relativeCheck)) {
362305
362391
  return null;
362306
362392
  }
362307
- const relativeFilePath = path58.relative(basePath, absoluteFilePath);
362393
+ const relativeFilePath = path59.relative(basePath, absoluteFilePath);
362308
362394
  return {
362309
362395
  absolutePath: absoluteFilePath,
362310
- filePath: relativeFilePath || path58.basename(absoluteFilePath),
362396
+ filePath: relativeFilePath || path59.basename(absoluteFilePath),
362311
362397
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
362312
362398
  lineNumber: data.line_number,
362313
362399
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
@@ -362334,7 +362420,7 @@ var init_ripGrep = __esm({
362334
362420
  description += ` in ${this.params.include_pattern}`;
362335
362421
  }
362336
362422
  const pathParam = this.params.dir_path || ".";
362337
- const resolvedPath = path58.resolve(this.config.getTargetDir(), pathParam);
362423
+ const resolvedPath = path59.resolve(this.config.getTargetDir(), pathParam);
362338
362424
  if (resolvedPath === this.config.getTargetDir() || pathParam === ".") {
362339
362425
  description += ` within ./`;
362340
362426
  } else {
@@ -362390,7 +362476,7 @@ var init_ripGrep = __esm({
362390
362476
  return "total_max_matches must be at least 1.";
362391
362477
  }
362392
362478
  if (params.dir_path) {
362393
- const resolvedPath = path58.resolve(this.config.getTargetDir(), params.dir_path);
362479
+ const resolvedPath = path59.resolve(this.config.getTargetDir(), params.dir_path);
362394
362480
  const validationError = this.config.validatePathAccess(resolvedPath, "read");
362395
362481
  if (validationError) {
362396
362482
  return validationError;
@@ -362421,7 +362507,7 @@ var init_ripGrep = __esm({
362421
362507
 
362422
362508
  // packages/core/dist/src/tools/glob.js
362423
362509
  import fs51 from "node:fs";
362424
- import path59 from "node:path";
362510
+ import path60 from "node:path";
362425
362511
  function sortFileEntries(entries2, nowTimestamp, recencyThresholdMs) {
362426
362512
  const sortedEntries = [...entries2];
362427
362513
  sortedEntries.sort((a2, b2) => {
@@ -362466,7 +362552,7 @@ var init_glob2 = __esm({
362466
362552
  getDescription() {
362467
362553
  let description = `'${this.params.pattern}'`;
362468
362554
  if (this.params.dir_path) {
362469
- const searchDir = path59.resolve(this.config.getTargetDir(), this.params.dir_path || ".");
362555
+ const searchDir = path60.resolve(this.config.getTargetDir(), this.params.dir_path || ".");
362470
362556
  const relativePath = makeRelative(searchDir, this.config.getTargetDir());
362471
362557
  description += ` within ${shortenPath(relativePath)}`;
362472
362558
  }
@@ -362483,7 +362569,7 @@ var init_glob2 = __esm({
362483
362569
  const workspaceDirectories = workspaceContext.getDirectories();
362484
362570
  let searchDirectories;
362485
362571
  if (this.params.dir_path) {
362486
- const searchDirAbsolute = path59.resolve(this.config.getTargetDir(), this.params.dir_path);
362572
+ const searchDirAbsolute = path60.resolve(this.config.getTargetDir(), this.params.dir_path);
362487
362573
  const validationError = this.config.validatePathAccess(searchDirAbsolute, "read");
362488
362574
  if (validationError) {
362489
362575
  return {
@@ -362503,7 +362589,7 @@ var init_glob2 = __esm({
362503
362589
  const allEntries = [];
362504
362590
  for (const searchDir of searchDirectories) {
362505
362591
  let pattern = this.params.pattern;
362506
- const fullPath = path59.join(searchDir, pattern);
362592
+ const fullPath = path60.join(searchDir, pattern);
362507
362593
  if (fs51.existsSync(fullPath)) {
362508
362594
  pattern = escape2(pattern);
362509
362595
  }
@@ -362520,12 +362606,12 @@ var init_glob2 = __esm({
362520
362606
  });
362521
362607
  allEntries.push(...entries2);
362522
362608
  }
362523
- const relativePaths = allEntries.map((p2) => path59.relative(this.config.getTargetDir(), p2.fullpath()));
362609
+ const relativePaths = allEntries.map((p2) => path60.relative(this.config.getTargetDir(), p2.fullpath()));
362524
362610
  const { filteredPaths, ignoredCount } = fileDiscovery.filterFilesWithReport(relativePaths, {
362525
362611
  respectGitIgnore: this.params?.respect_git_ignore ?? this.config.getFileFilteringOptions().respectGitIgnore ?? DEFAULT_FILE_FILTERING_OPTIONS.respectGitIgnore,
362526
362612
  respectGeminiIgnore: this.params?.respect_gemini_ignore ?? this.config.getFileFilteringOptions().respectGeminiIgnore ?? DEFAULT_FILE_FILTERING_OPTIONS.respectGeminiIgnore
362527
362613
  });
362528
- const filteredAbsolutePaths = new Set(filteredPaths.map((p2) => path59.resolve(this.config.getTargetDir(), p2)));
362614
+ const filteredAbsolutePaths = new Set(filteredPaths.map((p2) => path60.resolve(this.config.getTargetDir(), p2)));
362529
362615
  const filteredEntries = allEntries.filter((entry) => filteredAbsolutePaths.has(entry.fullpath()));
362530
362616
  if (!filteredEntries || filteredEntries.length === 0) {
362531
362617
  let message = `No files found matching pattern "${this.params.pattern}"`;
@@ -362589,7 +362675,7 @@ ${fileListDescription}`;
362589
362675
  * Validates the parameters for the tool.
362590
362676
  */
362591
362677
  validateToolParamValues(params) {
362592
- const searchDirAbsolute = path59.resolve(this.config.getTargetDir(), params.dir_path || ".");
362678
+ const searchDirAbsolute = path60.resolve(this.config.getTargetDir(), params.dir_path || ".");
362593
362679
  const validationError = this.config.validatePathAccess(searchDirAbsolute, "read");
362594
362680
  if (validationError) {
362595
362681
  return validationError;
@@ -362622,9 +362708,9 @@ ${fileListDescription}`;
362622
362708
 
362623
362709
  // packages/core/dist/src/utils/getFolderStructure.js
362624
362710
  import * as fs52 from "node:fs/promises";
362625
- import * as path60 from "node:path";
362711
+ import * as path61 from "node:path";
362626
362712
  async function readFullStructure(rootPath, options) {
362627
- const rootName = path60.basename(rootPath);
362713
+ const rootName = path61.basename(rootPath);
362628
362714
  const rootNode = {
362629
362715
  name: rootName,
362630
362716
  path: rootPath,
@@ -362674,7 +362760,7 @@ async function readFullStructure(rootPath, options) {
362674
362760
  break;
362675
362761
  }
362676
362762
  const fileName = entry.name;
362677
- const filePath = path60.join(currentPath, fileName);
362763
+ const filePath = path61.join(currentPath, fileName);
362678
362764
  if (options.fileService?.shouldIgnoreFile(filePath, filterFileOptions)) {
362679
362765
  continue;
362680
362766
  }
@@ -362694,7 +362780,7 @@ async function readFullStructure(rootPath, options) {
362694
362780
  break;
362695
362781
  }
362696
362782
  const subFolderName = entry.name;
362697
- const subFolderPath = path60.join(currentPath, subFolderName);
362783
+ const subFolderPath = path61.join(currentPath, subFolderName);
362698
362784
  const isIgnored = options.fileService?.shouldIgnoreDirectory(subFolderPath, filterFileOptions) ?? false;
362699
362785
  if (options.ignoredFolders.has(subFolderName) || isIgnored) {
362700
362786
  const ignoredSubFolder = {
@@ -362732,7 +362818,7 @@ async function readFullStructure(rootPath, options) {
362732
362818
  function formatStructure(node, currentIndent, isLastChildOfParent, isProcessingRootNode, builder) {
362733
362819
  const connector = isLastChildOfParent ? "\u2514\u2500\u2500\u2500" : "\u251C\u2500\u2500\u2500";
362734
362820
  if (!isProcessingRootNode || node.isIgnored) {
362735
- builder.push(`${currentIndent}${connector}${node.name}${path60.sep}${node.isIgnored ? TRUNCATION_INDICATOR : ""}`);
362821
+ builder.push(`${currentIndent}${connector}${node.name}${path61.sep}${node.isIgnored ? TRUNCATION_INDICATOR : ""}`);
362736
362822
  }
362737
362823
  const indentForChildren = isProcessingRootNode ? "" : currentIndent + (isLastChildOfParent ? " " : "\u2502 ");
362738
362824
  const fileCount = node.files.length;
@@ -362756,7 +362842,7 @@ function formatStructure(node, currentIndent, isLastChildOfParent, isProcessingR
362756
362842
  }
362757
362843
  }
362758
362844
  async function getFolderStructure(directory, options) {
362759
- const resolvedPath = path60.resolve(directory);
362845
+ const resolvedPath = path61.resolve(directory);
362760
362846
  const mergedOptions = {
362761
362847
  maxItems: options?.maxItems ?? MAX_ITEMS,
362762
362848
  ignoredFolders: options?.ignoredFolders ?? DEFAULT_IGNORED_FOLDERS,
@@ -362789,7 +362875,7 @@ async function getFolderStructure(directory, options) {
362789
362875
  }
362790
362876
  return `${summary}
362791
362877
 
362792
- ${resolvedPath}${path60.sep}
362878
+ ${resolvedPath}${path61.sep}
362793
362879
  ${structureLines.join("\n")}`;
362794
362880
  } catch (error2) {
362795
362881
  debugLogger.warn(`Error getting folder structure for ${resolvedPath}:`, error2);
@@ -362815,7 +362901,7 @@ var init_getFolderStructure = __esm({
362815
362901
  });
362816
362902
 
362817
362903
  // packages/core/dist/src/tools/activate-skill.js
362818
- import * as path61 from "node:path";
362904
+ import * as path62 from "node:path";
362819
362905
  var ActivateSkillToolInvocation, ActivateSkillTool;
362820
362906
  var init_activate_skill = __esm({
362821
362907
  "packages/core/dist/src/tools/activate-skill.js"() {
@@ -362843,7 +362929,7 @@ var init_activate_skill = __esm({
362843
362929
  }
362844
362930
  async getOrFetchFolderStructure(skillLocation) {
362845
362931
  if (this.cachedFolderStructure === void 0) {
362846
- this.cachedFolderStructure = await getFolderStructure(path61.dirname(skillLocation));
362932
+ this.cachedFolderStructure = await getFolderStructure(path62.dirname(skillLocation));
362847
362933
  }
362848
362934
  return this.cachedFolderStructure;
362849
362935
  }
@@ -362894,7 +362980,7 @@ ${folderStructure}`,
362894
362980
  };
362895
362981
  }
362896
362982
  skillManager.activateSkill(skillName);
362897
- this.config.getWorkspaceContext().addDirectory(path61.dirname(skill.location));
362983
+ this.config.getWorkspaceContext().addDirectory(path62.dirname(skill.location));
362898
362984
  const folderStructure = await this.getOrFetchFolderStructure(skill.location);
362899
362985
  return {
362900
362986
  llmContent: `<activated_skill name="${skillName}">
@@ -362906,7 +362992,7 @@ ${folderStructure}`,
362906
362992
  ${folderStructure}
362907
362993
  </available_resources>
362908
362994
  </activated_skill>`,
362909
- returnDisplay: `Skill **${skillName}** activated. Resources loaded from \`${path61.dirname(skill.location)}\`:
362995
+ returnDisplay: `Skill **${skillName}** activated. Resources loaded from \`${path62.dirname(skill.location)}\`:
362910
362996
 
362911
362997
  ${folderStructure}`
362912
362998
  };
@@ -373031,7 +373117,7 @@ import { spawn as cpSpawn } from "node:child_process";
373031
373117
  import { TextDecoder as TextDecoder2 } from "node:util";
373032
373118
  import os31 from "node:os";
373033
373119
  import fs53, { mkdirSync as mkdirSync4 } from "node:fs";
373034
- import path62 from "node:path";
373120
+ import path63 from "node:path";
373035
373121
  function ensurePromptvarsDisabled(command, shell) {
373036
373122
  if (shell !== "bash") {
373037
373123
  return command;
@@ -373148,7 +373234,7 @@ var init_shellExecutionService = __esm({
373148
373234
  static backgroundLogStreams = /* @__PURE__ */ new Map();
373149
373235
  static backgroundProcessHistory = /* @__PURE__ */ new Map();
373150
373236
  static getLogDir() {
373151
- return path62.join(Storage2.getGlobalTempDir(), "background-processes");
373237
+ return path63.join(Storage2.getGlobalTempDir(), "background-processes");
373152
373238
  }
373153
373239
  static formatShellBackgroundCompletion(pid, behavior, output, error2) {
373154
373240
  const logPath = _ShellExecutionService.getLogFilePath(pid);
@@ -373162,7 +373248,7 @@ ${truncated}`;
373162
373248
  return `[Background command completed ${status2}. Output saved to ${logPath}]`;
373163
373249
  }
373164
373250
  static getLogFilePath(pid) {
373165
- return path62.join(this.getLogDir(), `background-${pid}.log`);
373251
+ return path63.join(this.getLogDir(), `background-${pid}.log`);
373166
373252
  }
373167
373253
  static syncBackgroundLog(pid, content) {
373168
373254
  if (!this.backgroundLogPids.has(pid))
@@ -374079,7 +374165,7 @@ ${truncated}`;
374079
374165
 
374080
374166
  // packages/core/dist/src/sandbox/utils/proactivePermissions.js
374081
374167
  import os32 from "node:os";
374082
- import path63 from "node:path";
374168
+ import path64 from "node:path";
374083
374169
  import fs54 from "node:fs";
374084
374170
  function isNetworkReliantCommand(commandName, subCommand) {
374085
374171
  const normalizedCommand = normalizeCommand(commandName);
@@ -374104,42 +374190,42 @@ async function getProactiveToolSuggestions(commandName) {
374104
374190
  const primaryCachePaths = [];
374105
374191
  const optionalCachePaths = [];
374106
374192
  if (normalizedCommand === "npm" || normalizedCommand === "npx") {
374107
- readOnlyPaths.push(path63.join(home, ".npmrc"));
374108
- primaryCachePaths.push(path63.join(home, ".npm"));
374109
- optionalCachePaths.push(path63.join(home, ".node-gyp"));
374110
- optionalCachePaths.push(path63.join(home, ".cache"));
374193
+ readOnlyPaths.push(path64.join(home, ".npmrc"));
374194
+ primaryCachePaths.push(path64.join(home, ".npm"));
374195
+ optionalCachePaths.push(path64.join(home, ".node-gyp"));
374196
+ optionalCachePaths.push(path64.join(home, ".cache"));
374111
374197
  } else if (normalizedCommand === "yarn") {
374112
- readOnlyPaths.push(path63.join(home, ".yarnrc"));
374113
- readOnlyPaths.push(path63.join(home, ".yarnrc.yml"));
374114
- primaryCachePaths.push(path63.join(home, ".yarn"));
374115
- primaryCachePaths.push(path63.join(home, ".config", "yarn"));
374116
- optionalCachePaths.push(path63.join(home, ".cache"));
374198
+ readOnlyPaths.push(path64.join(home, ".yarnrc"));
374199
+ readOnlyPaths.push(path64.join(home, ".yarnrc.yml"));
374200
+ primaryCachePaths.push(path64.join(home, ".yarn"));
374201
+ primaryCachePaths.push(path64.join(home, ".config", "yarn"));
374202
+ optionalCachePaths.push(path64.join(home, ".cache"));
374117
374203
  } else if (normalizedCommand === "pnpm") {
374118
- readOnlyPaths.push(path63.join(home, ".npmrc"));
374119
- primaryCachePaths.push(path63.join(home, ".pnpm-store"));
374120
- primaryCachePaths.push(path63.join(home, ".config", "pnpm"));
374121
- optionalCachePaths.push(path63.join(home, ".cache"));
374204
+ readOnlyPaths.push(path64.join(home, ".npmrc"));
374205
+ primaryCachePaths.push(path64.join(home, ".pnpm-store"));
374206
+ primaryCachePaths.push(path64.join(home, ".config", "pnpm"));
374207
+ optionalCachePaths.push(path64.join(home, ".cache"));
374122
374208
  } else if (normalizedCommand === "bun") {
374123
- readOnlyPaths.push(path63.join(home, ".bunfig.toml"));
374124
- primaryCachePaths.push(path63.join(home, ".bun"));
374125
- optionalCachePaths.push(path63.join(home, ".cache"));
374209
+ readOnlyPaths.push(path64.join(home, ".bunfig.toml"));
374210
+ primaryCachePaths.push(path64.join(home, ".bun"));
374211
+ optionalCachePaths.push(path64.join(home, ".cache"));
374126
374212
  } else if (normalizedCommand === "git") {
374127
- readOnlyPaths.push(path63.join(home, ".ssh"));
374128
- readOnlyPaths.push(path63.join(home, ".gitconfig"));
374129
- optionalCachePaths.push(path63.join(home, ".cache"));
374213
+ readOnlyPaths.push(path64.join(home, ".ssh"));
374214
+ readOnlyPaths.push(path64.join(home, ".gitconfig"));
374215
+ optionalCachePaths.push(path64.join(home, ".cache"));
374130
374216
  } else if (normalizedCommand === "ssh" || normalizedCommand === "scp" || normalizedCommand === "sftp") {
374131
- readOnlyPaths.push(path63.join(home, ".ssh"));
374217
+ readOnlyPaths.push(path64.join(home, ".ssh"));
374132
374218
  }
374133
374219
  if (os32.platform() === "win32") {
374134
374220
  const appData = process.env["AppData"];
374135
374221
  const localAppData = process.env["LocalAppData"];
374136
374222
  if (normalizedCommand === "npm" || normalizedCommand === "npx") {
374137
374223
  if (appData) {
374138
- primaryCachePaths.push(path63.join(appData, "npm"));
374139
- optionalCachePaths.push(path63.join(appData, "npm-cache"));
374224
+ primaryCachePaths.push(path64.join(appData, "npm"));
374225
+ optionalCachePaths.push(path64.join(appData, "npm-cache"));
374140
374226
  }
374141
374227
  if (localAppData) {
374142
- optionalCachePaths.push(path63.join(localAppData, "npm-cache"));
374228
+ optionalCachePaths.push(path64.join(localAppData, "npm-cache"));
374143
374229
  }
374144
374230
  }
374145
374231
  }
@@ -374217,7 +374303,7 @@ var init_proactivePermissions = __esm({
374217
374303
  // packages/core/dist/src/tools/shell.js
374218
374304
  import fsPromises10 from "node:fs/promises";
374219
374305
  import fs55 from "node:fs";
374220
- import path64 from "node:path";
374306
+ import path65 from "node:path";
374221
374307
  import os33 from "node:os";
374222
374308
  import crypto20 from "node:crypto";
374223
374309
  var OUTPUT_UPDATE_INTERVAL_MS, BACKGROUND_DELAY_MS, SHOW_NL_DESCRIPTION_THRESHOLD, ShellToolInvocation, ShellTool;
@@ -374306,7 +374392,7 @@ ${trimmed2}
374306
374392
  }
374307
374393
  const parentCounts = /* @__PURE__ */ new Map();
374308
374394
  for (const p2 of nonRedundant) {
374309
- const parent = path64.dirname(p2);
374395
+ const parent = path65.dirname(p2);
374310
374396
  if (!parentCounts.has(parent)) {
374311
374397
  parentCounts.set(parent, []);
374312
374398
  }
@@ -374315,23 +374401,23 @@ ${trimmed2}
374315
374401
  const finalPaths = /* @__PURE__ */ new Set();
374316
374402
  const sensitiveDirs = /* @__PURE__ */ new Set([
374317
374403
  os33.homedir(),
374318
- path64.dirname(os33.homedir()),
374319
- path64.sep,
374320
- path64.join(path64.sep, "etc"),
374321
- path64.join(path64.sep, "usr"),
374322
- path64.join(path64.sep, "var"),
374323
- path64.join(path64.sep, "bin"),
374324
- path64.join(path64.sep, "sbin"),
374325
- path64.join(path64.sep, "lib"),
374326
- path64.join(path64.sep, "root"),
374327
- path64.join(path64.sep, "home"),
374328
- path64.join(path64.sep, "Users")
374404
+ path65.dirname(os33.homedir()),
374405
+ path65.sep,
374406
+ path65.join(path65.sep, "etc"),
374407
+ path65.join(path65.sep, "usr"),
374408
+ path65.join(path65.sep, "var"),
374409
+ path65.join(path65.sep, "bin"),
374410
+ path65.join(path65.sep, "sbin"),
374411
+ path65.join(path65.sep, "lib"),
374412
+ path65.join(path65.sep, "root"),
374413
+ path65.join(path65.sep, "home"),
374414
+ path65.join(path65.sep, "Users")
374329
374415
  ]);
374330
374416
  if (os33.platform() === "win32") {
374331
374417
  const systemRoot = process.env["SystemRoot"];
374332
374418
  if (systemRoot) {
374333
374419
  sensitiveDirs.add(systemRoot);
374334
- sensitiveDirs.add(path64.join(systemRoot, "System32"));
374420
+ sensitiveDirs.add(path65.join(systemRoot, "System32"));
374335
374421
  }
374336
374422
  const programFiles = process.env["ProgramFiles"];
374337
374423
  if (programFiles)
@@ -374499,7 +374585,7 @@ ${trimmed2}
374499
374585
  }
374500
374586
  const isWindows2 = os33.platform() === "win32";
374501
374587
  const tempFileName = `shell_pgrep_${crypto20.randomBytes(6).toString("hex")}.tmp`;
374502
- const tempFilePath = path64.join(os33.tmpdir(), tempFileName);
374588
+ const tempFilePath = path65.join(os33.tmpdir(), tempFileName);
374503
374589
  const timeoutMs = this.context.config.getShellToolInactivityTimeout();
374504
374590
  const timeoutController = new AbortController();
374505
374591
  let timeoutTimer;
@@ -374507,7 +374593,7 @@ ${trimmed2}
374507
374593
  const onAbort = () => combinedController.abort();
374508
374594
  try {
374509
374595
  const commandToExecute = this.wrapCommandForPgrep(strippedCommand, tempFilePath, isWindows2);
374510
- const cwd = this.params.dir_path ? path64.resolve(this.context.config.getTargetDir(), this.params.dir_path) : this.context.config.getTargetDir();
374596
+ const cwd = this.params.dir_path ? path65.resolve(this.context.config.getTargetDir(), this.params.dir_path) : this.context.config.getTargetDir();
374511
374597
  const validationError = this.context.config.validatePathAccess(cwd);
374512
374598
  if (validationError) {
374513
374599
  return {
@@ -374757,11 +374843,11 @@ ${result2.output}`;
374757
374843
  try {
374758
374844
  let currentPath = p2;
374759
374845
  if (currentPath.startsWith("~")) {
374760
- currentPath = path64.join(os33.homedir(), currentPath.slice(1));
374846
+ currentPath = path65.join(os33.homedir(), currentPath.slice(1));
374761
374847
  }
374762
374848
  try {
374763
374849
  if (fs55.existsSync(currentPath) && fs55.statSync(currentPath).isFile()) {
374764
- currentPath = path64.dirname(currentPath);
374850
+ currentPath = path65.dirname(currentPath);
374765
374851
  }
374766
374852
  } catch {
374767
374853
  }
@@ -374776,7 +374862,7 @@ ${result2.output}`;
374776
374862
  }
374777
374863
  break;
374778
374864
  }
374779
- currentPath = path64.dirname(currentPath);
374865
+ currentPath = path65.dirname(currentPath);
374780
374866
  }
374781
374867
  } catch {
374782
374868
  }
@@ -374875,7 +374961,7 @@ ${result2.output}`;
374875
374961
  return "Command cannot be empty.";
374876
374962
  }
374877
374963
  if (params.dir_path) {
374878
- const resolvedPath = path64.resolve(this.context.config.getTargetDir(), params.dir_path);
374964
+ const resolvedPath = path65.resolve(this.context.config.getTargetDir(), params.dir_path);
374879
374965
  return this.context.config.validatePathAccess(resolvedPath);
374880
374966
  }
374881
374967
  return null;
@@ -375602,8 +375688,8 @@ function many(p2) {
375602
375688
  function many1(p2) {
375603
375689
  return ab(p2, many(p2), (head, tail) => [head, ...tail]);
375604
375690
  }
375605
- function ab(pa, pb, join38) {
375606
- return (data, i4) => mapOuter(pa(data, i4), (ma) => mapInner(pb(data, ma.position), (vb, j2) => join38(ma.value, vb, data, i4, j2)));
375691
+ function ab(pa, pb, join37) {
375692
+ return (data, i4) => mapOuter(pa(data, i4), (ma) => mapInner(pb(data, ma.position), (vb, j2) => join37(ma.value, vb, data, i4, j2)));
375607
375693
  }
375608
375694
  function left(pa, pb) {
375609
375695
  return ab(pa, pb, (va) => va);
@@ -375611,8 +375697,8 @@ function left(pa, pb) {
375611
375697
  function right(pa, pb) {
375612
375698
  return ab(pa, pb, (va, vb) => vb);
375613
375699
  }
375614
- function abc(pa, pb, pc, join38) {
375615
- return (data, i4) => mapOuter(pa(data, i4), (ma) => mapOuter(pb(data, ma.position), (mb) => mapInner(pc(data, mb.position), (vc, j2) => join38(ma.value, mb.value, vc, data, i4, j2))));
375700
+ function abc(pa, pb, pc, join37) {
375701
+ return (data, i4) => mapOuter(pa(data, i4), (ma) => mapOuter(pb(data, ma.position), (mb) => mapInner(pc(data, mb.position), (vc, j2) => join37(ma.value, mb.value, vc, data, i4, j2))));
375616
375702
  }
375617
375703
  function middle(pa, pb, pc) {
375618
375704
  return abc(pa, pb, pc, (ra, rb) => rb);
@@ -383534,7 +383620,7 @@ var init_snippets_legacy = __esm({
383534
383620
  });
383535
383621
 
383536
383622
  // packages/core/dist/src/prompts/utils.js
383537
- import path65 from "node:path";
383623
+ import path66 from "node:path";
383538
383624
  import process23 from "node:process";
383539
383625
  function resolvePathFromEnv(envVar) {
383540
383626
  const trimmedEnvVar = envVar?.trim();
@@ -383553,7 +383639,7 @@ function resolvePathFromEnv(envVar) {
383553
383639
  if (customPath === "~") {
383554
383640
  customPath = home;
383555
383641
  } else {
383556
- customPath = path65.join(home, customPath.slice(2));
383642
+ customPath = path66.join(home, customPath.slice(2));
383557
383643
  }
383558
383644
  } catch (error2) {
383559
383645
  debugLogger.warn(`Could not resolve home directory for path: ${trimmedEnvVar}`, error2);
@@ -383562,7 +383648,7 @@ function resolvePathFromEnv(envVar) {
383562
383648
  }
383563
383649
  return {
383564
383650
  isSwitch: false,
383565
- value: path65.resolve(customPath),
383651
+ value: path66.resolve(customPath),
383566
383652
  isDisabled: false
383567
383653
  };
383568
383654
  }
@@ -383745,7 +383831,7 @@ When you are finished, you **MUST** call the \`complete_task\` tool. The \`repor
383745
383831
 
383746
383832
  // packages/core/dist/src/prompts/promptProvider.js
383747
383833
  import fs56 from "node:fs";
383748
- import path66 from "node:path";
383834
+ import path67 from "node:path";
383749
383835
  import process24 from "node:process";
383750
383836
  function getSandboxMode() {
383751
383837
  if (process24.env["SANDBOX"] === "sandbox-exec")
@@ -383803,7 +383889,7 @@ var init_promptProvider = __esm({
383803
383889
  }
383804
383890
  let basePrompt;
383805
383891
  if (systemMdResolution.value && !systemMdResolution.isDisabled) {
383806
- let systemMdPath = path66.resolve(path66.join(GEMINI_DIR, "system.md"));
383892
+ let systemMdPath = path67.resolve(path67.join(GEMINI_DIR, "system.md"));
383807
383893
  if (!systemMdResolution.isSwitch) {
383808
383894
  systemMdPath = systemMdResolution.value;
383809
383895
  }
@@ -383858,8 +383944,11 @@ var init_promptProvider = __esm({
383858
383944
  planningWorkflow: this.withSection("planningWorkflow", () => ({
383859
383945
  interactive: interactiveMode,
383860
383946
  planModeToolsList,
383861
- plansDir: context2.config.storage.getPlansDir(),
383862
- approvedPlanPath: context2.config.getApprovedPlanPath()
383947
+ plansDir: makeRelative(context2.config.storage.getPlansDir(), context2.config.getProjectRoot()).replaceAll("\\", "/"),
383948
+ approvedPlanPath: (() => {
383949
+ const approvedPath = context2.config.getApprovedPlanPath();
383950
+ return approvedPath ? makeRelative(approvedPath, context2.config.getProjectRoot()).replaceAll("\\", "/") : void 0;
383951
+ })()
383863
383952
  }), isPlanMode),
383864
383953
  operationalGuidelines: this.withSection("operationalGuidelines", () => ({
383865
383954
  interactive: interactiveMode,
@@ -383892,7 +383981,7 @@ var init_promptProvider = __esm({
383892
383981
  [Active Topic: ${sanitizedTopic}]`;
383893
383982
  }
383894
383983
  }
383895
- this.maybeWriteSystemMd(sanitizedPrompt, systemMdResolution, path66.resolve(path66.join(GEMINI_DIR, "system.md")));
383984
+ this.maybeWriteSystemMd(sanitizedPrompt, systemMdResolution, path67.resolve(path67.join(GEMINI_DIR, "system.md")));
383896
383985
  return sanitizedPrompt;
383897
383986
  }
383898
383987
  getCompressionPrompt(context2) {
@@ -383908,7 +383997,7 @@ var init_promptProvider = __esm({
383908
383997
  const writeSystemMdResolution = resolvePathFromEnv(process24.env["GEMINI_WRITE_SYSTEM_MD"]);
383909
383998
  if (writeSystemMdResolution.value && !writeSystemMdResolution.isDisabled) {
383910
383999
  const writePath = writeSystemMdResolution.isSwitch ? defaultPath : writeSystemMdResolution.value;
383911
- fs56.mkdirSync(path66.dirname(writePath), { recursive: true });
384000
+ fs56.mkdirSync(path67.dirname(writePath), { recursive: true });
383912
384001
  fs56.writeFileSync(writePath, basePrompt);
383913
384002
  }
383914
384003
  }
@@ -387383,7 +387472,7 @@ var init_js_yaml = __esm({
387383
387472
 
387384
387473
  // packages/core/dist/src/skills/skillLoader.js
387385
387474
  import * as fs57 from "node:fs/promises";
387386
- import * as path67 from "node:path";
387475
+ import * as path68 from "node:path";
387387
387476
  function parseFrontmatter(content) {
387388
387477
  try {
387389
387478
  const parsed = load2(content);
@@ -387433,7 +387522,7 @@ function parseSimpleFrontmatter(content) {
387433
387522
  async function loadSkillsFromDir(dir) {
387434
387523
  const discoveredSkills = [];
387435
387524
  try {
387436
- const absoluteSearchPath = path67.resolve(dir);
387525
+ const absoluteSearchPath = path68.resolve(dir);
387437
387526
  const stats = await fs57.stat(absoluteSearchPath).catch(() => null);
387438
387527
  if (!stats || !stats.isDirectory()) {
387439
387528
  return [];
@@ -387499,7 +387588,7 @@ var init_skillLoader = __esm({
387499
387588
 
387500
387589
  // packages/core/dist/src/agents/agentLoader.js
387501
387590
  import * as fs58 from "node:fs/promises";
387502
- import * as path68 from "node:path";
387591
+ import * as path69 from "node:path";
387503
387592
  import * as crypto21 from "node:crypto";
387504
387593
  function guessIntendedKind(rawInput) {
387505
387594
  if (typeof rawInput !== "object" || rawInput === null)
@@ -387774,7 +387863,7 @@ async function loadAgentsFromDirectory(dir) {
387774
387863
  }
387775
387864
  const files = dirEntries.filter((entry) => entry.isFile() && !entry.name.startsWith("_") && entry.name.endsWith(".md"));
387776
387865
  for (const entry of files) {
387777
- const filePath = path68.join(dir, entry.name);
387866
+ const filePath = path69.join(dir, entry.name);
387778
387867
  try {
387779
387868
  const content = await fs58.readFile(filePath, "utf-8");
387780
387869
  const hash = crypto21.createHash("sha256").update(content).digest("hex");
@@ -387970,16 +388059,16 @@ var init_agentLoader = __esm({
387970
388059
 
387971
388060
  // packages/core/dist/src/tools/get-internal-docs.js
387972
388061
  import fs59 from "node:fs/promises";
387973
- import path69 from "node:path";
388062
+ import path70 from "node:path";
387974
388063
  import { fileURLToPath as fileURLToPath15 } from "node:url";
387975
388064
  async function getDocsRoot() {
387976
388065
  const currentFile = fileURLToPath15(import.meta.url);
387977
- let searchDir = path69.dirname(currentFile);
388066
+ let searchDir = path70.dirname(currentFile);
387978
388067
  const isDocsDir = async (dir) => {
387979
388068
  try {
387980
388069
  const stats = await fs59.stat(dir);
387981
388070
  if (stats.isDirectory()) {
387982
- const marker = path69.join(dir, "sidebar.json");
388071
+ const marker = path70.join(dir, "sidebar.json");
387983
388072
  await fs59.access(marker);
387984
388073
  return true;
387985
388074
  }
@@ -387988,11 +388077,11 @@ async function getDocsRoot() {
387988
388077
  return false;
387989
388078
  };
387990
388079
  while (true) {
387991
- const candidate = path69.join(searchDir, "docs");
388080
+ const candidate = path70.join(searchDir, "docs");
387992
388081
  if (await isDocsDir(candidate)) {
387993
388082
  return candidate;
387994
388083
  }
387995
- const parent = path69.dirname(searchDir);
388084
+ const parent = path70.dirname(searchDir);
387996
388085
  if (parent === searchDir) {
387997
388086
  break;
387998
388087
  }
@@ -388038,7 +388127,7 @@ ${fileList}`;
388038
388127
  returnDisplay: `Found ${files.length} documentation files.`
388039
388128
  };
388040
388129
  }
388041
- const resolvedPath = path69.resolve(docsRoot, this.params.path);
388130
+ const resolvedPath = path70.resolve(docsRoot, this.params.path);
388042
388131
  if (!resolvedPath.startsWith(docsRoot)) {
388043
388132
  throw new Error("Access denied: Requested path is outside the documentation directory.");
388044
388133
  }
@@ -392421,7 +392510,7 @@ var init_client3 = __esm({
392421
392510
 
392422
392511
  // packages/core/dist/src/mcp/oauth-token-storage.js
392423
392512
  import { promises as fs60 } from "node:fs";
392424
- import * as path70 from "node:path";
392513
+ import * as path71 from "node:path";
392425
392514
  var MCPOAuthTokenStorage;
392426
392515
  var init_oauth_token_storage = __esm({
392427
392516
  "packages/core/dist/src/mcp/oauth-token-storage.js"() {
@@ -392451,7 +392540,7 @@ var init_oauth_token_storage = __esm({
392451
392540
  * Ensure the config directory exists.
392452
392541
  */
392453
392542
  async ensureConfigDir() {
392454
- const configDir = path70.dirname(this.getTokenFilePath());
392543
+ const configDir = path71.dirname(this.getTokenFilePath());
392455
392544
  await fs60.mkdir(configDir, { recursive: true });
392456
392545
  }
392457
392546
  /**
@@ -396040,7 +396129,7 @@ ${summary}
396040
396129
  });
396041
396130
 
396042
396131
  // packages/core/dist/src/context/toolOutputMaskingService.js
396043
- import path71 from "node:path";
396132
+ import path72 from "node:path";
396044
396133
  import * as fsPromises11 from "node:fs/promises";
396045
396134
  var DEFAULT_TOOL_PROTECTION_THRESHOLD, DEFAULT_MIN_PRUNABLE_TOKENS_THRESHOLD, DEFAULT_PROTECT_LATEST_TURN, MASKING_INDICATOR_TAG, TOOL_OUTPUTS_DIR3, EXEMPT_TOOLS, ToolOutputMaskingService;
396046
396135
  var init_toolOutputMaskingService = __esm({
@@ -396123,11 +396212,11 @@ var init_toolOutputMaskingService = __esm({
396123
396212
  debugLogger.debug(`[ToolOutputMasking] Triggering masking. Prunable tool tokens: ${totalPrunableTokens.toLocaleString()} (> ${maskingConfig.minPrunableThresholdTokens.toLocaleString()})`);
396124
396213
  const newHistory = [...history];
396125
396214
  let actualTokensSaved = 0;
396126
- let toolOutputsDir = path71.join(config3.storage.getProjectTempDir(), TOOL_OUTPUTS_DIR3);
396215
+ let toolOutputsDir = path72.join(config3.storage.getProjectTempDir(), TOOL_OUTPUTS_DIR3);
396127
396216
  const sessionId = config3.getSessionId();
396128
396217
  if (sessionId) {
396129
396218
  const safeSessionId = sanitizeFilenamePart(sessionId);
396130
- toolOutputsDir = path71.join(toolOutputsDir, `session-${safeSessionId}`);
396219
+ toolOutputsDir = path72.join(toolOutputsDir, `session-${safeSessionId}`);
396131
396220
  }
396132
396221
  await fsPromises11.mkdir(toolOutputsDir, { recursive: true });
396133
396222
  for (const item of prunableParts) {
@@ -396141,7 +396230,7 @@ var init_toolOutputMaskingService = __esm({
396141
396230
  const safeToolName = sanitizeFilenamePart(toolName).toLowerCase();
396142
396231
  const safeCallId = sanitizeFilenamePart(callId).toLowerCase();
396143
396232
  const fileName = `${safeToolName}_${safeCallId}_${Math.random().toString(36).substring(7)}.txt`;
396144
- const filePath = path71.join(toolOutputsDir, fileName);
396233
+ const filePath = path72.join(toolOutputsDir, fileName);
396145
396234
  await fsPromises11.writeFile(filePath, content, "utf-8");
396146
396235
  const originalResponse = (
396147
396236
  // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
@@ -398237,7 +398326,7 @@ var init_fastAckHelper = __esm({
398237
398326
 
398238
398327
  // packages/core/dist/src/utils/workspaceContext.js
398239
398328
  import * as fs61 from "node:fs";
398240
- import * as path72 from "node:path";
398329
+ import * as path73 from "node:path";
398241
398330
  var WorkspaceContext;
398242
398331
  var init_workspaceContext = __esm({
398243
398332
  "packages/core/dist/src/utils/workspaceContext.js"() {
@@ -398330,14 +398419,14 @@ var init_workspaceContext = __esm({
398330
398419
  if (!fs61.existsSync(pathToAdd)) {
398331
398420
  return;
398332
398421
  }
398333
- const resolved = fs61.realpathSync(path72.resolve(this.targetDir, pathToAdd));
398422
+ const resolved = fs61.realpathSync(path73.resolve(this.targetDir, pathToAdd));
398334
398423
  this.readOnlyPaths.add(resolved);
398335
398424
  } catch (e3) {
398336
398425
  debugLogger.warn(`Failed to add read-only path ${pathToAdd}:`, e3);
398337
398426
  }
398338
398427
  }
398339
398428
  resolveAndValidateDir(directory) {
398340
- const absolutePath = path72.resolve(this.targetDir, directory);
398429
+ const absolutePath = path73.resolve(this.targetDir, directory);
398341
398430
  if (!fs61.existsSync(absolutePath)) {
398342
398431
  throw new Error(`Directory does not exist: ${absolutePath}`);
398343
398432
  }
@@ -398413,7 +398502,7 @@ var init_workspaceContext = __esm({
398413
398502
  * if it did exist.
398414
398503
  */
398415
398504
  fullyResolvedPath(pathToCheck) {
398416
- return resolveToRealPath(path72.resolve(this.targetDir, pathToCheck));
398505
+ return resolveToRealPath(path73.resolve(this.targetDir, pathToCheck));
398417
398506
  }
398418
398507
  /**
398419
398508
  * Checks if a path is within a given root directory.
@@ -398422,8 +398511,8 @@ var init_workspaceContext = __esm({
398422
398511
  * @returns True if the path is within the root directory, false otherwise
398423
398512
  */
398424
398513
  isPathWithinRoot(pathToCheck, rootDirectory) {
398425
- const relative5 = path72.relative(rootDirectory, pathToCheck);
398426
- return !relative5.startsWith(`..${path72.sep}`) && relative5 !== ".." && !path72.isAbsolute(relative5);
398514
+ const relative5 = path73.relative(rootDirectory, pathToCheck);
398515
+ return !relative5.startsWith(`..${path73.sep}`) && relative5 !== ".." && !path73.isAbsolute(relative5);
398427
398516
  }
398428
398517
  };
398429
398518
  }
@@ -398431,7 +398520,7 @@ var init_workspaceContext = __esm({
398431
398520
 
398432
398521
  // packages/core/dist/src/config/scoped-config.js
398433
398522
  import { AsyncLocalStorage as AsyncLocalStorage3 } from "node:async_hooks";
398434
- import * as path73 from "node:path";
398523
+ import * as path74 from "node:path";
398435
398524
  function getWorkspaceContextOverride() {
398436
398525
  return workspaceContextOverride.getStore();
398437
398526
  }
@@ -398447,7 +398536,7 @@ function createScopedWorkspaceContext(parentContext, additionalDirectories) {
398447
398536
  throw new Error("Cannot create scoped workspace context: parent has no directories");
398448
398537
  }
398449
398538
  for (const dir of additionalDirectories) {
398450
- if (path73.resolve(dir) === path73.parse(path73.resolve(dir)).root) {
398539
+ if (path74.resolve(dir) === path74.parse(path74.resolve(dir)).root) {
398451
398540
  throw new Error(`Cannot add filesystem root "${dir}" as a workspace directory`);
398452
398541
  }
398453
398542
  }
@@ -400454,9 +400543,9 @@ ${errorMessage}` : errorMessage;
400454
400543
 
400455
400544
  // packages/core/dist/src/utils/browserConsent.js
400456
400545
  import * as fs62 from "node:fs/promises";
400457
- import * as path74 from "node:path";
400546
+ import * as path75 from "node:path";
400458
400547
  async function getBrowserConsentIfNeeded() {
400459
- const consentFilePath = path74.join(Storage2.getGlobalGeminiDir(), BROWSER_PROFILE_DIR, BROWSER_CONSENT_FLAG_FILE);
400548
+ const consentFilePath = path75.join(Storage2.getGlobalGeminiDir(), BROWSER_PROFILE_DIR, BROWSER_CONSENT_FLAG_FILE);
400460
400549
  try {
400461
400550
  await fs62.access(consentFilePath);
400462
400551
  return true;
@@ -400480,7 +400569,7 @@ async function getBrowserConsentIfNeeded() {
400480
400569
  }
400481
400570
  async function markConsentAsAcknowledged(consentFilePath) {
400482
400571
  try {
400483
- await fs62.mkdir(path74.dirname(consentFilePath), { recursive: true });
400572
+ await fs62.mkdir(path75.dirname(consentFilePath), { recursive: true });
400484
400573
  await fs62.writeFile(consentFilePath, `Browser privacy consent acknowledged at ${(/* @__PURE__ */ new Date()).toISOString()}
400485
400574
  `);
400486
400575
  } catch {
@@ -400744,7 +400833,7 @@ var init_automationOverlay = __esm({
400744
400833
  });
400745
400834
 
400746
400835
  // packages/core/dist/src/agents/browser/browserManager.js
400747
- import * as path75 from "node:path";
400836
+ import * as path76 from "node:path";
400748
400837
  import * as fs63 from "node:fs";
400749
400838
  import { fileURLToPath as fileURLToPath16 } from "node:url";
400750
400839
  var __filename5, __dirname8, BROWSER_PROFILE_DIR2, DomainNotAllowedError, MCP_TIMEOUT_MS, MAX_RECONNECT_RETRIES, RECONNECT_BASE_DELAY_MS, POTENTIALLY_NAVIGATING_TOOLS, BrowserManager;
@@ -400761,7 +400850,7 @@ var init_browserManager = __esm({
400761
400850
  init_automationOverlay();
400762
400851
  init_loggers();
400763
400852
  __filename5 = fileURLToPath16(import.meta.url);
400764
- __dirname8 = path75.dirname(__filename5);
400853
+ __dirname8 = path76.dirname(__filename5);
400765
400854
  BROWSER_PROFILE_DIR2 = "cli-browser-profile";
400766
400855
  DomainNotAllowedError = class extends Error {
400767
400856
  constructor(message) {
@@ -401164,7 +401253,7 @@ var init_browserManager = __esm({
401164
401253
  if (browserConfig.customConfig.profilePath) {
401165
401254
  mcpArgs.push("--userDataDir", browserConfig.customConfig.profilePath);
401166
401255
  } else if (sessionMode === "persistent") {
401167
- const defaultProfilePath = path75.join(Storage2.getGlobalGeminiDir(), BROWSER_PROFILE_DIR2);
401256
+ const defaultProfilePath = path76.join(Storage2.getGlobalGeminiDir(), BROWSER_PROFILE_DIR2);
401168
401257
  mcpArgs.push("--userDataDir", defaultProfilePath);
401169
401258
  }
401170
401259
  if (!this.config.getUsageStatisticsEnabled()) {
@@ -401180,9 +401269,9 @@ var init_browserManager = __esm({
401180
401269
  mcpArgs.push(`--chromeArg="--host-rules=MAP * ~NOTFOUND, ${exclusionRules}"`);
401181
401270
  }
401182
401271
  debugLogger.log(`Launching bundled chrome-devtools-mcp (${sessionMode} mode) with args: ${mcpArgs.join(" ")}`);
401183
- let bundleMcpPath = path75.resolve(__dirname8, "bundled/chrome-devtools-mcp.mjs");
401272
+ let bundleMcpPath = path76.resolve(__dirname8, "bundled/chrome-devtools-mcp.mjs");
401184
401273
  if (!fs63.existsSync(bundleMcpPath)) {
401185
- bundleMcpPath = path75.resolve(__dirname8, __dirname8.includes(`${path75.sep}dist${path75.sep}`) ? "../../../bundled/chrome-devtools-mcp.mjs" : "../../../dist/bundled/chrome-devtools-mcp.mjs");
401274
+ bundleMcpPath = path76.resolve(__dirname8, __dirname8.includes(`${path76.sep}dist${path76.sep}`) ? "../../../bundled/chrome-devtools-mcp.mjs" : "../../../dist/bundled/chrome-devtools-mcp.mjs");
401186
401275
  }
401187
401276
  this.mcpTransport = new StdioClientTransport({
401188
401277
  command: "node",
@@ -402406,47 +402495,6 @@ ${value}`
402406
402495
  }
402407
402496
  });
402408
402497
 
402409
- // packages/core/dist/src/utils/planUtils.js
402410
- import path76 from "node:path";
402411
- async function validatePlanPath(planPath, plansDir) {
402412
- const safeFilename = path76.basename(planPath);
402413
- const resolvedPath = path76.join(plansDir, safeFilename);
402414
- const realPath = resolveToRealPath(resolvedPath);
402415
- const realPlansDir = resolveToRealPath(plansDir);
402416
- if (!isSubpath(realPlansDir, realPath)) {
402417
- return PlanErrorMessages.PATH_ACCESS_DENIED(planPath, realPlansDir);
402418
- }
402419
- if (!await fileExists(resolvedPath)) {
402420
- return PlanErrorMessages.FILE_NOT_FOUND(planPath);
402421
- }
402422
- return null;
402423
- }
402424
- async function validatePlanContent(planPath) {
402425
- try {
402426
- if (await isEmpty(planPath)) {
402427
- return PlanErrorMessages.FILE_EMPTY;
402428
- }
402429
- return null;
402430
- } catch (err2) {
402431
- const message = err2 instanceof Error ? err2.message : String(err2);
402432
- return PlanErrorMessages.READ_FAILURE(message);
402433
- }
402434
- }
402435
- var PlanErrorMessages;
402436
- var init_planUtils = __esm({
402437
- "packages/core/dist/src/utils/planUtils.js"() {
402438
- "use strict";
402439
- init_fileUtils();
402440
- init_paths();
402441
- PlanErrorMessages = {
402442
- PATH_ACCESS_DENIED: (planPath, plansDir) => `Access denied: plan path (${planPath}) must be within the designated plans directory (${plansDir}).`,
402443
- FILE_NOT_FOUND: (path98) => `Plan file does not exist: ${path98}. You must create the plan file before requesting approval.`,
402444
- FILE_EMPTY: "Plan file is empty. You must write content to the plan file before requesting approval.",
402445
- READ_FAILURE: (detail) => `Failed to read plan file: ${detail}`
402446
- };
402447
- }
402448
- });
402449
-
402450
402498
  // packages/core/dist/src/utils/checks.js
402451
402499
  function assumeExhaustive(_value) {
402452
402500
  }
@@ -402498,7 +402546,6 @@ var init_exit_plan_mode = __esm({
402498
402546
  init_tool_names();
402499
402547
  init_planUtils();
402500
402548
  init_types2();
402501
- init_paths();
402502
402549
  init_loggers();
402503
402550
  init_types7();
402504
402551
  init_coreTools();
@@ -402516,12 +402563,10 @@ var init_exit_plan_mode = __esm({
402516
402563
  if (!params.plan_filename || params.plan_filename.trim() === "") {
402517
402564
  return "plan_filename is required.";
402518
402565
  }
402519
- const safeFilename = path77.basename(params.plan_filename);
402520
- const plansDir = resolveToRealPath(this.config.storage.getPlansDir());
402521
- const resolvedPath = path77.join(this.config.storage.getPlansDir(), safeFilename);
402522
- const realPath = resolveToRealPath(resolvedPath);
402523
- if (!isSubpath(plansDir, realPath)) {
402524
- return `Access denied: plan path (${resolvedPath}) must be within the designated plans directory (${plansDir}).`;
402566
+ try {
402567
+ resolveAndValidatePlanPath(params.plan_filename, this.config.storage.getPlansDir(), this.config.getProjectRoot());
402568
+ } catch (e3) {
402569
+ return e3 instanceof Error ? e3.message : String(e3);
402525
402570
  }
402526
402571
  return null;
402527
402572
  }
@@ -402543,7 +402588,7 @@ var init_exit_plan_mode = __esm({
402543
402588
  }
402544
402589
  async shouldConfirmExecute(abortSignal) {
402545
402590
  const resolvedPlanPath = this.getResolvedPlanPath();
402546
- const pathError = await validatePlanPath(this.params.plan_filename, this.config.storage.getPlansDir());
402591
+ const pathError = await validatePlanPath(this.params.plan_filename, this.config.storage.getPlansDir(), this.config.getProjectRoot());
402547
402592
  if (pathError) {
402548
402593
  this.planValidationError = pathError;
402549
402594
  return false;
@@ -402585,8 +402630,7 @@ var init_exit_plan_mode = __esm({
402585
402630
  * Note: Validation is done in validateToolParamValues, so this assumes the path is valid.
402586
402631
  */
402587
402632
  getResolvedPlanPath() {
402588
- const safeFilename = path77.basename(this.params.plan_filename);
402589
- return path77.join(this.config.storage.getPlansDir(), safeFilename);
402633
+ return resolveAndValidatePlanPath(this.params.plan_filename, this.config.storage.getPlansDir(), this.config.getProjectRoot());
402590
402634
  }
402591
402635
  async execute({ abortSignal: _signal }) {
402592
402636
  const resolvedPlanPath = this.getResolvedPlanPath();
@@ -460111,7 +460155,7 @@ var wo = (s5) => {
460111
460155
  var fse = __toESM(require_lib7(), 1);
460112
460156
  init_dist7();
460113
460157
  import { promises as fsPromises12, createReadStream as createReadStream6 } from "node:fs";
460114
- import { join as join32 } from "node:path";
460158
+ import { join as join31 } from "node:path";
460115
460159
 
460116
460160
  // packages/a2a-server/src/config/config.ts
460117
460161
  var dotenv = __toESM(require_main2(), 1);
@@ -460454,7 +460498,7 @@ var GCSTaskStore = class {
460454
460498
  if (await fse.pathExists(workDir)) {
460455
460499
  const entries2 = await fsPromises12.readdir(workDir);
460456
460500
  if (entries2.length > 0) {
460457
- const tmpArchiveFile = join32(tmpdir(), getTmpArchiveFilename(taskId));
460501
+ const tmpArchiveFile = join31(tmpdir(), getTmpArchiveFilename(taskId));
460458
460502
  try {
460459
460503
  await zn(
460460
460504
  {
@@ -460576,7 +460620,7 @@ var GCSTaskStore = class {
460576
460620
  const workspaceFile = this.storage.bucket(this.bucketName).file(workspaceObjectPath);
460577
460621
  const [workspaceExists] = await workspaceFile.exists();
460578
460622
  if (workspaceExists) {
460579
- const tmpArchiveFile = join32(tmpdir(), getTmpArchiveFilename(taskId));
460623
+ const tmpArchiveFile = join31(tmpdir(), getTmpArchiveFilename(taskId));
460580
460624
  try {
460581
460625
  await workspaceFile.download({ destination: tmpArchiveFile });
460582
460626
  await lo({ file: tmpArchiveFile, cwd: workDir });