Commit db8f92e
authored
feat(init): add grep and glob local-op handlers (#703)
## Summary
Adds two new local-op types so the server can search project files
without reading them all — eliminates the need for "FILE SELECTION mode"
LLM calls in many cases.
- **grep**: regex search across files with optional glob filter. Batched
— multiple patterns in one round-trip. Capped at 100 matches per search,
2000-char line truncation.
- **glob**: find files by name pattern. Batched — multiple patterns in
one round-trip. Capped at 100 results.
Both use a Node.js `fs.readdir`/`readFile` implementation (no ripgrep
dependency required). Skips `node_modules`, `.git`, `__pycache__`,
`.venv`, `dist`, `build` by default.
Server-side counterpart (schemas + step prompt updates) will come in a
separate cli-init-api PR.
## Test plan
- [x] 8 new tests: grep (single pattern, batch, include filter, no
match, path sandbox) + glob (single, batch, no match)
- [x] All 171 init tests pass
- [x] Lint clean
Made with [Cursor](https://cursor.com)1 parent 430083d commit db8f92e
4 files changed
Lines changed: 760 additions & 0 deletions
0 commit comments