新增大量渠道适配器相关的协议、策略、工具类与基础设施代码,包括: 1. 多协议定义:认证、消息、配置、网关等核心接口 2. 策略模块:上下文、群聊、去重、防抖等业务策略 3. 工具集:重试、去重、文本分块、消息格式化等SDK工具 4. 基础设施:外部进程管理、事件广播、熔断机制等 5. 账户与管道系统:账户管理、消息处理管道实现 6. 运行时服务:状态收集、维护任务、日志等后台服务
33 lines
729 B
Python
33 lines
729 B
Python
from __future__ import annotations
|
|
|
|
from typing import Protocol, runtime_checkable
|
|
|
|
|
|
@runtime_checkable
|
|
class ChannelConfigProtocol(Protocol):
|
|
@property
|
|
def channel_id(self) -> str: ...
|
|
|
|
@property
|
|
def channel_type(self) -> str: ...
|
|
|
|
def resolve_account(self, account_id: str) -> dict | None: ...
|
|
|
|
def is_enabled(self) -> bool: ...
|
|
|
|
def is_configured(self) -> bool: ...
|
|
|
|
def list_account_ids(self) -> list[str]: ...
|
|
|
|
def default_account_id(self) -> str: ...
|
|
|
|
def disabled_reason(self) -> str: ...
|
|
|
|
def unconfigured_reason(self) -> str: ...
|
|
|
|
def describe_account(self) -> dict: ...
|
|
|
|
def resolve_allow_from(self) -> list[str]: ...
|
|
|
|
def has_configured_state(self) -> bool: ...
|