@probelabs/probe 0.6.0-rc161 → 0.6.0-rc162
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 +89 -0
- package/build/agent/ProbeAgent.js +349 -85
- package/build/agent/contextCompactor.js +271 -0
- package/build/agent/index.js +788 -84
- package/build/agent/schemaUtils.js +7 -0
- package/build/agent/xmlParsingUtils.js +24 -4
- package/build/tools/common.js +16 -1
- package/cjs/agent/ProbeAgent.cjs +823 -134
- package/cjs/index.cjs +823 -134
- package/package.json +1 -1
- package/src/agent/ProbeAgent.js +349 -85
- package/src/agent/contextCompactor.js +271 -0
- package/src/agent/index.js +30 -1
- package/src/agent/schemaUtils.js +7 -0
- package/src/agent/xmlParsingUtils.js +24 -4
- package/src/tools/common.js +16 -1
package/README.md
CHANGED
|
@@ -29,6 +29,7 @@ During installation, the package will automatically download the appropriate pro
|
|
|
29
29
|
- **Automatic Binary Management**: Automatically downloads and manages the probe binary
|
|
30
30
|
- **Direct CLI Access**: Use the probe binary directly from the command line when installed globally
|
|
31
31
|
- **MCP Server**: Built-in Model Context Protocol server for AI assistant integration
|
|
32
|
+
- **Context Window Compaction**: Automatic conversation history compression when approaching token limits
|
|
32
33
|
|
|
33
34
|
## Usage
|
|
34
35
|
|
|
@@ -92,6 +93,7 @@ const agent = new ProbeAgent({
|
|
|
92
93
|
model: 'claude-3-5-sonnet-20241022', // Optional: override model
|
|
93
94
|
allowEdit: false, // Optional: enable code modification
|
|
94
95
|
debug: true, // Optional: enable debug logging
|
|
96
|
+
allowedTools: ['*'], // Optional: filter available tools (see Tool Filtering below)
|
|
95
97
|
enableMcp: true, // Optional: enable MCP tool integration
|
|
96
98
|
mcpConfig: { // Optional: MCP configuration (see MCP section below)
|
|
97
99
|
mcpServers: {...}
|
|
@@ -215,6 +217,86 @@ const agent = new ProbeAgent({
|
|
|
215
217
|
|
|
216
218
|
See [docs/RETRY_AND_FALLBACK.md](./docs/RETRY_AND_FALLBACK.md) for complete documentation and examples.
|
|
217
219
|
|
|
220
|
+
### Tool Filtering
|
|
221
|
+
|
|
222
|
+
ProbeAgent supports filtering available tools to control what operations the AI can perform. This is useful for security, cost control, or limiting functionality to specific use cases.
|
|
223
|
+
|
|
224
|
+
```javascript
|
|
225
|
+
import { ProbeAgent } from '@probelabs/probe';
|
|
226
|
+
|
|
227
|
+
// Allow all tools (default behavior)
|
|
228
|
+
const agent1 = new ProbeAgent({
|
|
229
|
+
path: '/path/to/project',
|
|
230
|
+
allowedTools: ['*'] // or undefined
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
// Allow only specific tools (whitelist mode)
|
|
234
|
+
const agent2 = new ProbeAgent({
|
|
235
|
+
path: '/path/to/project',
|
|
236
|
+
allowedTools: ['search', 'query', 'extract']
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
// Allow all except specific tools (exclusion mode)
|
|
240
|
+
const agent3 = new ProbeAgent({
|
|
241
|
+
path: '/path/to/project',
|
|
242
|
+
allowedTools: ['*', '!bash', '!implement']
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
// Raw AI mode - no tools at all
|
|
246
|
+
const agent4 = new ProbeAgent({
|
|
247
|
+
path: '/path/to/project',
|
|
248
|
+
allowedTools: [] // or use disableTools: true
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
// Convenience flag for raw AI mode (better DX)
|
|
252
|
+
const agent5 = new ProbeAgent({
|
|
253
|
+
path: '/path/to/project',
|
|
254
|
+
disableTools: true // Clearer than allowedTools: []
|
|
255
|
+
});
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
**Available Tools:**
|
|
259
|
+
- `search` - Semantic code search
|
|
260
|
+
- `query` - Tree-sitter pattern matching
|
|
261
|
+
- `extract` - Extract code blocks
|
|
262
|
+
- `listFiles` - List files and directories
|
|
263
|
+
- `searchFiles` - Find files by glob pattern
|
|
264
|
+
- `bash` - Execute bash commands (requires `enableBash: true`)
|
|
265
|
+
- `implement` - Implement features with aider (requires `allowEdit: true`)
|
|
266
|
+
- `edit` - Edit files with exact string replacement (requires `allowEdit: true`)
|
|
267
|
+
- `create` - Create new files (requires `allowEdit: true`)
|
|
268
|
+
- `delegate` - Delegate tasks to subagents (requires `enableDelegate: true`)
|
|
269
|
+
- `attempt_completion` - Signal task completion
|
|
270
|
+
- `mcp__*` - MCP tools use the `mcp__` prefix (e.g., `mcp__filesystem__read_file`)
|
|
271
|
+
|
|
272
|
+
**MCP Tool Filtering:**
|
|
273
|
+
MCP tools follow the `mcp__toolname` naming convention. You can:
|
|
274
|
+
- Allow all MCP tools: `allowedTools: ['*']`
|
|
275
|
+
- Allow specific MCP tool: `allowedTools: ['mcp__filesystem__read_file']`
|
|
276
|
+
- Allow all from a server: `allowedTools: ['mcp__filesystem__*']` (using pattern matching)
|
|
277
|
+
- Block MCP tools: `allowedTools: ['*', '!mcp__*']`
|
|
278
|
+
|
|
279
|
+
**CLI Usage:**
|
|
280
|
+
```bash
|
|
281
|
+
# Allow only search and extract tools
|
|
282
|
+
probe agent "Explain this code" --allowed-tools search,extract
|
|
283
|
+
|
|
284
|
+
# Raw AI mode (no tools) - option 1
|
|
285
|
+
probe agent "What is this project about?" --allowed-tools none
|
|
286
|
+
|
|
287
|
+
# Raw AI mode (no tools) - option 2 (better DX)
|
|
288
|
+
probe agent "Tell me about this project" --disable-tools
|
|
289
|
+
|
|
290
|
+
# All tools (default)
|
|
291
|
+
probe agent "Analyze the architecture" --allowed-tools all
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
**Notes:**
|
|
295
|
+
- Tool filtering works in conjunction with feature flags (`allowEdit`, `enableBash`, `enableDelegate`)
|
|
296
|
+
- Both the feature flag AND `allowedTools` must permit a tool for it to be available
|
|
297
|
+
- Blocked tools will not appear in the system message and cannot be executed
|
|
298
|
+
- Use `allowedTools: []` for pure conversational AI without code analysis tools
|
|
299
|
+
|
|
218
300
|
### Using as an MCP Server
|
|
219
301
|
|
|
220
302
|
Probe includes a built-in MCP (Model Context Protocol) server for integration with AI assistants:
|
|
@@ -691,6 +773,13 @@ probe mcp --timeout 60
|
|
|
691
773
|
}
|
|
692
774
|
```
|
|
693
775
|
|
|
776
|
+
## Additional Documentation
|
|
777
|
+
|
|
778
|
+
- [Context Window Compaction](./CONTEXT_COMPACTION.md) - Automatic conversation history compression
|
|
779
|
+
- [MCP Integration](./MCP_INTEGRATION_SUMMARY.md) - Model Context Protocol support details
|
|
780
|
+
- [Delegate Tool](./DELEGATE_TOOL_README.md) - Task distribution to subagents
|
|
781
|
+
- [Maid Integration](./MAID_INTEGRATION.md) - Integration with Maid LLM framework
|
|
782
|
+
|
|
694
783
|
## Related Projects
|
|
695
784
|
|
|
696
785
|
- [probe](https://github.com/probelabs/probe) - The core probe code search tool
|