openbot
|
bbe36be192
|
feat(wecom): official aibot long-connection protocol + real WS transport
- wecom_ws.py: AibotWSAdapter (asyncio websockets bridged to channel threads):
connect wss://openws.work.weixin.qq.com, aibot_subscribe auth, 30s ping
heartbeat, reader->queue, graceful shutdown
- wecom.py switched to official frames:
* inbound aibot_msg_callback / aibot_event_callback (enter_chat -> welcome)
* reply: aibot_respond_msg stream {id, finish, content} reusing the
callback's req_id; after finish, proactive aibot_send_msg markdown
* image inbound: {url, aeskey} fetch + AES-256-CBC (IV=key[:16], PKCS7)
* mixed (text+image) and voice (transcribed) message types
- tests updated to official frame shapes; 43 passed
|
2026-10-06 16:06:49 +08:00 |
|
openbot
|
d698ae8a60
|
feat(channels): add wecom / wecom-app / weixin IM channels (M1.5)
- base.py: IMChannel protocol + InboundMessage + shared helpers
(split_message_text utf-8 byte-safe, clean_control_chars ZWSP hygiene)
- editable_stream.py: create-edit-flush streaming fallback pattern
- wecom.py: aibot WebSocket long-connection (replyStream streaming,
allowlist, reconnect backoff, auth-failure terminal)
- wecom_app.py: self-built app HTTP callback (stdlib server, WXBizMsgCrypt
AES-CBC round-trip, access_token cache, media download; works in both
WeCom client and WeChat via WeChat-plugin, no streaming on this path)
- weixin.py: WeChat bot QR login + getupdates long-poll + sendmessage
- tests: 28 passed (mock transports, crypt roundtrip, stream coalesce)
Ported from dsh-im (xmanrui) protocol facts and resilience patterns.
|
2026-10-06 11:33:07 +08:00 |
|