新增评论通知功能:MCP工具 + REST端点 + 前端通知面板

- 新增 xhs_get_comment_notifications / xhs_reply_notification MCP工具
- 通知获取前先读取首页未读小红点数字,无未读则直接返回空,避免重复处理
- 新增 REST 端点 GET /notifications/comments 和 POST /notifications/reply
- 前端小红书页面新增「通知」按钮和 NotificationPanel slide-over 组件
- 通知面板支持查看评论通知列表和行内回复
This commit is contained in:
2026-03-02 18:46:52 +08:00
parent 54a3d9708a
commit 64dbc45265
11 changed files with 637 additions and 0 deletions
+27
View File
@@ -187,6 +187,33 @@ export const XHS_SELECTORS = {
// -- Phase 4: Interaction (Like / Favorite) --------------------------------
// -- Phase 5: Notification ------------------------------------------------
notification: {
/** Each notification item container. */
container: '.container',
/** User avatar link (href contains userId + xsecToken). */
userAvatar: 'a.user-avatar',
/** User name link. */
userName: '.user-info a',
/** Interaction type hint (e.g. "评论了你的笔记"). */
interactionHint: '.interaction-hint span:first-child',
/** Notification time. */
interactionTime: '.interaction-time',
/** Comment content text. */
interactionContent: '.interaction-content',
/** Note thumbnail image (parent link href contains feedId + xsecToken). */
extraImage: '.extra img',
/** Reply button to expand inline reply. */
replyButton: '.action-reply',
/** Reply textarea that appears after clicking reply. */
replyInput: 'textarea.comment-input',
/** Reply submit button. */
replySubmit: 'button.submit',
/** Unread badge on the explore page bottom menu. */
unreadBadge: '#global > div.main-container > div.bottom-menu > div > li.link-wrapper.bottom-channel > a > div > div',
},
interaction: {
/** Like button on the feed detail page. */
likeButton: '.engage-bar-style .like-wrapper',