feat(gateway): unify QQBot branding, add PLATFORM_HINTS, fix streaming, restore missing setup functions
- Rename platform from 'qq' to 'qqbot' across all integration points (Platform enum, toolset, config keys, import paths, file rename qq.py → qqbot.py) - Add PLATFORM_HINTS for QQBot in prompt_builder (QQ supports markdown) - Set SUPPORTS_MESSAGE_EDITING = False to skip streaming on QQ (prevents duplicate messages from non-editable partial + final sends) - Add _send_qqbot() standalone send function for cron/send_message tool - Add interactive _setup_qq() wizard in hermes_cli/setup.py - Restore missing _setup_signal/email/sms/dingtalk/feishu/wecom/wecom_callback functions that were lost during the original merge
This commit is contained in:
@@ -9,7 +9,7 @@ Each adapter handles:
|
||||
"""
|
||||
|
||||
from .base import BasePlatformAdapter, MessageEvent, SendResult
|
||||
from .qq import QQAdapter
|
||||
from .qqbot import QQAdapter
|
||||
|
||||
__all__ = [
|
||||
"BasePlatformAdapter",
|
||||
|
||||
@@ -152,7 +152,7 @@ class QQAdapter(BasePlatformAdapter):
|
||||
MAX_MESSAGE_LENGTH = MAX_MESSAGE_LENGTH
|
||||
|
||||
def __init__(self, config: PlatformConfig):
|
||||
super().__init__(config, Platform.QQ)
|
||||
super().__init__(config, Platform.QQBOT)
|
||||
|
||||
extra = config.extra or {}
|
||||
self._app_id = str(extra.get("app_id") or os.getenv("QQ_APP_ID", "")).strip()
|
||||
@@ -194,7 +194,7 @@ class QQAdapter(BasePlatformAdapter):
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
return "QQ"
|
||||
return "QQBot"
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Connection lifecycle
|
||||
@@ -658,7 +658,7 @@ class QQAdapter(BasePlatformAdapter):
|
||||
try:
|
||||
payload = json.loads(raw)
|
||||
except Exception:
|
||||
logger.debug("[%s] Failed to parse JSON: %r", "QQ", raw)
|
||||
logger.debug("[%s] Failed to parse JSON: %r", "QQBot", raw)
|
||||
return None
|
||||
return payload if isinstance(payload, dict) else None
|
||||
|
||||
Reference in New Issue
Block a user