ForcePilot/backend/package/yuxi/external_systems/infrastructure/config.py
Kris 74709ba2d3 feat: 完成外部系统限界上下文核心代码实现
新增六边形架构核心代码包,包含:
1. 协议适配器层:HTTP/SMTP/IMAP/SSH/GRPC等多协议适配器实现
2. 认证插件体系:基础认证、API密钥、HMAC等多类型认证插件
3. 执行编排框架:工具执行器、上下文构建、运行时治理组件
4. 用例端口与DTO:定义领域服务端口与数据传输对象
5. 厂商集成包框架:支持第三方系统集成扩展
6. 基础设施装配层:实现依赖注入与服务装配

所有代码遵循六边形架构设计原则,实现端口与适配器解耦,支持动态扩展与自动发现。
2026-06-20 22:12:42 +08:00

23 lines
1.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""infrastructure/config.py装配层模块配置与全局单例引用。
集中暴露 infrastructure 装配层所需的全局单例,提供单一查找点与可替换入口:
- ``default_adapter_registry``AdapterRegistry 全局单例(只读、无状态),
由 ``create_use_cases_from_db`` 注入到需要 ``AdapterRegistry`` 端口的 service。
其余全局单例(``crypto_service`` / ``pool_manager`` / ``default_secret_resolver``
/ ``id_generator`` / ``circuit_breaker`` / ``rate_limiter`` / ``token_refresh_registry``
由 ``framework/runtime`` 的 factory 函数(``create_runtime_services`` /
``create_tool_executor``封装使用container 不直接消费,故不在本模块重复导出。
"""
from __future__ import annotations
from yuxi.external_systems.framework.registry import default_registry
#: 装配层默认使用的 AdapterRegistry 单例(只读、无状态)。
#: 由 ``create_use_cases_from_db`` 注入到 ``SystemService`` / ``ToolService`` /
#: ``AssetService`` / ``ImportService`` 等需要 ``AdapterRegistry`` 端口的 service。
default_adapter_registry = default_registry
__all__ = ["default_adapter_registry"]