* feat(engine): 翻译凭据测试新增 translation.ai 服务类型 * feat(server): 候选词翻译新增 AI 辅助提供方,收敛为单一 translation.provider * feat(ui-html): 候选词翻译新增 AI 辅助提供方并跟随单一 provider * fix(server): 将 ai_translation 加入编译目标与测试套件 * fix(server): 在 AiTranslation 命名空间导出 ParseTranslations 供测试调用 * fix(server): 解析模型返回时剥除 Markdown 代码块标记 * fix(server): AI 候选词翻译校验占位 Token、收紧解析,翻译配置改读快照 - AI 翻译的 Token 改用 IsUsableSecret 校验,出厂模板的占位符不再被当成可用凭据 - 解析模型回复时,合法 JSON 但键不对、数组长度不符或残缺 JSON 一律作废,不再把原文当译文显示和写进释义库 - 从旧布尔推导出腾讯云时保留 tencent_tmt.enabled 门禁;在设置页明确选择时才打开,升级不会替用户向腾讯云发送候选词 - 候选词翻译读取的 provider 与各服务配置合成一份加锁快照,配置重载时整份替换,候选线程和翻译 worker 不再直接读会被改写的全局字符串;每个任务只解析当前服务的配置 - provider 与三个旧布尔一次原子写入;旧的 niutrans/custom enabled 开关改为切换 provider - AI 联想与 AI 翻译共用 ChatCompletions 传输层,翻译超时与 AI 联想一致改为 8 秒 - 设置页凭据测试与运行时共用 AiTranslation::FromConfiguredTranslation,provider 白名单只保留 IsValidTranslationProvider 一处 * fix(ui-html): 候选词翻译的 AI 配置提示随 AI 辅助页实时更新 AI 辅助页改服务商、地址、Token 或模型后,翻译区的提示和摘要立刻刷新,不用重开设置窗口;可用性判断与服务端一致,占位 Token 不算已配置。 --------- Co-authored-by: fanlusky <1730976608@qq.com>
Metasequoia IME Server(水杉输入法 Server 端)
This is the server end of MSIME-Windows.
How to build
Prerequisites
- Visual Studio 2026
- CMake
- vcpkg
- Python3.10+
- Boost
- Node.js and pnpm 10 (settings page build)
Make sure vcpkg and Boost are installed by Scoop.
Build steps(For Dev)
Clone the product and provision the reviewed dictionary release from its root:
git clone --recursive https://github.com/metasequoiaime/MSIME-Windows.git
cd MSIME-Windows
python scripts/product_lock.py fetch-dictionaries --staging-root .
if ($LASTEXITCODE -ne 0) { throw 'Dictionary verification failed' }
$devLocalData = Join-Path $PWD 'build/dev-local'
$devData = Join-Path $devLocalData 'metasequoiaime'
New-Item -ItemType Directory -Force $devData | Out-Null
Copy-Item MetasequoiaImeDict/out/* $devData -Force
Copy-Item engine/helpcode/helpcodes $devData -Recurse -Force
Copy-Item server/assets/tables/* $devData -Force
Copy-Item server/assets/config/config.toml $devData -Force
Push-Location ui-html/webview2/settings/ime-settings
try {
pnpm install --frozen-lockfile
if ($LASTEXITCODE -ne 0) { throw 'Settings dependencies failed' }
pnpm build
if ($LASTEXITCODE -ne 0) { throw 'Settings page build failed' }
} finally { Pop-Location }
$devWebview = Join-Path $devData 'html/webview2'
New-Item -ItemType Directory -Force $devWebview | Out-Null
foreach ($part in @('shared', 'candwnd', 'ftb', 'menu')) {
Copy-Item "ui-html/webview2/$part" $devWebview -Recurse -Force
}
$devSettings = Join-Path $devWebview 'settings/ime-settings'
New-Item -ItemType Directory -Force $devSettings | Out-Null
Copy-Item ui-html/webview2/settings/ime-settings/dist $devSettings -Recurse -Force
python server/scripts/prepare_env.py
if ($LASTEXITCODE -ne 0) { throw 'Server environment setup failed' }
$env:LOCALAPPDATA = $devLocalData
$env:METASEQUOIA_IME_DATA_DIR = $devData
cd server
Use a dedicated PowerShell terminal. These steps stage the same locked data as CI
and the current product pages in a separate development directory. Both
LOCALAPPDATA (Windows config/pages) and METASEQUOIA_IME_DATA_DIR (Engine data)
are set for that terminal; setting only the latter would still use installed
Windows configuration and pages. Close the terminal after development.
Dictionary source changes belong in Engine's dictionary/; use its root build_profile.py
to build data instead of calling internal stages in the archived Dict repository.
Then, build and run,
.\scripts\lcompile.ps1
.\scripts\lrun.ps1
If you want to build and run in one step, run the following command,
.\scripts\llaunch.ps1
Watchdog
MetasequoiaImeWatchdog.exe is built next to the server. Starting the server directly also starts the watchdog,
which monitors the server from the same directory and restarts it after an unexpected exit. Repeated early crashes use
an exponential restart delay (up to 30 seconds) to avoid a restart storm.
The developer terminate shortcut stops both processes. The restart shortcut asks the watchdog to start a fresh server after the current process exits.
English prefix candidates
Place english.db next to msime.db in %LOCALAPPDATA%\metasequoiaime. Set
general.cn_en_mixed_input = true in config.toml to enable asynchronous English prefix candidates for Quanpin and
Shuangpin. The master switch utility.mixed_candidates must also be on; English, emoji, kaomoji and date/time mixed
candidates are queried together on the single MixedCandidates worker thread (src/mixed/).
Developer Shortcuts
The server process includes a few built-in global shortcuts that are useful during development:
Ctrl + Shift + Alt + T- terminate
MetasequoiaImeServerimmediately
- terminate
Ctrl + Shift + Alt + R- restart
MetasequoiaImeServer - Settings exposes the same restart under 外观 → 重启输入法进程; it reaches the server over the Aux pipe because Settings runs in its own process
- restart
Ctrl + Shift + Alt + C- clear IME engine cache
Ctrl + Shift + Alt + 1toCtrl + Shift + Alt + 8- delete candidate
1to8from the current candidate window - this only works while the candidate window is visible
- delete candidate
Screenshots
Shared voice providers
The server links Engine VoiceCapture and Voice. WAV encoding and batch transcription/polish codecs come from the public library; Windows keeps provider configuration, SiliconFlow padding/retry behavior and Doubao streaming. Batch uploads are bounded to 20 MiB and responses to 1 MiB. Failed or empty polish responses retain the original transcript.
本地 Release 构建脚本可通过 -ManifestTool <mt.exe 路径> 使用其他 Windows SDK;未指定时沿用现有 SDK 路径。配置、编译或 manifest 嵌入失败都会中止,避免安装器收集旧产物。






