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:
Allen Hutchison
2025-04-23 17:25:47 -07:00
committed by GitHub
parent d771dcbdb9
commit cf92ffab34
2 changed files with 388 additions and 0 deletions

View File

@@ -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);