mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
Add concatenation tool (#130)
* Adding a tool inspired by files-to-prompt that will recursivly read through all the files in a directory (guarded by targetDir) and concatenate those files for the model. Ignores common build artifacts and non-text files. * Migraded glob logic to fast-glob. Buffed the tool description to give more guidance to the model. Incorporated reveiw feedback. * lint and error checking.
This commit is contained in:
@@ -17,6 +17,7 @@ import { EditTool } from '../tools/edit.js';
|
||||
import { TerminalTool } from '../tools/terminal.js';
|
||||
import { WriteFileTool } from '../tools/write-file.js';
|
||||
import { WebFetchTool } from '../tools/web-fetch.js';
|
||||
import { ReadManyFilesTool } from '../tools/read-many-files.js';
|
||||
|
||||
const DEFAULT_PASSTHROUGH_COMMANDS = ['ls', 'git', 'npm'];
|
||||
|
||||
@@ -130,6 +131,7 @@ function createToolRegistry(config: Config): ToolRegistry {
|
||||
new TerminalTool(targetDir, config),
|
||||
new WriteFileTool(targetDir),
|
||||
new WebFetchTool(), // Note: WebFetchTool takes no arguments
|
||||
new ReadManyFilesTool(targetDir),
|
||||
];
|
||||
for (const tool of tools) {
|
||||
registry.registerTool(tool);
|
||||
|
||||
Reference in New Issue
Block a user