antgroup / antgroup/YASA-Engine

[OSS26] 关键词搜索文件路径 search_files_by_keyword

Open
#131 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OSS26-Good First Issue
Dominant language
TypeScript
Stars
323
Forks
40
PR merge metrics
No merged PRs in 30d

Description

接口介绍

按文件名或路径关键词在指定代码仓库内检索文件,返回命中文件的路径、文件名、大小与语言标识,支持扩展名过滤。

工具名

search_files_by_keyword

背景与目标

LLM Agent 经常需要先按"业务关键词"找到相关源文件再深入分析。例如要审计登录链路时,先搜 Login / Auth 相关文件;要审计文件上传时搜 Upload。这是代码搜索的"文件维度"补集,与 search_code_by_keyword 配套使用。

输入参数
参数 类型 必填 说明
keyword string 文件名或路径关键词
repository_path string 仓库本地绝对路径
is_regex bool 默认 false
match_target enum(filename, fullpath) 默认 filename;fullpath 时匹配整条路径
extensions string[] 限定扩展名,如 ["java", "kt"]
max_results int 默认 200
输出结构
{
  "total_matches": 7,
  "results": [
    {
      "file_path": "src/main/java/com/example/auth/LoginController.java",
      "filename": "LoginController.java",
      "size_bytes": 4821,
      "language": "java"
    }
  ]
}
验收标准
  • 1 万文件量级仓库响应 < 1s
  • 默认排除 .git/node_modules/target/build/dist/
  • extensions 过滤生效
  • 单元测试覆盖:正则模式、空仓库、超大量结果截断
预估工作量

0.5-1 人日(适合新手熟悉项目结构)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the search_files_by_keyword tool entry point and the existing search_code_by_keyword implementation to understand how tools accept parameters and return results. Add the specified filename/path matching, extension filtering, directory exclusions, result limit, and metadata, then add unit tests for regex mode, an empty repository, and truncation of large result sets. Confirm the tool meets the stated response-time target on a repository of about 10,000 files.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.