Forked from crunch3r/ai-toolbox
Forked from crunch3r/ai-toolbox
src / locales / zh-TW.ts
src / locales / zh-TW.ts
/**
* Traditional Chinese (zh-TW) translations for AI Toolbox plugin
*/
import type { FullTranslationSet } from './types';
export const zhTWTranslations: 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: '⚠️ 會話警告:你已達到 token 上限的 {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: '在操作之後自動 commit 變更' },
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: '透過 null byte 檢查偵測二進位檔案' },
regexReDoSProtection: { displayName: '🛡️ ReDoS 防護', hint: '防止正則拒絕服務' },
statePersistenceEnabled: { displayName: '💽 狀態持久化', hint: '在會話之間持久化工具執行狀態' },
notificationsEnabled: { displayName: '🔔 桌面通知', hint: '顯示系統通知' },
updateCheckEnabled: { displayName: '🔄 外掛更新檢查', subtitle: '靜默的 LM Studio hub .VERSION 檢查 —— 無新工具、無 OS 權限', hint: "每日一次,外掛會靜默檢查已發佈的 LM Studio hub .VERSION 檔案是否存在嚴格更新的版本。若存在,將透過桌面通知彈窗(桌面通知開啟)或聊天中的一行(關閉)提示。當你是最新版本或處於已忽略的版本時保持靜音;狀態在重新安裝後仍存在。" },
temporalAwareness: { displayName: '⏰ 時間感知', subtitle: '向每則訊息注入當前日期/時間', hint: '讓 AI 知道目前時間。' },
dateFormatStyle: { displayName: '📅 日期格式樣式', options: { standard: '標準([Zeit: ...])', heuteIst: 'HEUTE IST 模式(醒目)' } },
contextGuardEnabled: { displayName: '🧠 ContextGuard Token 管理', subtitle: '自動歷史壓縮與智慧閱讀', hint: '達到 token 上限時自動壓縮聊天歷史。啟用智慧檔案閱讀與終端輸出過濾。' },
contextGuardCompressionPercent: { displayName: '📊 壓縮觸發點(占上下文視窗百分比)', subtitle: '⚙️ ContextGuard 設定', hint: "當上下文使用率達到活躍模型上下文視窗的該百分比時,即觸發歷史壓縮。若 LM Studio 回報了模型的真實視窗則採用之;否則套用內建的 30k fallback。" },
contextGuardAgenticDensity: { displayName: '🔢 Agent 字元/Token 密度', subtitle: '⚙️ ContextGuard 設定', hint: '用於由字元長度估算 token 的每-token 字元數(散文 + 工具輸出的 agent 混合;實測區間約 ~3.2-3.4 —— 預設值 3.6 由 owner 設定於該區間之上)。越高 = 內容越密集 = 估算 token 越少;越低則估算越多並更早觸發壓縮。' },
contextGuardForceSummaryOnCompress: { displayName: '💾 壓縮前強制儲存會話記憶', subtitle: '⚙️ ContextGuard 設定', hint: "當上下文達到你的壓縮觸發點時,將以摘要模型產生結構化的會話摘要(任務描述、已完成事項、待辦事項),並在歷史被壓縮之前持久化。非致命:任何失敗時,先前的遙測檢查點仍會執行。" },
contextGuardSmartReading: { displayName: '🔍 智慧檔案閱讀', subtitle: '⚙️ ContextGuard 設定', hint: '從使用者查詢中萃取關鍵詞,僅讀取檔案的相關部分。節省 token 並加速回應。' },
contextGuardSummaryModel: { displayName: '🤖 摘要模型名稱', subtitle: '⚙️ ContextGuard 設定', hint: '用於歷史摘要的 LM Studio 模型名稱。留空則使用目前聊天模型。' },
contextGuardTerminalFilterEnabled: { displayName: '📌 終端輸出過濾', subtitle: '⚙️ ContextGuard 設定', hint: '自動截斷冗長的終端輸出以節省 token。' },
contextGuardTerminalFilterLength: { displayName: '📏 最大終端輸出長度', subtitle: '⚙️ ContextGuard 設定', hint: '終端輸出被截斷並摘要之前的最大字元數。' },
compactionEnabled: { displayName: '✂️ 壓縮前預先摘要剪枝', subtitle: '⚙️ C 壓縮家族', hint: '在對歷史做摘要之前,超出位元組預算的工具 payload 會被替換為頭/尾預覽加上一個不透明定位器;完整結果仍逐字儲存在 .ai_toolbox/compaction/ 中。' },
compactionMaxResultBytes: { displayName: '📏 剪枝前的最大工具結果(位元組)', subtitle: '⚙️ C 壓縮家族', hint: '聊天歷史中每個工具結果 payload 的位元組預算。超過此值的會在摘要前被剪枝為預覽 + 定位器(逐字副本儲存在磁碟上)。' },
contextUsageFooter: { displayName: '📊 工具結果中的上下文使用頁尾', subtitle: '⚙️ LLM 側限制感知', hint: "一旦預估的上下文使用量超過模型視窗的一半,每個工具結果都會附帶一個簡短頁尾,例如 [ctx ~48.3k/64k = 76%] —— 附加到字串結果上,並對純物件結果加入加成的 ctx_footer 欄位(每個已註冊的工具都回傳一個)—— 讓模型隨時看到目前的 token 使用量。在 >=90% 時會加上接近上限的建議訊息。" },
autoTrackingEnabled: { displayName: '🤖 啟用自動追蹤', subtitle: '自動記住重要事件', hint: '在背景靜默追蹤決策、完成事項與 bug 修復。預設啟用。' },
autoTrackTokenThreshold: { displayName: '自動追蹤 Token 閾值', subtitle: '自動追蹤設定', hint: "當 token 使用率達到該百分比時觸發會話記憶儲存(預設:75%)。有助於防止上下文溢出。" },
autoTrackDecisions: { displayName: '📌 自動追蹤決策', subtitle: '⚙️ 自動追蹤設定', hint: '偵測「我決定了」,「結論」,「就用這個」等措辭。' },
autoTrackCompletions: { displayName: '✅ 自動追蹤完成事項', subtitle: '⚙️ 自動追蹤設定', hint: '偵測「成功完成」,「實作完畢」等措辭。' },
autoTrackErrors: { displayName: '🐛 自動追蹤 Bug 修復', subtitle: '⚙️ 自動追蹤設定', hint: '偵測「修好了 bug」,「解決了問題」等措辭。' },
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: '取消',
},
};
/**
* Traditional Chinese (zh-TW) translations for AI Toolbox plugin
*/
import type { FullTranslationSet } from './types';
export const zhTWTranslations: 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: '⚠️ 會話警告:你已達到 token 上限的 {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: '在操作之後自動 commit 變更' },
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: '透過 null byte 檢查偵測二進位檔案' },
regexReDoSProtection: { displayName: '🛡️ ReDoS 防護', hint: '防止正則拒絕服務' },
statePersistenceEnabled: { displayName: '💽 狀態持久化', hint: '在會話之間持久化工具執行狀態' },
notificationsEnabled: { displayName: '🔔 桌面通知', hint: '顯示系統通知' },
updateCheckEnabled: { displayName: '🔄 外掛更新檢查', subtitle: '靜默的 LM Studio hub .VERSION 檢查 —— 無新工具、無 OS 權限', hint: "每日一次,外掛會靜默檢查已發佈的 LM Studio hub .VERSION 檔案是否存在嚴格更新的版本。若存在,將透過桌面通知彈窗(桌面通知開啟)或聊天中的一行(關閉)提示。當你是最新版本或處於已忽略的版本時保持靜音;狀態在重新安裝後仍存在。" },
temporalAwareness: { displayName: '⏰ 時間感知', subtitle: '向每則訊息注入當前日期/時間', hint: '讓 AI 知道目前時間。' },
dateFormatStyle: { displayName: '📅 日期格式樣式', options: { standard: '標準([Zeit: ...])', heuteIst: 'HEUTE IST 模式(醒目)' } },
contextGuardEnabled: { displayName: '🧠 ContextGuard Token 管理', subtitle: '自動歷史壓縮與智慧閱讀', hint: '達到 token 上限時自動壓縮聊天歷史。啟用智慧檔案閱讀與終端輸出過濾。' },
contextGuardCompressionPercent: { displayName: '📊 壓縮觸發點(占上下文視窗百分比)', subtitle: '⚙️ ContextGuard 設定', hint: "當上下文使用率達到活躍模型上下文視窗的該百分比時,即觸發歷史壓縮。若 LM Studio 回報了模型的真實視窗則採用之;否則套用內建的 30k fallback。" },
contextGuardAgenticDensity: { displayName: '🔢 Agent 字元/Token 密度', subtitle: '⚙️ ContextGuard 設定', hint: '用於由字元長度估算 token 的每-token 字元數(散文 + 工具輸出的 agent 混合;實測區間約 ~3.2-3.4 —— 預設值 3.6 由 owner 設定於該區間之上)。越高 = 內容越密集 = 估算 token 越少;越低則估算越多並更早觸發壓縮。' },
contextGuardForceSummaryOnCompress: { displayName: '💾 壓縮前強制儲存會話記憶', subtitle: '⚙️ ContextGuard 設定', hint: "當上下文達到你的壓縮觸發點時,將以摘要模型產生結構化的會話摘要(任務描述、已完成事項、待辦事項),並在歷史被壓縮之前持久化。非致命:任何失敗時,先前的遙測檢查點仍會執行。" },
contextGuardSmartReading: { displayName: '🔍 智慧檔案閱讀', subtitle: '⚙️ ContextGuard 設定', hint: '從使用者查詢中萃取關鍵詞,僅讀取檔案的相關部分。節省 token 並加速回應。' },
contextGuardSummaryModel: { displayName: '🤖 摘要模型名稱', subtitle: '⚙️ ContextGuard 設定', hint: '用於歷史摘要的 LM Studio 模型名稱。留空則使用目前聊天模型。' },
contextGuardTerminalFilterEnabled: { displayName: '📌 終端輸出過濾', subtitle: '⚙️ ContextGuard 設定', hint: '自動截斷冗長的終端輸出以節省 token。' },
contextGuardTerminalFilterLength: { displayName: '📏 最大終端輸出長度', subtitle: '⚙️ ContextGuard 設定', hint: '終端輸出被截斷並摘要之前的最大字元數。' },
compactionEnabled: { displayName: '✂️ 壓縮前預先摘要剪枝', subtitle: '⚙️ C 壓縮家族', hint: '在對歷史做摘要之前,超出位元組預算的工具 payload 會被替換為頭/尾預覽加上一個不透明定位器;完整結果仍逐字儲存在 .ai_toolbox/compaction/ 中。' },
compactionMaxResultBytes: { displayName: '📏 剪枝前的最大工具結果(位元組)', subtitle: '⚙️ C 壓縮家族', hint: '聊天歷史中每個工具結果 payload 的位元組預算。超過此值的會在摘要前被剪枝為預覽 + 定位器(逐字副本儲存在磁碟上)。' },
contextUsageFooter: { displayName: '📊 工具結果中的上下文使用頁尾', subtitle: '⚙️ LLM 側限制感知', hint: "一旦預估的上下文使用量超過模型視窗的一半,每個工具結果都會附帶一個簡短頁尾,例如 [ctx ~48.3k/64k = 76%] —— 附加到字串結果上,並對純物件結果加入加成的 ctx_footer 欄位(每個已註冊的工具都回傳一個)—— 讓模型隨時看到目前的 token 使用量。在 >=90% 時會加上接近上限的建議訊息。" },
autoTrackingEnabled: { displayName: '🤖 啟用自動追蹤', subtitle: '自動記住重要事件', hint: '在背景靜默追蹤決策、完成事項與 bug 修復。預設啟用。' },
autoTrackTokenThreshold: { displayName: '自動追蹤 Token 閾值', subtitle: '自動追蹤設定', hint: "當 token 使用率達到該百分比時觸發會話記憶儲存(預設:75%)。有助於防止上下文溢出。" },
autoTrackDecisions: { displayName: '📌 自動追蹤決策', subtitle: '⚙️ 自動追蹤設定', hint: '偵測「我決定了」,「結論」,「就用這個」等措辭。' },
autoTrackCompletions: { displayName: '✅ 自動追蹤完成事項', subtitle: '⚙️ 自動追蹤設定', hint: '偵測「成功完成」,「實作完畢」等措辭。' },
autoTrackErrors: { displayName: '🐛 自動追蹤 Bug 修復', subtitle: '⚙️ 自動追蹤設定', hint: '偵測「修好了 bug」,「解決了問題」等措辭。' },
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: '取消',
},
};