@probelabs/probe 0.6.0-rc196 → 0.6.0-rc197

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.
@@ -2458,9 +2458,13 @@ Follow these instructions carefully:
2458
2458
  try {
2459
2459
  // Add sessionId and workingDirectory to params for tool execution
2460
2460
  // Validate and resolve workingDirectory
2461
- let resolvedWorkingDirectory = (this.allowedFolders && this.allowedFolders[0]) || process.cwd();
2461
+ // Priority: explicit cwd > first allowed folder > process.cwd()
2462
+ let resolvedWorkingDirectory = this.cwd || (this.allowedFolders && this.allowedFolders[0]) || process.cwd();
2462
2463
  if (params.workingDirectory) {
2463
- const requestedDir = resolve(params.workingDirectory);
2464
+ // Resolve relative paths against the current working directory context, not process.cwd()
2465
+ const requestedDir = isAbsolute(params.workingDirectory)
2466
+ ? resolve(params.workingDirectory)
2467
+ : resolve(resolvedWorkingDirectory, params.workingDirectory);
2464
2468
  // Check if the requested directory is within allowed folders
2465
2469
  const isWithinAllowed = !this.allowedFolders || this.allowedFolders.length === 0 ||
2466
2470
  this.allowedFolders.some(folder => {