@probelabs/probe-chat 0.6.0-rc105 → 0.6.0-rc107

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 +65 -2
  2. package/package.json +1 -1
  3. package/probeChat.js +2 -0
package/index.js CHANGED
@@ -68,6 +68,13 @@ export function main() {
68
68
  .option('--implement-tool-config <path>', 'Path to implementation tool configuration file')
69
69
  .option('--implement-tool-list-backends', 'List available implementation tool backends')
70
70
  .option('--implement-tool-backend-info <backend>', 'Show information about a specific implementation tool backend')
71
+ .option('--enable-bash', 'Enable bash command execution for system exploration')
72
+ .option('--bash-allow <patterns>', 'Additional bash command patterns to allow (comma-separated)')
73
+ .option('--bash-deny <patterns>', 'Additional bash command patterns to deny (comma-separated)')
74
+ .option('--no-default-bash-allow', 'Disable default bash allow list (use only custom patterns)')
75
+ .option('--no-default-bash-deny', 'Disable default bash deny list (use only custom patterns)')
76
+ .option('--bash-timeout <ms>', 'Bash command timeout in milliseconds (default: 120000)')
77
+ .option('--bash-working-dir <path>', 'Default working directory for bash commands')
71
78
  .option('--trace-file [path]', 'Enable tracing to file (default: ./traces.jsonl)')
72
79
  .option('--trace-remote [endpoint]', 'Enable tracing to remote endpoint (default: http://localhost:4318/v1/traces)')
73
80
  .option('--trace-console', 'Enable tracing to console (for debugging)')
@@ -323,6 +330,58 @@ export function main() {
323
330
  const googleApiKey = process.env.GOOGLE_API_KEY;
324
331
  const hasApiKeys = !!(anthropicApiKey || openaiApiKey || googleApiKey);
325
332
 
333
+ // --- Bash Configuration Processing ---
334
+ let bashConfig = null;
335
+ if (options.enableBash) {
336
+ bashConfig = {};
337
+
338
+ // Parse allow patterns
339
+ if (options.bashAllow) {
340
+ bashConfig.allow = options.bashAllow.split(',').map(p => p.trim()).filter(p => p.length > 0);
341
+ logInfo(chalk.blue(`Bash allow patterns: ${bashConfig.allow.join(', ')}`));
342
+ }
343
+
344
+ // Parse deny patterns
345
+ if (options.bashDeny) {
346
+ bashConfig.deny = options.bashDeny.split(',').map(p => p.trim()).filter(p => p.length > 0);
347
+ logInfo(chalk.blue(`Bash deny patterns: ${bashConfig.deny.join(', ')}`));
348
+ }
349
+
350
+ // Handle default list flags
351
+ if (options.defaultBashAllow === false) {
352
+ bashConfig.disableDefaultAllow = true;
353
+ logInfo(chalk.blue('Default bash allow list disabled'));
354
+ }
355
+
356
+ if (options.defaultBashDeny === false) {
357
+ bashConfig.disableDefaultDeny = true;
358
+ logInfo(chalk.blue('Default bash deny list disabled'));
359
+ }
360
+
361
+ // Parse timeout
362
+ if (options.bashTimeout) {
363
+ const timeout = parseInt(options.bashTimeout, 10);
364
+ if (isNaN(timeout) || timeout < 1000) {
365
+ logError(chalk.red('Bash timeout must be a number >= 1000 milliseconds'));
366
+ process.exit(1);
367
+ }
368
+ bashConfig.timeout = timeout;
369
+ logInfo(chalk.blue(`Bash timeout: ${timeout}ms`));
370
+ }
371
+
372
+ // Set working directory
373
+ if (options.bashWorkingDir) {
374
+ if (!existsSync(options.bashWorkingDir)) {
375
+ logError(chalk.red(`Bash working directory does not exist: ${options.bashWorkingDir}`));
376
+ process.exit(1);
377
+ }
378
+ bashConfig.workingDirectory = realpathSync(options.bashWorkingDir);
379
+ logInfo(chalk.blue(`Bash working directory: ${bashConfig.workingDirectory}`));
380
+ }
381
+
382
+ logInfo(chalk.green('Bash command execution enabled'));
383
+ }
384
+
326
385
  // --- Web Mode (check before non-interactive to override) ---
327
386
  if (options.web) {
328
387
  if (!hasApiKeys) {
@@ -359,7 +418,9 @@ export function main() {
359
418
  isNonInteractive: true,
360
419
  customPrompt: customPrompt,
361
420
  promptType: options.prompt && ['architect', 'code-review', 'code-review-template', 'support', 'engineer'].includes(options.prompt) ? options.prompt : null,
362
- allowEdit: options.allowEdit
421
+ allowEdit: options.allowEdit,
422
+ enableBash: options.enableBash,
423
+ bashConfig: bashConfig
363
424
  });
364
425
  // Model/Provider info is logged via logInfo above if debug enabled
365
426
  logInfo(chalk.blue(`Using Session ID: ${chat.getSessionId()}`)); // Log the actual session ID being used
@@ -468,7 +529,9 @@ export function main() {
468
529
  isNonInteractive: false,
469
530
  customPrompt: customPrompt,
470
531
  promptType: options.prompt && ['architect', 'code-review', 'code-review-template', 'support', 'engineer'].includes(options.prompt) ? options.prompt : null,
471
- allowEdit: options.allowEdit
532
+ allowEdit: options.allowEdit,
533
+ enableBash: options.enableBash,
534
+ bashConfig: bashConfig
472
535
  });
473
536
 
474
537
  // Log model/provider info using logInfo
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@probelabs/probe-chat",
3
- "version": "0.6.0-rc105",
3
+ "version": "0.6.0-rc107",
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",
package/probeChat.js CHANGED
@@ -252,6 +252,8 @@ export class ProbeChat {
252
252
  * @param {boolean} [options.debug] - Enable debug mode
253
253
  * @param {boolean} [options.enableMcp=false] - Enable MCP tool integration
254
254
  * @param {Array} [options.mcpServers] - MCP server configurations
255
+ * @param {boolean} [options.enableBash=false] - Enable bash command execution
256
+ * @param {Object} [options.bashConfig] - Bash configuration options
255
257
  */
256
258
  constructor(options = {}) {
257
259
  this.isNonInteractive = options.isNonInteractive || process.env.PROBE_NON_INTERACTIVE === '1';