@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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@probelabs/probe",
3
- "version": "0.6.0-rc228",
3
+ "version": "0.6.0-rc229",
4
4
  "description": "Node.js wrapper for the probe code search tool",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.js",
@@ -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