v0.12.4: 安全豁免 + 搜索质量 + 上下文管控 + 版本纪律 Cleanup

Fix:
- 工作空间路径安全豁免 — AppData 拦截自相矛盾,tree/list_directory 恢复正常
- 搜索自动抓取硬上限 MAX_AUTO_FETCH=8,防止上下文爆炸 132%
- 搜索结果相关性过滤 — 跳过 Canva/ChatGPT 等无关条目
- 浏览器回退 LRU 缓存 — 同 URL 10min 内不再重复渲染
- Plan Mode 任务描述固化到系统提示词 — 压缩后不丢失目标
- ephemeral 清理时机优化 — 高负载时跳过,避免 Plan 进度丢失

Refactor:
- 全项目 v0.12.0 → v0.12.4 版本号同步(7 文件)
- 版本号纪律:仅 5 白名单文件保留版本号,其余 14 源码全部清除
- docs/DEVELOPMENT.md 据实重写(目录/架构/规范/SearXNG/Harness)
- SearXNG 抓取条数输入框改为 min=1 max=8 数字框
- 代码注释中的版本标记全部移除,仅描述功能
This commit is contained in:
thzxx
2026-06-23 20:45:53 +08:00
parent 8feffd53cd
commit d3c3bacb8d
21 changed files with 488 additions and 219 deletions
+5 -1
View File
@@ -8,7 +8,7 @@ import * as fs from 'fs';
import * as path from 'path';
import { app } from 'electron';
import { mainWindow } from './main.js';
import { checkPathAllowed, checkCommandAllowed } from './tool-security.js';
import { checkPathAllowed, checkCommandAllowed, addBlocklistExemptions } from './tool-security.js';
/** 发送日志到渲染进程日志面板 */
function sendLog(level: 'info' | 'success' | 'warn' | 'error' | 'debug', message: string, detail?: string): void {
@@ -26,6 +26,8 @@ export function ensureWorkspaceDir(): void {
fs.mkdirSync(DEFAULT_WORKSPACE_DIR, { recursive: true });
sendLog('info', `📁 创建默认工作空间目录`, DEFAULT_WORKSPACE_DIR);
}
// 工作空间目录及其子目录不受安全黑名单限制
addBlocklistExemptions([DEFAULT_WORKSPACE_DIR]);
}
/** 获取当前工作空间目录(支持用户自定义) */
@@ -41,6 +43,8 @@ export function setWorkspaceDir(dir: string): void {
fs.mkdirSync(resolved, { recursive: true });
}
_workspaceDir = resolved;
// 用户自定义的工作空间目录也需安全豁免
addBlocklistExemptions([resolved]);
}
/**