refactor: 清理未使用的类型定义和接口字段
- 移除 Provider 相关的 apiKeyEnvVar 字段(未实现的功能) - 清理 Server routes 中未使用的 Core 类型导入 - 清理 UI Message 接口中未使用的 metadata 字段
This commit is contained in:
@@ -9,7 +9,6 @@ import { getConfig } from './config.js';
|
||||
import type {
|
||||
AgentMode,
|
||||
AgentInfo,
|
||||
AgentConfigFile,
|
||||
AgentModelConfig,
|
||||
AgentPermission,
|
||||
} from '@ai-assistant/core';
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -365,11 +365,6 @@ export interface Message {
|
||||
parts: MessagePart[];
|
||||
/** 所有文本拼接(兼容字段) */
|
||||
content?: string;
|
||||
metadata?: {
|
||||
model?: string;
|
||||
stepCount?: number;
|
||||
totalTokens?: number;
|
||||
};
|
||||
}
|
||||
|
||||
/** @deprecated 使用 Message 代替 */
|
||||
|
||||
Reference in New Issue
Block a user