Skip to content

feat: i18n + MCP + AGENTS.md enhancements#307

Open
WqyJh wants to merge 18 commits into
mainfrom
mirror/pr-547
Open

feat: i18n + MCP + AGENTS.md enhancements#307
WqyJh wants to merge 18 commits into
mainfrom
mirror/pr-547

Conversation

@WqyJh

@WqyJh WqyJh commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • 国际化 (i18n):完成 TUI 界面全量中文/繁体中文/英文化,覆盖 permission、question、error、dialog 等组件
  • MCP 增强:新增 Chrome DevTools MCP Server 和 Playwright MCP Server 配置
  • AGENTS.md 增强:新增 /init 语言管控、/review skill 提取、/distill 持续运行规范
  • Bug 修复:修复 MimoFreeAuthPlugin 类型守卫阻塞、runLoop 无限循环守卫
  • 仓库维护:更新 .gitignore、仓库结构文档、新增 start.bat/run.bat 启动脚本

Changes

新增功能

  • TUI i18n 系统:新增 \en.ts\、\zh.ts\、\zht.ts\ 国际化文件,覆盖 ~200+ 硬编码字符串
  • Chrome DevTools MCP Server (v1.2.0) 集成
  • Playwright MCP Server 集成
  • /distill\ 命令支持持续运行直到目标达成
  • /review\ 命令自动提取重复工作流为 skills

Bug 修复

  • 修复 \MimoFreeAuthPlugin\ 中 ??=\ 运算符导致 mimo-auto 被阻塞的问题
  • 修复 runLoop 无限循环守卫 + busy elapsed time 显示
  • 修复 heap snapshot i18n 参数类型错误

国际化

  • 翻译所有 TUI 硬编码字符串(Thinking、Thought、Click to expand/collapse 等)
  • 翻译 retry 错误消息(Too Many Requests 等)
  • 翻译 permission dialog 中的 'allow always' 字符串
  • 新增繁体中文 (\zht.ts) 完整翻译

文档与维护

  • 更新 AGENTS.md:新增语言强制约束、开发编码规范、命令说明
  • 更新仓库结构文档,移除 web 包
  • .gitignore 新增 dev/test 产物排除
  • 新增 start.bat/run.bat Windows 启动脚本

Mirrored from XiaomiMiMo/MiMo-Code#547 — original author @dxdw2021.

dxdw2021 added 18 commits June 12, 2026 01:21
bat 使用 --cwd 覆盖了工作目录,导致 cd /d 失效。
将 %WORK_DIR% 作为位置参数传递给 src/index.ts,CLI 的  [project]
命令会执行 process.chdir() 切换到正确目录。
- Add retry i18n keys to en/zh/zht/ja/fr/es/ru (prompt retry display)
- Convert hardcoded retry string to use t() in prompt component
- Fix missing UI zh translations: sessionReview diffs/showAll/showLess/more
- Add repo structure and architecture docs to AGENTS.md
- Add 6 missing UI keys to zht (sessionReview diffs)
- Add 30 missing TUI keys to zht (login/provider dialogs)
- All 4 locale files now have 100% key coverage (UI 147, TUI 349)
- autocomplete: 'No matching items' → t()
- prompt: '(click to expand)', 'exit shell mode' → t()
- app: toast messages for fork/update/heap/snapshot/model → t()
- app: dialog titles for update complete → t()
- app: interactive bash description → t()
- Add zh/zht translations for all new keys
…o provider

Root cause: MimoFreeAuthPlugin.config() used \input.provider.mimo ??= { ... }\
which skips the ENTIRE provider setup when user's dev-home config already defines
a \mimo\ entry (e.g. with deepseek-v4-flash-free model only). Since ??= checks
for null/undefined, a partial config entry is enough to block all plugin defaults.

This also explains why after Xiaomi login + logout, 'MiMo Auto (free) 通道未加载'
still appears: bootstrap() rebuilds provider list, hits same ??= issue, and
mimo-auto is never merged into the provider's model list.

Fix: Replace bulk \??=\ with individual \??=\ per field (name, npm, api, options,
models[mimo-auto]). This lets the plugin's defaults merge correctly with any
user-defined partial config, ensuring mimo-auto is always available.
There are two .dev-home directories:
  - .dev-home/ (correct, already gitignored)
  - .dev-home / (with trailing space in name, NOT gitignored)

The stray directory is likely from a copy/paste mishap and contains
logs and other runtime data that should never be committed.
Replace hardcoded English strings in permission.tsx with t() calls:
  - 'This will allow {permission} until MiMoCode is restarted.'
  - 'This will allow the following patterns until MiMoCode is restarted'
  - 'Confirm' / 'Cancel' buttons

Add translations to zh.ts and zht.ts. Other languages fall back to English.
Configure @playwright/mcp v0.0.76 as a local MCP server with:
- Chromium browser (already installed)
- PLAYWRIGHT_BROWSERS_PATH pointing to existing install
- 120s timeout for browser operations
…stion.tsx

permission.tsx: replace all hardcoded English UI strings with t() calls
- Permission titles for edit/read/glob/grep/list/bash/task/webfetch/websearch/codesearch/ext_dir/doom_loop
- Label text (Path/Pattern/URL/Query/Tool/Patterns)
- Error text (No diff provided)
- Button labels (Confirm/Cancel)
- Keyboard hints (select/confirm/minimize/fullscreen)

question.tsx: replace hardcoded strings with t() calls
- Tab label (Confirm/Review)
- Multi-select hint, custom answer text, not-answered placeholder
- All keyboard hints (tab/select/submit/toggle/confirm/dismiss)

Add zh.ts and zht.ts Chinese translations, en.ts as fallback.
Add chrome-devtools-mcp for Chrome DevTools Protocol access:
- DOM/CSS inspection, network/performance profiling
- Automatically launched via npx when MiMoCode starts
ReasoningHeader: 'Thinking' -> tui.reasoning.thinking, 'Thought' -> tui.reasoning.thought
GenericTool/Bash/Write/ApplyPatch: all 'Click to expand/collapse' -> tui.tool.*
Write: 'N line(s)' -> tui.tool.line/lines with count
ApplyPatch: 'N change(s)' -> tui.tool.click_to_expand_changes
Add zh.ts/zht.ts Chinese translations
…ent and skill extraction

AGENTS.md: add comprehensive Chinese language rules, dev standards, and command reference section
initialize.txt: add zh.ts language mode header, mandatory Chinese enforcement section, and command reference template
review.txt: add language constraint header and 'Extract Repeated Workflows As Skills' phase to auto-create .mimocode/skills/ from diff patterns
distill.txt: add language header, explicit stop condition, and /goal clear auto-cleanup on completion
…inese

Add retryMessageMap in prompt/index.tsx to translate server-side error
messages (Too Many Requests / Provider is overloaded / Rate Limited /
Transient network error) via i18n keys.
Also translate 'Retry Error' dialog title.

Add keys to en.ts/zh.ts/zht.ts.
- 更新 AGENTS.md 中的包描述,新增 storybook、slack、enterprise、extensions 等包的说明
- 添加子包 AGENTS.md 约束摘要
- 移除 packages/web 及其相关依赖
- 将各包版本号从 1.14.19 降至 0.1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants