ForcePilot/backend/package/yuxi/channels/__init__.py
Kris 7a972055b7 feat: 新增渠道服务基础框架与核心工具类
新增大量渠道适配器相关的协议、策略、工具类与基础设施代码,包括:
1.  多协议定义:认证、消息、配置、网关等核心接口
2.  策略模块:上下文、群聊、去重、防抖等业务策略
3.  工具集:重试、去重、文本分块、消息格式化等SDK工具
4.  基础设施:外部进程管理、事件广播、熔断机制等
5.  账户与管道系统:账户管理、消息处理管道实现
6.  运行时服务:状态收集、维护任务、日志等后台服务
2026-05-12 00:53:57 +08:00

117 lines
3.2 KiB
Python

from yuxi.channels.models import (
AgentRequest,
AgentResult,
Attachment,
ChannelAccountSnapshot,
ChannelIdentity,
ChannelMessage,
ChannelResponse,
ChannelStatus,
ChannelType,
ChatType,
DeliveryResult,
EventType,
HealthStatus,
MentionsInfo,
MessageType,
TokenStatus,
build_snapshot_from_adapter,
)
from yuxi.channels.base import BaseChannelAdapter
from yuxi.channels.exceptions import (
ChannelAuthenticationError,
ChannelConnectionError,
ChannelException,
ChannelNotConnectedError,
ChannelRateLimitError,
DeliveryFailedError,
MessageFormatError,
)
from yuxi.channels.infra.circuit_breaker import CircuitBreaker, CircuitBreakerOpenError, CircuitState
from yuxi.channels.registry import ChannelRegistry, register_builtin_adapter
from yuxi.channels.manager import ChannelManager
from yuxi.channels.router import MessageRouter
from yuxi.channels.session_mapper import SessionMapper
from yuxi.channels.services.maintenance import MaintenanceRunner
from yuxi.channels.bridge import BridgeAdapter
from yuxi.channels.plugin import ChannelPlugin, channel_plugin
from yuxi.channels.meta import ChannelMeta
from yuxi.channels.capabilities import ChannelCapabilities
from yuxi.channels.protocols import (
ChannelConfigProtocol,
ChannelGatewayProtocol,
ChannelHeartbeatProtocol,
ChannelLifecycleProtocol,
ChannelMessageActionProtocol,
ChannelMessagingProtocol,
ChannelOutboundProtocol,
ChannelStatusProtocol,
ChannelThreadingProtocol,
)
from yuxi.channels.services.context import ChatAbortEntry, ChatRunBuffer, GatewayRequestContext
from yuxi.channels.infra.broadcast import EventBroadcaster
from yuxi.channels.infra.config_watcher import ConfigWatcher
from yuxi.channels.services.doctor import ConfigDoctor, DiagnosisIssue
from yuxi.channels.policy.heartbeat import BaseHeartbeatAdapter
__all__ = [
"AgentRequest",
"AgentResult",
"Attachment",
"ChannelAccountSnapshot",
"ChannelIdentity",
"ChannelMessage",
"ChannelResponse",
"ChannelStatus",
"ChannelType",
"ChatType",
"DeliveryResult",
"EventType",
"HealthStatus",
"MentionsInfo",
"MessageType",
"TokenStatus",
"build_snapshot_from_adapter",
"BaseChannelAdapter",
"BaseHeartbeatAdapter",
"ChannelAuthenticationError",
"ChannelConnectionError",
"ChannelException",
"ChannelNotConnectedError",
"ChannelRateLimitError",
"DeliveryFailedError",
"MessageFormatError",
"CircuitBreaker",
"CircuitBreakerOpenError",
"CircuitState",
"ChannelRegistry",
"register_builtin_adapter",
"ChannelManager",
"MessageRouter",
"SessionMapper",
"MaintenanceRunner",
"BridgeAdapter",
"ChannelPlugin",
"channel_plugin",
"ChannelMeta",
"ChannelCapabilities",
"ChannelConfigProtocol",
"ChannelGatewayProtocol",
"ChannelHeartbeatProtocol",
"ChannelLifecycleProtocol",
"ChannelMessageActionProtocol",
"ChannelMessagingProtocol",
"ChannelOutboundProtocol",
"ChannelStatusProtocol",
"ChannelThreadingProtocol",
"ChatAbortEntry",
"ChatRunBuffer",
"GatewayRequestContext",
"EventBroadcaster",
"ConfigWatcher",
"ConfigDoctor",
"DiagnosisIssue",
]