优化: AI授权目录改进(误弹窗根因+安全加固)

strip_verbatim比对侧收口/黑名单统一/symlink/bind双路径reload/toast接线;cargo test 18
This commit is contained in:
2026-06-20 15:54:51 +08:00
parent e5a89165e6
commit e2ece2d898
8 changed files with 251 additions and 79 deletions

View File

@@ -111,13 +111,18 @@ export default {
// ===== F-260619-03 Phase A: AI tool allowed dirs panel =====
panelAllowedDirs: '📁 AI Tool Allowed Dirs',
descAllowedDirs: 'AI file tools (read/write/list/patch/search) can only access the following authorized directories. The project root (workspace_root) is always implicitly authorized and need not be added. Access to directories not in the list will be rejected.',
descAllowedDirs: 'AI file tools (read/write/list/patch/search) can only access the following authorized directories. The project root (devflow itself) is always implicitly authorized and need not be added. Access to directories not in the list will be rejected.',
allowedDirsLoading: 'Loading…',
allowedDirsEmpty: 'No extra authorized directories (only project root is authorized by default)',
allowedDirsInputPlaceholder: 'Enter absolute path, e.g. E:/wk-lab/u-abc',
allowedDirsSelectDir: 'Select Dir',
allowedDirsAdd: 'Add',
allowedDirsSave: 'Save',
allowedDirsReload: 'Reload',
allowedDirsLoadFail: 'Failed to load authorized directories',
allowedDirsDup: 'This directory is already in the authorized list',
allowedDirsAddFail: 'Failed to add authorized directory',
allowedDirsRemoveFail: 'Failed to remove authorized directory',
// ===== Knowledge base panel =====
panelKnowledge: '📚 Knowledge base',

View File

@@ -111,13 +111,18 @@ export default {
// ===== F-260619-03 Phase A: AI 工具授权目录面板 =====
panelAllowedDirs: '📁 AI 工具授权目录',
descAllowedDirs: 'AI 文件工具(读/写/列/改/搜等)仅可访问以下授权目录。项目根目录(workspace_root)始终隐式授权,无需在此添加。未在列表内的目录访问将被拒绝。',
descAllowedDirs: 'AI 文件工具(读/写/列/改/搜等)仅可访问以下授权目录。项目根目录(devflow 自身)始终隐式授权,无需在此添加。未在列表内的目录访问将被拒绝。',
allowedDirsLoading: '加载中…',
allowedDirsEmpty: '暂无额外授权目录(仅项目根目录默认授权)',
allowedDirsInputPlaceholder: '输入授权目录绝对路径,如 E:/wk-lab/u-abc',
allowedDirsSelectDir: '选择目录',
allowedDirsAdd: '添加',
allowedDirsSave: '保存',
allowedDirsReload: '重载',
allowedDirsLoadFail: '加载授权目录失败',
allowedDirsDup: '该目录已在授权列表中',
allowedDirsAddFail: '添加授权目录失败',
allowedDirsRemoveFail: '删除授权目录失败',
// ===== 知识库面板 =====
panelKnowledge: '📚 知识库',