@probelabs/probe 0.6.0-rc104 → 0.6.0-rc106

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.
@@ -37,6 +37,13 @@ export const delegateSchema = z.object({
37
37
  task: z.string().describe('The task to delegate to a subagent. Be specific about what needs to be accomplished.')
38
38
  });
39
39
 
40
+ export const bashSchema = z.object({
41
+ command: z.string().describe('The bash command to execute'),
42
+ workingDirectory: z.string().optional().describe('Directory to execute the command in (optional)'),
43
+ timeout: z.number().optional().describe('Command timeout in milliseconds (optional)'),
44
+ env: z.record(z.string()).optional().describe('Additional environment variables (optional)')
45
+ });
46
+
40
47
  // Schema for the attempt_completion tool - flexible validation for direct XML response
41
48
  export const attemptCompletionSchema = {
42
49
  // Custom validation that requires result parameter but allows direct XML response
@@ -277,10 +284,67 @@ I have refactored the search module according to the requirements and verified t
277
284
  </attempt_completion>
278
285
  `;
279
286
 
287
+ export const bashToolDefinition = `
288
+ ## bash
289
+ Description: Execute bash commands for system exploration and development tasks. This tool has built-in security with allow/deny lists. By default, only safe read-only commands are allowed for code exploration.
290
+
291
+ Parameters:
292
+ - command: (required) The bash command to execute
293
+ - workingDirectory: (optional) Directory to execute the command in
294
+ - timeout: (optional) Command timeout in milliseconds
295
+ - env: (optional) Additional environment variables as an object
296
+
297
+ Security: Commands are filtered through allow/deny lists for safety:
298
+ - Allowed by default: ls, cat, git status, npm list, find, grep, etc.
299
+ - Denied by default: rm -rf, sudo, npm install, dangerous system commands
300
+
301
+ Usage Examples:
302
+
303
+ <examples>
304
+
305
+ User: What files are in the src directory?
306
+ <bash>
307
+ <command>ls -la src/</command>
308
+ </bash>
309
+
310
+ User: Show me the git status
311
+ <bash>
312
+ <command>git status</command>
313
+ </bash>
314
+
315
+ User: Find all TypeScript files
316
+ <bash>
317
+ <command>find . -name "*.ts" -type f</command>
318
+ </bash>
319
+
320
+ User: Check installed npm packages
321
+ <bash>
322
+ <command>npm list --depth=0</command>
323
+ </bash>
324
+
325
+ User: Search for TODO comments in code
326
+ <bash>
327
+ <command>grep -r "TODO" src/</command>
328
+ </bash>
329
+
330
+ User: Show recent git commits
331
+ <bash>
332
+ <command>git log --oneline -10</command>
333
+ </bash>
334
+
335
+ User: Check system info
336
+ <bash>
337
+ <command>uname -a</command>
338
+ </bash>
339
+
340
+ </examples>
341
+ `;
342
+
280
343
  export const searchDescription = 'Search code in the repository using Elasticsearch-like query syntax. Use this tool first for any code-related questions.';
281
344
  export const queryDescription = 'Search code using ast-grep structural pattern matching. Use this tool to find specific code structures like functions, classes, or methods.';
282
345
  export const extractDescription = 'Extract code blocks from files based on file paths and optional line numbers. Use this tool to see complete context after finding relevant files.';
283
346
  export const delegateDescription = 'Automatically delegate big distinct tasks to specialized probe subagents within the agentic loop. Used by AI agents to break down complex requests into focused, parallel tasks.';
347
+ export const bashDescription = 'Execute bash commands for system exploration and development tasks. Secure by default with built-in allow/deny lists.';
284
348
 
285
349
  // Valid tool names that should be parsed as tool calls
286
350
  const DEFAULT_VALID_TOOLS = [
@@ -5,6 +5,7 @@
5
5
 
6
6
  // Export Vercel AI SDK tool generators
7
7
  export { searchTool, queryTool, extractTool, delegateTool } from './vercel.js';
8
+ export { bashTool } from './bash.js';
8
9
 
9
10
  // Export LangChain tools
10
11
  export { createSearchTool, createQueryTool, createExtractTool } from './langchain.js';
@@ -15,8 +16,11 @@ export {
15
16
  querySchema,
16
17
  extractSchema,
17
18
  delegateSchema,
19
+ bashSchema,
18
20
  delegateDescription,
19
21
  delegateToolDefinition,
22
+ bashDescription,
23
+ bashToolDefinition,
20
24
  attemptCompletionSchema,
21
25
  attemptCompletionToolDefinition
22
26
  } from './common.js';
@@ -26,6 +30,7 @@ export { DEFAULT_SYSTEM_MESSAGE } from './system-message.js';
26
30
 
27
31
  // For backward compatibility, create and export pre-configured tools
28
32
  import { searchTool as searchToolGenerator, queryTool as queryToolGenerator, extractTool as extractToolGenerator, delegateTool as delegateToolGenerator } from './vercel.js';
33
+ import { bashTool as bashToolGenerator } from './bash.js';
29
34
  import { DEFAULT_SYSTEM_MESSAGE } from './system-message.js';
30
35
 
31
36
  // Create default tool instances (for backward compatibility)
@@ -34,6 +39,7 @@ const tools = {
34
39
  queryTool: queryToolGenerator(),
35
40
  extractTool: extractToolGenerator(),
36
41
  delegateTool: delegateToolGenerator(),
42
+ bashTool: bashToolGenerator(),
37
43
  DEFAULT_SYSTEM_MESSAGE
38
44
  };
39
45