mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 15:38:19 +08:00
refactor(chain): 处理链功能域 mixin 化,清理未使用导入并根治兼容层循环导入
- ChainBase 拆分为 RecognitionMixin/MessageProcessingMixin/NotificationMixin - TransferChain 拆分为 7 个功能 mixin(_mixins.py),SubscribeChain 音乐订阅域拆出 _music.py - 斜杠命令交互四件套收敛为 InteractionChainMixin 委托,会话管理器移至 application 层,chain 层不再 re-export - 模块基础类收敛到 app/modules/_base(notification/mediaserver 语义重命名) - 清理 app/chain/__init__.py 24 个未使用导入,修正 49 处测试 patch 目标到实际命名空间 - 兼容层 legacy 符号不再并入 __all__,根治 schemas 初始化反向拉起 application.transfer 的循环导入 - 修复 bangumi 集数为字符串时 set_bangumi_info 抛 TypeError - 新增重复代码等架构门禁测试;capability 清单校验排除下划线内部目录
This commit is contained in:
@@ -1,7 +1,21 @@
|
||||
from app.agent.llm import AgentCapabilityManager, LLMHelper
|
||||
from app.agent.orchestrator import agent_manager
|
||||
from app.agent.prompt import prompt_manager
|
||||
from app.agent.prompt.transfer_redo import build_manual_redo_prompt
|
||||
from app.application.agent import register_agent_services
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.log import logger
|
||||
|
||||
# 导入期即向 application 门面注册实现,保证任何先于 initialize 的
|
||||
# 链层调用都能通过门面取到 Agent 服务对象。
|
||||
register_agent_services(
|
||||
agent_manager=agent_manager,
|
||||
prompt_manager=prompt_manager,
|
||||
capability_manager=AgentCapabilityManager,
|
||||
llm_helper=LLMHelper,
|
||||
manual_redo_prompt_builder=build_manual_redo_prompt,
|
||||
)
|
||||
|
||||
|
||||
class AgentInitializer:
|
||||
"""
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
from app.application.commands import register_command_class
|
||||
from app.command import Command
|
||||
|
||||
# 导入期即向 application 门面注册命令类,保证工具调用时不依赖静态边。
|
||||
register_command_class(Command)
|
||||
|
||||
|
||||
def init_command():
|
||||
"""
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
from app.application.scheduling import register_scheduler_class
|
||||
from app.scheduler import Scheduler
|
||||
|
||||
# 导入期即向 application 门面注册调度器类,保证工具调用时不依赖静态边。
|
||||
register_scheduler_class(Scheduler)
|
||||
|
||||
|
||||
def init_scheduler():
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user