@probelabs/probe 0.6.0-rc228 → 0.6.0-rc229

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.
@@ -10288,6 +10288,7 @@ function buildSearchDelegateTask({ searchQuery, searchPath, exact, language, all
10288
10288
  `Options: exact=${exact ? "true" : "false"}, language=${language || "auto"}, allow_tests=${allowTests ? "true" : "false"}.`,
10289
10289
  "",
10290
10290
  'Return ONLY valid JSON: {"targets": ["path/to/file.ext#Symbol", "path/to/file.ext:line", "path/to/file.ext:start-end"]}',
10291
+ 'IMPORTANT: Use ABSOLUTE file paths in targets (e.g., "/full/path/to/file.ext#Symbol"). If you only have relative paths, make them relative to the search path above.',
10291
10292
  "Prefer #Symbol when a function/class name is clear; otherwise use line numbers.",
10292
10293
  "Deduplicate targets. Do NOT explain or answer - ONLY return the JSON targets."
10293
10294
  ].join("\n");
@@ -10409,11 +10410,11 @@ var init_vercel = __esm({
10409
10410
  }
10410
10411
  return await runRawSearch();
10411
10412
  }
10412
- const effectiveCwd = options.cwd || ".";
10413
- const resolvedTargets = targets.map((target) => resolveTargetPath(target, effectiveCwd));
10413
+ const resolutionBase = searchPaths[0] || options.cwd || ".";
10414
+ const resolvedTargets = targets.map((target) => resolveTargetPath(target, resolutionBase));
10414
10415
  const extractOptions = {
10415
10416
  files: resolvedTargets,
10416
- cwd: effectiveCwd,
10417
+ cwd: resolutionBase,
10417
10418
  allowTests: allow_tests ?? true
10418
10419
  };
10419
10420
  if (outline) {
@@ -140,6 +140,7 @@ function buildSearchDelegateTask({ searchQuery, searchPath, exact, language, all
140
140
  `Options: exact=${exact ? 'true' : 'false'}, language=${language || 'auto'}, allow_tests=${allowTests ? 'true' : 'false'}.`,
141
141
  '',
142
142
  'Return ONLY valid JSON: {"targets": ["path/to/file.ext#Symbol", "path/to/file.ext:line", "path/to/file.ext:start-end"]}',
143
+ 'IMPORTANT: Use ABSOLUTE file paths in targets (e.g., "/full/path/to/file.ext#Symbol"). If you only have relative paths, make them relative to the search path above.',
143
144
  'Prefer #Symbol when a function/class name is clear; otherwise use line numbers.',
144
145
  'Deduplicate targets. Do NOT explain or answer - ONLY return the JSON targets.'
145
146
  ].join('\n');
@@ -267,11 +268,14 @@ export const searchTool = (options = {}) => {
267
268
  return await runRawSearch();
268
269
  }
269
270
 
270
- const effectiveCwd = options.cwd || '.';
271
- const resolvedTargets = targets.map(target => resolveTargetPath(target, effectiveCwd));
271
+ // Resolve relative paths against the actual search directory, not the general cwd.
272
+ // The delegate returns paths relative to where the search was performed (searchPaths[0]),
273
+ // which may differ from options.cwd when the user specifies a path parameter.
274
+ const resolutionBase = searchPaths[0] || options.cwd || '.';
275
+ const resolvedTargets = targets.map(target => resolveTargetPath(target, resolutionBase));
272
276
  const extractOptions = {
273
277
  files: resolvedTargets,
274
- cwd: effectiveCwd,
278
+ cwd: resolutionBase,
275
279
  allowTests: allow_tests ?? true
276
280
  };
277
281