refactor: 清理未使用的类型定义和接口字段

- 移除 Provider 相关的 apiKeyEnvVar 字段(未实现的功能)
- 清理 Server routes 中未使用的 Core 类型导入
- 清理 UI Message 接口中未使用的 metadata 字段
This commit is contained in:
2025-12-30 10:41:38 +08:00
parent 243f8dc860
commit 5f38753f6d
16 changed files with 9 additions and 98 deletions
-1
View File
@@ -9,7 +9,6 @@ import { getConfig } from './config.js';
import type {
AgentMode,
AgentInfo,
AgentConfigFile,
AgentModelConfig,
AgentPermission,
} from '@ai-assistant/core';
+1 -14
View File
@@ -6,20 +6,7 @@
import { Hono } from 'hono';
import { getConfig } from './config.js';
import type {
CheckpointMetadata,
CheckpointConfig,
CheckpointTrigger,
FileChange,
FileChangeType,
DiffInfo,
FileDiff,
RollbackOptions,
RollbackResult,
RollbackRecord,
SafetyCheckResult,
UnrevertResult,
} from '@ai-assistant/core';
import type { CheckpointMetadata } from '@ai-assistant/core';
import {
CheckpointManager,
getCheckpointManager,
+1 -5
View File
@@ -7,11 +7,7 @@
import { Hono } from 'hono';
import { z } from 'zod';
import { getConfig } from './config.js';
import type {
Command,
CommandInput,
CommandExecutionResult,
} from '@ai-assistant/core';
// Command, CommandInput, CommandExecutionResult 类型由函数自动推断
import {
getCommandRegistry,
createCommandExecutor,
+1 -4
View File
@@ -6,10 +6,7 @@
import { Hono } from 'hono';
import { getConfig } from './config.js';
import type {
FileDiagnostic,
ServerStatus,
} from '@ai-assistant/core';
import type { FileDiagnostic } from '@ai-assistant/core';
import {
initLSP,
listServers,
+1 -6
View File
@@ -6,12 +6,7 @@
import { Hono } from 'hono';
import { getConfig } from './config.js';
import type {
MCPConfig,
MCPServerConfig,
MCPServerStatus,
MCPTool,
} from '@ai-assistant/core';
import type { MCPConfig } from '@ai-assistant/core';
import {
getMCPManager,
loadMCPConfig,
+1 -1
View File
@@ -5,7 +5,7 @@
*/
import { Hono } from 'hono';
import type { ServiceConfig, ServiceType } from '@ai-assistant/core';
import type { ServiceType } from '@ai-assistant/core';
import {
loadProvidersConfig,
getServiceConfig,
+1 -1
View File
@@ -11,7 +11,7 @@ import {
type Message,
type MessagePart,
} from '../types.js';
import type { MessageInfo, Part, ApiPart } from '@ai-assistant/core';
// MessageInfo, Part, ApiPart 从 Core 导入但仅用于类型推导
import { MessageStorage, PartStorage, partsToApiFormat } from '@ai-assistant/core';
export const sessionsRouter = new Hono();
-5
View File
@@ -365,11 +365,6 @@ export interface Message {
parts: MessagePart[];
/** 所有文本拼接(兼容字段) */
content?: string;
metadata?: {
model?: string;
stepCount?: number;
totalTokens?: number;
};
}
/** @deprecated 使用 Message 代替 */