Forked from crunch3r/ai-toolbox
Forked from crunch3r/ai-toolbox
src / locales / zh-CN.ts
src / locales / zh-CN.ts
/**
* Simplified Chinese (zh-CN) translations for AI Toolbox plugin
*/
import type { FullTranslationSet } from './types';
export const zhCNTranslations: FullTranslationSet = {
fileSystem: {
categoryTitle: '📁 文件系统工具',
tools: [
{ toolName: 'list_directory', description: '列出工作区中的文件和文件夹', parameters: ['path(可选)'] },
{ toolName: 'read_file', description: '读取文本文件内容', parameters: ['file_name'] },
{ toolName: 'save_file', description: '创建或覆盖文件', parameters: ['file_name, content'] },
{ toolName: 'replace_text_in_file', description: '在文件中替换精确匹配的字符串(复杂插入/替换务必使用此工具——切勿改用 line_operations)', parameters: ['file_name, old_string, new_string'] },
{ toolName: 'insert_at_line', description: '⚠️ 仅限单次插入——多步结构性修改请改用 save_file/replace_text_in_file。在指定行号处插入文本。', parameters: ['file_name, line_number, content'] },
{ toolName: 'append_file', description: '向文件末尾追加内容', parameters: ['file_name, content'] },
{ toolName: 'delete_lines_in_file', description: '删除文件中的指定行', parameters: ['file_name, start_line, end_line(可选)'] },
{ toolName: 'line_operations', description: '类 awk 地插入/删除/重排行,无 shell 依赖;三层护栏(模式锚定、行指纹、边界校验)+ 写入后 MD5 完整性检查', parameters: ['file_name, operation, target_line or pattern anchors (+ options)'] },
{ toolName: 'make_directory', description: '创建新目录', parameters: ['directory_name'] },
{ toolName: 'move_file', description: '移动或重命名文件/目录', parameters: ['source, destination'] },
{ toolName: 'copy_file', description: '将文件复制到新位置', parameters: ['source, destination'] },
{ toolName: 'delete_path', description: '删除文件或目录(破坏性操作)', parameters: ['path'] },
{ toolName: 'delete_files_by_pattern', description: '按正则表达式模式删除文件', parameters: ['pattern(正则)'] },
{ toolName: 'find_files', description: '递归查找匹配名称模式的文件', parameters: ['pattern, max_depth(可选)'] },
{ toolName: 'fuzzy_find_local_files', description: '按名称/路径相似度模糊搜索文件', parameters: ['query, path(可选), max_results(可选)'] },
{ toolName: 'get_file_metadata', description: '获取文件大小、日期与类型信息', parameters: ['path'] },
{ toolName: 'change_directory', description: '更改工作目录', parameters: ['directory'] },
{ toolName: 'read_document', description: '读取 PDF 或 DOCX 文档', parameters: ['file_path'] },
{ toolName: 'analyze_project', description: '运行项目级 lint 分析', parameters: [] },
{ toolName: 'read_file_chunked', description: '以结构化分块读取文件,绕过字符限制;对超大文件返回起止索引以实现流式控制', parameters: ['file_name, chunk_size/max_chunks(可选)'] },
{ toolName: 'ripgrep', description: '通过 worker 隔离的 ripgrep 进行递归内容搜索——整个扫描在主线程之外执行(3 秒看门狗终止卡死的 worker);默认不区分大小写(-i);无效的 Rust 正则自动按字面量重试,并通过 pattern_mode 上报;默认排除 node_modules', parameters: ['pattern, path, mode, case_insensitive, include_glob, exclude_globs, max_depth'] },
{ toolName: 'find_replace_all', description: '跨多文件的正则搜索与替换,支持 dry-run 预览、.bak 备份和扩展名过滤——内置深度上限防挂起', parameters: ['pattern, replacement(可选), directory/dry_run/confirm (+ filters)'] },
{ toolName: 'pattern_scan', description: '递归内容搜索,以 {file, line, content} 返回匹配行;不安全正则自动降级为字面量;每文件 256 KB / 1 万行上限并记录跳过项;3 秒墙钟上限协作中止扫描 → PARTIAL 结果并置 aborted 标志', parameters: ['pattern (+ root/mode/caps options)'] },
{ toolName: 'directory_tree', description: '以树形格式可视化目录结构,支持最大深度、可选文件大小显示及自动排除大型目录', parameters: ['path/max_depth/show_size(可选)'] },
{ toolName: 'file_diff', description: '比较两个文件并返回带 +/− 标记和行号的统一 diff', parameters: ['file_a, file_b'] },
{ toolName: 'apply_patch', description: '完全在进程内应用 unified-diff 或二进制字节锚点补丁(无需 shell):按行 add/replace/context 块并附验证', parameters: ['file_path, patch_content (+ mode)'] },
],
},
webSearch: {
categoryTitle: '🌐 网络与研究工具',
tools: [
{ toolName: 'web_search', description: '通过 DuckDuckGo/Google/Bing 回退链搜索', parameters: ['query, providers(可选)'] },
{ toolName: 'wikipedia_search', description: '在维基百科中搜索页面摘要', parameters: ['query, lang(可选)'] },
{ toolName: 'fetch_web_content', description: '获取网页的纯文本内容', parameters: ['url'] },
{ toolName: 'rag_web_content', description: '基于 RAG 的语义化网页提取', parameters: ['url, query'] },
{ toolName: 'browser_session_control', description: '控制浏览器操作(点击、输入等)', parameters: ['actions 数组, read_page 标志'] },
],
},
browserAutomation: {
categoryTitle: '🌐 浏览器自动化工具',
tools: [
{ toolName: 'browser_open_page', description: '使用 Puppeteer 一次性渲染页面', parameters: ['url, screenshot_path(可选), actions(可选)'] },
{ toolName: 'browser_session_close', description: '优雅关闭持久化浏览器会话,防止遗留的 Chromium 进程', parameters: [] },
{ toolName: 'preview_html', description: '在系统默认浏览器中渲染原始 HTML 或现有 .html 文件', parameters: ['source (HTML string or path)'] },
{ toolName: 'open_file', description: '用系统默认应用打开文件/URL(Windows start / macOS open / Linux xdg-open)', parameters: ['target'] },
],
},
gitOperations: {
categoryTitle: '🐙 Git 与 GitHub 工具',
tools: [
{ toolName: 'git_status', description: '查看仓库中已修改的文件', parameters: [] },
{ toolName: 'git_diff', description: '详细查看变更内容', parameters: ['file_path(可选), cached(可选)'] },
{ toolName: 'git_commit', description: '提交暂存区的更改', parameters: ['message'] },
{ toolName: 'git_log', description: '查看提交历史', parameters: ['max_count(可选)'] },
{ toolName: 'git_add', description: '暂存指定文件或全部更改', parameters: ['paths(可选)'] },
{ toolName: 'git_checkout', description: '切换到已有分支或创建新分支', parameters: ['branch_name, create_new(可选)'] },
{ toolName: 'gh_create_issue', description: '创建新的 GitHub issue', parameters: ['title, body(可选), labels(可选)'] },
{ toolName: 'gh_list_issues', description: '列出仓库中的 issues', parameters: ['state(可选), labels(可选), limit(可选)'] },
{ toolName: 'gh_view_comments', description: '查看 issue 或 PR 的评论', parameters: ['number, type(可选)'] },
{ toolName: 'gh_create_pr', description: '创建 Pull Request', parameters: ['title, body, head_branch, base_branch(可选)'] },
{ toolName: 'gh_list_prs', description: '列出 Pull Requests', parameters: ['state(可选), limit(可选)'] },
{ toolName: 'gh_view_pr_diff', description: '获取 PR 的 diff/patch', parameters: ['number'] },
{ toolName: 'gh_push', description: '将提交推送到远程仓库', parameters: ['branch(可选)'] },
{ toolName: 'git_stash', description: '管理未提交的更改:保存、弹出、丢弃并列出 stash(原生 Git CLI——isomorphic-git 不支持 stash)', parameters: ['operation (+ options)'] },
{ toolName: 'git_blame', description: '逐行提交历史,显示作者、时间戳和哈希;路径校验可防止遍历攻击', parameters: ['file_path (+ options)'] },
],
},
databaseQueries: {
categoryTitle: '💾 数据库查询工具',
tools: [
{ toolName: 'query_database', description: '运行只读 SQLite 查询', parameters: ['query(SQL 字符串)'] },
],
},
documentParsing: {
categoryTitle: '📄 文档解析工具',
tools: [
{ toolName: 'read_document', description: '读取 PDF 或 DOCX 文档', parameters: ['file_path'] },
],
},
backgroundCommands: {
categoryTitle: '⏱️ 后台命令工具',
tools: [
{ toolName: 'run_background_command', description: '在后台启动长时间运行的进程', parameters: ['command, timeout_hours(必填), name(必填)'] },
{ toolName: 'check_background_command', description: '查看运行中命令的状态与输出', parameters: ['id'] },
{ toolName: 'cancel_background_command', description: '终止正在运行的后台命令', parameters: ['id'] },
],
},
codeRefactoring: {
categoryTitle: '🧬 代码重构工具',
tools: [
{ toolName: 'refactor_code', description: '基于 AST 的重构(Babel):重命名标识符、跨文件移动函数、提取函数、清理无用导入——语法安全,带 .bak 备份且失败时自动回滚;支持 dry-run diff', parameters: ['file_path, operation, per-operation fields, dry_run(可选)'] },
],
},
execution: {
categoryTitle: '⚡ 执行工具',
tools: [
{ toolName: 'run_javascript', description: '在隔离的 Node VM 上下文中执行 JavaScript;eval/require/child_process 被阻止,默认超时 5 秒', parameters: ['javascript, timeout_seconds(可选)'] },
{ toolName: 'run_python', description: '在受控沙箱中执行 Python;os/subprocess/sys 导入被阻止,默认超时 10 秒', parameters: ['python, timeout_seconds(可选)'] },
{ toolName: 'execute_command', description: '⚠️ 以多层净化和管道限制运行 shell 命令——默认禁用', parameters: ['command (+ options)'] },
{ toolName: 'run_in_terminal', description: '启动操作系统原生终端窗口(cmd/PowerShell/zsh/bash),支持环境变量与可见性选项', parameters: [] },
{ toolName: 'run_tests', description: '从 package.json 自动检测测试框架(Jest/Mocha/Vitest)并运行项目测试套件,返回结果', parameters: [] },
],
},
textProcessing: {
categoryTitle: '📝 文本处理工具',
tools: [
{ toolName: 'text_transform', description: '基于正则的文本替换,支持捕获组($1/$2)、行范围及全局/忽略大小写模式——比 shell sed 更安全', parameters: ['file_name, pattern, replacement(可选), flags(可选)'] },
{ toolName: 'text_extract', description: '从分隔文本(CSV/TSV/自定义)中按零基字段索引提取结构化字段', parameters: ['file_name, fields, delimiter(可选), output_format(可选)'] },
{ toolName: 'markdown_table_gen', description: '从对象数组生成有效的 Markdown 表格,支持表头、对齐与截断', parameters: ['data, headers(可选)'] },
],
},
taskPlanning: {
categoryTitle: '📋 任务规划工具',
tools: [
{ toolName: 'create_plan', description: '创建多步骤执行计划(1–30 步);替换任何活动计划并返回 planId + stepCount', parameters: ['goal, steps'] },
{ toolName: 'get_plan', description: '返回活动计划,含各步骤状态、完成百分比与已用时间;无计划时返回 null', parameters: [] },
{ toolName: 'update_plan_step', description: '通过状态机更新单个计划步骤(pending→in_progress→done;any→blocked;blocked→pending)——阻塞时必须提供 note', parameters: ['planId, index, status, note (required if blocked)'] },
{ toolName: 'remove_plan', description: '从工作状态存储中移除已持久化的计划;除非 confirm=true 否则仅返回 dry-run 预览 — 仅限未完成的计划,已完成计划会在最后一个 done 时由 update_plan_step 自动移除', parameters: ['planId, confirm (required to remove)'] },
],
},
contextManagement: {
categoryTitle: '🧠 上下文与记忆工具',
tools: [
{ toolName: 'auto_summarize_context', description: '分析近期会话活动中的模式、高频工具使用及值得记住的决策;以全局范围保存到持久化记忆', parameters: ['session_events (+ config_changes)'] },
{ toolName: 'get_context_memory', description: '按类型(decision/pattern/configuration/file_change/error/summary)检索历史上下文条目;近因×频率评分优先呈现最近且常被访问的条目', parameters: ['type(可选), limit(可选)'] },
{ toolName: 'search_context', description: '对上下文条目的标题、正文与标签进行模糊文本搜索;搜索前清理已过期的会话条目(24 小时 TTL)', parameters: ['query, max_results(可选)'] },
{ toolName: 'context_summary', description: '持久化记忆的统计概览:总条目数、按类型细分及近期活动计数', parameters: [] },
{ toolName: 'delete_context_entry', description: '按唯一 ID 删除特定上下文条目,不清除其余历史', parameters: ['entry_id'] },
{ toolName: 'clear_context_memory', description: '清除所有自动保存的上下文条目(⚠️ 不可逆;需 confirm=true)', parameters: ['confirm'] },
{ toolName: 'track_important_event', description: '手动记录事件、决策或里程碑,可加自定义标签以便分类检索', parameters: ['title, content, tags(可选)'] },
{ toolName: 'save_session_summary', description: '保存结构化会话摘要(成果、待办任务、决策),压缩存储以绕过 10k SDK 限制', parameters: ['task_description (+ optional sections)'] },
{ toolName: 'get_session_summary', description: '获取最近保存的会话摘要,对旧数据提供向后兼容的回退', parameters: [] },
{ toolName: 'save_memory', description: '将事实持久化到 .ai_toolbox_memory.msgpack 以实现跨会话连续性(RAM + 原子磁盘副本)', parameters: ['fact'] },
{ toolName: 'get_memory', description: '检索所有已保存的记忆条目;先查本地项目文件,再查持久化存储', parameters: [] },
{ toolName: 'delete_memory', description: '按唯一键删除特定记忆条目(保存时返回该键)', parameters: ['entry_id'] },
{ toolName: 'list_sessions', description: '分页浏览已保存的会话摘要,支持限制控制', parameters: ['limit(可选), offset(可选)'] },
{ toolName: 'search_sessions', description: '对已存储的会话摘要进行关键词搜索,最新优先', parameters: ['query, max_results(可选)'] },
{ toolName: 'clear_session_index', description: '仅删除所有轻量级会话索引条目——摘要不受影响(需 confirm=true)', parameters: ['confirm'] },
{ toolName: 'manage_projects', description: '管理跨项目注册表 — 变更与读取:注册 / 注销 / 更新 / 清空所有项目 + info / list / search(唯一工具,覆盖全部注册表操作;破坏性操作必需 confirm=true)', parameters: ['action (register|unregister|update|clear_all|info|list|search), project_name, working_dir_path(register/unregister/update/info 必需), source_dirs(可选), query + max_results(用于 search), confirm(破坏性操作必需)'] },
{ toolName: 'register_project', description: '[已弃用的 manage_projects(action="register") 别名] 按名称 + 工作目录路径在跨项目注册表中注册或更新项目(+ 可选源码目录)', parameters: ['project_name, working_dir_path, source_dirs(可选)'] },
{ toolName: 'get_project_info', description: '[已弃用的 manage_projects(action="info") 别名] 按工作目录路径检索某个已注册项目的详情', parameters: ['working_dir_path'] },
{ toolName: 'list_projects', description: '[已弃用的 manage_projects(action="list") 别名] 列出所有已注册项目,含路径、最后访问时间与会话计数', parameters: [] },
{ toolName: 'search_projects', description: '[已弃用的 manage_projects(action="search") 别名] 按名称或路径子串搜索已注册项目;惰性注册表同步会自动注册在会话记忆中发现的项目', parameters: ['query, max_results(可选)'] },
{ toolName: 'switch_context', description: '将上下文存储切换到另一项目的工作目录以回忆其记忆/会话(遵循 Step 0.7 横幅的 confirm-first 原则)', parameters: ['target_working_dir_path'] },
{ toolName: 'restore_session_context', description: '只读调用,一次性恢复当前项目所有先前会话持久化的内容:最新会话摘要 + 已存计划 + 上下文条目(自动检查点折叠)+ 记忆事实 + 近期会话索引——唯一的"读取会话记忆"入口', parameters: ['include_sessions_index、max_chars(均可选)'] },
{ toolName: 'memory_recall', description: '基于ID的只读召回,覆盖整个内存层:mode=index 列出跨上下文条目+记忆事实+会话的紧凑 id/标题/日期行;mode=fetch 为最多10个id返回完整记录,并附带自解释的未命中原因(summary_never_persisted 属设计预期)', parameters: ['mode (index|fetch)、kind、limit(仅 index)/ids ≤10、per_item_chars(仅 fetch)'] },
],
},
vectorRag: {
categoryTitle: '🔍 向量 RAG 工具',
tools: [
{ toolName: 'rag_index_files', description: '将目录中的 TS/JS/MD/JSON/YAML/文本文件索引用于语义搜索,支持批处理', parameters: ['directoryPath, filePattern(可选), batchSize(可选)'] },
{ toolName: 'rag_index_pdf', description: '按页边界分块(每块约 300 词)索引 PDF,带 page_number 来源信息——有界读取防 OOM', parameters: ['filePath, chunkSize/overlap(可选)'] },
{ toolName: 'rag_index_docx', description: '通过 mammoth 提取 DOCX 文本为按词边界的分块,走与 PDF 相同的嵌入流水线', parameters: ['filePath, chunkSize/overlap(可选)'] },
{ toolName: 'rag_index_xlsx', description: '将电子表格的所有工作表索引为行数组,可加工作表名前缀以便追溯', parameters: ['filePath, chunkSize(可选), includeSheetNames(可选)'] },
{ toolName: 'rag_query_vector', description: '对向量索引进行余弦相似度查询,返回 top-k 分块及其内容与得分', parameters: ['query, topK(可选)'] },
{ toolName: 'rag_clear_index', description: '清空整个向量索引(需 confirm=true);全量重建索引前使用', parameters: ['confirm'] },
{ toolName: 'rag_web_content', description: '抓取 URL 并仅返回与查询相关的文本分块——有界、去重的提取', parameters: ['url, query'] },
],
},
uiGeneration: {
categoryTitle: '🎨 UI 生成工具',
tools: [
{ toolName: 'generate_ui_component', description: '根据用户描述创建交互式 HTML/CSS/JS 组件(按钮、表单、表格)', parameters: [] },
{ toolName: 'render_and_preview_ui', description: '在浏览器中渲染组件并提供实时预览,便于快速原型开发', parameters: [] },
{ toolName: 'extract_ui_data', description: '通过 CSS 选择器/XPath 从页面提取结构化数据,以表格形式返回到聊天', parameters: [] },
],
},
httpClient: {
categoryTitle: '📡 HTTP 客户端工具',
tools: [
{ toolName: 'http_request', description: '通用 GET/POST/PUT/DELETE/PATCH 客户端,带重试逻辑、超时配置与 multipart 上传——SSRF 防护(⚠️ 默认禁用)', parameters: ['url, method (+ options)'] },
{ toolName: 'http_get_json', description: '期望 JSON 响应的 GET 请求,自动解析并支持可选的 schema 校验', parameters: ['url (+ headers/options)'] },
{ toolName: 'http_post_json', description: '带 JSON 载荷的 POST 请求,自动处理 content-type 并支持认证令牌;返回状态码', parameters: ['url, body (+ options)'] },
],
},
utilities: {
categoryTitle: '🔧 实用工具',
tools: [
{ toolName: 'markdown_preview', description: '将 Markdown 文件渲染为 HTML,并在默认浏览器中打开', parameters: ['file_path'] },
{ toolName: 'get_repeat_tool_advice', description: '返回重复工具提醒的当前状态与活动提示;用于检查模型是否陷入重复循环', parameters: ['toolName, args (optional)'] },
{ toolName: 'get_update_info', description: '读取 AI Toolbox 当前更新状态(不产生任何更改):已安装版本、是否有已知的新发布版本(针对 hub .VERSION 文件的 24 小时缓存检查),以及可用时的 marketplace 页面 URL — 请在聊天中将其渲染为可点击链接', parameters: [] },
{ toolName: 'dismiss_update_reminder', description: '对某个更新提醒版本记录"暂不",使其不再在每个回合重复通知;该版本将永久保持静默,严格更新的版本仍会通知', parameters: ['version'] },
],
},
imageProcessing: {
categoryTitle: '🖼️ 图像处理与分析工具',
tools: [
{ toolName: 'image_to_text', description: '通过 Tesseract.js 进行 OCR 文本提取,带置信度分数与语言检测(最大 50 MB)', parameters: ['imagePath, language(可选)'] },
{ toolName: 'describe_image', description: '获取图像元数据:PNG/JPG/BMP/GIF/WebP/TIFF 的尺寸、格式、大小与时间戳', parameters: ['imagePath'] },
{ toolName: 'screenshot_desktop', description: '跨平台截取桌面屏幕截图(GDI+/screencapture/ImageMagick)', parameters: ['outputPath/format/quality(可选)'] },
{ toolName: 'compare_images', description: '对两张图像进行字节级与尺寸比较;相同编码时给出精确匹配状态', parameters: ['image1Path, image2Path'] },
],
},
backupRestore: {
categoryTitle: '💾 备份与恢复工具',
tools: [
{ toolName: 'create_backup', description: '将整个工作目录创建为压缩 ZIP 快照,存至 .ai_toolbox_backups/(需 confirm=true)', parameters: ['confirm, destination/targetDirectory(可选)'] },
{ toolName: 'list_backups', description: '按日期或大小排序列出备份,含文件名、路径、大小与创建时间戳', parameters: ['sortBy/limit(可选)'] },
{ toolName: 'restore_backup', description: '从备份归档恢复工作目录(⚠️ 覆盖所有文件;需 confirm=true)', parameters: ['backupFile, confirm'] },
{ toolName: 'delete_backup', description: '删除某个特定备份文件(⚠️ 不可逆;先验证存在性)', parameters: ['backupFile, confirm'] },
{ toolName: 'cleanup_backups', description: '列出并可选删除 .bak 编辑备份——默认 dry-run,删除需确认', parameters: ['confirm(可选)'] },
{ toolName: 'restore_from_bak', description: '从文件修改工具创建的 .bak 备份中还原指定文件(replace_text_in_file、insert_at_line、append_file、delete_lines_in_file)', parameters: ['file_name'] },
{ toolName: 'list_available_bak_backups', description: '扫描当前工作目录中所有由文件修改工具创建的 .bak 备份文件;用于恢复前查看可用备份', parameters: [] },
],
},
dataVisualization: {
categoryTitle: '📈 数据可视化工具',
tools: [
{ toolName: 'generate_chart', description: '从原始数据将 bar/line/pie/doughnut/scatter/radar 图表渲染为 PNG 图像;渲染器不可用时回退到 HTML', parameters: ['type, data (+ title/colors/output_path optional)'] },
],
},
// ── UNIFIED LANGUAGE v2 (26.10): 运行时提示文本。S4(<SYSTEM_INSTRUCTION>)按设计保持中性,
// 在所有语言包中逐字节相同(改写需 owner 明确 GO)。──
runtimeTexts: {
workingDirDetected: '⚠️ 检测到工作目录',
workingDirMentionedLine: '用户在消息中提到了一个目录路径:',
workingDirConfirmAsk: '请在更改工作目录之前先请求用户确认。',
workingDirExampleLabel: '示例回复:',
workingDirExampleText: "我注意到你提到了目录 '{path}'。\n是否要将此设为你的工作目录?\n后续所有文件操作都将以此目录为基准。",
workingDirReplyHint: "请回复 '{yes}' 以确认,或 '{no}' 以拒绝。",
workingDirOriginalMessageLabel: '用户的原始消息:',
projectDetectedTitle: '⚠️ 检测到已注册项目',
projectFoundLead: '我找到了一个与你的消息匹配的已注册项目:',
projectNameLabel: '项目:“{name}”',
projectPathLabel: '路径:{path}',
projectSwitchQuestion: '是否要将工作目录切换到该项目?',
sessionMemoryLoadedTitle: '📋 会话记忆已加载',
previousSessionLabel: '上一次会话摘要:',
// S4 — 刻意保持中性(所有语言包逐字节相同,owner 06.10 裁决)
checkpointWarningHeader: 'TOKEN LIMIT WARNING — ACKNOWLEDGE BEFORE RESPONDING:',
checkpointActionRequiredLead: 'ACTION REQUIRED: Before responding to the user\'s message, explicitly acknowledge this token limit warning.',
checkpointIfConfirmedLine: 'If the user replied with one of the confirmation options shown in the warning above → trigger the context management save tool now.',
checkpointIfDeclinedLine: 'If the user declined or did NOT give a confirmation reply → ask them if they want to proceed with a context save.',
checkpointDoNotProceedLine: 'Do not proceed with normal conversation until this warning has been addressed.',
sessionWarningHead: '⚠️ 会话警告:你已达到令牌上限的 {pct}%。建议在继续之前先保存会话记忆。',
bufferedEventsLine: '缓冲区中的自动跟踪事件(将随检查点一起保存):{count}',
contextSaveQuestion: "是否要执行上下文保存?回复 '{yes}' 触发会话记忆保存,或 '{no}' 继续。",
attachedFilesTitle: '📎 可用的附件文件:',
attachedFilesLead: '你可以访问以下附件文件。可以使用 read_document 工具按文件名读取它们:',
// 有意引用英文横幅标题 —— documentTools.ts 引用的是该确切字符串(契约)。
attachmentErrorCrossRef: "注意:如果这是附件文件,请使用 \"ATTACHED FILES AVAILABLE\" 列表中的确切文件名。",
ragContextHeader: '--- 相关文档上下文 ---',
answerLanguageLine: '请用{language}回复用户。',
},
// ── UNIFIED LANGUAGE v2 (26.10): 设置面板标签 —— 启动时按解析出的语言固化(烘焙)。──
uiLabels: {
languageRow: {
displayName: '🌐 语言',
options: { auto: '自动(跟随 LM Studio)', en: 'English', de: 'Deutsch (德语)', es: 'Español', zhCN: '简体中文', zhTW: '繁体中文' },
},
godMode: { displayName: '⚡⚠️ GOD MODE - 启用所有工具 ⚠️⚡', subtitle: '警告:将立即激活每个工具类别。请谨慎使用。', hint: '启用后,所有单独开关都会被绕过,无论设置如何都会激活每个工具。' },
fileSystem: { displayName: '📁 文件系统工具', hint: '启用文件读取/写入/搜索操作' },
webSearch: { displayName: '🌐 网络与研究工具', hint: '启用 DuckDuckGo/Wikipedia 搜索' },
packageManage: { displayName: '包管理工具', subtitle: 'npm/pip/cargo 操作', hint: '启用包管理器工具。出于安全原因默认禁用。' },
gitOperations: { displayName: '🐙 Git & GitHub 工具', subtitle: '版本控制与 API', hint: '启用 git 操作和 GitHub API 访问。' },
gitAutoCommit: { displayName: '💾 Git 自动提交', subtitle: '⚙️ Git & GitHub 工具的组成部分', hint: '在操作之后自动提交更改' },
defaultBranch: { displayName: '🌿 默认分支', subtitle: '⚙️ Git & GitHub 工具的组成部分', hint: '新仓库和 git 操作的分支名称' },
databaseQueries: { displayName: '🗄️ 数据库查询', hint: '启用只读 SQLite 查询' },
documentParsing: { displayName: '📄 文档解析', hint: '启用 PDF/DOCX 文档读取' },
backgroundCommands: { displayName: '⏳ 后台命令', hint: '启用长时运行进程跟踪' },
imageProcessing: { displayName: '🖼️ 图像处理工具', subtitle: 'OCR、截图与比较', hint: '启用图像 OCR(Tesseract.js)、屏幕截图捕获和图像比较工具。' },
httpClient: { displayName: '🔌 HTTP 客户端工具', subtitle: '通用 REST API 客户端', hint: '启用用于向任意 REST API 发起请求的通用 HTTP 客户端(GET、POST、PUT、DELETE)。' },
vectorRag: { displayName: '📊 向量 RAG / 语义搜索', subtitle: '语义文档搜索', hint: '启用基于向量嵌入的语义搜索,实现智能文档检索。' },
uiGeneration: { displayName: '🎨 交互式 UI 生成工具', subtitle: '生成并渲染交互式 UI 组件', hint: '启用用于生成 HTML/CSS/JS 组件(按钮、表单、图表、仪表板)并在浏览器中渲染的工具。' },
contextManagement: { displayName: '🧠 自动上下文管理工具', subtitle: '自动会话跟踪与记忆管理', hint: '启用将重要决策、模式和配置自动保存到持久记忆的工具。' },
documentRAG: { displayName: '📚 文档 RAG / 与文件对话', subtitle: '为聊天启用文件索引和语义搜索', hint: '将文档附加到你的聊天消息中。插件将通过语义搜索自动从附件文件中检索相关内容。' },
textProcessing: { displayName: '📝 文本处理工具(sed/awk 等价物)', subtitle: '基于正则的文本转换与字段提取', hint: '启用用于批量文本替换、模式匹配和结构化数据提取的工具,无需 shell 依赖。' },
refactorCode: { displayName: '🔧 AST 代码重构工具', subtitle: '重命名、移动、提取函数并清理未使用的导入', hint: '启用基于 AST 的代码重构工具(rename_identifier、move_function、extract_function、unused_import_cleanup)。' },
utility: { displayName: '🛠️ 实用与维护工具', subtitle: '备份、图表生成、Markdown 预览、行操作', hint: '启用实用工具(create_backup、list_backups、restore_backup、delete_backup、cleanup_backups、generate_chart、markdown_preview)。' },
taskPlanning: { displayName: '📋 任务规划工具', subtitle: '结构化的多步骤工作流工具', hint: '启用 create_plan、update_plan_step 和 get_plan,用于结构化任务执行。' },
clusterAwareToolOrder: { displayName: '🧭 集群感知的工具排序', subtitle: '按优先级层级 + 模块中心性对暴露的工具排序,而非按字母顺序。', hint: '使用静态的 ARCHITECTURE.md 依赖图(无 fs I/O)。禁用可恢复旧版字母顺序。' },
retrievalLimit: { displayName: '🔢 检索上限', subtitle: '每次查询返回的最大块数', hint: '为每个查询要检索的相关文档块的最大数量。' },
retrievalAffinityThreshold: { displayName: '🎯 检索亲和阈值', subtitle: '最低相关度得分(0-1)', hint: '低于该相似度得分的块将被过滤掉。值越低 = 结果越多,但相关性可能更低。' },
executionJavaScript: { displayName: '⚡ 允许 JavaScript 执行', subtitle: "启用 'run_javascript' 工具", hint: '警告:代码将在你的机器上运行。' },
executionPython: { displayName: '🐍 允许 Python 执行', subtitle: "启用 'run_python' 工具", hint: '警告:代码将在你的机器上运行。' },
executionTerminal: { displayName: '💻 允许终端执行', subtitle: "启用 'run_in_terminal' 工具", hint: '打开真实的终端窗口。' },
executionShell: { displayName: '🔧 允许 Shell 命令执行', subtitle: "启用 'execute_command' 工具", hint: '警告:命令将在你的机器上运行。' },
executionTests: { displayName: '🧪 允许测试执行', subtitle: "启用 'run_tests' 工具", hint: '警告:将运行 npm jest / pytest / go test —— 可能会安装软件包并执行代码。' },
searchFallbackChain: { displayName: '🔍 搜索回退链', hint: '主要搜索引擎。不可用时自动回退到其他引擎。' },
safesearch: { displayName: '🛡️ 安全搜索', options: { off: '关闭', moderate: '中等', strict: '严格' } },
browserAutomation: { displayName: '🖥️ 浏览器自动化工具', subtitle: '无头浏览器控制与自动化', hint: '启用基于 Puppeteer 的无头浏览器自动化,用于网页抓取、测试和 UI 交互。' },
browserTimeout: { displayName: '⏱️ 浏览器超时', subtitle: '⚙️ 浏览器自动化工具的组成部分', hint: '等待浏览器操作的最大时间(毫秒),超过则超时。' },
headlessMode: { displayName: '👻 无头模式', subtitle: '⚙️ 浏览器自动化工具的组成部分', hint: '在无 GUI 的情况下运行浏览器(自动化推荐)。' },
pathValidationEnabled: { displayName: '🔒 路径校验', hint: '防止目录遍历攻击' },
binaryFileDetection: { displayName: '📁 二进制文件检测', hint: '通过空字节检查检测二进制文件' },
regexReDoSProtection: { displayName: '🛡️ ReDoS 保护', hint: '防止正则拒绝服务' },
statePersistenceEnabled: { displayName: '💽 状态持久化', hint: '在会话之间持久化工具执行状态' },
notificationsEnabled: { displayName: '🔔 桌面通知', hint: '显示系统通知' },
updateCheckEnabled: { displayName: '🔄 插件更新检查', subtitle: '静默的 LM Studio hub .VERSION 检查 —— 无新工具,无操作系统权限', hint: "每天一次,插件会静默检查已发布的 LM Studio hub .VERSION 文件中是否存在严格更新的版本。如果存在,将通过桌面通知弹窗(桌面通知开启)或聊天中的一行(关闭)进行提示。当你是最新版本或处于已忽略的版本时保持静默;状态在重新安装后依然存在。" },
temporalAwareness: { displayName: '⏰ 时间感知', subtitle: '向每条消息注入当前日期/时间', hint: '让 AI 知道当前时间。' },
dateFormatStyle: { displayName: '📅 日期格式样式', options: { standard: '标准([Zeit: ...])', heuteIst: 'HEUTE IST 模式(醒目)' } },
contextGuardEnabled: { displayName: '🧠 ContextGuard 令牌管理', subtitle: '自动历史压缩与智能读取', hint: '达到令牌限制时自动压缩聊天历史。启用智能文件读取和终端输出过滤。' },
contextGuardCompressionPercent: { displayName: '📊 压缩触发点(占上下文窗口的百分比)', subtitle: '⚙️ ContextGuard 设置', hint: "当上下文使用率达到活动模型上下文窗口的该百分比时,将触发历史压缩。如果 LM Studio 报告了模型的真实窗口,则使用它;否则应用内置的 30k 回退值。" },
contextGuardAgenticDensity: { displayName: '🔢 Agent 字符/令牌密度', subtitle: '⚙️ ContextGuard 设置', hint: '用于从字符长度估算令牌的每令牌字符数(散文 + 工具输出的 agent 混合;实测区间约 ~3.2-3.4 —— 默认值 3.6 由 owner 设定,高于该区间)。更高 = 内容更密集 = 估算令牌更少;更低则估算更多并更早触发压缩。' },
contextGuardForceSummaryOnCompress: { displayName: '💾 压缩前强制保存会话记忆', subtitle: '⚙️ ContextGuard 设置', hint: "当上下文达到你的压缩触发点时,将使用摘要模型生成结构化的会话摘要(任务描述、已完成事项、待办事项),并在压缩历史之前持久化。非致命:在任何失败情况下,之前的遥测检查点仍会运行。" },
contextGuardSmartReading: { displayName: '🔍 智能文件读取', subtitle: '⚙️ ContextGuard 设置', hint: '从用户查询中提取关键字,只读取文件的相关部分。节省令牌并加快响应速度。' },
contextGuardSummaryModel: { displayName: '🤖 摘要模型名称', subtitle: '⚙️ ContextGuard 设置', hint: '用于历史摘要的 LM Studio 模型名称。留空则使用当前聊天模型。' },
contextGuardTerminalFilterEnabled: { displayName: '📌 终端输出过滤', subtitle: '⚙️ ContextGuard 设置', hint: '自动截断冗长的终端输出以节省令牌。' },
contextGuardTerminalFilterLength: { displayName: '📏 最大终端输出长度', subtitle: '⚙️ ContextGuard 设置', hint: '在终端输出被截断和摘要之前的最大字符数。' },
compactionEnabled: { displayName: '✂️ 压缩前预摘要剪枝', subtitle: '⚙️ C 压缩家族', hint: '在对历史进行摘要之前,超出字节预算的工具负载将被替换为头/尾预览加上一个不透明定位符;完整结果仍逐字存储在 .ai_toolbox/compaction/ 中。' },
compactionMaxResultBytes: { displayName: '📏 剪枝前的最大工具结果(字节)', subtitle: '⚙️ C 压缩家族', hint: '聊天历史中每个工具结果负载的字节预算。超出该值的将在摘要前被剪枝为预览 + 定位符(逐字副本存储在磁盘上)。' },
contextUsageFooter: { displayName: '📊 工具结果中的上下文使用页脚', subtitle: '⚙️ LLM 侧限制感知', hint: "一旦预计的上下文使用量超过模型窗口的一半,每个工具结果都会获得一个简短页脚,如 [ctx ~48.3k/64k = 76%] —— 追加到字符串结果中,并在纯对象结果中添加为附加的 ctx_footer 字段(每个注册的工具都返回一个)—— 使模型始终能看到当前的令牌使用量。在 >=90% 时添加接近限制的提示。" },
autoTrackingEnabled: { displayName: '🤖 启用自动跟踪', subtitle: '自动记住重要事件', hint: '在后台静默跟踪决策、完成事项和错误修复。默认启用。' },
autoTrackTokenThreshold: { displayName: '自动跟踪令牌阈值', subtitle: '自动跟踪设置', hint: '当令牌使用率达到该百分比时触发会话记忆保存(默认:75%)。有助于防止上下文溢出。' },
autoTrackDecisions: { displayName: '📌 自动跟踪决策', subtitle: '⚙️ 自动跟踪设置', hint: '检测诸如“我决定”、“结论”、“采用”等短语。' },
autoTrackCompletions: { displayName: '✅ 自动跟踪完成事项', subtitle: '⚙️ 自动跟踪设置', hint: '检测诸如“成功完成”、“实现完毕”等短语。' },
autoTrackErrors: { displayName: '🐛 自动跟踪错误修复', subtitle: '⚙️ 自动跟踪设置', hint: '检测诸如“修复了错误”、“解决了问题”等短语。' },
autoSummaryInterval: { displayName: '📊 会话摘要间隔', subtitle: '⚙️ 自动跟踪设置', hint: '两次自动会话摘要之间的消息数量。值越大 = 频率越低。' },
// Budget-Guard-Arc i18n (06.11, owner 规则“所有工具描述必须始终翻译”): config.ts 的 EN 回退值保持字节级一致。
budgetGuardEnabled: { displayName: '🛡️ 预算守卫(上下文限制保护)', hint: '确定性上下文预算守卫的主开关 —— M1 预读门、M2 感知预算的溢出上限、M3 在 85% 边缘自动持久化。默认开启(06.11);关闭可恢复字节级相同的旧行为。' },
budgetGuardAdvisoryThresholdPct: { displayName: '🔢 预算守卫咨询阈值 (%)', subtitle: '⚙️ 预算守卫设置', hint: 'M1 预读门:当使用量超过上下文限制的此百分比时,读取工具返回自描述的预算咨询而非完整转储。' },
budgetGuardSpillThresholdPct: { displayName: '✂️ 预算守卫溢出阈值 (%)', subtitle: '⚙️ 预算守卫设置', hint: 'M2 溢出门槛:工具结果超过此百分比时写入磁盘(绝对值与预算相对上限中更严格者生效)。' },
budgetGuardAutopauseThresholdPct: { displayName: '💾 预算守卫自动持久化边缘 (%)', subtitle: '⚙️ 预算守卫设置', hint: 'M3:达到此百分比边缘时自动保存会话记忆,每会话最多一次。' },
budgetGuardSafetyMarginPct: { displayName: '🧮 预算守卫安全边际 (%)', subtitle: '⚙️ 预算守卫设置', hint: '为 M2 预算计算从上下文限制中保留的余量 —— 限制 × (1 − 边际/100);默认 8 ⇒ 在 92% 处溢出。' },
},
general: {
pluginName: 'AI Toolbox 插件',
enabledTools: '已启用的工具:',
disabledTools: '禁用的工具:',
errorPrefix: '错误:',
successPrefix: '成功:',
yesWord: '确认',
noWord: '取消',
},
};
/**
* Simplified Chinese (zh-CN) translations for AI Toolbox plugin
*/
import type { FullTranslationSet } from './types';
export const zhCNTranslations: FullTranslationSet = {
fileSystem: {
categoryTitle: '📁 文件系统工具',
tools: [
{ toolName: 'list_directory', description: '列出工作区中的文件和文件夹', parameters: ['path(可选)'] },
{ toolName: 'read_file', description: '读取文本文件内容', parameters: ['file_name'] },
{ toolName: 'save_file', description: '创建或覆盖文件', parameters: ['file_name, content'] },
{ toolName: 'replace_text_in_file', description: '在文件中替换精确匹配的字符串(复杂插入/替换务必使用此工具——切勿改用 line_operations)', parameters: ['file_name, old_string, new_string'] },
{ toolName: 'insert_at_line', description: '⚠️ 仅限单次插入——多步结构性修改请改用 save_file/replace_text_in_file。在指定行号处插入文本。', parameters: ['file_name, line_number, content'] },
{ toolName: 'append_file', description: '向文件末尾追加内容', parameters: ['file_name, content'] },
{ toolName: 'delete_lines_in_file', description: '删除文件中的指定行', parameters: ['file_name, start_line, end_line(可选)'] },
{ toolName: 'line_operations', description: '类 awk 地插入/删除/重排行,无 shell 依赖;三层护栏(模式锚定、行指纹、边界校验)+ 写入后 MD5 完整性检查', parameters: ['file_name, operation, target_line or pattern anchors (+ options)'] },
{ toolName: 'make_directory', description: '创建新目录', parameters: ['directory_name'] },
{ toolName: 'move_file', description: '移动或重命名文件/目录', parameters: ['source, destination'] },
{ toolName: 'copy_file', description: '将文件复制到新位置', parameters: ['source, destination'] },
{ toolName: 'delete_path', description: '删除文件或目录(破坏性操作)', parameters: ['path'] },
{ toolName: 'delete_files_by_pattern', description: '按正则表达式模式删除文件', parameters: ['pattern(正则)'] },
{ toolName: 'find_files', description: '递归查找匹配名称模式的文件', parameters: ['pattern, max_depth(可选)'] },
{ toolName: 'fuzzy_find_local_files', description: '按名称/路径相似度模糊搜索文件', parameters: ['query, path(可选), max_results(可选)'] },
{ toolName: 'get_file_metadata', description: '获取文件大小、日期与类型信息', parameters: ['path'] },
{ toolName: 'change_directory', description: '更改工作目录', parameters: ['directory'] },
{ toolName: 'read_document', description: '读取 PDF 或 DOCX 文档', parameters: ['file_path'] },
{ toolName: 'analyze_project', description: '运行项目级 lint 分析', parameters: [] },
{ toolName: 'read_file_chunked', description: '以结构化分块读取文件,绕过字符限制;对超大文件返回起止索引以实现流式控制', parameters: ['file_name, chunk_size/max_chunks(可选)'] },
{ toolName: 'ripgrep', description: '通过 worker 隔离的 ripgrep 进行递归内容搜索——整个扫描在主线程之外执行(3 秒看门狗终止卡死的 worker);默认不区分大小写(-i);无效的 Rust 正则自动按字面量重试,并通过 pattern_mode 上报;默认排除 node_modules', parameters: ['pattern, path, mode, case_insensitive, include_glob, exclude_globs, max_depth'] },
{ toolName: 'find_replace_all', description: '跨多文件的正则搜索与替换,支持 dry-run 预览、.bak 备份和扩展名过滤——内置深度上限防挂起', parameters: ['pattern, replacement(可选), directory/dry_run/confirm (+ filters)'] },
{ toolName: 'pattern_scan', description: '递归内容搜索,以 {file, line, content} 返回匹配行;不安全正则自动降级为字面量;每文件 256 KB / 1 万行上限并记录跳过项;3 秒墙钟上限协作中止扫描 → PARTIAL 结果并置 aborted 标志', parameters: ['pattern (+ root/mode/caps options)'] },
{ toolName: 'directory_tree', description: '以树形格式可视化目录结构,支持最大深度、可选文件大小显示及自动排除大型目录', parameters: ['path/max_depth/show_size(可选)'] },
{ toolName: 'file_diff', description: '比较两个文件并返回带 +/− 标记和行号的统一 diff', parameters: ['file_a, file_b'] },
{ toolName: 'apply_patch', description: '完全在进程内应用 unified-diff 或二进制字节锚点补丁(无需 shell):按行 add/replace/context 块并附验证', parameters: ['file_path, patch_content (+ mode)'] },
],
},
webSearch: {
categoryTitle: '🌐 网络与研究工具',
tools: [
{ toolName: 'web_search', description: '通过 DuckDuckGo/Google/Bing 回退链搜索', parameters: ['query, providers(可选)'] },
{ toolName: 'wikipedia_search', description: '在维基百科中搜索页面摘要', parameters: ['query, lang(可选)'] },
{ toolName: 'fetch_web_content', description: '获取网页的纯文本内容', parameters: ['url'] },
{ toolName: 'rag_web_content', description: '基于 RAG 的语义化网页提取', parameters: ['url, query'] },
{ toolName: 'browser_session_control', description: '控制浏览器操作(点击、输入等)', parameters: ['actions 数组, read_page 标志'] },
],
},
browserAutomation: {
categoryTitle: '🌐 浏览器自动化工具',
tools: [
{ toolName: 'browser_open_page', description: '使用 Puppeteer 一次性渲染页面', parameters: ['url, screenshot_path(可选), actions(可选)'] },
{ toolName: 'browser_session_close', description: '优雅关闭持久化浏览器会话,防止遗留的 Chromium 进程', parameters: [] },
{ toolName: 'preview_html', description: '在系统默认浏览器中渲染原始 HTML 或现有 .html 文件', parameters: ['source (HTML string or path)'] },
{ toolName: 'open_file', description: '用系统默认应用打开文件/URL(Windows start / macOS open / Linux xdg-open)', parameters: ['target'] },
],
},
gitOperations: {
categoryTitle: '🐙 Git 与 GitHub 工具',
tools: [
{ toolName: 'git_status', description: '查看仓库中已修改的文件', parameters: [] },
{ toolName: 'git_diff', description: '详细查看变更内容', parameters: ['file_path(可选), cached(可选)'] },
{ toolName: 'git_commit', description: '提交暂存区的更改', parameters: ['message'] },
{ toolName: 'git_log', description: '查看提交历史', parameters: ['max_count(可选)'] },
{ toolName: 'git_add', description: '暂存指定文件或全部更改', parameters: ['paths(可选)'] },
{ toolName: 'git_checkout', description: '切换到已有分支或创建新分支', parameters: ['branch_name, create_new(可选)'] },
{ toolName: 'gh_create_issue', description: '创建新的 GitHub issue', parameters: ['title, body(可选), labels(可选)'] },
{ toolName: 'gh_list_issues', description: '列出仓库中的 issues', parameters: ['state(可选), labels(可选), limit(可选)'] },
{ toolName: 'gh_view_comments', description: '查看 issue 或 PR 的评论', parameters: ['number, type(可选)'] },
{ toolName: 'gh_create_pr', description: '创建 Pull Request', parameters: ['title, body, head_branch, base_branch(可选)'] },
{ toolName: 'gh_list_prs', description: '列出 Pull Requests', parameters: ['state(可选), limit(可选)'] },
{ toolName: 'gh_view_pr_diff', description: '获取 PR 的 diff/patch', parameters: ['number'] },
{ toolName: 'gh_push', description: '将提交推送到远程仓库', parameters: ['branch(可选)'] },
{ toolName: 'git_stash', description: '管理未提交的更改:保存、弹出、丢弃并列出 stash(原生 Git CLI——isomorphic-git 不支持 stash)', parameters: ['operation (+ options)'] },
{ toolName: 'git_blame', description: '逐行提交历史,显示作者、时间戳和哈希;路径校验可防止遍历攻击', parameters: ['file_path (+ options)'] },
],
},
databaseQueries: {
categoryTitle: '💾 数据库查询工具',
tools: [
{ toolName: 'query_database', description: '运行只读 SQLite 查询', parameters: ['query(SQL 字符串)'] },
],
},
documentParsing: {
categoryTitle: '📄 文档解析工具',
tools: [
{ toolName: 'read_document', description: '读取 PDF 或 DOCX 文档', parameters: ['file_path'] },
],
},
backgroundCommands: {
categoryTitle: '⏱️ 后台命令工具',
tools: [
{ toolName: 'run_background_command', description: '在后台启动长时间运行的进程', parameters: ['command, timeout_hours(必填), name(必填)'] },
{ toolName: 'check_background_command', description: '查看运行中命令的状态与输出', parameters: ['id'] },
{ toolName: 'cancel_background_command', description: '终止正在运行的后台命令', parameters: ['id'] },
],
},
codeRefactoring: {
categoryTitle: '🧬 代码重构工具',
tools: [
{ toolName: 'refactor_code', description: '基于 AST 的重构(Babel):重命名标识符、跨文件移动函数、提取函数、清理无用导入——语法安全,带 .bak 备份且失败时自动回滚;支持 dry-run diff', parameters: ['file_path, operation, per-operation fields, dry_run(可选)'] },
],
},
execution: {
categoryTitle: '⚡ 执行工具',
tools: [
{ toolName: 'run_javascript', description: '在隔离的 Node VM 上下文中执行 JavaScript;eval/require/child_process 被阻止,默认超时 5 秒', parameters: ['javascript, timeout_seconds(可选)'] },
{ toolName: 'run_python', description: '在受控沙箱中执行 Python;os/subprocess/sys 导入被阻止,默认超时 10 秒', parameters: ['python, timeout_seconds(可选)'] },
{ toolName: 'execute_command', description: '⚠️ 以多层净化和管道限制运行 shell 命令——默认禁用', parameters: ['command (+ options)'] },
{ toolName: 'run_in_terminal', description: '启动操作系统原生终端窗口(cmd/PowerShell/zsh/bash),支持环境变量与可见性选项', parameters: [] },
{ toolName: 'run_tests', description: '从 package.json 自动检测测试框架(Jest/Mocha/Vitest)并运行项目测试套件,返回结果', parameters: [] },
],
},
textProcessing: {
categoryTitle: '📝 文本处理工具',
tools: [
{ toolName: 'text_transform', description: '基于正则的文本替换,支持捕获组($1/$2)、行范围及全局/忽略大小写模式——比 shell sed 更安全', parameters: ['file_name, pattern, replacement(可选), flags(可选)'] },
{ toolName: 'text_extract', description: '从分隔文本(CSV/TSV/自定义)中按零基字段索引提取结构化字段', parameters: ['file_name, fields, delimiter(可选), output_format(可选)'] },
{ toolName: 'markdown_table_gen', description: '从对象数组生成有效的 Markdown 表格,支持表头、对齐与截断', parameters: ['data, headers(可选)'] },
],
},
taskPlanning: {
categoryTitle: '📋 任务规划工具',
tools: [
{ toolName: 'create_plan', description: '创建多步骤执行计划(1–30 步);替换任何活动计划并返回 planId + stepCount', parameters: ['goal, steps'] },
{ toolName: 'get_plan', description: '返回活动计划,含各步骤状态、完成百分比与已用时间;无计划时返回 null', parameters: [] },
{ toolName: 'update_plan_step', description: '通过状态机更新单个计划步骤(pending→in_progress→done;any→blocked;blocked→pending)——阻塞时必须提供 note', parameters: ['planId, index, status, note (required if blocked)'] },
{ toolName: 'remove_plan', description: '从工作状态存储中移除已持久化的计划;除非 confirm=true 否则仅返回 dry-run 预览 — 仅限未完成的计划,已完成计划会在最后一个 done 时由 update_plan_step 自动移除', parameters: ['planId, confirm (required to remove)'] },
],
},
contextManagement: {
categoryTitle: '🧠 上下文与记忆工具',
tools: [
{ toolName: 'auto_summarize_context', description: '分析近期会话活动中的模式、高频工具使用及值得记住的决策;以全局范围保存到持久化记忆', parameters: ['session_events (+ config_changes)'] },
{ toolName: 'get_context_memory', description: '按类型(decision/pattern/configuration/file_change/error/summary)检索历史上下文条目;近因×频率评分优先呈现最近且常被访问的条目', parameters: ['type(可选), limit(可选)'] },
{ toolName: 'search_context', description: '对上下文条目的标题、正文与标签进行模糊文本搜索;搜索前清理已过期的会话条目(24 小时 TTL)', parameters: ['query, max_results(可选)'] },
{ toolName: 'context_summary', description: '持久化记忆的统计概览:总条目数、按类型细分及近期活动计数', parameters: [] },
{ toolName: 'delete_context_entry', description: '按唯一 ID 删除特定上下文条目,不清除其余历史', parameters: ['entry_id'] },
{ toolName: 'clear_context_memory', description: '清除所有自动保存的上下文条目(⚠️ 不可逆;需 confirm=true)', parameters: ['confirm'] },
{ toolName: 'track_important_event', description: '手动记录事件、决策或里程碑,可加自定义标签以便分类检索', parameters: ['title, content, tags(可选)'] },
{ toolName: 'save_session_summary', description: '保存结构化会话摘要(成果、待办任务、决策),压缩存储以绕过 10k SDK 限制', parameters: ['task_description (+ optional sections)'] },
{ toolName: 'get_session_summary', description: '获取最近保存的会话摘要,对旧数据提供向后兼容的回退', parameters: [] },
{ toolName: 'save_memory', description: '将事实持久化到 .ai_toolbox_memory.msgpack 以实现跨会话连续性(RAM + 原子磁盘副本)', parameters: ['fact'] },
{ toolName: 'get_memory', description: '检索所有已保存的记忆条目;先查本地项目文件,再查持久化存储', parameters: [] },
{ toolName: 'delete_memory', description: '按唯一键删除特定记忆条目(保存时返回该键)', parameters: ['entry_id'] },
{ toolName: 'list_sessions', description: '分页浏览已保存的会话摘要,支持限制控制', parameters: ['limit(可选), offset(可选)'] },
{ toolName: 'search_sessions', description: '对已存储的会话摘要进行关键词搜索,最新优先', parameters: ['query, max_results(可选)'] },
{ toolName: 'clear_session_index', description: '仅删除所有轻量级会话索引条目——摘要不受影响(需 confirm=true)', parameters: ['confirm'] },
{ toolName: 'manage_projects', description: '管理跨项目注册表 — 变更与读取:注册 / 注销 / 更新 / 清空所有项目 + info / list / search(唯一工具,覆盖全部注册表操作;破坏性操作必需 confirm=true)', parameters: ['action (register|unregister|update|clear_all|info|list|search), project_name, working_dir_path(register/unregister/update/info 必需), source_dirs(可选), query + max_results(用于 search), confirm(破坏性操作必需)'] },
{ toolName: 'register_project', description: '[已弃用的 manage_projects(action="register") 别名] 按名称 + 工作目录路径在跨项目注册表中注册或更新项目(+ 可选源码目录)', parameters: ['project_name, working_dir_path, source_dirs(可选)'] },
{ toolName: 'get_project_info', description: '[已弃用的 manage_projects(action="info") 别名] 按工作目录路径检索某个已注册项目的详情', parameters: ['working_dir_path'] },
{ toolName: 'list_projects', description: '[已弃用的 manage_projects(action="list") 别名] 列出所有已注册项目,含路径、最后访问时间与会话计数', parameters: [] },
{ toolName: 'search_projects', description: '[已弃用的 manage_projects(action="search") 别名] 按名称或路径子串搜索已注册项目;惰性注册表同步会自动注册在会话记忆中发现的项目', parameters: ['query, max_results(可选)'] },
{ toolName: 'switch_context', description: '将上下文存储切换到另一项目的工作目录以回忆其记忆/会话(遵循 Step 0.7 横幅的 confirm-first 原则)', parameters: ['target_working_dir_path'] },
{ toolName: 'restore_session_context', description: '只读调用,一次性恢复当前项目所有先前会话持久化的内容:最新会话摘要 + 已存计划 + 上下文条目(自动检查点折叠)+ 记忆事实 + 近期会话索引——唯一的"读取会话记忆"入口', parameters: ['include_sessions_index、max_chars(均可选)'] },
{ toolName: 'memory_recall', description: '基于ID的只读召回,覆盖整个内存层:mode=index 列出跨上下文条目+记忆事实+会话的紧凑 id/标题/日期行;mode=fetch 为最多10个id返回完整记录,并附带自解释的未命中原因(summary_never_persisted 属设计预期)', parameters: ['mode (index|fetch)、kind、limit(仅 index)/ids ≤10、per_item_chars(仅 fetch)'] },
],
},
vectorRag: {
categoryTitle: '🔍 向量 RAG 工具',
tools: [
{ toolName: 'rag_index_files', description: '将目录中的 TS/JS/MD/JSON/YAML/文本文件索引用于语义搜索,支持批处理', parameters: ['directoryPath, filePattern(可选), batchSize(可选)'] },
{ toolName: 'rag_index_pdf', description: '按页边界分块(每块约 300 词)索引 PDF,带 page_number 来源信息——有界读取防 OOM', parameters: ['filePath, chunkSize/overlap(可选)'] },
{ toolName: 'rag_index_docx', description: '通过 mammoth 提取 DOCX 文本为按词边界的分块,走与 PDF 相同的嵌入流水线', parameters: ['filePath, chunkSize/overlap(可选)'] },
{ toolName: 'rag_index_xlsx', description: '将电子表格的所有工作表索引为行数组,可加工作表名前缀以便追溯', parameters: ['filePath, chunkSize(可选), includeSheetNames(可选)'] },
{ toolName: 'rag_query_vector', description: '对向量索引进行余弦相似度查询,返回 top-k 分块及其内容与得分', parameters: ['query, topK(可选)'] },
{ toolName: 'rag_clear_index', description: '清空整个向量索引(需 confirm=true);全量重建索引前使用', parameters: ['confirm'] },
{ toolName: 'rag_web_content', description: '抓取 URL 并仅返回与查询相关的文本分块——有界、去重的提取', parameters: ['url, query'] },
],
},
uiGeneration: {
categoryTitle: '🎨 UI 生成工具',
tools: [
{ toolName: 'generate_ui_component', description: '根据用户描述创建交互式 HTML/CSS/JS 组件(按钮、表单、表格)', parameters: [] },
{ toolName: 'render_and_preview_ui', description: '在浏览器中渲染组件并提供实时预览,便于快速原型开发', parameters: [] },
{ toolName: 'extract_ui_data', description: '通过 CSS 选择器/XPath 从页面提取结构化数据,以表格形式返回到聊天', parameters: [] },
],
},
httpClient: {
categoryTitle: '📡 HTTP 客户端工具',
tools: [
{ toolName: 'http_request', description: '通用 GET/POST/PUT/DELETE/PATCH 客户端,带重试逻辑、超时配置与 multipart 上传——SSRF 防护(⚠️ 默认禁用)', parameters: ['url, method (+ options)'] },
{ toolName: 'http_get_json', description: '期望 JSON 响应的 GET 请求,自动解析并支持可选的 schema 校验', parameters: ['url (+ headers/options)'] },
{ toolName: 'http_post_json', description: '带 JSON 载荷的 POST 请求,自动处理 content-type 并支持认证令牌;返回状态码', parameters: ['url, body (+ options)'] },
],
},
utilities: {
categoryTitle: '🔧 实用工具',
tools: [
{ toolName: 'markdown_preview', description: '将 Markdown 文件渲染为 HTML,并在默认浏览器中打开', parameters: ['file_path'] },
{ toolName: 'get_repeat_tool_advice', description: '返回重复工具提醒的当前状态与活动提示;用于检查模型是否陷入重复循环', parameters: ['toolName, args (optional)'] },
{ toolName: 'get_update_info', description: '读取 AI Toolbox 当前更新状态(不产生任何更改):已安装版本、是否有已知的新发布版本(针对 hub .VERSION 文件的 24 小时缓存检查),以及可用时的 marketplace 页面 URL — 请在聊天中将其渲染为可点击链接', parameters: [] },
{ toolName: 'dismiss_update_reminder', description: '对某个更新提醒版本记录"暂不",使其不再在每个回合重复通知;该版本将永久保持静默,严格更新的版本仍会通知', parameters: ['version'] },
],
},
imageProcessing: {
categoryTitle: '🖼️ 图像处理与分析工具',
tools: [
{ toolName: 'image_to_text', description: '通过 Tesseract.js 进行 OCR 文本提取,带置信度分数与语言检测(最大 50 MB)', parameters: ['imagePath, language(可选)'] },
{ toolName: 'describe_image', description: '获取图像元数据:PNG/JPG/BMP/GIF/WebP/TIFF 的尺寸、格式、大小与时间戳', parameters: ['imagePath'] },
{ toolName: 'screenshot_desktop', description: '跨平台截取桌面屏幕截图(GDI+/screencapture/ImageMagick)', parameters: ['outputPath/format/quality(可选)'] },
{ toolName: 'compare_images', description: '对两张图像进行字节级与尺寸比较;相同编码时给出精确匹配状态', parameters: ['image1Path, image2Path'] },
],
},
backupRestore: {
categoryTitle: '💾 备份与恢复工具',
tools: [
{ toolName: 'create_backup', description: '将整个工作目录创建为压缩 ZIP 快照,存至 .ai_toolbox_backups/(需 confirm=true)', parameters: ['confirm, destination/targetDirectory(可选)'] },
{ toolName: 'list_backups', description: '按日期或大小排序列出备份,含文件名、路径、大小与创建时间戳', parameters: ['sortBy/limit(可选)'] },
{ toolName: 'restore_backup', description: '从备份归档恢复工作目录(⚠️ 覆盖所有文件;需 confirm=true)', parameters: ['backupFile, confirm'] },
{ toolName: 'delete_backup', description: '删除某个特定备份文件(⚠️ 不可逆;先验证存在性)', parameters: ['backupFile, confirm'] },
{ toolName: 'cleanup_backups', description: '列出并可选删除 .bak 编辑备份——默认 dry-run,删除需确认', parameters: ['confirm(可选)'] },
{ toolName: 'restore_from_bak', description: '从文件修改工具创建的 .bak 备份中还原指定文件(replace_text_in_file、insert_at_line、append_file、delete_lines_in_file)', parameters: ['file_name'] },
{ toolName: 'list_available_bak_backups', description: '扫描当前工作目录中所有由文件修改工具创建的 .bak 备份文件;用于恢复前查看可用备份', parameters: [] },
],
},
dataVisualization: {
categoryTitle: '📈 数据可视化工具',
tools: [
{ toolName: 'generate_chart', description: '从原始数据将 bar/line/pie/doughnut/scatter/radar 图表渲染为 PNG 图像;渲染器不可用时回退到 HTML', parameters: ['type, data (+ title/colors/output_path optional)'] },
],
},
// ── UNIFIED LANGUAGE v2 (26.10): 运行时提示文本。S4(<SYSTEM_INSTRUCTION>)按设计保持中性,
// 在所有语言包中逐字节相同(改写需 owner 明确 GO)。──
runtimeTexts: {
workingDirDetected: '⚠️ 检测到工作目录',
workingDirMentionedLine: '用户在消息中提到了一个目录路径:',
workingDirConfirmAsk: '请在更改工作目录之前先请求用户确认。',
workingDirExampleLabel: '示例回复:',
workingDirExampleText: "我注意到你提到了目录 '{path}'。\n是否要将此设为你的工作目录?\n后续所有文件操作都将以此目录为基准。",
workingDirReplyHint: "请回复 '{yes}' 以确认,或 '{no}' 以拒绝。",
workingDirOriginalMessageLabel: '用户的原始消息:',
projectDetectedTitle: '⚠️ 检测到已注册项目',
projectFoundLead: '我找到了一个与你的消息匹配的已注册项目:',
projectNameLabel: '项目:“{name}”',
projectPathLabel: '路径:{path}',
projectSwitchQuestion: '是否要将工作目录切换到该项目?',
sessionMemoryLoadedTitle: '📋 会话记忆已加载',
previousSessionLabel: '上一次会话摘要:',
// S4 — 刻意保持中性(所有语言包逐字节相同,owner 06.10 裁决)
checkpointWarningHeader: 'TOKEN LIMIT WARNING — ACKNOWLEDGE BEFORE RESPONDING:',
checkpointActionRequiredLead: 'ACTION REQUIRED: Before responding to the user\'s message, explicitly acknowledge this token limit warning.',
checkpointIfConfirmedLine: 'If the user replied with one of the confirmation options shown in the warning above → trigger the context management save tool now.',
checkpointIfDeclinedLine: 'If the user declined or did NOT give a confirmation reply → ask them if they want to proceed with a context save.',
checkpointDoNotProceedLine: 'Do not proceed with normal conversation until this warning has been addressed.',
sessionWarningHead: '⚠️ 会话警告:你已达到令牌上限的 {pct}%。建议在继续之前先保存会话记忆。',
bufferedEventsLine: '缓冲区中的自动跟踪事件(将随检查点一起保存):{count}',
contextSaveQuestion: "是否要执行上下文保存?回复 '{yes}' 触发会话记忆保存,或 '{no}' 继续。",
attachedFilesTitle: '📎 可用的附件文件:',
attachedFilesLead: '你可以访问以下附件文件。可以使用 read_document 工具按文件名读取它们:',
// 有意引用英文横幅标题 —— documentTools.ts 引用的是该确切字符串(契约)。
attachmentErrorCrossRef: "注意:如果这是附件文件,请使用 \"ATTACHED FILES AVAILABLE\" 列表中的确切文件名。",
ragContextHeader: '--- 相关文档上下文 ---',
answerLanguageLine: '请用{language}回复用户。',
},
// ── UNIFIED LANGUAGE v2 (26.10): 设置面板标签 —— 启动时按解析出的语言固化(烘焙)。──
uiLabels: {
languageRow: {
displayName: '🌐 语言',
options: { auto: '自动(跟随 LM Studio)', en: 'English', de: 'Deutsch (德语)', es: 'Español', zhCN: '简体中文', zhTW: '繁体中文' },
},
godMode: { displayName: '⚡⚠️ GOD MODE - 启用所有工具 ⚠️⚡', subtitle: '警告:将立即激活每个工具类别。请谨慎使用。', hint: '启用后,所有单独开关都会被绕过,无论设置如何都会激活每个工具。' },
fileSystem: { displayName: '📁 文件系统工具', hint: '启用文件读取/写入/搜索操作' },
webSearch: { displayName: '🌐 网络与研究工具', hint: '启用 DuckDuckGo/Wikipedia 搜索' },
packageManage: { displayName: '包管理工具', subtitle: 'npm/pip/cargo 操作', hint: '启用包管理器工具。出于安全原因默认禁用。' },
gitOperations: { displayName: '🐙 Git & GitHub 工具', subtitle: '版本控制与 API', hint: '启用 git 操作和 GitHub API 访问。' },
gitAutoCommit: { displayName: '💾 Git 自动提交', subtitle: '⚙️ Git & GitHub 工具的组成部分', hint: '在操作之后自动提交更改' },
defaultBranch: { displayName: '🌿 默认分支', subtitle: '⚙️ Git & GitHub 工具的组成部分', hint: '新仓库和 git 操作的分支名称' },
databaseQueries: { displayName: '🗄️ 数据库查询', hint: '启用只读 SQLite 查询' },
documentParsing: { displayName: '📄 文档解析', hint: '启用 PDF/DOCX 文档读取' },
backgroundCommands: { displayName: '⏳ 后台命令', hint: '启用长时运行进程跟踪' },
imageProcessing: { displayName: '🖼️ 图像处理工具', subtitle: 'OCR、截图与比较', hint: '启用图像 OCR(Tesseract.js)、屏幕截图捕获和图像比较工具。' },
httpClient: { displayName: '🔌 HTTP 客户端工具', subtitle: '通用 REST API 客户端', hint: '启用用于向任意 REST API 发起请求的通用 HTTP 客户端(GET、POST、PUT、DELETE)。' },
vectorRag: { displayName: '📊 向量 RAG / 语义搜索', subtitle: '语义文档搜索', hint: '启用基于向量嵌入的语义搜索,实现智能文档检索。' },
uiGeneration: { displayName: '🎨 交互式 UI 生成工具', subtitle: '生成并渲染交互式 UI 组件', hint: '启用用于生成 HTML/CSS/JS 组件(按钮、表单、图表、仪表板)并在浏览器中渲染的工具。' },
contextManagement: { displayName: '🧠 自动上下文管理工具', subtitle: '自动会话跟踪与记忆管理', hint: '启用将重要决策、模式和配置自动保存到持久记忆的工具。' },
documentRAG: { displayName: '📚 文档 RAG / 与文件对话', subtitle: '为聊天启用文件索引和语义搜索', hint: '将文档附加到你的聊天消息中。插件将通过语义搜索自动从附件文件中检索相关内容。' },
textProcessing: { displayName: '📝 文本处理工具(sed/awk 等价物)', subtitle: '基于正则的文本转换与字段提取', hint: '启用用于批量文本替换、模式匹配和结构化数据提取的工具,无需 shell 依赖。' },
refactorCode: { displayName: '🔧 AST 代码重构工具', subtitle: '重命名、移动、提取函数并清理未使用的导入', hint: '启用基于 AST 的代码重构工具(rename_identifier、move_function、extract_function、unused_import_cleanup)。' },
utility: { displayName: '🛠️ 实用与维护工具', subtitle: '备份、图表生成、Markdown 预览、行操作', hint: '启用实用工具(create_backup、list_backups、restore_backup、delete_backup、cleanup_backups、generate_chart、markdown_preview)。' },
taskPlanning: { displayName: '📋 任务规划工具', subtitle: '结构化的多步骤工作流工具', hint: '启用 create_plan、update_plan_step 和 get_plan,用于结构化任务执行。' },
clusterAwareToolOrder: { displayName: '🧭 集群感知的工具排序', subtitle: '按优先级层级 + 模块中心性对暴露的工具排序,而非按字母顺序。', hint: '使用静态的 ARCHITECTURE.md 依赖图(无 fs I/O)。禁用可恢复旧版字母顺序。' },
retrievalLimit: { displayName: '🔢 检索上限', subtitle: '每次查询返回的最大块数', hint: '为每个查询要检索的相关文档块的最大数量。' },
retrievalAffinityThreshold: { displayName: '🎯 检索亲和阈值', subtitle: '最低相关度得分(0-1)', hint: '低于该相似度得分的块将被过滤掉。值越低 = 结果越多,但相关性可能更低。' },
executionJavaScript: { displayName: '⚡ 允许 JavaScript 执行', subtitle: "启用 'run_javascript' 工具", hint: '警告:代码将在你的机器上运行。' },
executionPython: { displayName: '🐍 允许 Python 执行', subtitle: "启用 'run_python' 工具", hint: '警告:代码将在你的机器上运行。' },
executionTerminal: { displayName: '💻 允许终端执行', subtitle: "启用 'run_in_terminal' 工具", hint: '打开真实的终端窗口。' },
executionShell: { displayName: '🔧 允许 Shell 命令执行', subtitle: "启用 'execute_command' 工具", hint: '警告:命令将在你的机器上运行。' },
executionTests: { displayName: '🧪 允许测试执行', subtitle: "启用 'run_tests' 工具", hint: '警告:将运行 npm jest / pytest / go test —— 可能会安装软件包并执行代码。' },
searchFallbackChain: { displayName: '🔍 搜索回退链', hint: '主要搜索引擎。不可用时自动回退到其他引擎。' },
safesearch: { displayName: '🛡️ 安全搜索', options: { off: '关闭', moderate: '中等', strict: '严格' } },
browserAutomation: { displayName: '🖥️ 浏览器自动化工具', subtitle: '无头浏览器控制与自动化', hint: '启用基于 Puppeteer 的无头浏览器自动化,用于网页抓取、测试和 UI 交互。' },
browserTimeout: { displayName: '⏱️ 浏览器超时', subtitle: '⚙️ 浏览器自动化工具的组成部分', hint: '等待浏览器操作的最大时间(毫秒),超过则超时。' },
headlessMode: { displayName: '👻 无头模式', subtitle: '⚙️ 浏览器自动化工具的组成部分', hint: '在无 GUI 的情况下运行浏览器(自动化推荐)。' },
pathValidationEnabled: { displayName: '🔒 路径校验', hint: '防止目录遍历攻击' },
binaryFileDetection: { displayName: '📁 二进制文件检测', hint: '通过空字节检查检测二进制文件' },
regexReDoSProtection: { displayName: '🛡️ ReDoS 保护', hint: '防止正则拒绝服务' },
statePersistenceEnabled: { displayName: '💽 状态持久化', hint: '在会话之间持久化工具执行状态' },
notificationsEnabled: { displayName: '🔔 桌面通知', hint: '显示系统通知' },
updateCheckEnabled: { displayName: '🔄 插件更新检查', subtitle: '静默的 LM Studio hub .VERSION 检查 —— 无新工具,无操作系统权限', hint: "每天一次,插件会静默检查已发布的 LM Studio hub .VERSION 文件中是否存在严格更新的版本。如果存在,将通过桌面通知弹窗(桌面通知开启)或聊天中的一行(关闭)进行提示。当你是最新版本或处于已忽略的版本时保持静默;状态在重新安装后依然存在。" },
temporalAwareness: { displayName: '⏰ 时间感知', subtitle: '向每条消息注入当前日期/时间', hint: '让 AI 知道当前时间。' },
dateFormatStyle: { displayName: '📅 日期格式样式', options: { standard: '标准([Zeit: ...])', heuteIst: 'HEUTE IST 模式(醒目)' } },
contextGuardEnabled: { displayName: '🧠 ContextGuard 令牌管理', subtitle: '自动历史压缩与智能读取', hint: '达到令牌限制时自动压缩聊天历史。启用智能文件读取和终端输出过滤。' },
contextGuardCompressionPercent: { displayName: '📊 压缩触发点(占上下文窗口的百分比)', subtitle: '⚙️ ContextGuard 设置', hint: "当上下文使用率达到活动模型上下文窗口的该百分比时,将触发历史压缩。如果 LM Studio 报告了模型的真实窗口,则使用它;否则应用内置的 30k 回退值。" },
contextGuardAgenticDensity: { displayName: '🔢 Agent 字符/令牌密度', subtitle: '⚙️ ContextGuard 设置', hint: '用于从字符长度估算令牌的每令牌字符数(散文 + 工具输出的 agent 混合;实测区间约 ~3.2-3.4 —— 默认值 3.6 由 owner 设定,高于该区间)。更高 = 内容更密集 = 估算令牌更少;更低则估算更多并更早触发压缩。' },
contextGuardForceSummaryOnCompress: { displayName: '💾 压缩前强制保存会话记忆', subtitle: '⚙️ ContextGuard 设置', hint: "当上下文达到你的压缩触发点时,将使用摘要模型生成结构化的会话摘要(任务描述、已完成事项、待办事项),并在压缩历史之前持久化。非致命:在任何失败情况下,之前的遥测检查点仍会运行。" },
contextGuardSmartReading: { displayName: '🔍 智能文件读取', subtitle: '⚙️ ContextGuard 设置', hint: '从用户查询中提取关键字,只读取文件的相关部分。节省令牌并加快响应速度。' },
contextGuardSummaryModel: { displayName: '🤖 摘要模型名称', subtitle: '⚙️ ContextGuard 设置', hint: '用于历史摘要的 LM Studio 模型名称。留空则使用当前聊天模型。' },
contextGuardTerminalFilterEnabled: { displayName: '📌 终端输出过滤', subtitle: '⚙️ ContextGuard 设置', hint: '自动截断冗长的终端输出以节省令牌。' },
contextGuardTerminalFilterLength: { displayName: '📏 最大终端输出长度', subtitle: '⚙️ ContextGuard 设置', hint: '在终端输出被截断和摘要之前的最大字符数。' },
compactionEnabled: { displayName: '✂️ 压缩前预摘要剪枝', subtitle: '⚙️ C 压缩家族', hint: '在对历史进行摘要之前,超出字节预算的工具负载将被替换为头/尾预览加上一个不透明定位符;完整结果仍逐字存储在 .ai_toolbox/compaction/ 中。' },
compactionMaxResultBytes: { displayName: '📏 剪枝前的最大工具结果(字节)', subtitle: '⚙️ C 压缩家族', hint: '聊天历史中每个工具结果负载的字节预算。超出该值的将在摘要前被剪枝为预览 + 定位符(逐字副本存储在磁盘上)。' },
contextUsageFooter: { displayName: '📊 工具结果中的上下文使用页脚', subtitle: '⚙️ LLM 侧限制感知', hint: "一旦预计的上下文使用量超过模型窗口的一半,每个工具结果都会获得一个简短页脚,如 [ctx ~48.3k/64k = 76%] —— 追加到字符串结果中,并在纯对象结果中添加为附加的 ctx_footer 字段(每个注册的工具都返回一个)—— 使模型始终能看到当前的令牌使用量。在 >=90% 时添加接近限制的提示。" },
autoTrackingEnabled: { displayName: '🤖 启用自动跟踪', subtitle: '自动记住重要事件', hint: '在后台静默跟踪决策、完成事项和错误修复。默认启用。' },
autoTrackTokenThreshold: { displayName: '自动跟踪令牌阈值', subtitle: '自动跟踪设置', hint: '当令牌使用率达到该百分比时触发会话记忆保存(默认:75%)。有助于防止上下文溢出。' },
autoTrackDecisions: { displayName: '📌 自动跟踪决策', subtitle: '⚙️ 自动跟踪设置', hint: '检测诸如“我决定”、“结论”、“采用”等短语。' },
autoTrackCompletions: { displayName: '✅ 自动跟踪完成事项', subtitle: '⚙️ 自动跟踪设置', hint: '检测诸如“成功完成”、“实现完毕”等短语。' },
autoTrackErrors: { displayName: '🐛 自动跟踪错误修复', subtitle: '⚙️ 自动跟踪设置', hint: '检测诸如“修复了错误”、“解决了问题”等短语。' },
autoSummaryInterval: { displayName: '📊 会话摘要间隔', subtitle: '⚙️ 自动跟踪设置', hint: '两次自动会话摘要之间的消息数量。值越大 = 频率越低。' },
// Budget-Guard-Arc i18n (06.11, owner 规则“所有工具描述必须始终翻译”): config.ts 的 EN 回退值保持字节级一致。
budgetGuardEnabled: { displayName: '🛡️ 预算守卫(上下文限制保护)', hint: '确定性上下文预算守卫的主开关 —— M1 预读门、M2 感知预算的溢出上限、M3 在 85% 边缘自动持久化。默认开启(06.11);关闭可恢复字节级相同的旧行为。' },
budgetGuardAdvisoryThresholdPct: { displayName: '🔢 预算守卫咨询阈值 (%)', subtitle: '⚙️ 预算守卫设置', hint: 'M1 预读门:当使用量超过上下文限制的此百分比时,读取工具返回自描述的预算咨询而非完整转储。' },
budgetGuardSpillThresholdPct: { displayName: '✂️ 预算守卫溢出阈值 (%)', subtitle: '⚙️ 预算守卫设置', hint: 'M2 溢出门槛:工具结果超过此百分比时写入磁盘(绝对值与预算相对上限中更严格者生效)。' },
budgetGuardAutopauseThresholdPct: { displayName: '💾 预算守卫自动持久化边缘 (%)', subtitle: '⚙️ 预算守卫设置', hint: 'M3:达到此百分比边缘时自动保存会话记忆,每会话最多一次。' },
budgetGuardSafetyMarginPct: { displayName: '🧮 预算守卫安全边际 (%)', subtitle: '⚙️ 预算守卫设置', hint: '为 M2 预算计算从上下文限制中保留的余量 —— 限制 × (1 − 边际/100);默认 8 ⇒ 在 92% 处溢出。' },
},
general: {
pluginName: 'AI Toolbox 插件',
enabledTools: '已启用的工具:',
disabledTools: '禁用的工具:',
errorPrefix: '错误:',
successPrefix: '成功:',
yesWord: '确认',
noWord: '取消',
},
};