@probelabs/probe 0.6.0-rc154 → 0.6.0-rc159

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 (31) hide show
  1. package/bin/binaries/probe-v0.6.0-rc159-aarch64-apple-darwin.tar.gz +0 -0
  2. package/bin/binaries/probe-v0.6.0-rc159-aarch64-unknown-linux-musl.tar.gz +0 -0
  3. package/bin/binaries/probe-v0.6.0-rc159-x86_64-apple-darwin.tar.gz +0 -0
  4. package/bin/binaries/probe-v0.6.0-rc159-x86_64-pc-windows-msvc.zip +0 -0
  5. package/bin/binaries/probe-v0.6.0-rc159-x86_64-unknown-linux-musl.tar.gz +0 -0
  6. package/build/agent/ProbeAgent.d.ts +2 -0
  7. package/build/agent/ProbeAgent.js +20 -4
  8. package/build/agent/acp/server.js +1 -0
  9. package/build/agent/index.js +464 -216
  10. package/build/delegate.js +326 -201
  11. package/build/downloader.js +46 -17
  12. package/build/extractor.js +12 -12
  13. package/build/tools/vercel.js +55 -14
  14. package/build/utils.js +18 -9
  15. package/cjs/agent/ProbeAgent.cjs +478 -234
  16. package/cjs/index.cjs +41496 -41272
  17. package/package.json +2 -2
  18. package/src/agent/ProbeAgent.d.ts +2 -0
  19. package/src/agent/ProbeAgent.js +20 -4
  20. package/src/agent/acp/server.js +1 -0
  21. package/src/agent/index.js +8 -0
  22. package/src/delegate.js +326 -201
  23. package/src/downloader.js +46 -17
  24. package/src/extractor.js +12 -12
  25. package/src/tools/vercel.js +55 -14
  26. package/src/utils.js +18 -9
  27. package/bin/binaries/probe-v0.6.0-rc154-aarch64-apple-darwin.tar.gz +0 -0
  28. package/bin/binaries/probe-v0.6.0-rc154-aarch64-unknown-linux-gnu.tar.gz +0 -0
  29. package/bin/binaries/probe-v0.6.0-rc154-x86_64-apple-darwin.tar.gz +0 -0
  30. package/bin/binaries/probe-v0.6.0-rc154-x86_64-pc-windows-msvc.zip +0 -0
  31. package/bin/binaries/probe-v0.6.0-rc154-x86_64-unknown-linux-gnu.tar.gz +0 -0
@@ -13,6 +13,8 @@ export interface ProbeAgentOptions {
13
13
  promptType?: 'code-explorer' | 'engineer' | 'code-review' | 'support' | 'architect';
14
14
  /** Allow the use of the 'implement' tool for code editing */
15
15
  allowEdit?: boolean;
16
+ /** Enable the delegate tool for task distribution to subagents */
17
+ enableDelegate?: boolean;
16
18
  /** Search directory path */
17
19
  path?: string;
18
20
  /** Force specific AI provider */
@@ -18,11 +18,12 @@ import { TokenCounter } from './tokenCounter.js';
18
18
  import { InMemoryStorageAdapter } from './storage/InMemoryStorageAdapter.js';
19
19
  import { HookManager, HOOK_TYPES } from './hooks/HookManager.js';
20
20
  import { SUPPORTED_IMAGE_EXTENSIONS, IMAGE_MIME_TYPES } from './imageConfig.js';
21
- import {
21
+ import {
22
22
  createTools,
23
23
  searchToolDefinition,
24
24
  queryToolDefinition,
25
25
  extractToolDefinition,
26
+ delegateToolDefinition,
26
27
  listFilesToolDefinition,
27
28
  searchFilesToolDefinition,
28
29
  attemptCompletionToolDefinition,
@@ -75,6 +76,7 @@ export class ProbeAgent {
75
76
  * @param {string} [options.customPrompt] - Custom prompt to replace the default system message
76
77
  * @param {string} [options.promptType] - Predefined prompt type (architect, code-review, support)
77
78
  * @param {boolean} [options.allowEdit=false] - Allow the use of the 'implement' tool
79
+ * @param {boolean} [options.enableDelegate=false] - Enable the delegate tool for task distribution to subagents
78
80
  * @param {string} [options.path] - Search directory path
79
81
  * @param {string} [options.provider] - Force specific AI provider
80
82
  * @param {string} [options.model] - Override model name
@@ -97,6 +99,7 @@ export class ProbeAgent {
97
99
  this.customPrompt = options.customPrompt || null;
98
100
  this.promptType = options.promptType || 'code-explorer';
99
101
  this.allowEdit = !!options.allowEdit;
102
+ this.enableDelegate = !!options.enableDelegate;
100
103
  this.debug = options.debug || process.env.DEBUG === '1';
101
104
  this.cancelled = false;
102
105
  this.tracer = options.tracer || null;
@@ -889,6 +892,9 @@ ${attemptCompletionToolDefinition}
889
892
  if (this.allowEdit) {
890
893
  toolDefinitions += `${implementToolDefinition}\n`;
891
894
  }
895
+ if (this.enableDelegate) {
896
+ toolDefinitions += `${delegateToolDefinition}\n`;
897
+ }
892
898
 
893
899
  // Build XML tool guidelines
894
900
  let xmlToolGuidelines = `
@@ -952,7 +958,7 @@ Available Tools:
952
958
  - extract: Extract specific code blocks or lines from files.
953
959
  - listFiles: List files and directories in a specified location.
954
960
  - searchFiles: Find files matching a glob pattern with recursive search capability.
955
- ${this.allowEdit ? '- implement: Implement a feature or fix a bug using aider.\n' : ''}
961
+ ${this.allowEdit ? '- implement: Implement a feature or fix a bug using aider.\n' : ''}${this.enableDelegate ? '- delegate: Delegate big distinct tasks to specialized probe subagents.\n' : ''}
956
962
  - attempt_completion: Finalize the task and provide the result to the user.
957
963
  - attempt_complete: Quick completion using previous response (shorthand).
958
964
  `;
@@ -1323,6 +1329,9 @@ When troubleshooting:
1323
1329
  if (this.allowEdit) {
1324
1330
  validTools.push('implement');
1325
1331
  }
1332
+ if (this.enableDelegate) {
1333
+ validTools.push('delegate');
1334
+ }
1326
1335
 
1327
1336
  // Try parsing with hybrid parser that supports both native and MCP tools
1328
1337
  const nativeTools = validTools;
@@ -1462,18 +1471,24 @@ When troubleshooting:
1462
1471
 
1463
1472
  // Execute tool with tracing if available
1464
1473
  const executeToolCall = async () => {
1465
- // For delegate tool, pass current iteration and max iterations
1474
+ // For delegate tool, pass current iteration, max iterations, session ID, and config
1466
1475
  if (toolName === 'delegate') {
1467
1476
  const enhancedParams = {
1468
1477
  ...toolParams,
1469
1478
  currentIteration,
1470
1479
  maxIterations,
1480
+ parentSessionId: this.sessionId, // Pass parent session ID for tracking
1481
+ path: this.searchPath, // Inherit search path
1482
+ provider: this.provider, // Inherit AI provider
1483
+ model: this.model, // Inherit model
1471
1484
  debug: this.debug,
1472
1485
  tracer: this.tracer
1473
1486
  };
1474
-
1487
+
1475
1488
  if (this.debug) {
1476
1489
  console.log(`[DEBUG] Executing delegate tool at iteration ${currentIteration}/${maxIterations}`);
1490
+ console.log(`[DEBUG] Parent session: ${this.sessionId}`);
1491
+ console.log(`[DEBUG] Inherited config: path=${this.searchPath}, provider=${this.provider}, model=${this.model}`);
1477
1492
  console.log(`[DEBUG] Delegate task: ${toolParams.task?.substring(0, 100)}...`);
1478
1493
  }
1479
1494
 
@@ -2205,6 +2220,7 @@ Convert your previous response content into actual JSON data that follows this s
2205
2220
  customPrompt: this.customPrompt,
2206
2221
  promptType: this.promptType,
2207
2222
  allowEdit: this.allowEdit,
2223
+ enableDelegate: this.enableDelegate,
2208
2224
  path: this.allowedFolders[0], // Use first allowed folder as primary path
2209
2225
  allowedFolders: [...this.allowedFolders],
2210
2226
  provider: this.clientApiProvider,
@@ -329,6 +329,7 @@ export class ACPServer {
329
329
  provider: this.options.provider,
330
330
  model: this.options.model,
331
331
  allowEdit: this.options.allowEdit,
332
+ enableDelegate: this.options.enableDelegate,
332
333
  debug: this.options.debug,
333
334
  enableMcp: this.options.enableMcp,
334
335
  mcpConfig: this.options.mcpConfig,