refactor(messaging): 拆分用户交互模块到 application/messaging 层

- 新增 application/messaging 交互层:router.py 统一会话优先级与回调分发,
  site/subscribe/skill/media/plugin 各交互状态与视图从 Chain 迁出
- MessageChain 改为通过 InteractionRouter 派发文本会话与按钮回调,
  新增结构化 callback_data 通道(兼容 CALLBACK: 文本前缀)
- Transfer 失败重试/AI 接管回调归入 TransferChain
- MediaInteractionChain 拆出为 app/chain/interaction.py(旧路径保留兼容别名)
- WebAgent Endpoint 去重,统一使用 agent.py 回调协议函数
- 删除 app/chain/skills.py(交互逻辑并入 SkillInteractionHandler)
- 同步更新架构文档与测试,全量 4476 通过
This commit is contained in:
jxxghp
2026-08-15 16:36:39 +08:00
parent 5a1808592a
commit dd38c16400
30 changed files with 4894 additions and 4230 deletions
+3 -3
View File
@@ -7,13 +7,13 @@ from app.chain import ChainBase
from app.chain.download import DownloadChain
from app.chain.message import MessageChain
from app.chain.site import SiteChain
from app.chain.skills import SkillsChain
from app.chain.subscribe import SubscribeChain
from app.chain.system import SystemChain
from app.chain.transfer import TransferChain
from app.runtime.events import Event as ManagerEvent, eventmanager, Event
from app.runtime.extensions.plugin_manager import PluginManager
from app.application.messaging.message import MessageHelper
from app.application.messaging.skill import SkillInteractionHandler
from app.runtime.thread import ThreadHelper
from app.runtime.log import logger
from app.scheduler import Scheduler
@@ -25,7 +25,7 @@ from app.foundation.collections import DictUtils
class CommandChain(ChainBase):
pass
"""命令分发专用 Chain,仅作为命令侧的消息投递网关。"""
def _finish_command_processing_status(status: Optional[dict], user_id: Optional[str] = None) -> None:
@@ -132,7 +132,7 @@ class Command(metaclass=Singleton):
"data": {},
},
"/skills": {
"func": SkillsChain().remote_manage,
"func": SkillInteractionHandler(messenger=CommandChain()).remote_manage,
"description": "管理技能",
"category": "智能体",
"data": {},