feat(tools): glob + grep read-only workspace search tools
Weak local models reached for shell find/grep -r (unjailed, dumps .gitignore'd trees, floods context) to answer 'does frontend/ exist?' / 'where is symbol X?'. Add two jailed, gitignore-aware read-only tools: - GlobTool (name 'glob', T1, FILE_READ+DIRECTORY_LIST): find files by glob pattern; survey-exempt from anti-hallucination read gates like list_dir. - GrepTool (name 'grep', T1, FILE_READ): regex content search, returns path:line: text; skips gitignored, binary (NUL), and >2MB files. Both reuse GitignoreMatcher + PathJail from the filesystem package, share FileReadTool's jail/anchor/toggle, cap at 200 results. Registered in ToolConfig.buildTools (fileRead block) and added to StageConfig.ALWAYS_AVAILABLE_READ_TOOLS so every tool-granting stage can call them. 6 tests green. Vikunja #37.
This commit is contained in:
@@ -66,6 +66,6 @@ data class StageConfig(
|
||||
|
||||
companion object {
|
||||
/** Read-only tools every tool-granting stage may call regardless of its declared set. */
|
||||
val ALWAYS_AVAILABLE_READ_TOOLS: Set<String> = setOf("file_read", "list_dir")
|
||||
val ALWAYS_AVAILABLE_READ_TOOLS: Set<String> = setOf("file_read", "list_dir", "glob", "grep")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user