重构事件总线和插件运行时,优化消息处理逻辑,新增 IPC 传输字典转换功能,改进组件管理协议

This commit is contained in:
DrSmoothl
2026-03-14 01:39:59 +08:00
parent 84212e8e95
commit 2c330e3902
7 changed files with 197 additions and 56 deletions

View File

@@ -1,7 +1,7 @@
import random
from pathlib import Path
from typing import Any, Dict, List, Optional
import random
import time
from src.chat.message_receive.chat_manager import BotChatSession, chat_manager
@@ -260,8 +260,8 @@ class RuntimeDataCapabilityMixin:
return {"success": False, "error": str(e)}
@staticmethod
def _serialize_messages(messages: list) -> List[Dict[str, Any]]:
result: List[Dict[str, Any]] = []
def _serialize_messages(messages: list) -> List[Any]:
result: List[Any] = []
for msg in messages:
if hasattr(msg, "model_dump"):
result.append(msg.model_dump())