文件工具

Agent 在工作区根目录内通过内置文件工具读写内容。

核心工具

工具 用途
read_file 读取文本或 Office/PDF(有大小限制)
write_file 创建或覆盖文件
edit_file 定向搜索替换
batch_edit 多文件批量编辑(v0.8.0+)
apply_patch 统一 diff 补丁
refactor_imports 导入整理辅助(代码)
list_dir 列出目录
file_info 元数据(大小、修改时间)

搜索与发现

工具 代码模式 办公模式
glob_files
file_search ✅(可合并符号索引命中)
grep_files ✅(ripgrep)

复合工具(v0.8.6+,代码):

工具 用途
explore_codebase 串联 glob → grep → read,缩短探索回合
edit_and_check 编辑后跑 scoped 测试(edit → run_tests)

仍可手搓 glob_filesgrep_filesread_file;长程任务见 LHT

办公glob_files / file_search,不用 grep_files,也不通过 shell 跑 grep

断言工具(Harness)

工具 用途
assert_file_count 按 glob 断言文件数量
assert_output_matches 断言命令输出匹配
assert_tests_pass 断言测试通过

Gate-as-Code 谓词库同源,供技能 / 门禁编排使用。

安全

界面

变更会出现在 Diff文件预览

相关:Git 工具 · 办公 I/O · Gate-as-Code