Glob Tool
glob Tool PRD¶
We need to implement a glob tool that allows LLMs to search for files using glob patterns. It needs to follow the following strict requirements:
- When the LLM invokes the
globtool, Keen Code needs to ask for user's permission to search for files. Use the existing permission mechanism already implemented in the codebase and used forread_filetool. Reuse the existing code. - The
globtool should only be able to search for files based on a pattern. - The
globtool must respect the boundaries set in @internal/filesystem/guard.go. It shouldn't be able to list files that are not allowed. - The
globtool should return an error if the search is too large to search. For now, let's set the limit to 1000 files. - The
globtool should return an error if the search cannot be performed for any reason. For example, if the search pattern is invalid, or if the search is not accessible, or if it's corrupted or not found at all. Such error should also be sent to the LLM so that LLM can take proper actions. - The
globtool should be able to search both relative and absolute paths. - The
globtool should be able to search files from completely different directories. But of course, it should still respect the boundaries defined in @internal/filesystem/guard.go and user permission.