[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 / 备选方案
Scope / 范围
Provider / model
Acceptance criteria / 验收标准
- 现有 external imports 可映射到统一 adapter contract
- detection 与 import 仍可分离,避免 secret 穿过 IPC
- renderer 侧 detection metadata 仍是 sanitized 的
- 不削弱现有 env-key / secret 安全约束
- 先迁移至少一个来源验证抽象是否合理
Likely touchpoints / 可能涉及
apps/desktop/src/main/onboarding-ipc.ts
apps/desktop/src/main/imports/*.ts
packages/shared/src/detection.ts
[Feature]: 统一外部 Provider 导入为共享 Adapter 框架 / Unify external provider imports under a shared adapter framework
Problem / pain point / 问题
现在已经支持多种外部配置导入:
这已经很有价值,但 detect/import 仍然是逐个来源定制实现。随着来源继续增加,维护成本和漂移风险会越来越高。
We already support several external config sources, but each still owns a bespoke detect/import path.
Proposed solution / 方案
引入统一的
ExternalProviderAdapter形状,让每个 adapter 负责:detect()import()This should preserve current safety guarantees while reducing duplicated plumbing.
Alternatives considered / 备选方案
Scope / 范围
Provider / model
Acceptance criteria / 验收标准
Likely touchpoints / 可能涉及
apps/desktop/src/main/onboarding-ipc.tsapps/desktop/src/main/imports/*.tspackages/shared/src/detection.ts