@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.
- package/bin/binaries/probe-v0.6.0-rc159-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc159-aarch64-unknown-linux-musl.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc159-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc159-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc159-x86_64-unknown-linux-musl.tar.gz +0 -0
- package/build/agent/ProbeAgent.d.ts +2 -0
- package/build/agent/ProbeAgent.js +20 -4
- package/build/agent/acp/server.js +1 -0
- package/build/agent/index.js +464 -216
- package/build/delegate.js +326 -201
- package/build/downloader.js +46 -17
- package/build/extractor.js +12 -12
- package/build/tools/vercel.js +55 -14
- package/build/utils.js +18 -9
- package/cjs/agent/ProbeAgent.cjs +478 -234
- package/cjs/index.cjs +41496 -41272
- package/package.json +2 -2
- package/src/agent/ProbeAgent.d.ts +2 -0
- package/src/agent/ProbeAgent.js +20 -4
- package/src/agent/acp/server.js +1 -0
- package/src/agent/index.js +8 -0
- package/src/delegate.js +326 -201
- package/src/downloader.js +46 -17
- package/src/extractor.js +12 -12
- package/src/tools/vercel.js +55 -14
- package/src/utils.js +18 -9
- package/bin/binaries/probe-v0.6.0-rc154-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc154-aarch64-unknown-linux-gnu.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc154-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc154-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc154-x86_64-unknown-linux-gnu.tar.gz +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@probelabs/probe",
|
|
3
|
-
"version": "0.6.0-
|
|
3
|
+
"version": "0.6.0-rc159",
|
|
4
4
|
"description": "Node.js wrapper for the probe code search tool",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@ai-sdk/google": "^2.0.14",
|
|
79
79
|
"@ai-sdk/openai": "^2.0.10",
|
|
80
80
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
81
|
-
"@probelabs/maid": "^0.0.
|
|
81
|
+
"@probelabs/maid": "^0.0.20",
|
|
82
82
|
"adm-zip": "^0.5.16",
|
|
83
83
|
"ai": "^5.0.0",
|
|
84
84
|
"ajv": "^8.17.1",
|
|
@@ -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 */
|
package/src/agent/ProbeAgent.js
CHANGED
|
@@ -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
|
|
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,
|
package/src/agent/acp/server.js
CHANGED
|
@@ -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,
|
package/src/agent/index.js
CHANGED
|
@@ -123,6 +123,7 @@ function parseArgs() {
|
|
|
123
123
|
provider: null,
|
|
124
124
|
model: null,
|
|
125
125
|
allowEdit: false,
|
|
126
|
+
enableDelegate: false,
|
|
126
127
|
verbose: false,
|
|
127
128
|
help: false,
|
|
128
129
|
maxIterations: null,
|
|
@@ -156,6 +157,10 @@ function parseArgs() {
|
|
|
156
157
|
config.verbose = true;
|
|
157
158
|
} else if (arg === '--allow-edit') {
|
|
158
159
|
config.allowEdit = true;
|
|
160
|
+
} else if (arg === '--enable-delegate') {
|
|
161
|
+
config.enableDelegate = true;
|
|
162
|
+
} else if (arg === '--no-delegate') {
|
|
163
|
+
config.enableDelegate = false; // Explicitly disable delegation (used by subagents)
|
|
159
164
|
} else if (arg === '--path' && i + 1 < args.length) {
|
|
160
165
|
config.path = args[++i];
|
|
161
166
|
} else if (arg === '--allowed-folders' && i + 1 < args.length) {
|
|
@@ -237,6 +242,7 @@ Options:
|
|
|
237
242
|
--provider <name> Force AI provider: anthropic, openai, google
|
|
238
243
|
--model <name> Override model name
|
|
239
244
|
--allow-edit Enable code modification capabilities
|
|
245
|
+
--enable-delegate Enable delegate tool for task distribution to subagents
|
|
240
246
|
--verbose Enable verbose output
|
|
241
247
|
--outline Use outline-xml format for code search results
|
|
242
248
|
--mcp Run as MCP server
|
|
@@ -565,6 +571,7 @@ async function main() {
|
|
|
565
571
|
model: config.model,
|
|
566
572
|
path: config.path,
|
|
567
573
|
allowEdit: config.allowEdit,
|
|
574
|
+
enableDelegate: config.enableDelegate,
|
|
568
575
|
debug: config.verbose
|
|
569
576
|
});
|
|
570
577
|
await server.start();
|
|
@@ -713,6 +720,7 @@ async function main() {
|
|
|
713
720
|
promptType: config.prompt,
|
|
714
721
|
customPrompt: systemPrompt,
|
|
715
722
|
allowEdit: config.allowEdit,
|
|
723
|
+
enableDelegate: config.enableDelegate,
|
|
716
724
|
debug: config.verbose,
|
|
717
725
|
tracer: appTracer,
|
|
718
726
|
outline: config.outline,
|