mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
- Re-export _ssrf_redirect_guard from __init__.py - Fix _parse_json @staticmethod using self._log_tag - Update test_detect_message_type to call as instance method - Fix mock.patch path for httpx.AsyncClient in adapter submodule
57 lines
1.6 KiB
Python
57 lines
1.6 KiB
Python
"""
|
|
QQBot platform package.
|
|
|
|
Re-exports the main adapter symbols from ``adapter.py`` (the original
|
|
``qqbot.py``) so that **all existing import paths remain unchanged**::
|
|
|
|
from gateway.platforms.qqbot import QQAdapter # works
|
|
from gateway.platforms.qqbot import check_qq_requirements # works
|
|
|
|
New modules:
|
|
- ``constants`` — shared constants (API URLs, timeouts, message types)
|
|
- ``utils`` — User-Agent builder, config helpers
|
|
- ``crypto`` — AES-256-GCM key generation and decryption
|
|
- ``onboard`` — QR-code scan-to-configure flow
|
|
"""
|
|
|
|
# -- Adapter (original qqbot.py) ------------------------------------------
|
|
from .adapter import ( # noqa: F401
|
|
QQAdapter,
|
|
QQCloseError,
|
|
check_qq_requirements,
|
|
_coerce_list,
|
|
_ssrf_redirect_guard,
|
|
)
|
|
|
|
# -- Onboard (QR-code scan-to-configure) -----------------------------------
|
|
from .onboard import ( # noqa: F401
|
|
BindStatus,
|
|
create_bind_task,
|
|
poll_bind_result,
|
|
build_connect_url,
|
|
)
|
|
from .crypto import decrypt_secret, generate_bind_key # noqa: F401
|
|
|
|
# -- Utils -----------------------------------------------------------------
|
|
from .utils import build_user_agent, get_api_headers, coerce_list # noqa: F401
|
|
|
|
__all__ = [
|
|
# adapter
|
|
"QQAdapter",
|
|
"QQCloseError",
|
|
"check_qq_requirements",
|
|
"_coerce_list",
|
|
"_ssrf_redirect_guard",
|
|
# onboard
|
|
"BindStatus",
|
|
"create_bind_task",
|
|
"poll_bind_result",
|
|
"build_connect_url",
|
|
# crypto
|
|
"decrypt_secret",
|
|
"generate_bind_key",
|
|
# utils
|
|
"build_user_agent",
|
|
"get_api_headers",
|
|
"coerce_list",
|
|
]
|