@probelabs/probe 0.6.0-rc187 → 0.6.0-rc189

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.
@@ -2387,7 +2387,9 @@ When troubleshooting:
2387
2387
  if (this.allowedTools.isEnabled('listFiles')) validTools.push('listFiles');
2388
2388
  if (this.allowedTools.isEnabled('searchFiles')) validTools.push('searchFiles');
2389
2389
  if (this.allowedTools.isEnabled('readImage')) validTools.push('readImage');
2390
- if (this.allowedTools.isEnabled('attempt_completion')) validTools.push('attempt_completion');
2390
+ // Always allow attempt_completion - it's a completion signal, not a tool
2391
+ // This ensures agents can complete even when disableTools: true is set (fixes #333)
2392
+ validTools.push('attempt_completion');
2391
2393
 
2392
2394
  // Edit tools (require both allowEdit flag AND allowedTools permission)
2393
2395
  if (this.allowEdit && this.allowedTools.isEnabled('implement')) {
@@ -54730,6 +54730,10 @@ function cleanSchemaResponse(response) {
54730
54730
  return response;
54731
54731
  }
54732
54732
  const trimmed = response.trim();
54733
+ const resultWrapperMatch = trimmed.match(/^<result>\s*([\s\S]*?)\s*<\/result>$/);
54734
+ if (resultWrapperMatch) {
54735
+ return cleanSchemaResponse(resultWrapperMatch[1]);
54736
+ }
54733
54737
  const jsonBlockMatch = trimmed.match(/```json\s*\n([\s\S]*?)\n```/);
54734
54738
  if (jsonBlockMatch) {
54735
54739
  return normalizeJsonQuotes(jsonBlockMatch[1].trim());
@@ -61143,7 +61147,7 @@ You are working with a repository located at: ${searchDirectory}
61143
61147
  if (this.allowedTools.isEnabled("listFiles")) validTools.push("listFiles");
61144
61148
  if (this.allowedTools.isEnabled("searchFiles")) validTools.push("searchFiles");
61145
61149
  if (this.allowedTools.isEnabled("readImage")) validTools.push("readImage");
61146
- if (this.allowedTools.isEnabled("attempt_completion")) validTools.push("attempt_completion");
61150
+ validTools.push("attempt_completion");
61147
61151
  if (this.allowEdit && this.allowedTools.isEnabled("implement")) {
61148
61152
  validTools.push("implement", "edit", "create");
61149
61153
  }
@@ -253,6 +253,14 @@ export function cleanSchemaResponse(response) {
253
253
 
254
254
  const trimmed = response.trim();
255
255
 
256
+ // Strip <result>...</result> wrapper if present (legacy XML format from some AI models)
257
+ // Some models like Google Gemini wrap JSON in <result> tags despite instructions not to
258
+ const resultWrapperMatch = trimmed.match(/^<result>\s*([\s\S]*?)\s*<\/result>$/);
259
+ if (resultWrapperMatch) {
260
+ // Recursively clean the inner content in case there are nested patterns
261
+ return cleanSchemaResponse(resultWrapperMatch[1]);
262
+ }
263
+
256
264
  // First, look for JSON after code block markers - similar to mermaid extraction
257
265
  // Try with json language specifier
258
266
  const jsonBlockMatch = trimmed.match(/```json\s*\n([\s\S]*?)\n```/);
@@ -81416,6 +81416,10 @@ function cleanSchemaResponse(response) {
81416
81416
  return response;
81417
81417
  }
81418
81418
  const trimmed = response.trim();
81419
+ const resultWrapperMatch = trimmed.match(/^<result>\s*([\s\S]*?)\s*<\/result>$/);
81420
+ if (resultWrapperMatch) {
81421
+ return cleanSchemaResponse(resultWrapperMatch[1]);
81422
+ }
81419
81423
  const jsonBlockMatch = trimmed.match(/```json\s*\n([\s\S]*?)\n```/);
81420
81424
  if (jsonBlockMatch) {
81421
81425
  return normalizeJsonQuotes(jsonBlockMatch[1].trim());
@@ -87828,7 +87832,7 @@ You are working with a repository located at: ${searchDirectory}
87828
87832
  if (this.allowedTools.isEnabled("listFiles")) validTools.push("listFiles");
87829
87833
  if (this.allowedTools.isEnabled("searchFiles")) validTools.push("searchFiles");
87830
87834
  if (this.allowedTools.isEnabled("readImage")) validTools.push("readImage");
87831
- if (this.allowedTools.isEnabled("attempt_completion")) validTools.push("attempt_completion");
87835
+ validTools.push("attempt_completion");
87832
87836
  if (this.allowEdit && this.allowedTools.isEnabled("implement")) {
87833
87837
  validTools.push("implement", "edit", "create");
87834
87838
  }
package/cjs/index.cjs CHANGED
@@ -79038,6 +79038,10 @@ function cleanSchemaResponse(response) {
79038
79038
  return response;
79039
79039
  }
79040
79040
  const trimmed = response.trim();
79041
+ const resultWrapperMatch = trimmed.match(/^<result>\s*([\s\S]*?)\s*<\/result>$/);
79042
+ if (resultWrapperMatch) {
79043
+ return cleanSchemaResponse(resultWrapperMatch[1]);
79044
+ }
79041
79045
  const jsonBlockMatch = trimmed.match(/```json\s*\n([\s\S]*?)\n```/);
79042
79046
  if (jsonBlockMatch) {
79043
79047
  return normalizeJsonQuotes(jsonBlockMatch[1].trim());
@@ -85450,7 +85454,7 @@ You are working with a repository located at: ${searchDirectory}
85450
85454
  if (this.allowedTools.isEnabled("listFiles")) validTools.push("listFiles");
85451
85455
  if (this.allowedTools.isEnabled("searchFiles")) validTools.push("searchFiles");
85452
85456
  if (this.allowedTools.isEnabled("readImage")) validTools.push("readImage");
85453
- if (this.allowedTools.isEnabled("attempt_completion")) validTools.push("attempt_completion");
85457
+ validTools.push("attempt_completion");
85454
85458
  if (this.allowEdit && this.allowedTools.isEnabled("implement")) {
85455
85459
  validTools.push("implement", "edit", "create");
85456
85460
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@probelabs/probe",
3
- "version": "0.6.0-rc187",
3
+ "version": "0.6.0-rc189",
4
4
  "description": "Node.js wrapper for the probe code search tool",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.js",
@@ -2387,7 +2387,9 @@ When troubleshooting:
2387
2387
  if (this.allowedTools.isEnabled('listFiles')) validTools.push('listFiles');
2388
2388
  if (this.allowedTools.isEnabled('searchFiles')) validTools.push('searchFiles');
2389
2389
  if (this.allowedTools.isEnabled('readImage')) validTools.push('readImage');
2390
- if (this.allowedTools.isEnabled('attempt_completion')) validTools.push('attempt_completion');
2390
+ // Always allow attempt_completion - it's a completion signal, not a tool
2391
+ // This ensures agents can complete even when disableTools: true is set (fixes #333)
2392
+ validTools.push('attempt_completion');
2391
2393
 
2392
2394
  // Edit tools (require both allowEdit flag AND allowedTools permission)
2393
2395
  if (this.allowEdit && this.allowedTools.isEnabled('implement')) {
@@ -253,6 +253,14 @@ export function cleanSchemaResponse(response) {
253
253
 
254
254
  const trimmed = response.trim();
255
255
 
256
+ // Strip <result>...</result> wrapper if present (legacy XML format from some AI models)
257
+ // Some models like Google Gemini wrap JSON in <result> tags despite instructions not to
258
+ const resultWrapperMatch = trimmed.match(/^<result>\s*([\s\S]*?)\s*<\/result>$/);
259
+ if (resultWrapperMatch) {
260
+ // Recursively clean the inner content in case there are nested patterns
261
+ return cleanSchemaResponse(resultWrapperMatch[1]);
262
+ }
263
+
256
264
  // First, look for JSON after code block markers - similar to mermaid extraction
257
265
  // Try with json language specifier
258
266
  const jsonBlockMatch = trimmed.match(/```json\s*\n([\s\S]*?)\n```/);