Skip to content

feat(boss): add chatlist, chatmsg, and send commands#95

Open
huangsen365 wants to merge 1 commit intojackwener:mainfrom
huangsen365:feat/boss-chat-commands
Open

feat(boss): add chatlist, chatmsg, and send commands#95
huangsen365 wants to merge 1 commit intojackwener:mainfrom
huangsen365:feat/boss-chat-commands

Conversation

@huangsen365
Copy link

Summary

Add three new BOSS直聘 (zhipin.com) chat commands for the recruiting (Boss) side:

New Commands

Command Description
boss/chatlist List chat conversations with candidates (聊天列表)
boss/chatmsg Read message history with a specific candidate (聊天消息)
boss/send Send a text message to a candidate (发送消息)

Usage

# List recent chat conversations
opencli boss chatlist
opencli boss chatlist --page 2 --limit 10 --job_id 0

# Read chat messages (uid from chatlist)
opencli boss chatmsg --uid <encryptUid>

# Send a message
opencli boss send --uid <encryptUid> --text "你好,方便聊聊吗?"

Implementation Details

  • chatlist: Calls getBossFriendListV2.json API with cookie auth, returns name, job, last message, uid, and security_id.
  • chatmsg: Resolves encryptUid → numeric uid + securityId via friend list, then fetches history via historyMsg API.
  • send: Uses UI automation instead of HTTP API because BOSS chat messaging is powered by MQTT protocol. The command:
    1. Opens the chat page
    2. Clicks on the target user in the sidebar
    3. Types text into the contenteditable editor (.boss-chat-editor-input)
    4. Clicks the send button (.submit)

All commands require Strategy.COOKIE with an active BOSS直聘 login in Chrome.

Testing

Tested end-to-end on macOS with Chrome browser bridge:

  • chatlist returns conversations with correct fields
  • chatmsg reads message history with timestamps
  • send successfully delivers messages (verified via chatmsg)

- boss/chatlist: List chat conversations (招聘端聊天列表)
  Uses getBossFriendListV2 API with pagination and job filter support.

- boss/chatmsg: Read chat message history with a candidate
  Resolves encryptUid to numeric uid/securityId, fetches via historyMsg API.

- boss/send: Send chat message to a candidate via UI automation
  BOSS chat uses MQTT protocol (not HTTP), so this command automates the
  web chat UI: clicks on user in list → types in contenteditable editor →
  clicks the send button.

All three commands use Strategy.COOKIE and require an active BOSS直聘
login session in Chrome.
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