Skip to content

feat: geek-side chat — messages, reply, exchange accept/reject#25

Open
DuanXiaoWen wants to merge 1 commit into
jackwener:mainfrom
DuanXiaoWen:feat/geek-chat-messages-exchange
Open

feat: geek-side chat — messages, reply, exchange accept/reject#25
DuanXiaoWen wants to merge 1 commit into
jackwener:mainfrom
DuanXiaoWen:feat/geek-chat-messages-exchange

Conversation

@DuanXiaoWen

Copy link
Copy Markdown

Summary

  • boss messages — list all conversations with last message per boss
  • boss unread — show bosses who messaged you but you haven't replied
  • boss reply <friendId> "text" — send a message (MQTT over WSS + Protobuf)
  • boss chat-history <friendId> — view bilateral chat history
  • boss send-resume <friendId> — send attachment resume to a boss
  • boss request-phone <friendId> — request phone number exchange
  • boss request-wechat <friendId> — request WeChat exchange
  • boss accept <friendId> — accept incoming exchange request (auto-detects phone/wechat/resume)
  • boss accept <friendId> --reject — reject incoming exchange request

Technical

BOSS 直聘 uses MQTT over WSS for real-time messaging (not HTTP):

  • Server: wss://ws6.zhipin.com:443/chatws
  • Auth: userName = page_token|0, password = wt2 (from /wapi/zppassport/get/wt), Cookie header required for WS 101 upgrade
  • Message payload: hand-written Protobuf encoder for TechwolfChatProtocol

Exchange accept key discovery: the acceptItemContact / acceptItemWeiXinRequest APIs require mid (not msgId) — found after exhaustive parameter search across dozens of candidates.

New API endpoints used:

  • POST /wapi/zprelation/friend/geekFilterByLabel — friend list
  • GET /wapi/zpchat/geek/userLastMsg — last message per friend
  • GET /wapi/zpchat/geek/getBossData — boss chat context + securityId
  • POST /wapi/zpchat/exchange/request — initiate exchange
  • POST /wapi/zpchat/geek/acceptItemContact — accept phone/resume request
  • POST /wapi/zpchat/geek/acceptItemWeiXinRequest — accept WeChat request
  • POST /wapi/zpchat/geek/rejectItemContact — reject request

Test plan

  • 127 unit tests pass (python3.11 -m pytest tests/test_cli.py -q)
  • All new commands have --help coverage
  • Protobuf encoder unit tests (varint, message structure, text encoding)
  • Exchange accept/reject mock tests covering resume, wechat, and reject paths
  • Unread filter logic tested (self-sent messages excluded)
  • Live tested: boss messages, boss unread, boss reply, boss accept, boss send-resume

🤖 Generated with Claude Code

New commands for job seekers (geek mode):
- boss messages [-n N]       — list all conversations with last message
- boss unread [-n N]         — show conversations awaiting your reply
- boss reply <id> "text"     — send a message via MQTT/Protobuf
- boss chat-history <id>     — view bilateral chat history
- boss send-resume <id>      — send attachment resume
- boss request-phone <id>    — request phone number exchange
- boss request-wechat <id>   — request WeChat exchange
- boss accept <id>           — accept incoming exchange request (auto-detects type)
- boss accept <id> --reject  — reject incoming exchange request

Technical highlights:
- Reverse-engineered BOSS 直聘 MQTT over WSS chat protocol
- Hand-written Protobuf encoder for TechwolfChatProtocol messages
- MQTT auth: page_token (from getUserInfo) + wt2 (from /get/wt) + Cookie header
- Exchange accept key param is `mid` (not `msgId`) — found after exhaustive search
- New API endpoints: geekFilterByLabel, userLastMsg, getBossData, exchange/request

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant