@probelabs/probe-chat 0.6.0-rc57 → 0.6.0-rc59

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.
Files changed (3) hide show
  1. package/index.js +4 -4
  2. package/package.json +2 -2
  3. package/probeChat.js +16 -0
package/index.js CHANGED
@@ -61,7 +61,7 @@ export function main() {
61
61
  .option('--images <urls>', 'Comma-separated list of image URLs to include in the message')
62
62
  .option('--json', 'Output the response as JSON in non-interactive mode')
63
63
  .option('--max-iterations <number>', 'Maximum number of tool iterations allowed (default: 30)')
64
- .option('--prompt <value>', 'Use a custom prompt (values: architect, code-review, support, path to a file, or arbitrary string)')
64
+ .option('--prompt <value>', 'Use a custom prompt (values: architect, code-review, code-review-template, support, path to a file, or arbitrary string)')
65
65
  .option('--allow-edit', 'Enable the implement tool for editing files')
66
66
  .option('--implement-tool-backend <backend>', 'Choose implementation tool backend (aider, claude-code)')
67
67
  .option('--implement-tool-timeout <ms>', 'Implementation tool timeout in milliseconds')
@@ -250,7 +250,7 @@ export function main() {
250
250
  let customPrompt = null;
251
251
  if (options.prompt) {
252
252
  // Check if it's one of the predefined prompts
253
- const predefinedPrompts = ['architect', 'code-review', 'support', 'engineer'];
253
+ const predefinedPrompts = ['architect', 'code-review', 'code-review-template', 'support', 'engineer'];
254
254
  if (predefinedPrompts.includes(options.prompt)) {
255
255
  process.env.PROMPT_TYPE = options.prompt;
256
256
  logInfo(chalk.blue(`Using predefined prompt: ${options.prompt}`));
@@ -358,7 +358,7 @@ export function main() {
358
358
  sessionId: options.sessionId,
359
359
  isNonInteractive: true,
360
360
  customPrompt: customPrompt,
361
- promptType: options.prompt && ['architect', 'code-review', 'support', 'engineer'].includes(options.prompt) ? options.prompt : null,
361
+ promptType: options.prompt && ['architect', 'code-review', 'code-review-template', 'support', 'engineer'].includes(options.prompt) ? options.prompt : null,
362
362
  allowEdit: options.allowEdit
363
363
  });
364
364
  // Model/Provider info is logged via logInfo above if debug enabled
@@ -467,7 +467,7 @@ export function main() {
467
467
  sessionId: options.sessionId,
468
468
  isNonInteractive: false,
469
469
  customPrompt: customPrompt,
470
- promptType: options.prompt && ['architect', 'code-review', 'support', 'engineer'].includes(options.prompt) ? options.prompt : null,
470
+ promptType: options.prompt && ['architect', 'code-review', 'code-review-template', 'support', 'engineer'].includes(options.prompt) ? options.prompt : null,
471
471
  allowEdit: options.allowEdit
472
472
  });
473
473
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@probelabs/probe-chat",
3
- "version": "0.6.0-rc57",
3
+ "version": "0.6.0-rc59",
4
4
  "description": "CLI and web interface for Probe code search (formerly @probelabs/probe-web and @probelabs/probe-chat)",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  "@ai-sdk/anthropic": "^1.2.0",
33
33
  "@ai-sdk/google": "^1.2.1",
34
34
  "@ai-sdk/openai": "^1.3.0",
35
- "@buger/probe": "^0.6.0-rc57",
35
+ "@buger/probe": "^0.6.0-rc59",
36
36
  "@opentelemetry/api": "^1.9.0",
37
37
  "@opentelemetry/exporter-trace-otlp-http": "^0.203.0",
38
38
  "@opentelemetry/resources": "^2.0.1",
package/probeChat.js CHANGED
@@ -625,6 +625,8 @@ If you detect critical issues that should prevent the code from being merged, in
625
625
 
626
626
  The <fail> tag will cause the GitHub check to fail, drawing immediate attention to these critical issues.`,
627
627
 
628
+ 'code-review-template': `You are going to perform code review according to provided user rules. Ensure to review only code provided in diff and latest commit, if provided. However you still need to fully understand how modified code works, and read dependencies if something is not clear.`,
629
+
628
630
  'engineer': `You are senior engineer focused on software architecture and design.
629
631
  Before jumping on the task you first, in details analyse user request, and try to provide elegant and concise solution.
630
632
  If solution is clear, you can jump to implementation right away, if not, you can ask user a clarification question, by calling attempt_completion tool, with required details.
@@ -1107,6 +1109,20 @@ When troubleshooting:
1107
1109
  });
1108
1110
  }
1109
1111
 
1112
+ // Add warning message when reaching the last iteration
1113
+ if (currentIteration === MAX_TOOL_ITERATIONS) {
1114
+ const warningMessage = `⚠️ WARNING: You have reached the maximum tool iterations limit (${MAX_TOOL_ITERATIONS}). This is your final message. Please respond with the data you have so far. If something was not completed, honestly state what was not done and provide any partial results or recommendations you can offer.`;
1115
+
1116
+ currentMessages.push({
1117
+ role: 'user',
1118
+ content: warningMessage
1119
+ });
1120
+
1121
+ if (this.debug) {
1122
+ console.log(`[DEBUG] Added max iterations warning message at iteration ${currentIteration}`);
1123
+ }
1124
+ }
1125
+
1110
1126
  this.tokenCounter.calculateContextSize(currentMessages);
1111
1127
  if (this.debug) console.log(`[DEBUG] Estimated context tokens BEFORE LLM call (Iter ${currentIteration}): ${this.tokenCounter.contextSize}`);
1112
1128