feat: 设置面板 + Provider 扩展 + 构建脚本
- 设置面板:三步引导 / AI 配置 / API Key / 规则管理 / 连接测试 - Provider 重构:统一 OpenAICompatibleProvider 基类,新增 Gemini/Claude/混元/智谱等 - 审查面板 Webview:三 Tab、统计卡片、问题列表、postMessage 通信 - esbuild 构建脚本 + 生产打包 + PMD 下载 - 保存文件自动静态分析(500ms debounce)
This commit is contained in:
@@ -48,7 +48,7 @@ Phase 4 内部必须按 4.1 → 4.2 → 4.3 → 4.4 → 4.5 → 4.6 顺序,Fix
|
||||
|------|------|------|
|
||||
| `src/types.ts` | 新建 | `LinterDiagnostic`、`AdapterResult`、`LinterAdapter` 等公共类型 |
|
||||
| `src/config/index.ts` | 新建 | 统一导出 |
|
||||
| `src/config/ai.ts` | 新建 | AI 配置 getter(provider/model/endpoint/temperature/timeout/outputLanguage) |
|
||||
| `src/config/ai.ts` | 新建 | AI 配置 getter(provider/model/baseUrl/temperature/timeout/outputLanguage) |
|
||||
| `src/config/linter.ts` | 新建 | Linter 配置 getter(linters.xxx 语言-linter 映射、PMD 路径) |
|
||||
| `src/config/fixer.ts` | 新建 | 修复器配置(contextLines) |
|
||||
| `src/config/secret.ts` | 新建 | API Key SecretStorage(get/set/delete/isConfigured) |
|
||||
@@ -91,7 +91,7 @@ export interface LinterAdapter {
|
||||
|------|--------|------|--------|
|
||||
| ai | `ai.provider` | enum | `deepseek` |
|
||||
| ai | `ai.model` | string | `deepseek-chat` |
|
||||
| ai | `ai.endpoint` | string | `https://api.deepseek.com/v1` |
|
||||
| ai | `ai.baseUrl` | string | `https://api.deepseek.com/v1` |
|
||||
| ai | `ai.temperature` | number | 0.2 |
|
||||
| ai | `ai.timeout` | number | 300 |
|
||||
| ai | `ai.outputLanguage` | string | `zh-CN` |
|
||||
@@ -270,7 +270,7 @@ jars/pmd/
|
||||
| `src/ai/providers/base.ts` | 新建 | `AIProvider` 抽象基类 + `ChatOptions` 接口 |
|
||||
| `src/ai/providers/deepseek.ts` | 新建 | `DeepSeekProvider extends AIProvider` |
|
||||
| `src/ai/providers/openai.ts` | 新建 | `OpenAIProvider extends AIProvider` |
|
||||
| `src/ai/factory.ts` | 新建 | `createProvider(providerId, apiKey, endpoint)` 工厂函数 |
|
||||
| `src/ai/factory.ts` | 新建 | `createProvider(providerId, apiKey, baseUrl)` 工厂函数 |
|
||||
|
||||
**Provider 接口**:
|
||||
```typescript
|
||||
@@ -283,7 +283,7 @@ interface ChatOptions {
|
||||
abstract class AIProvider {
|
||||
abstract id: string;
|
||||
abstract name: string;
|
||||
constructor(protected apiKey: string, protected endpoint: string) {}
|
||||
constructor(protected apiKey: string, protected baseUrl: string) {}
|
||||
abstract chat(systemPrompt: string, userPrompt: string, options: ChatOptions): Promise<string>;
|
||||
}
|
||||
```
|
||||
@@ -499,7 +499,7 @@ applyFix() 应用修复到编辑器(单条 / 批量倒序)
|
||||
| 快速开始 | 三步引导(①②③ 圆形序号,完成变紫色) | 实时状态 |
|
||||
| 审核引擎 | 三个模块标签(紫/琥珀/绿圆点) | 静态 |
|
||||
| AI 模型配置 | 提供商下拉框 + 模型下拉框 + 状态标签 | `ai.provider` / `ai.model` |
|
||||
| API Key | 密码输入框 + Base URL + 状态标签 | SecretStorage / `ai.endpoint` |
|
||||
| API Key | 密码输入框 + Base URL + 状态标签 | SecretStorage / `ai.baseUrl` |
|
||||
| 输出语言 | 下拉框 | `ai.outputLanguage` |
|
||||
| 自定义规则 | 开关列表 + 添加行 | `.code-review/config.yaml` |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user