feat(core): 实现先读后写验证机制
确保 write_file 和 edit_file 修改已存在的文件前必须先调用 read_file - 在 AgentToolExecutor 中添加 readFiles 状态跟踪已读文件 - 创建 read-before-write.ts hook 拦截写操作并验证 - 在 Agent 初始化时注册验证 hook - 提供 AI 友好的错误消息引导正确操作
This commit is contained in:
@@ -23,6 +23,9 @@ export {
|
||||
type ProjectConfig,
|
||||
} from './config-loader.js';
|
||||
|
||||
// Read-Before-Write Hook
|
||||
export { createReadBeforeWriteHook } from './read-before-write.js';
|
||||
|
||||
// 类型导出
|
||||
export type {
|
||||
HookType,
|
||||
|
||||
Reference in New Issue
Block a user