refactor(core,server): 统一模块职责并消除类型重复

- 统一 ToolStatus 类型(Core 导出,Server 引用)
- 重命名 Server SessionManager 为 SessionMetadataManager
- 扩展 Core PermissionContext 添加结构化字段
- 统一 Part 类型导出(Core 定义存储格式,Server 定义展示格式)
- 简化 Message 格式(移除 MergedMessage,统一使用 Message)
- 添加向后兼容的类型别名和 @deprecated 注释
This commit is contained in:
2025-12-16 21:06:41 +08:00
parent 1b7d55848d
commit 0a26c3ab72
15 changed files with 177 additions and 95 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ import { fadeInUp, smoothTransition } from '../utils/animations';
import { getAgentDisplayName } from '../utils/agent';
import { Markdown } from './Markdown';
import { FileMentionText } from './FileMentionTag';
import type { Message, ToolCallInfo, ToolCallStatus, ToolMessagePart } from '../api/types.js';
import type { Message, ToolCallInfo, ToolStatus, ToolMessagePart } from '../api/types.js';
interface ChatMessageProps {
message: Message;
@@ -319,7 +319,7 @@ function ToolPartItem({ part }: ToolPartItemProps) {
/**
* 获取工具状态图标
*/
function getStatusIcon(status: ToolCallStatus) {
function getStatusIcon(status: ToolStatus) {
switch (status) {
case 'pending':
return <Clock size={14} className="text-yellow-500" />;