@probelabs/probe 0.6.0-rc249 → 0.6.0-rc251

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.
@@ -4383,7 +4383,8 @@ Convert your previous response content into actual JSON data that follows this s
4383
4383
  // Call answer recursively with _schemaFormatted flag to prevent infinite loop
4384
4384
  finalResult = await this.answer(schemaPrompt, [], {
4385
4385
  ...options,
4386
- _schemaFormatted: true
4386
+ _schemaFormatted: true,
4387
+ _completionPromptProcessed: true // Prevent cascading completion prompts in retry calls
4387
4388
  });
4388
4389
 
4389
4390
  // Step 2: Validate and fix Mermaid diagrams if present (BEFORE cleaning schema)
@@ -4642,7 +4643,8 @@ Convert your previous response content into actual JSON data that follows this s
4642
4643
  finalResult = await this.answer(schemaDefinitionPrompt, [], {
4643
4644
  ...options,
4644
4645
  _schemaFormatted: true,
4645
- _skipValidation: true // Skip validation in recursive correction calls to prevent loops
4646
+ _skipValidation: true, // Skip validation in recursive correction calls to prevent loops
4647
+ _completionPromptProcessed: true // Prevent cascading completion prompts in retry calls
4646
4648
  });
4647
4649
  finalResult = cleanSchemaResponse(finalResult);
4648
4650
  validation = validateJsonResponse(finalResult);
@@ -4702,7 +4704,8 @@ Convert your previous response content into actual JSON data that follows this s
4702
4704
  ...options,
4703
4705
  _schemaFormatted: true,
4704
4706
  _skipValidation: true, // Skip validation in recursive correction calls to prevent loops
4705
- _disableTools: true // Only allow attempt_completion - prevent AI from using search/query tools
4707
+ _disableTools: true, // Only allow attempt_completion - prevent AI from using search/query tools
4708
+ _completionPromptProcessed: true // Prevent cascading completion prompts in retry calls
4706
4709
  });
4707
4710
  finalResult = cleanSchemaResponse(finalResult);
4708
4711
 
@@ -4787,7 +4790,8 @@ Convert your previous response content into actual JSON data that follows this s
4787
4790
  }
4788
4791
 
4789
4792
  // Append DSL output buffer directly to response (bypasses LLM rewriting)
4790
- if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted) {
4793
+ // Skip during _completionPromptProcessed only the parent answer() should append the buffer.
4794
+ if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted && !options._completionPromptProcessed) {
4791
4795
  const outputContent = this._outputBuffer.items.join('\n\n');
4792
4796
  if (options.schema) {
4793
4797
  // Schema response — the finalResult is JSON. Wrap output in RAW_OUTPUT
@@ -25309,7 +25309,7 @@ var init_esm3 = __esm({
25309
25309
  }
25310
25310
  constructor(src, dest, opts) {
25311
25311
  super(src, dest, opts);
25312
- this.proxyErrors = (er) => dest.emit("error", er);
25312
+ this.proxyErrors = (er) => this.dest.emit("error", er);
25313
25313
  src.on("error", this.proxyErrors);
25314
25314
  }
25315
25315
  };
@@ -26023,6 +26023,8 @@ var init_esm3 = __esm({
26023
26023
  return: stop,
26024
26024
  [Symbol.asyncIterator]() {
26025
26025
  return this;
26026
+ },
26027
+ [Symbol.asyncDispose]: async () => {
26026
26028
  }
26027
26029
  };
26028
26030
  }
@@ -26058,6 +26060,8 @@ var init_esm3 = __esm({
26058
26060
  return: stop,
26059
26061
  [Symbol.iterator]() {
26060
26062
  return this;
26063
+ },
26064
+ [Symbol.dispose]: () => {
26061
26065
  }
26062
26066
  };
26063
26067
  }
@@ -84643,7 +84647,9 @@ NOT: {"type": "object", "properties": {"name": {"type": "string"}}}
84643
84647
  Convert your previous response content into actual JSON data that follows this schema structure.`;
84644
84648
  finalResult = await this.answer(schemaPrompt, [], {
84645
84649
  ...options,
84646
- _schemaFormatted: true
84650
+ _schemaFormatted: true,
84651
+ _completionPromptProcessed: true
84652
+ // Prevent cascading completion prompts in retry calls
84647
84653
  });
84648
84654
  if (!this.disableMermaidValidation) {
84649
84655
  try {
@@ -84847,8 +84853,10 @@ Convert your previous response content into actual JSON data that follows this s
84847
84853
  finalResult = await this.answer(schemaDefinitionPrompt, [], {
84848
84854
  ...options,
84849
84855
  _schemaFormatted: true,
84850
- _skipValidation: true
84856
+ _skipValidation: true,
84851
84857
  // Skip validation in recursive correction calls to prevent loops
84858
+ _completionPromptProcessed: true
84859
+ // Prevent cascading completion prompts in retry calls
84852
84860
  });
84853
84861
  finalResult = cleanSchemaResponse(finalResult);
84854
84862
  validation = validateJsonResponse(finalResult);
@@ -84901,8 +84909,10 @@ Convert your previous response content into actual JSON data that follows this s
84901
84909
  _schemaFormatted: true,
84902
84910
  _skipValidation: true,
84903
84911
  // Skip validation in recursive correction calls to prevent loops
84904
- _disableTools: true
84912
+ _disableTools: true,
84905
84913
  // Only allow attempt_completion - prevent AI from using search/query tools
84914
+ _completionPromptProcessed: true
84915
+ // Prevent cascading completion prompts in retry calls
84906
84916
  });
84907
84917
  finalResult = cleanSchemaResponse(finalResult);
84908
84918
  validation = validateJsonResponse(finalResult, { debug: this.debug });
@@ -84972,7 +84982,7 @@ Convert your previous response content into actual JSON data that follows this s
84972
84982
  console.log(`[DEBUG] Removed thinking tags from final result`);
84973
84983
  }
84974
84984
  }
84975
- if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted) {
84985
+ if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted && !options._completionPromptProcessed) {
84976
84986
  const outputContent = this._outputBuffer.items.join("\n\n");
84977
84987
  if (options.schema) {
84978
84988
  finalResult = (finalResult || "") + "\n<<<RAW_OUTPUT>>>\n" + outputContent + "\n<<<END_RAW_OUTPUT>>>";
@@ -52443,7 +52443,7 @@ var init_esm3 = __esm({
52443
52443
  }
52444
52444
  constructor(src, dest, opts) {
52445
52445
  super(src, dest, opts);
52446
- this.proxyErrors = (er) => dest.emit("error", er);
52446
+ this.proxyErrors = (er) => this.dest.emit("error", er);
52447
52447
  src.on("error", this.proxyErrors);
52448
52448
  }
52449
52449
  };
@@ -53157,6 +53157,8 @@ var init_esm3 = __esm({
53157
53157
  return: stop,
53158
53158
  [Symbol.asyncIterator]() {
53159
53159
  return this;
53160
+ },
53161
+ [Symbol.asyncDispose]: async () => {
53160
53162
  }
53161
53163
  };
53162
53164
  }
@@ -53192,6 +53194,8 @@ var init_esm3 = __esm({
53192
53194
  return: stop,
53193
53195
  [Symbol.iterator]() {
53194
53196
  return this;
53197
+ },
53198
+ [Symbol.dispose]: () => {
53195
53199
  }
53196
53200
  };
53197
53201
  }
@@ -111342,7 +111346,9 @@ NOT: {"type": "object", "properties": {"name": {"type": "string"}}}
111342
111346
  Convert your previous response content into actual JSON data that follows this schema structure.`;
111343
111347
  finalResult = await this.answer(schemaPrompt, [], {
111344
111348
  ...options,
111345
- _schemaFormatted: true
111349
+ _schemaFormatted: true,
111350
+ _completionPromptProcessed: true
111351
+ // Prevent cascading completion prompts in retry calls
111346
111352
  });
111347
111353
  if (!this.disableMermaidValidation) {
111348
111354
  try {
@@ -111546,8 +111552,10 @@ Convert your previous response content into actual JSON data that follows this s
111546
111552
  finalResult = await this.answer(schemaDefinitionPrompt, [], {
111547
111553
  ...options,
111548
111554
  _schemaFormatted: true,
111549
- _skipValidation: true
111555
+ _skipValidation: true,
111550
111556
  // Skip validation in recursive correction calls to prevent loops
111557
+ _completionPromptProcessed: true
111558
+ // Prevent cascading completion prompts in retry calls
111551
111559
  });
111552
111560
  finalResult = cleanSchemaResponse(finalResult);
111553
111561
  validation = validateJsonResponse(finalResult);
@@ -111600,8 +111608,10 @@ Convert your previous response content into actual JSON data that follows this s
111600
111608
  _schemaFormatted: true,
111601
111609
  _skipValidation: true,
111602
111610
  // Skip validation in recursive correction calls to prevent loops
111603
- _disableTools: true
111611
+ _disableTools: true,
111604
111612
  // Only allow attempt_completion - prevent AI from using search/query tools
111613
+ _completionPromptProcessed: true
111614
+ // Prevent cascading completion prompts in retry calls
111605
111615
  });
111606
111616
  finalResult = cleanSchemaResponse(finalResult);
111607
111617
  validation = validateJsonResponse(finalResult, { debug: this.debug });
@@ -111671,7 +111681,7 @@ Convert your previous response content into actual JSON data that follows this s
111671
111681
  console.log(`[DEBUG] Removed thinking tags from final result`);
111672
111682
  }
111673
111683
  }
111674
- if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted) {
111684
+ if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted && !options._completionPromptProcessed) {
111675
111685
  const outputContent = this._outputBuffer.items.join("\n\n");
111676
111686
  if (options.schema) {
111677
111687
  finalResult = (finalResult || "") + "\n<<<RAW_OUTPUT>>>\n" + outputContent + "\n<<<END_RAW_OUTPUT>>>";
package/cjs/index.cjs CHANGED
@@ -40464,7 +40464,7 @@ var init_esm3 = __esm({
40464
40464
  }
40465
40465
  constructor(src, dest, opts) {
40466
40466
  super(src, dest, opts);
40467
- this.proxyErrors = (er) => dest.emit("error", er);
40467
+ this.proxyErrors = (er) => this.dest.emit("error", er);
40468
40468
  src.on("error", this.proxyErrors);
40469
40469
  }
40470
40470
  };
@@ -41178,6 +41178,8 @@ var init_esm3 = __esm({
41178
41178
  return: stop,
41179
41179
  [Symbol.asyncIterator]() {
41180
41180
  return this;
41181
+ },
41182
+ [Symbol.asyncDispose]: async () => {
41181
41183
  }
41182
41184
  };
41183
41185
  }
@@ -41213,6 +41215,8 @@ var init_esm3 = __esm({
41213
41215
  return: stop,
41214
41216
  [Symbol.iterator]() {
41215
41217
  return this;
41218
+ },
41219
+ [Symbol.dispose]: () => {
41216
41220
  }
41217
41221
  };
41218
41222
  }
@@ -109695,7 +109699,9 @@ NOT: {"type": "object", "properties": {"name": {"type": "string"}}}
109695
109699
  Convert your previous response content into actual JSON data that follows this schema structure.`;
109696
109700
  finalResult = await this.answer(schemaPrompt, [], {
109697
109701
  ...options,
109698
- _schemaFormatted: true
109702
+ _schemaFormatted: true,
109703
+ _completionPromptProcessed: true
109704
+ // Prevent cascading completion prompts in retry calls
109699
109705
  });
109700
109706
  if (!this.disableMermaidValidation) {
109701
109707
  try {
@@ -109899,8 +109905,10 @@ Convert your previous response content into actual JSON data that follows this s
109899
109905
  finalResult = await this.answer(schemaDefinitionPrompt, [], {
109900
109906
  ...options,
109901
109907
  _schemaFormatted: true,
109902
- _skipValidation: true
109908
+ _skipValidation: true,
109903
109909
  // Skip validation in recursive correction calls to prevent loops
109910
+ _completionPromptProcessed: true
109911
+ // Prevent cascading completion prompts in retry calls
109904
109912
  });
109905
109913
  finalResult = cleanSchemaResponse(finalResult);
109906
109914
  validation = validateJsonResponse(finalResult);
@@ -109953,8 +109961,10 @@ Convert your previous response content into actual JSON data that follows this s
109953
109961
  _schemaFormatted: true,
109954
109962
  _skipValidation: true,
109955
109963
  // Skip validation in recursive correction calls to prevent loops
109956
- _disableTools: true
109964
+ _disableTools: true,
109957
109965
  // Only allow attempt_completion - prevent AI from using search/query tools
109966
+ _completionPromptProcessed: true
109967
+ // Prevent cascading completion prompts in retry calls
109958
109968
  });
109959
109969
  finalResult = cleanSchemaResponse(finalResult);
109960
109970
  validation = validateJsonResponse(finalResult, { debug: this.debug });
@@ -110024,7 +110034,7 @@ Convert your previous response content into actual JSON data that follows this s
110024
110034
  console.log(`[DEBUG] Removed thinking tags from final result`);
110025
110035
  }
110026
110036
  }
110027
- if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted) {
110037
+ if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted && !options._completionPromptProcessed) {
110028
110038
  const outputContent = this._outputBuffer.items.join("\n\n");
110029
110039
  if (options.schema) {
110030
110040
  finalResult = (finalResult || "") + "\n<<<RAW_OUTPUT>>>\n" + outputContent + "\n<<<END_RAW_OUTPUT>>>";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@probelabs/probe",
3
- "version": "0.6.0-rc249",
3
+ "version": "0.6.0-rc251",
4
4
  "description": "Node.js wrapper for the probe code search tool",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.js",
@@ -4383,7 +4383,8 @@ Convert your previous response content into actual JSON data that follows this s
4383
4383
  // Call answer recursively with _schemaFormatted flag to prevent infinite loop
4384
4384
  finalResult = await this.answer(schemaPrompt, [], {
4385
4385
  ...options,
4386
- _schemaFormatted: true
4386
+ _schemaFormatted: true,
4387
+ _completionPromptProcessed: true // Prevent cascading completion prompts in retry calls
4387
4388
  });
4388
4389
 
4389
4390
  // Step 2: Validate and fix Mermaid diagrams if present (BEFORE cleaning schema)
@@ -4642,7 +4643,8 @@ Convert your previous response content into actual JSON data that follows this s
4642
4643
  finalResult = await this.answer(schemaDefinitionPrompt, [], {
4643
4644
  ...options,
4644
4645
  _schemaFormatted: true,
4645
- _skipValidation: true // Skip validation in recursive correction calls to prevent loops
4646
+ _skipValidation: true, // Skip validation in recursive correction calls to prevent loops
4647
+ _completionPromptProcessed: true // Prevent cascading completion prompts in retry calls
4646
4648
  });
4647
4649
  finalResult = cleanSchemaResponse(finalResult);
4648
4650
  validation = validateJsonResponse(finalResult);
@@ -4702,7 +4704,8 @@ Convert your previous response content into actual JSON data that follows this s
4702
4704
  ...options,
4703
4705
  _schemaFormatted: true,
4704
4706
  _skipValidation: true, // Skip validation in recursive correction calls to prevent loops
4705
- _disableTools: true // Only allow attempt_completion - prevent AI from using search/query tools
4707
+ _disableTools: true, // Only allow attempt_completion - prevent AI from using search/query tools
4708
+ _completionPromptProcessed: true // Prevent cascading completion prompts in retry calls
4706
4709
  });
4707
4710
  finalResult = cleanSchemaResponse(finalResult);
4708
4711
 
@@ -4787,7 +4790,8 @@ Convert your previous response content into actual JSON data that follows this s
4787
4790
  }
4788
4791
 
4789
4792
  // Append DSL output buffer directly to response (bypasses LLM rewriting)
4790
- if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted) {
4793
+ // Skip during _completionPromptProcessed only the parent answer() should append the buffer.
4794
+ if (this._outputBuffer && this._outputBuffer.items.length > 0 && !options._schemaFormatted && !options._completionPromptProcessed) {
4791
4795
  const outputContent = this._outputBuffer.items.join('\n\n');
4792
4796
  if (options.schema) {
4793
4797
  // Schema response — the finalResult is JSON. Wrap output in RAW_OUTPUT