2026-05-13 16:41:11 +08:00
|
|
|
from yuxi.channels.auth import (
|
|
|
|
|
AuthHealth,
|
|
|
|
|
AuthHealthMonitor,
|
|
|
|
|
BackoffConfig,
|
|
|
|
|
BaseTokenProvider,
|
|
|
|
|
CertificateTokenProvider,
|
|
|
|
|
CompatTokenProvider,
|
|
|
|
|
DmPolicy,
|
|
|
|
|
ExponentialBackoff,
|
|
|
|
|
GroupPolicy,
|
|
|
|
|
NetworkGuardError,
|
|
|
|
|
OAuth2TokenProvider,
|
|
|
|
|
QRTokenProvider,
|
|
|
|
|
SecretManager,
|
|
|
|
|
SecretSource,
|
|
|
|
|
SecurityPolicy,
|
|
|
|
|
SecurityPolicyEngine,
|
|
|
|
|
SensitiveDataFilter,
|
|
|
|
|
StaticTokenProvider,
|
|
|
|
|
TokenProviderType,
|
|
|
|
|
TokenState,
|
|
|
|
|
UnifiedTokenManager,
|
|
|
|
|
apply_ssrf_guard_defaults,
|
|
|
|
|
build_ssrf_safe_headers,
|
|
|
|
|
check_response_size,
|
|
|
|
|
check_response_text,
|
|
|
|
|
fetch_with_ssrf_guard,
|
|
|
|
|
get_health_monitor,
|
|
|
|
|
get_secret_manager,
|
|
|
|
|
get_security_policy_engine,
|
|
|
|
|
get_token_manager,
|
|
|
|
|
init_secret_manager,
|
|
|
|
|
is_hostname_allowed,
|
|
|
|
|
is_private_url,
|
|
|
|
|
redact_sensitive,
|
|
|
|
|
safe_webhook_url,
|
|
|
|
|
sanitize_transport_kwargs,
|
|
|
|
|
validate_url,
|
|
|
|
|
validate_url_with_whitelist,
|
|
|
|
|
)
|
|
|
|
|
from yuxi.channels.base import BaseChannelAdapter
|
|
|
|
|
from yuxi.channels.bridge import BridgeAdapter
|
|
|
|
|
from yuxi.channels.capabilities import ChannelCapabilities
|
|
|
|
|
from yuxi.channels.exceptions import (
|
|
|
|
|
ChannelAuthenticationError,
|
|
|
|
|
ChannelConnectionError,
|
|
|
|
|
ChannelException,
|
|
|
|
|
ChannelNotConnectedError,
|
|
|
|
|
ChannelRateLimitError,
|
|
|
|
|
DeliveryFailedError,
|
|
|
|
|
MessageFormatError,
|
|
|
|
|
)
|
|
|
|
|
from yuxi.channels.infra.broadcast import EventBroadcaster
|
|
|
|
|
from yuxi.channels.infra.circuit_breaker import CircuitBreaker, CircuitBreakerOpenError, CircuitState
|
|
|
|
|
from yuxi.channels.infra.config_watcher import ConfigWatcher
|
|
|
|
|
from yuxi.channels.manager import ChannelManager
|
|
|
|
|
from yuxi.channels.meta import ChannelMeta
|
2026-05-12 00:53:57 +08:00
|
|
|
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.plugin import ChannelPlugin, channel_plugin
|
2026-05-13 16:41:11 +08:00
|
|
|
from yuxi.channels.policy.heartbeat import BaseHeartbeatAdapter
|
2026-05-12 00:53:57 +08:00
|
|
|
from yuxi.channels.protocols import (
|
|
|
|
|
ChannelConfigProtocol,
|
|
|
|
|
ChannelGatewayProtocol,
|
|
|
|
|
ChannelHeartbeatProtocol,
|
|
|
|
|
ChannelLifecycleProtocol,
|
|
|
|
|
ChannelMessageActionProtocol,
|
|
|
|
|
ChannelMessagingProtocol,
|
|
|
|
|
ChannelOutboundProtocol,
|
|
|
|
|
ChannelStatusProtocol,
|
|
|
|
|
ChannelThreadingProtocol,
|
|
|
|
|
)
|
2026-05-13 16:41:11 +08:00
|
|
|
from yuxi.channels.registry import ChannelRegistry, register_builtin_adapter
|
|
|
|
|
from yuxi.channels.router import MessageRouter
|
2026-05-12 00:53:57 +08:00
|
|
|
from yuxi.channels.services.context import ChatAbortEntry, ChatRunBuffer, GatewayRequestContext
|
|
|
|
|
from yuxi.channels.services.doctor import ConfigDoctor, DiagnosisIssue
|
2026-05-13 16:41:11 +08:00
|
|
|
from yuxi.channels.services.maintenance import MaintenanceRunner
|
|
|
|
|
from yuxi.channels.session_mapper import SessionMapper
|
2026-05-12 00:53:57 +08:00
|
|
|
|
|
|
|
|
__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",
|
2026-05-13 16:41:11 +08:00
|
|
|
"SecretManager",
|
|
|
|
|
"SecretSource",
|
|
|
|
|
"get_secret_manager",
|
|
|
|
|
"init_secret_manager",
|
|
|
|
|
"BaseTokenProvider",
|
|
|
|
|
"TokenProviderType",
|
|
|
|
|
"TokenState",
|
|
|
|
|
"UnifiedTokenManager",
|
|
|
|
|
"get_token_manager",
|
|
|
|
|
"CertificateTokenProvider",
|
|
|
|
|
"CompatTokenProvider",
|
|
|
|
|
"OAuth2TokenProvider",
|
|
|
|
|
"QRTokenProvider",
|
|
|
|
|
"StaticTokenProvider",
|
|
|
|
|
"AuthHealth",
|
|
|
|
|
"AuthHealthMonitor",
|
|
|
|
|
"get_health_monitor",
|
|
|
|
|
"BackoffConfig",
|
|
|
|
|
"ExponentialBackoff",
|
|
|
|
|
"DmPolicy",
|
|
|
|
|
"GroupPolicy",
|
|
|
|
|
"SecurityPolicy",
|
|
|
|
|
"SecurityPolicyEngine",
|
|
|
|
|
"get_security_policy_engine",
|
|
|
|
|
"SensitiveDataFilter",
|
|
|
|
|
"redact_sensitive",
|
|
|
|
|
"NetworkGuardError",
|
|
|
|
|
"apply_ssrf_guard_defaults",
|
|
|
|
|
"build_ssrf_safe_headers",
|
|
|
|
|
"check_response_size",
|
|
|
|
|
"check_response_text",
|
|
|
|
|
"fetch_with_ssrf_guard",
|
|
|
|
|
"is_hostname_allowed",
|
|
|
|
|
"is_private_url",
|
|
|
|
|
"safe_webhook_url",
|
|
|
|
|
"sanitize_transport_kwargs",
|
|
|
|
|
"validate_url",
|
|
|
|
|
"validate_url_with_whitelist",
|
2026-05-12 00:53:57 +08:00
|
|
|
]
|