@probelabs/probe-chat 0.6.0-rc174 → 0.6.0-rc175
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/index.js +26 -2
- package/package.json +1 -1
- package/probeChat.js +1 -0
package/index.js
CHANGED
|
@@ -78,6 +78,7 @@ export function main() {
|
|
|
78
78
|
.option('--trace-file [path]', 'Enable tracing to file (default: ./traces.jsonl)')
|
|
79
79
|
.option('--trace-remote [endpoint]', 'Enable tracing to remote endpoint (default: http://localhost:4318/v1/traces)')
|
|
80
80
|
.option('--trace-console', 'Enable tracing to console (for debugging)')
|
|
81
|
+
.option('--completion-prompt <prompt>', 'Custom prompt to run after attempt_completion for validation/review (can be a string or path to a file)')
|
|
81
82
|
.argument('[path]', 'Path to the codebase to search (overrides ALLOWED_FOLDERS)')
|
|
82
83
|
.parse(process.argv);
|
|
83
84
|
|
|
@@ -253,6 +254,27 @@ export function main() {
|
|
|
253
254
|
}
|
|
254
255
|
|
|
255
256
|
|
|
257
|
+
// Handle completion prompt if provided
|
|
258
|
+
let completionPrompt = null;
|
|
259
|
+
if (options.completionPrompt) {
|
|
260
|
+
// Check if it's a file path
|
|
261
|
+
try {
|
|
262
|
+
const completionPromptPath = resolve(options.completionPrompt);
|
|
263
|
+
if (existsSync(completionPromptPath)) {
|
|
264
|
+
completionPrompt = readFileSync(completionPromptPath, 'utf8');
|
|
265
|
+
logInfo(chalk.blue(`Loaded completion prompt from file: ${completionPromptPath}`));
|
|
266
|
+
} else {
|
|
267
|
+
// Not an existing file, treat as a direct string prompt
|
|
268
|
+
completionPrompt = options.completionPrompt;
|
|
269
|
+
logInfo(chalk.blue(`Using completion prompt string`));
|
|
270
|
+
}
|
|
271
|
+
} catch (error) {
|
|
272
|
+
// If there's an error resolving the path, treat as a direct string prompt
|
|
273
|
+
completionPrompt = options.completionPrompt;
|
|
274
|
+
logInfo(chalk.blue(`Using completion prompt string`));
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
256
278
|
// Handle custom prompt if provided
|
|
257
279
|
let customPrompt = null;
|
|
258
280
|
if (options.prompt) {
|
|
@@ -420,7 +442,8 @@ export function main() {
|
|
|
420
442
|
promptType: options.prompt && ['architect', 'code-review', 'code-review-template', 'support', 'engineer'].includes(options.prompt) ? options.prompt : null,
|
|
421
443
|
allowEdit: options.allowEdit,
|
|
422
444
|
enableBash: options.enableBash,
|
|
423
|
-
bashConfig: bashConfig
|
|
445
|
+
bashConfig: bashConfig,
|
|
446
|
+
completionPrompt: completionPrompt
|
|
424
447
|
});
|
|
425
448
|
// Model/Provider info is logged via logInfo above if debug enabled
|
|
426
449
|
logInfo(chalk.blue(`Using Session ID: ${chat.getSessionId()}`)); // Log the actual session ID being used
|
|
@@ -531,7 +554,8 @@ export function main() {
|
|
|
531
554
|
promptType: options.prompt && ['architect', 'code-review', 'code-review-template', 'support', 'engineer'].includes(options.prompt) ? options.prompt : null,
|
|
532
555
|
allowEdit: options.allowEdit,
|
|
533
556
|
enableBash: options.enableBash,
|
|
534
|
-
bashConfig: bashConfig
|
|
557
|
+
bashConfig: bashConfig,
|
|
558
|
+
completionPrompt: completionPrompt
|
|
535
559
|
});
|
|
536
560
|
|
|
537
561
|
// Log model/provider info using logInfo
|
package/package.json
CHANGED
package/probeChat.js
CHANGED
|
@@ -261,6 +261,7 @@ export class ProbeChat {
|
|
|
261
261
|
* @param {Array} [options.mcpServers] - MCP server configurations
|
|
262
262
|
* @param {boolean} [options.enableBash=false] - Enable bash command execution
|
|
263
263
|
* @param {Object} [options.bashConfig] - Bash configuration options
|
|
264
|
+
* @param {string} [options.completionPrompt] - Custom prompt to run after attempt_completion for validation/review (runs before mermaid/JSON validation)
|
|
264
265
|
*/
|
|
265
266
|
constructor(options = {}) {
|
|
266
267
|
this.isNonInteractive = options.isNonInteractive || process.env.PROBE_NON_INTERACTIVE === '1';
|