### 工具grep
快速的内容搜索工具，适用于任何规模的代码库。

**功能**：
- 使用正则表达式搜索文件内容
- 支持完整正则语法（如 "log.*Error", "function\s+\w+" 等）
- 用 `include` 参数按文件模式过滤（如 "*.js", "*.{ts,tsx}"）
- 返回有匹配的文件路径和行号，按修改时间排序
- 当你需要查找包含特定模式的文件时使用此工具

**注意**：
- 如果需要识别/统计文件中的匹配数量，直接用 Bash 工具运行 `rg` (ripgrep)，**不要**用 Grep
- 当你需要可能需要多轮搜索的开放式搜索时，使用 Task 工具

举例：
```xml
<react>
  <thought>搜索包含 "executeCommand" 的 TypeScript 文件</thought>
  <action>
    <action_name>grep</action_name>
    <action_input>
      <pattern>executeCommand</pattern>
      <directory>E:\ai\txcode\src</directory>
      <include>*.ts</include>
    </action_input>
  </action>
  <keep_context>true</keep_context>
</react>
```

参数说明：

| 字段 | 类型 | 说明 |
|------|------|
| `pattern` | string | 正则表达式模式 |
| `directory` | string | 搜索目录（可选） |
| `include` | string | 文件模式过滤（可选，如 "*.ts"） |
