@probelabs/probe 0.6.0-rc212 → 0.6.0-rc213
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-rc213-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc213-aarch64-unknown-linux-musl.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc213-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc213-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc213-x86_64-unknown-linux-musl.tar.gz +0 -0
- package/build/agent/index.js +34 -19
- package/build/tools/analyzeAll.js +36 -18
- package/build/tools/common.js +1 -1
- package/cjs/agent/ProbeAgent.cjs +34 -19
- package/cjs/index.cjs +34 -19
- package/package.json +1 -1
- package/src/tools/analyzeAll.js +36 -18
- package/src/tools/common.js +1 -1
- package/bin/binaries/probe-v0.6.0-rc212-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc212-aarch64-unknown-linux-musl.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc212-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc212-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc212-x86_64-unknown-linux-musl.tar.gz +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/build/agent/index.js
CHANGED
|
@@ -4250,28 +4250,44 @@ ${chunkSummaries}`;
|
|
|
4250
4250
|
}
|
|
4251
4251
|
async function planAnalysis(question, path9, options) {
|
|
4252
4252
|
if (options.debug) {
|
|
4253
|
-
console.error(`[analyze_all] Phase 1: Planning analysis strategy...`);
|
|
4253
|
+
console.error(`[analyze_all] Phase 1: Planning analysis strategy (with exploration)...`);
|
|
4254
4254
|
}
|
|
4255
|
-
const planningTask = `
|
|
4255
|
+
const planningTask = `You are planning a bulk data analysis. Your goal is to find the BEST search strategy through exploration and experimentation.
|
|
4256
4256
|
|
|
4257
|
-
"${question}"
|
|
4257
|
+
QUESTION TO ANSWER: "${question}"
|
|
4258
|
+
SEARCH SCOPE: ${path9}
|
|
4259
|
+
|
|
4260
|
+
YOUR TASK: Explore, experiment, then plan.
|
|
4261
|
+
|
|
4262
|
+
STEP 1: EXPLORE THE REPOSITORY STRUCTURE
|
|
4263
|
+
Use listFiles to understand:
|
|
4264
|
+
- What types of files exist? (code, markdown, configs, etc.)
|
|
4265
|
+
- What are the naming patterns? (e.g., "Playbook", "Debrief", "spec", "test")
|
|
4266
|
+
- What directories and subdirectories exist?
|
|
4267
|
+
|
|
4268
|
+
STEP 2: TEST DIFFERENT SEARCH QUERIES
|
|
4269
|
+
Run several experimental searches to find what works:
|
|
4270
|
+
- Try different keyword combinations related to the question
|
|
4271
|
+
- Test queries based on file naming patterns you discovered
|
|
4272
|
+
- Check which queries return relevant results vs empty results
|
|
4273
|
+
- Iterate until you find queries that actually return data
|
|
4258
4274
|
|
|
4259
|
-
|
|
4275
|
+
For example, if looking for customer data:
|
|
4276
|
+
- First try: search for "customer" - see what comes back
|
|
4277
|
+
- If empty, try: search for "playbook" or "debrief" (common doc names)
|
|
4278
|
+
- Check the actual content to understand terminology used
|
|
4260
4279
|
|
|
4261
|
-
|
|
4280
|
+
STEP 3: CREATE THE FINAL PLAN
|
|
4281
|
+
Based on your experiments, output the BEST search strategy.
|
|
4262
4282
|
|
|
4263
|
-
|
|
4283
|
+
Use attempt_completion with this EXACT format:
|
|
4284
|
+
|
|
4285
|
+
SEARCH_QUERY: <the query that WORKED in your experiments - use OR for multiple terms>
|
|
4264
4286
|
AGGREGATION: <summarize | list_unique | count | group_by>
|
|
4265
4287
|
EXTRACTION_PROMPT: <what to extract from each search result>
|
|
4266
|
-
REASONING: <
|
|
4267
|
-
|
|
4268
|
-
Example plan:
|
|
4269
|
-
SEARCH_QUERY: export OR function OR class OR tool
|
|
4270
|
-
AGGREGATION: list_unique
|
|
4271
|
-
EXTRACTION_PROMPT: Extract tool names and their purpose
|
|
4272
|
-
REASONING: Using list_unique to deduplicate tool definitions
|
|
4288
|
+
REASONING: <what you discovered, what queries you tested, why the final query works>
|
|
4273
4289
|
|
|
4274
|
-
|
|
4290
|
+
CRITICAL: Do NOT guess keywords. Actually run searches and see what returns results!`;
|
|
4275
4291
|
try {
|
|
4276
4292
|
const result = await delegate({
|
|
4277
4293
|
task: planningTask,
|
|
@@ -4284,10 +4300,9 @@ IMPORTANT: Use attempt_completion immediately with your plan. Do NOT try to sear
|
|
|
4284
4300
|
tracer: options.tracer,
|
|
4285
4301
|
enableBash: false,
|
|
4286
4302
|
promptType: "code-researcher",
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
timeout: 60
|
|
4303
|
+
// Full tool access for exploration and experimentation
|
|
4304
|
+
maxIterations: 15,
|
|
4305
|
+
timeout: 180
|
|
4291
4306
|
});
|
|
4292
4307
|
const plan = parsePlanningResult(stripResultTags(result));
|
|
4293
4308
|
if (options.debug) {
|
|
@@ -9610,7 +9625,7 @@ var init_common = __esm({
|
|
|
9610
9625
|
env: external_exports.record(external_exports.string()).optional().describe("Additional environment variables (optional)")
|
|
9611
9626
|
});
|
|
9612
9627
|
analyzeAllSchema = external_exports.object({
|
|
9613
|
-
question: external_exports.string().min(1).describe('Free-form question to answer (e.g., "What features are customers using?", "List all API endpoints"). The AI will automatically
|
|
9628
|
+
question: external_exports.string().min(1).describe('Free-form question to answer (e.g., "What features are customers using?", "List all API endpoints"). The AI will automatically explore the repository, test search strategies, and synthesize a comprehensive answer.'),
|
|
9614
9629
|
path: external_exports.string().optional().default(".").describe("Directory path to search in")
|
|
9615
9630
|
});
|
|
9616
9631
|
attemptCompletionSchema = {
|
|
@@ -339,6 +339,8 @@ Organize all findings into clear categories with items listed under each.${compl
|
|
|
339
339
|
|
|
340
340
|
/**
|
|
341
341
|
* PHASE 1: Planning - Analyze the question and determine optimal strategy
|
|
342
|
+
* Uses a full agent that can explore the repository to understand its structure
|
|
343
|
+
* before creating the search plan.
|
|
342
344
|
* @param {string} question - The user's free-form question
|
|
343
345
|
* @param {string} path - Path to search in
|
|
344
346
|
* @param {Object} options - Delegate options
|
|
@@ -346,32 +348,48 @@ Organize all findings into clear categories with items listed under each.${compl
|
|
|
346
348
|
*/
|
|
347
349
|
async function planAnalysis(question, path, options) {
|
|
348
350
|
if (options.debug) {
|
|
349
|
-
console.error(`[analyze_all] Phase 1: Planning analysis strategy...`);
|
|
351
|
+
console.error(`[analyze_all] Phase 1: Planning analysis strategy (with exploration)...`);
|
|
350
352
|
}
|
|
351
353
|
|
|
352
|
-
const planningTask = `
|
|
354
|
+
const planningTask = `You are planning a bulk data analysis. Your goal is to find the BEST search strategy through exploration and experimentation.
|
|
353
355
|
|
|
354
|
-
"${question}"
|
|
356
|
+
QUESTION TO ANSWER: "${question}"
|
|
357
|
+
SEARCH SCOPE: ${path}
|
|
358
|
+
|
|
359
|
+
YOUR TASK: Explore, experiment, then plan.
|
|
360
|
+
|
|
361
|
+
STEP 1: EXPLORE THE REPOSITORY STRUCTURE
|
|
362
|
+
Use listFiles to understand:
|
|
363
|
+
- What types of files exist? (code, markdown, configs, etc.)
|
|
364
|
+
- What are the naming patterns? (e.g., "Playbook", "Debrief", "spec", "test")
|
|
365
|
+
- What directories and subdirectories exist?
|
|
366
|
+
|
|
367
|
+
STEP 2: TEST DIFFERENT SEARCH QUERIES
|
|
368
|
+
Run several experimental searches to find what works:
|
|
369
|
+
- Try different keyword combinations related to the question
|
|
370
|
+
- Test queries based on file naming patterns you discovered
|
|
371
|
+
- Check which queries return relevant results vs empty results
|
|
372
|
+
- Iterate until you find queries that actually return data
|
|
355
373
|
|
|
356
|
-
|
|
374
|
+
For example, if looking for customer data:
|
|
375
|
+
- First try: search for "customer" - see what comes back
|
|
376
|
+
- If empty, try: search for "playbook" or "debrief" (common doc names)
|
|
377
|
+
- Check the actual content to understand terminology used
|
|
357
378
|
|
|
358
|
-
|
|
379
|
+
STEP 3: CREATE THE FINAL PLAN
|
|
380
|
+
Based on your experiments, output the BEST search strategy.
|
|
359
381
|
|
|
360
|
-
|
|
382
|
+
Use attempt_completion with this EXACT format:
|
|
383
|
+
|
|
384
|
+
SEARCH_QUERY: <the query that WORKED in your experiments - use OR for multiple terms>
|
|
361
385
|
AGGREGATION: <summarize | list_unique | count | group_by>
|
|
362
386
|
EXTRACTION_PROMPT: <what to extract from each search result>
|
|
363
|
-
REASONING: <
|
|
364
|
-
|
|
365
|
-
Example plan:
|
|
366
|
-
SEARCH_QUERY: export OR function OR class OR tool
|
|
367
|
-
AGGREGATION: list_unique
|
|
368
|
-
EXTRACTION_PROMPT: Extract tool names and their purpose
|
|
369
|
-
REASONING: Using list_unique to deduplicate tool definitions
|
|
387
|
+
REASONING: <what you discovered, what queries you tested, why the final query works>
|
|
370
388
|
|
|
371
|
-
|
|
389
|
+
CRITICAL: Do NOT guess keywords. Actually run searches and see what returns results!`;
|
|
372
390
|
|
|
373
391
|
try {
|
|
374
|
-
// Planning phase -
|
|
392
|
+
// Planning phase - full agent with exploration capabilities
|
|
375
393
|
const result = await delegate({
|
|
376
394
|
task: planningTask,
|
|
377
395
|
debug: options.debug,
|
|
@@ -383,9 +401,9 @@ IMPORTANT: Use attempt_completion immediately with your plan. Do NOT try to sear
|
|
|
383
401
|
tracer: options.tracer,
|
|
384
402
|
enableBash: false,
|
|
385
403
|
promptType: 'code-researcher',
|
|
386
|
-
|
|
387
|
-
maxIterations:
|
|
388
|
-
timeout:
|
|
404
|
+
// Full tool access for exploration and experimentation
|
|
405
|
+
maxIterations: 15,
|
|
406
|
+
timeout: 180
|
|
389
407
|
});
|
|
390
408
|
|
|
391
409
|
const plan = parsePlanningResult(stripResultTags(result));
|
package/build/tools/common.js
CHANGED
|
@@ -47,7 +47,7 @@ export const bashSchema = z.object({
|
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
export const analyzeAllSchema = z.object({
|
|
50
|
-
question: z.string().min(1).describe('Free-form question to answer (e.g., "What features are customers using?", "List all API endpoints"). The AI will automatically
|
|
50
|
+
question: z.string().min(1).describe('Free-form question to answer (e.g., "What features are customers using?", "List all API endpoints"). The AI will automatically explore the repository, test search strategies, and synthesize a comprehensive answer.'),
|
|
51
51
|
path: z.string().optional().default('.').describe('Directory path to search in')
|
|
52
52
|
});
|
|
53
53
|
|
package/cjs/agent/ProbeAgent.cjs
CHANGED
|
@@ -33576,28 +33576,44 @@ ${chunkSummaries}`;
|
|
|
33576
33576
|
}
|
|
33577
33577
|
async function planAnalysis(question, path9, options) {
|
|
33578
33578
|
if (options.debug) {
|
|
33579
|
-
console.error(`[analyze_all] Phase 1: Planning analysis strategy...`);
|
|
33579
|
+
console.error(`[analyze_all] Phase 1: Planning analysis strategy (with exploration)...`);
|
|
33580
33580
|
}
|
|
33581
|
-
const planningTask = `
|
|
33581
|
+
const planningTask = `You are planning a bulk data analysis. Your goal is to find the BEST search strategy through exploration and experimentation.
|
|
33582
33582
|
|
|
33583
|
-
"${question}"
|
|
33583
|
+
QUESTION TO ANSWER: "${question}"
|
|
33584
|
+
SEARCH SCOPE: ${path9}
|
|
33585
|
+
|
|
33586
|
+
YOUR TASK: Explore, experiment, then plan.
|
|
33587
|
+
|
|
33588
|
+
STEP 1: EXPLORE THE REPOSITORY STRUCTURE
|
|
33589
|
+
Use listFiles to understand:
|
|
33590
|
+
- What types of files exist? (code, markdown, configs, etc.)
|
|
33591
|
+
- What are the naming patterns? (e.g., "Playbook", "Debrief", "spec", "test")
|
|
33592
|
+
- What directories and subdirectories exist?
|
|
33593
|
+
|
|
33594
|
+
STEP 2: TEST DIFFERENT SEARCH QUERIES
|
|
33595
|
+
Run several experimental searches to find what works:
|
|
33596
|
+
- Try different keyword combinations related to the question
|
|
33597
|
+
- Test queries based on file naming patterns you discovered
|
|
33598
|
+
- Check which queries return relevant results vs empty results
|
|
33599
|
+
- Iterate until you find queries that actually return data
|
|
33584
33600
|
|
|
33585
|
-
|
|
33601
|
+
For example, if looking for customer data:
|
|
33602
|
+
- First try: search for "customer" - see what comes back
|
|
33603
|
+
- If empty, try: search for "playbook" or "debrief" (common doc names)
|
|
33604
|
+
- Check the actual content to understand terminology used
|
|
33586
33605
|
|
|
33587
|
-
|
|
33606
|
+
STEP 3: CREATE THE FINAL PLAN
|
|
33607
|
+
Based on your experiments, output the BEST search strategy.
|
|
33588
33608
|
|
|
33589
|
-
|
|
33609
|
+
Use attempt_completion with this EXACT format:
|
|
33610
|
+
|
|
33611
|
+
SEARCH_QUERY: <the query that WORKED in your experiments - use OR for multiple terms>
|
|
33590
33612
|
AGGREGATION: <summarize | list_unique | count | group_by>
|
|
33591
33613
|
EXTRACTION_PROMPT: <what to extract from each search result>
|
|
33592
|
-
REASONING: <
|
|
33593
|
-
|
|
33594
|
-
Example plan:
|
|
33595
|
-
SEARCH_QUERY: export OR function OR class OR tool
|
|
33596
|
-
AGGREGATION: list_unique
|
|
33597
|
-
EXTRACTION_PROMPT: Extract tool names and their purpose
|
|
33598
|
-
REASONING: Using list_unique to deduplicate tool definitions
|
|
33614
|
+
REASONING: <what you discovered, what queries you tested, why the final query works>
|
|
33599
33615
|
|
|
33600
|
-
|
|
33616
|
+
CRITICAL: Do NOT guess keywords. Actually run searches and see what returns results!`;
|
|
33601
33617
|
try {
|
|
33602
33618
|
const result = await delegate({
|
|
33603
33619
|
task: planningTask,
|
|
@@ -33610,10 +33626,9 @@ IMPORTANT: Use attempt_completion immediately with your plan. Do NOT try to sear
|
|
|
33610
33626
|
tracer: options.tracer,
|
|
33611
33627
|
enableBash: false,
|
|
33612
33628
|
promptType: "code-researcher",
|
|
33613
|
-
|
|
33614
|
-
|
|
33615
|
-
|
|
33616
|
-
timeout: 60
|
|
33629
|
+
// Full tool access for exploration and experimentation
|
|
33630
|
+
maxIterations: 15,
|
|
33631
|
+
timeout: 180
|
|
33617
33632
|
});
|
|
33618
33633
|
const plan = parsePlanningResult(stripResultTags(result));
|
|
33619
33634
|
if (options.debug) {
|
|
@@ -38936,7 +38951,7 @@ var init_common2 = __esm({
|
|
|
38936
38951
|
env: external_exports.record(external_exports.string()).optional().describe("Additional environment variables (optional)")
|
|
38937
38952
|
});
|
|
38938
38953
|
analyzeAllSchema = external_exports.object({
|
|
38939
|
-
question: external_exports.string().min(1).describe('Free-form question to answer (e.g., "What features are customers using?", "List all API endpoints"). The AI will automatically
|
|
38954
|
+
question: external_exports.string().min(1).describe('Free-form question to answer (e.g., "What features are customers using?", "List all API endpoints"). The AI will automatically explore the repository, test search strategies, and synthesize a comprehensive answer.'),
|
|
38940
38955
|
path: external_exports.string().optional().default(".").describe("Directory path to search in")
|
|
38941
38956
|
});
|
|
38942
38957
|
attemptCompletionSchema = {
|
package/cjs/index.cjs
CHANGED
|
@@ -38267,7 +38267,7 @@ var init_common2 = __esm({
|
|
|
38267
38267
|
env: external_exports.record(external_exports.string()).optional().describe("Additional environment variables (optional)")
|
|
38268
38268
|
});
|
|
38269
38269
|
analyzeAllSchema = external_exports.object({
|
|
38270
|
-
question: external_exports.string().min(1).describe('Free-form question to answer (e.g., "What features are customers using?", "List all API endpoints"). The AI will automatically
|
|
38270
|
+
question: external_exports.string().min(1).describe('Free-form question to answer (e.g., "What features are customers using?", "List all API endpoints"). The AI will automatically explore the repository, test search strategies, and synthesize a comprehensive answer.'),
|
|
38271
38271
|
path: external_exports.string().optional().default(".").describe("Directory path to search in")
|
|
38272
38272
|
});
|
|
38273
38273
|
attemptCompletionSchema = {
|
|
@@ -99652,28 +99652,44 @@ ${chunkSummaries}`;
|
|
|
99652
99652
|
}
|
|
99653
99653
|
async function planAnalysis(question, path9, options) {
|
|
99654
99654
|
if (options.debug) {
|
|
99655
|
-
console.error(`[analyze_all] Phase 1: Planning analysis strategy...`);
|
|
99655
|
+
console.error(`[analyze_all] Phase 1: Planning analysis strategy (with exploration)...`);
|
|
99656
99656
|
}
|
|
99657
|
-
const planningTask = `
|
|
99657
|
+
const planningTask = `You are planning a bulk data analysis. Your goal is to find the BEST search strategy through exploration and experimentation.
|
|
99658
99658
|
|
|
99659
|
-
"${question}"
|
|
99659
|
+
QUESTION TO ANSWER: "${question}"
|
|
99660
|
+
SEARCH SCOPE: ${path9}
|
|
99661
|
+
|
|
99662
|
+
YOUR TASK: Explore, experiment, then plan.
|
|
99663
|
+
|
|
99664
|
+
STEP 1: EXPLORE THE REPOSITORY STRUCTURE
|
|
99665
|
+
Use listFiles to understand:
|
|
99666
|
+
- What types of files exist? (code, markdown, configs, etc.)
|
|
99667
|
+
- What are the naming patterns? (e.g., "Playbook", "Debrief", "spec", "test")
|
|
99668
|
+
- What directories and subdirectories exist?
|
|
99669
|
+
|
|
99670
|
+
STEP 2: TEST DIFFERENT SEARCH QUERIES
|
|
99671
|
+
Run several experimental searches to find what works:
|
|
99672
|
+
- Try different keyword combinations related to the question
|
|
99673
|
+
- Test queries based on file naming patterns you discovered
|
|
99674
|
+
- Check which queries return relevant results vs empty results
|
|
99675
|
+
- Iterate until you find queries that actually return data
|
|
99660
99676
|
|
|
99661
|
-
|
|
99677
|
+
For example, if looking for customer data:
|
|
99678
|
+
- First try: search for "customer" - see what comes back
|
|
99679
|
+
- If empty, try: search for "playbook" or "debrief" (common doc names)
|
|
99680
|
+
- Check the actual content to understand terminology used
|
|
99662
99681
|
|
|
99663
|
-
|
|
99682
|
+
STEP 3: CREATE THE FINAL PLAN
|
|
99683
|
+
Based on your experiments, output the BEST search strategy.
|
|
99664
99684
|
|
|
99665
|
-
|
|
99685
|
+
Use attempt_completion with this EXACT format:
|
|
99686
|
+
|
|
99687
|
+
SEARCH_QUERY: <the query that WORKED in your experiments - use OR for multiple terms>
|
|
99666
99688
|
AGGREGATION: <summarize | list_unique | count | group_by>
|
|
99667
99689
|
EXTRACTION_PROMPT: <what to extract from each search result>
|
|
99668
|
-
REASONING: <
|
|
99669
|
-
|
|
99670
|
-
Example plan:
|
|
99671
|
-
SEARCH_QUERY: export OR function OR class OR tool
|
|
99672
|
-
AGGREGATION: list_unique
|
|
99673
|
-
EXTRACTION_PROMPT: Extract tool names and their purpose
|
|
99674
|
-
REASONING: Using list_unique to deduplicate tool definitions
|
|
99690
|
+
REASONING: <what you discovered, what queries you tested, why the final query works>
|
|
99675
99691
|
|
|
99676
|
-
|
|
99692
|
+
CRITICAL: Do NOT guess keywords. Actually run searches and see what returns results!`;
|
|
99677
99693
|
try {
|
|
99678
99694
|
const result = await delegate({
|
|
99679
99695
|
task: planningTask,
|
|
@@ -99686,10 +99702,9 @@ IMPORTANT: Use attempt_completion immediately with your plan. Do NOT try to sear
|
|
|
99686
99702
|
tracer: options.tracer,
|
|
99687
99703
|
enableBash: false,
|
|
99688
99704
|
promptType: "code-researcher",
|
|
99689
|
-
|
|
99690
|
-
|
|
99691
|
-
|
|
99692
|
-
timeout: 60
|
|
99705
|
+
// Full tool access for exploration and experimentation
|
|
99706
|
+
maxIterations: 15,
|
|
99707
|
+
timeout: 180
|
|
99693
99708
|
});
|
|
99694
99709
|
const plan = parsePlanningResult(stripResultTags(result));
|
|
99695
99710
|
if (options.debug) {
|
package/package.json
CHANGED
package/src/tools/analyzeAll.js
CHANGED
|
@@ -339,6 +339,8 @@ Organize all findings into clear categories with items listed under each.${compl
|
|
|
339
339
|
|
|
340
340
|
/**
|
|
341
341
|
* PHASE 1: Planning - Analyze the question and determine optimal strategy
|
|
342
|
+
* Uses a full agent that can explore the repository to understand its structure
|
|
343
|
+
* before creating the search plan.
|
|
342
344
|
* @param {string} question - The user's free-form question
|
|
343
345
|
* @param {string} path - Path to search in
|
|
344
346
|
* @param {Object} options - Delegate options
|
|
@@ -346,32 +348,48 @@ Organize all findings into clear categories with items listed under each.${compl
|
|
|
346
348
|
*/
|
|
347
349
|
async function planAnalysis(question, path, options) {
|
|
348
350
|
if (options.debug) {
|
|
349
|
-
console.error(`[analyze_all] Phase 1: Planning analysis strategy...`);
|
|
351
|
+
console.error(`[analyze_all] Phase 1: Planning analysis strategy (with exploration)...`);
|
|
350
352
|
}
|
|
351
353
|
|
|
352
|
-
const planningTask = `
|
|
354
|
+
const planningTask = `You are planning a bulk data analysis. Your goal is to find the BEST search strategy through exploration and experimentation.
|
|
353
355
|
|
|
354
|
-
"${question}"
|
|
356
|
+
QUESTION TO ANSWER: "${question}"
|
|
357
|
+
SEARCH SCOPE: ${path}
|
|
358
|
+
|
|
359
|
+
YOUR TASK: Explore, experiment, then plan.
|
|
360
|
+
|
|
361
|
+
STEP 1: EXPLORE THE REPOSITORY STRUCTURE
|
|
362
|
+
Use listFiles to understand:
|
|
363
|
+
- What types of files exist? (code, markdown, configs, etc.)
|
|
364
|
+
- What are the naming patterns? (e.g., "Playbook", "Debrief", "spec", "test")
|
|
365
|
+
- What directories and subdirectories exist?
|
|
366
|
+
|
|
367
|
+
STEP 2: TEST DIFFERENT SEARCH QUERIES
|
|
368
|
+
Run several experimental searches to find what works:
|
|
369
|
+
- Try different keyword combinations related to the question
|
|
370
|
+
- Test queries based on file naming patterns you discovered
|
|
371
|
+
- Check which queries return relevant results vs empty results
|
|
372
|
+
- Iterate until you find queries that actually return data
|
|
355
373
|
|
|
356
|
-
|
|
374
|
+
For example, if looking for customer data:
|
|
375
|
+
- First try: search for "customer" - see what comes back
|
|
376
|
+
- If empty, try: search for "playbook" or "debrief" (common doc names)
|
|
377
|
+
- Check the actual content to understand terminology used
|
|
357
378
|
|
|
358
|
-
|
|
379
|
+
STEP 3: CREATE THE FINAL PLAN
|
|
380
|
+
Based on your experiments, output the BEST search strategy.
|
|
359
381
|
|
|
360
|
-
|
|
382
|
+
Use attempt_completion with this EXACT format:
|
|
383
|
+
|
|
384
|
+
SEARCH_QUERY: <the query that WORKED in your experiments - use OR for multiple terms>
|
|
361
385
|
AGGREGATION: <summarize | list_unique | count | group_by>
|
|
362
386
|
EXTRACTION_PROMPT: <what to extract from each search result>
|
|
363
|
-
REASONING: <
|
|
364
|
-
|
|
365
|
-
Example plan:
|
|
366
|
-
SEARCH_QUERY: export OR function OR class OR tool
|
|
367
|
-
AGGREGATION: list_unique
|
|
368
|
-
EXTRACTION_PROMPT: Extract tool names and their purpose
|
|
369
|
-
REASONING: Using list_unique to deduplicate tool definitions
|
|
387
|
+
REASONING: <what you discovered, what queries you tested, why the final query works>
|
|
370
388
|
|
|
371
|
-
|
|
389
|
+
CRITICAL: Do NOT guess keywords. Actually run searches and see what returns results!`;
|
|
372
390
|
|
|
373
391
|
try {
|
|
374
|
-
// Planning phase -
|
|
392
|
+
// Planning phase - full agent with exploration capabilities
|
|
375
393
|
const result = await delegate({
|
|
376
394
|
task: planningTask,
|
|
377
395
|
debug: options.debug,
|
|
@@ -383,9 +401,9 @@ IMPORTANT: Use attempt_completion immediately with your plan. Do NOT try to sear
|
|
|
383
401
|
tracer: options.tracer,
|
|
384
402
|
enableBash: false,
|
|
385
403
|
promptType: 'code-researcher',
|
|
386
|
-
|
|
387
|
-
maxIterations:
|
|
388
|
-
timeout:
|
|
404
|
+
// Full tool access for exploration and experimentation
|
|
405
|
+
maxIterations: 15,
|
|
406
|
+
timeout: 180
|
|
389
407
|
});
|
|
390
408
|
|
|
391
409
|
const plan = parsePlanningResult(stripResultTags(result));
|
package/src/tools/common.js
CHANGED
|
@@ -47,7 +47,7 @@ export const bashSchema = z.object({
|
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
export const analyzeAllSchema = z.object({
|
|
50
|
-
question: z.string().min(1).describe('Free-form question to answer (e.g., "What features are customers using?", "List all API endpoints"). The AI will automatically
|
|
50
|
+
question: z.string().min(1).describe('Free-form question to answer (e.g., "What features are customers using?", "List all API endpoints"). The AI will automatically explore the repository, test search strategies, and synthesize a comprehensive answer.'),
|
|
51
51
|
path: z.string().optional().default('.').describe('Directory path to search in')
|
|
52
52
|
});
|
|
53
53
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|