@probelabs/probe 0.6.0-rc253 → 0.6.0-rc255
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/README.md +166 -3
- package/bin/binaries/probe-v0.6.0-rc255-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc255-aarch64-unknown-linux-musl.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc255-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc255-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc255-x86_64-unknown-linux-musl.tar.gz +0 -0
- package/build/agent/ProbeAgent.d.ts +1 -1
- package/build/agent/ProbeAgent.js +51 -16
- package/build/agent/acp/tools.js +2 -1
- package/build/agent/acp/tools.test.js +2 -1
- package/build/agent/dsl/environment.js +19 -0
- package/build/agent/index.js +1512 -413
- package/build/agent/schemaUtils.js +91 -2
- package/build/agent/tools.js +0 -28
- package/build/delegate.js +3 -0
- package/build/index.js +2 -0
- package/build/tools/common.js +6 -5
- package/build/tools/edit.js +457 -65
- package/build/tools/executePlan.js +3 -1
- package/build/tools/fileTracker.js +318 -0
- package/build/tools/fuzzyMatch.js +271 -0
- package/build/tools/hashline.js +131 -0
- package/build/tools/lineEditHeuristics.js +138 -0
- package/build/tools/symbolEdit.js +119 -0
- package/build/tools/vercel.js +40 -9
- package/cjs/agent/ProbeAgent.cjs +1615 -517
- package/cjs/index.cjs +1643 -543
- package/index.d.ts +189 -1
- package/package.json +1 -1
- package/src/agent/ProbeAgent.d.ts +1 -1
- package/src/agent/ProbeAgent.js +51 -16
- package/src/agent/acp/tools.js +2 -1
- package/src/agent/acp/tools.test.js +2 -1
- package/src/agent/dsl/environment.js +19 -0
- package/src/agent/index.js +14 -3
- package/src/agent/schemaUtils.js +91 -2
- package/src/agent/tools.js +0 -28
- package/src/delegate.js +3 -0
- package/src/index.js +2 -0
- package/src/tools/common.js +6 -5
- package/src/tools/edit.js +457 -65
- package/src/tools/executePlan.js +3 -1
- package/src/tools/fileTracker.js +318 -0
- package/src/tools/fuzzyMatch.js +271 -0
- package/src/tools/hashline.js +131 -0
- package/src/tools/lineEditHeuristics.js +138 -0
- package/src/tools/symbolEdit.js +119 -0
- package/src/tools/vercel.js +40 -9
- package/bin/binaries/probe-v0.6.0-rc253-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc253-aarch64-unknown-linux-musl.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc253-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc253-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc253-x86_64-unknown-linux-musl.tar.gz +0 -0
package/src/agent/tools.js
CHANGED
|
@@ -87,7 +87,6 @@ export function createTools(configOptions) {
|
|
|
87
87
|
if (configOptions.allowEdit && isToolAllowed('create')) {
|
|
88
88
|
tools.createTool = createTool(configOptions);
|
|
89
89
|
}
|
|
90
|
-
|
|
91
90
|
return tools;
|
|
92
91
|
}
|
|
93
92
|
|
|
@@ -132,33 +131,6 @@ export {
|
|
|
132
131
|
parseXmlToolCall
|
|
133
132
|
};
|
|
134
133
|
|
|
135
|
-
// Define the implement tool XML definition
|
|
136
|
-
export const implementToolDefinition = `
|
|
137
|
-
## implement
|
|
138
|
-
Description: Implement a given task. Can modify files. Can be used ONLY if task explicitly stated that something requires modification or implementation.
|
|
139
|
-
|
|
140
|
-
Parameters:
|
|
141
|
-
- task: (required) The task description. Should be as detailed as possible, ideally pointing to exact files which needs be modified or created.
|
|
142
|
-
- autoCommits: (optional) Whether to enable auto-commits in aider. Default is false.
|
|
143
|
-
|
|
144
|
-
Usage Example:
|
|
145
|
-
|
|
146
|
-
<examples>
|
|
147
|
-
|
|
148
|
-
User: Can you implement a function to calculate Fibonacci numbers in main.js?
|
|
149
|
-
<implement>
|
|
150
|
-
<task>Implement a recursive function to calculate the nth Fibonacci number in main.js</task>
|
|
151
|
-
</implement>
|
|
152
|
-
|
|
153
|
-
User: Can you implement a function to calculate Fibonacci numbers in main.js with auto-commits?
|
|
154
|
-
<implement>
|
|
155
|
-
<task>Implement a recursive function to calculate the nth Fibonacci number in main.js</task>
|
|
156
|
-
<autoCommits>true</autoCommits>
|
|
157
|
-
</implement>
|
|
158
|
-
|
|
159
|
-
</examples>
|
|
160
|
-
`;
|
|
161
|
-
|
|
162
134
|
// Define the listFiles tool XML definition
|
|
163
135
|
export const listFilesToolDefinition = `
|
|
164
136
|
## listFiles
|
package/src/delegate.js
CHANGED
|
@@ -346,6 +346,7 @@ const DEFAULT_DELEGATE_TIMEOUT = parseInt(process.env.DELEGATE_TIMEOUT, 10) || 3
|
|
|
346
346
|
* @param {Object} [options.tracer=null] - Telemetry tracer instance
|
|
347
347
|
* @param {boolean} [options.enableBash=false] - Enable bash tool (inherited from parent)
|
|
348
348
|
* @param {Object} [options.bashConfig] - Bash configuration (inherited from parent)
|
|
349
|
+
* @param {boolean} [options.allowEdit=false] - Allow edit/create tools (inherited from parent)
|
|
349
350
|
* @param {string} [options.architectureFileName] - Architecture context filename to embed from repo root
|
|
350
351
|
* @param {string} [options.promptType='code-researcher'] - Prompt type for the subagent
|
|
351
352
|
* @param {Array<string>|null} [options.allowedTools] - Allowed tools for the subagent (null = default)
|
|
@@ -373,6 +374,7 @@ export async function delegate({
|
|
|
373
374
|
model = null,
|
|
374
375
|
enableBash = false,
|
|
375
376
|
bashConfig = null,
|
|
377
|
+
allowEdit = false,
|
|
376
378
|
architectureFileName = null,
|
|
377
379
|
promptType = 'code-researcher',
|
|
378
380
|
allowedTools = null,
|
|
@@ -462,6 +464,7 @@ export async function delegate({
|
|
|
462
464
|
model, // Inherit from parent
|
|
463
465
|
enableBash, // Inherit from parent
|
|
464
466
|
bashConfig, // Inherit from parent
|
|
467
|
+
allowEdit, // Inherit from parent
|
|
465
468
|
architectureFileName,
|
|
466
469
|
allowedTools,
|
|
467
470
|
disableTools,
|
package/src/index.js
CHANGED
|
@@ -51,6 +51,7 @@ import { searchTool, queryTool, extractTool, delegateTool, analyzeAllTool } from
|
|
|
51
51
|
import { createExecutePlanTool, getExecutePlanToolDefinition, createCleanupExecutePlanTool, getCleanupExecutePlanToolDefinition } from './tools/executePlan.js';
|
|
52
52
|
import { bashTool } from './tools/bash.js';
|
|
53
53
|
import { editTool, createTool } from './tools/edit.js';
|
|
54
|
+
import { FileTracker } from './tools/fileTracker.js';
|
|
54
55
|
import { ProbeAgent } from './agent/ProbeAgent.js';
|
|
55
56
|
import { SimpleTelemetry, SimpleAppTracer, initializeSimpleTelemetryFromOptions } from './agent/simpleTelemetry.js';
|
|
56
57
|
import { listFilesToolInstance, searchFilesToolInstance } from './agent/probeTool.js';
|
|
@@ -98,6 +99,7 @@ export {
|
|
|
98
99
|
bashTool,
|
|
99
100
|
editTool,
|
|
100
101
|
createTool,
|
|
102
|
+
FileTracker,
|
|
101
103
|
// Export tool instances
|
|
102
104
|
listFilesToolInstance,
|
|
103
105
|
searchFilesToolInstance,
|
package/src/tools/common.js
CHANGED
|
@@ -269,6 +269,8 @@ User: Read file inside the dependency
|
|
|
269
269
|
</extract>
|
|
270
270
|
|
|
271
271
|
</examples>
|
|
272
|
+
|
|
273
|
+
**Edit Integration:** The line numbers shown in extract output (e.g. "42 | code") can be used directly with the edit tool's start_line/end_line parameters for precise line-targeted editing. To edit inside a large function: extract it by symbol name first (e.g. "file.js#myFunction"), then use the line numbers from the output to make surgical edits with start_line/end_line.
|
|
272
274
|
`;
|
|
273
275
|
|
|
274
276
|
export const delegateToolDefinition = `
|
|
@@ -431,7 +433,7 @@ Capabilities:
|
|
|
431
433
|
|
|
432
434
|
export const searchDescription = 'Search code in the repository. Free-form questions are accepted, but Elasticsearch-style keyword queries work best. Use this tool first for any code-related questions.';
|
|
433
435
|
export const queryDescription = 'Search code using ast-grep structural pattern matching. Use this tool to find specific code structures like functions, classes, or methods.';
|
|
434
|
-
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.';
|
|
436
|
+
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. Line numbers from output can be used with edit start_line/end_line for precise editing.';
|
|
435
437
|
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.';
|
|
436
438
|
export const bashDescription = 'Execute bash commands for system exploration and development tasks. Secure by default with built-in allow/deny lists.';
|
|
437
439
|
export const analyzeAllDescription = 'Answer questions that require analyzing ALL matching data in the codebase. Use for aggregate questions like "What features exist?", "List all API endpoints", "Count TODO comments". The AI automatically plans the search strategy, processes all results via map-reduce, and synthesizes a comprehensive answer. WARNING: Slower than search - only use when you need complete coverage.';
|
|
@@ -450,7 +452,6 @@ export const DEFAULT_VALID_TOOLS = [
|
|
|
450
452
|
'useSkill',
|
|
451
453
|
'listFiles',
|
|
452
454
|
'searchFiles',
|
|
453
|
-
'implement',
|
|
454
455
|
'bash',
|
|
455
456
|
'task',
|
|
456
457
|
'attempt_completion'
|
|
@@ -496,9 +497,9 @@ function getValidParamsForTool(toolName) {
|
|
|
496
497
|
|
|
497
498
|
const schema = schemaMap[toolName];
|
|
498
499
|
if (!schema) {
|
|
499
|
-
// For tools without schema (listFiles, searchFiles
|
|
500
|
+
// For tools without schema (listFiles, searchFiles), return common params
|
|
500
501
|
// These are the shared params that appear across multiple tools
|
|
501
|
-
return ['path', 'directory', 'pattern', 'recursive', 'includeHidden', 'task', 'files', '
|
|
502
|
+
return ['path', 'directory', 'pattern', 'recursive', 'includeHidden', 'task', 'files', 'result'];
|
|
502
503
|
}
|
|
503
504
|
|
|
504
505
|
// For attempt_completion, it has custom validation, just return 'result'
|
|
@@ -688,7 +689,7 @@ export function detectUnrecognizedToolCall(xmlString, validTools) {
|
|
|
688
689
|
// Common tool names that AI might try to use (these should appear as top-level tags)
|
|
689
690
|
const knownToolNames = [
|
|
690
691
|
'search', 'query', 'extract', 'listFiles', 'searchFiles',
|
|
691
|
-
'listSkills', 'useSkill', 'readImage', '
|
|
692
|
+
'listSkills', 'useSkill', 'readImage', 'edit',
|
|
692
693
|
'create', 'delegate', 'bash', 'task', 'attempt_completion',
|
|
693
694
|
'attempt_complete', 'read_file', 'write_file', 'run_command',
|
|
694
695
|
'grep', 'find', 'cat', 'list_directory'
|