feat(tools): add glob tool with timeout protection

- Override OpenCode's built-in glob with 60s timeout
- Kill process on expiration to prevent indefinite hanging
- Reuse grep's CLI resolver for ripgrep detection

Generated by [OpenCode](https://opencode.ai/)
This commit is contained in:
YeonGyu-Kim
2025-12-08 14:04:37 +09:00
parent b77dd2fcdf
commit ed3d7a55f4
9 changed files with 241 additions and 0 deletions

View File

@@ -190,6 +190,12 @@ OpenCode 는 아주 확장가능하고 아주 커스터마이저블합니다.
- 기본 grep 도구는 시간제한이 걸려있지 않습니다. 대형 코드베이스에서 광범위한 패턴을 검색하면 CPU가 폭발하고 무한히 멈출 수 있습니다.
- 이 도구는 엄격한 제한을 적용하며, 내장 `grep`을 완전히 대체합니다.
#### Glob
- **glob**: 타임아웃 보호가 있는 파일 패턴 매칭 (60초). OpenCode 내장 `glob` 도구를 대체합니다.
- 기본 `glob`은 타임아웃이 없습니다. ripgrep이 멈추면 무한정 대기합니다.
- 이 도구는 타임아웃을 강제하고 만료 시 프로세스를 종료합니다.
#### 내장 MCPs
- **websearch_exa**: Exa AI 웹 검색. 실시간 웹 검색과 콘텐츠 스크래핑을 수행합니다. 관련 웹사이트에서 LLM에 최적화된 컨텍스트를 반환합니다.