Introduce a unified ExternalProviderAdapter framework to standardize the detection and import process for various external provider configurations (e.g., Codex, Claude Code, Gemini CLI, OpenCode), reducing maintenance overhead and improving consistency.
# [Feature]: 统一外部 Provider 导入为共享 Adapter 框架 / Unify external provider imports under a shared adapter framework ## Problem / pain point / 问题 现在已经支持多种外部配置导入: - Codex - Claude Code - Gemini CLI - OpenCode 这已经很有价值,但 detect/import 仍然是逐个来源定制实现。随着来源继续增加,维护成本和漂移风险会越来越高。 We already support several external config sources, but each still owns a bespoke detect/import path. ## Proposed solution / 方案 引入统一的 `ExternalProviderAdapter` 形状,让每个 adapter 负责: - `detect()` - `import()` - warnings - active provider / model - secret material 只在 import 路径可见,不暴露到 renderer - 可选 capability hints This should preserve current safety guarantees while reducing duplicated plumbing. ## Alternatives considered / 备选方案 - 继续每个 importer 单写 - 重复逻辑会持续增长 ## Scope / 范围 Provider / model ## Acceptance criteria / 验收标准 - 现有 external imports 可映射到统一 adapter contract - detection 与 import 仍可分离,避免 secret 穿过 IPC - renderer 侧 detection metadata 仍是 sanitized 的 - 不削弱现有 env-key / secret 安全约束 - 先迁移至少一个来源验证抽象是否合理 ## Likely tou