feat(grokbuild): add first-class Grok Build support (#5453)
main ← YUZHEthefool:feat/grokbuild-support
已合并 07:50AM - 17 Jul 26 UTC
## Summary / ??
Add Grok Build CLI as a first-class switchable app backed by it…s native `~/.grok/config.toml` format.
- manage, import, browse, and switch Grok Build providers with structured `[models]` / `[model.*]` configuration
- expose an independent `/grokbuild/v1/responses` route with its own provider namespace and failover queue
- make routed hot switches transactional so failed writes restore the previous provider, backup, and live config
- integrate Grok Build with MCP, prompts (`~/.grok/AGENTS.md`), Skills, native sessions, settings, and tray switching
- add complete Grok CLI lifecycle management in Settings > About: installation status, current/latest versions, refresh, one-click install/upgrade, bulk upgrades, conflict diagnostics, and manual install commands
- align Grok provider icons with existing apps: custom providers use the name-initial fallback, presets keep their own icons, and legacy auto-assigned Grok icons are normalized without overriding explicit user choices
- add schema migrations and regression coverage for provider switching, routing rollback, MCP serialization, sessions, and UI flows
## Related Issue / ?? Issue
Fixes #5407
Related prior discussion: #4825
## Implementation Notes
- Grok remote MCP keeps Grok-native `headers` and omits Codex-only `type` / `http_headers` fields.
- Provider switches and proxy teardown preserve `[mcp_servers.*]` entries in `config.toml`.
- Session management reads native `~/.grok/sessions/**/summary.json` and `chat_history.jsonl`, and resumes with `grok --resume <session-id>`.
- Prompt auto-import covers both first launch and database migration paths.
- CLI installation and updates use the official `@xai-official/grok` package; updates stay anchored to the detected npm/Volta/pnpm/Bun installation, including Grok-specific WSL directory overrides.
- Grok provider cards now follow the shared icon semantics: blank custom icons render provider initials, preset icons remain provider-specific, and the compatibility path distinguishes old automatic Grok icons from explicitly selected ones.
## Screenshots / ??
No static screenshot included. The complete Tauri debug build was manually verified on Windows 11 with real Grok provider, session, and Skills data.
## Verification
- `npm run typecheck`
- `npm run format:check`
- `npm run test:unit -- --testTimeout=15000` (72 files, 462 tests)
- `cargo fmt --all -- --check`
- `cargo clippy --all-targets --all-features -- -D warnings`
- `cargo test` with isolated `LOCALAPPDATA` (1,995 passed, 2 ignored, plus all integration suites)
- `npx tauri build --debug --no-bundle --ignore-version-mismatches` with the existing production frontend bundle
## Checklist / ????
- [x] `pnpm typecheck` equivalent passes via the repository `npm run typecheck` script
- [x] `pnpm format:check` equivalent passes via the repository `npm run format:check` script
- [x] `cargo clippy` passes with warnings denied
- [x] Updated all four locale files for user-facing text