优化: AI Chat全栈多批审查修复与架构清理(risk_level清理/路由解耦/工具渲染/测试补测/死代码)

This commit is contained in:
2026-06-18 22:57:19 +08:00
parent 0ca5d9805f
commit a2871a66e0
87 changed files with 5720 additions and 3012 deletions

View File

@@ -20,6 +20,7 @@ export default {
today: '今天',
yesterday: '昨天',
earlier: '更早',
groupEmpty: '暂无',
// ── Header 按钮 ──
conversationList: '对话列表',
@@ -156,7 +157,10 @@ export default {
clearContext: '清空上下文',
compressContext: '压缩上下文',
// 二次确认(清空不可逆语义,防误触;历史归档保留不删)
clearContextConfirm: '确定清空当前对话上下文?历史消息归档保留,不影响新对话',
// 标题「清空上下文」融入正文首句;强调不可逆 + 归档分段 + AI 不再看到历史
clearContextConfirm: '清空上下文?此操作不可逆,当前对话上下文将被归档为分段(AI 将不再看到这些历史消息)。新对话不受影响。',
// 二次确认弹窗的危险按钮文案(ConfirmDialog dangerLabel);不传则回退 common.confirm
clearContextDangerLabel: '清空',
// 折叠分隔条(连续同 status 合并一条;{n}=合并的消息条数)
contextArchived: '已归档 {n} 条消息',
compressed: '已压缩上下文',

View File

@@ -13,10 +13,14 @@ export default {
executionFailedHint: '工具执行失败,详情见下方',
collapse: '收起',
expandAll: '展开全部',
expand: '展开',
collapseAll: '全部收起',
written: '已写入',
items: '项',
lines: '行',
// UX-260618-08/11:截断提示(read_file 分页截断 / list_directory 1000 上限截断)
linesTruncated: '{shown}/{total} 行,已截断',
dirTruncated: '已截断,仅前 {n} 项',
// 工具显示名(含路径摘要前缀,fallback 兜底)
readPrefix: '读取',
@@ -41,6 +45,9 @@ export default {
taskCount: '{n} 项任务',
projectCount: '{n} 个项目',
ideaCount: '{n} 条灵感',
// UX-260618-10/12:list_trash 折叠态计数 + 分页 has_more 提示(后端返 {items,total,has_more} 对象)
trashCount: '回收站 {n} 项',
listHasMore: '(已显示 {n} 项,还有更多)',
createdWithName: '已创建:{name}',
created: '已创建',
updatedField: '已更新 {field}',
@@ -52,22 +59,38 @@ export default {
purged: '已彻底删除',
purgeIneffective: '清除未生效',
workflowHint: '请到工作流页面运行',
// UX-260618-05:run_workflow tool_result 显 execution_id(workflowHint 误导——工作流已触发;旧 key 保留防他处引用)
workflowTriggered: '任务 {id} 已触发工作流(推进至 {status},执行实例 {exec})',
workflowTriggeredShort: '执行实例 {exec}',
// UX-260616-04:formatToolResult 覆盖全部工具产出人类可读摘要(补缺失 key)
updatedTaskField: '任务 {id} 已更新字段 {field}',
advancedTask: '任务 {id} 已推进至 {status}',
// UX-260618-09:advance_task 退回累加轮数(>0 才显)
advancedTaskWithRounds: '任务 {id} 已推进至 {status}(已退回 {n} 次)',
commandOk: '命令成功({ms} 毫秒)',
commandFailed: '命令失败(退出码 {code}',
commandOutputLines: '{n} 行输出',
patchedFile: '已修改 {path}(增减 {diff} 字节)',
// UX-260618-06:patch_file 多匹配提示 + size_diff 单位
patchedMatches: '匹配 {n} 处',
bytesUnit: '字节',
patchedNoChange: '{path} 无更改',
appendedTo: '已向 {path} 追加 {bytes}',
renamedFile: '已重命名 {from} → {to}',
// UX-260618-12:rename_file 字节/跨卷 + write_file 覆盖/编码提示
renamedWithBytes: '已重命名 {from} → {to}({bytes})',
renamedCrossVolume: '已移动 {from} → {to}(跨卷,{bytes})',
writeOverwrite: '覆盖 {old} → {neww}',
encodingLabel: '编码:{enc}',
foundN: '找到 {n} 项',
boundDir: '已绑定目录「{path}」技术栈:{stack}',
deleteFilePermanent: '已硬删除 {path}',
deleteFileSoft: '已软删除 {path}(已备份)',
// UX-260618-07:软删补 backup_path(回收站文件名,用户知从哪恢复)
deleteFileSoft: '已软删除 {path}(已备份,可从 {backup_path} 恢复)',
fileInfoSize: '{path} {size}',
// UX-260618-12:file_info 修改时间(epoch_ms → 客户端 toLocaleString)
fileInfoModified: ' · 修改于 {time}',
fileInfoLines: ' · {n} 行',
fileInfoBinary: ' · 二进制',
fileInfoDir: ' · 目录',

View File

@@ -0,0 +1,46 @@
export default {
auditLog: {
title: '审批历史',
refresh: '刷新',
desc: 'AI 工具调用审计记录(按请求时间倒序)。参数与结果仅展示摘要,完整数据留存本地数据库。',
loading: '加载中…',
empty: '暂无审计记录',
col: {
time: '请求时间',
tool: '工具',
risk: '风险',
status: '状态',
decided: '决策者',
args: '参数摘要',
result: '结果摘要',
},
pager: {
prev: '上一页',
next: '下一页',
page: '第 {n} 页',
last: '(末页)',
},
risk: {
low: '低',
medium: '中',
high: '高',
},
status: {
pending: '待审批',
approved: '已批准',
rejected: '已拒绝',
executing: '执行中',
completed: '已完成',
failed: '失败',
},
decided: {
human: '人工',
auto: '自动',
},
},
}

7
src/i18n/zh-CN/error.ts Normal file
View File

@@ -0,0 +1,7 @@
export default {
error: {
title: '页面渲染异常',
desc: '当前区域因内部错误无法显示,可尝试重新加载。',
retry: '重试',
},
}

View File

@@ -51,11 +51,9 @@ export default {
fetchFailedNotFound: '端点不存在,该厂商可能不支持模型列表拉取:{msg}',
toastModelEditLocalOnly: '已启用 / 权重为本地编辑,下次拉取时覆盖',
// 模型特征标签(4 维度 + 探测来源)
// 模型特征标签(模态 + 能力 + 探测来源;cost/intel 去除见 UX-260618-04)
tagModality: { text: '文本', vision: '视觉', audio: '音频', video: '视频' },
tagCapability: { tool_use: '工具调用', embedding: '向量', code_gen: '代码' },
tagCost: { free: '免费', low: '低价', medium: '中价', high: '高价' },
tagIntel: { lite: '轻量', standard: '标准', plus: '增强', ultra: '旗舰' },
tagSource: { user_set: '手动', preset_table: '预设', heuristic: '推断', default: '默认' },
// ===== 连接管理面板 =====

View File

@@ -27,6 +27,7 @@ export default {
group: {
taskCount: '{n} 个任务',
unknownProject: '未知项目',
empty: '暂无任务',
},
// 新建任务模态