feat: implement M5 moments and rich messages
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
# M5 朋友圈、特殊发送与富消息验证记录(2026-09-04)
|
||||
|
||||
## 功能范围
|
||||
|
||||
完整清单见 `docs/M5-功能清单.md`。本阶段实现:
|
||||
|
||||
- 多聊天子窗口:弹出、查找、枚举和关闭(复用并补齐 M4 基础能力)。
|
||||
- 朋友圈:打开、当前页/下一页读取、刷新、发布文字和媒体、公开/标签白名单/标签黑名单、点赞/取消赞、评论。
|
||||
- 特殊发送:URL 卡片、PCM WAV 音频录制为语音条。
|
||||
- 消息:拍一拍、链接 URL、特殊消息分类、微信笔记内容、笔记 Markdown 文件。
|
||||
- 当前 v4 官方文档没有合并转发内容展开合同,因此只识别 `merge` 类型,不把 Note API 错套到合并消息。
|
||||
|
||||
## 安全设计
|
||||
|
||||
- 发布朋友圈、点赞、评论、URL 卡片、语音和拍一拍均要求精确确认令牌 `CONFIRM`。
|
||||
- 所有微信 UI 写操作继续使用统一命令队列;发送失败或结果未确认时不自动重试。
|
||||
- 朋友圈指纹只用于同一可见页面内的短生命周期定位;刷新/翻页后重新读取。
|
||||
- CLI 和验证产物不输出朋友圈作者、正文、联系人名称或消息正文。
|
||||
|
||||
## Linux 验证
|
||||
|
||||
```text
|
||||
~/.dotnet/dotnet test tests/WxAgent.Core.Tests -c Release --no-restore
|
||||
Passed: 30, Failed: 0
|
||||
|
||||
~/.dotnet/dotnet build WxAgent.sln -c Release -p:EnableWindowsTargeting=true --no-restore
|
||||
Build succeeded. 0 Warning(s), 0 Error(s)
|
||||
|
||||
~/.dotnet/dotnet publish src/WxAgent.Host -c Release -r win-x64 --self-contained true \
|
||||
-p:EnableWindowsTargeting=true -p:PublishSingleFile=true -p:PublishTrimmed=false --no-restore
|
||||
Publish succeeded.
|
||||
```
|
||||
|
||||
新增测试覆盖 URL 提取、链接/引用 Markdown、Note Markdown、特殊消息分类、朋友圈稳定指纹和朋友圈可见范围参数校验。
|
||||
|
||||
## Windows 真机验证
|
||||
|
||||
主机:`DESKTOP-EGI7QCK`,微信登录用户会话。
|
||||
|
||||
```text
|
||||
WxAgent.Host doctor --timeout 30 exit 0
|
||||
WxAgent.Host inspect-ui --output m5-ui-tree.json --timeout 30 exit 0
|
||||
WxAgent.Host smoke --output m5-smoke-ui.json --timeout 30 exit 0
|
||||
WxAgent.Host m5-smoke --timeout 60 exit 0
|
||||
```
|
||||
|
||||
`m5-smoke` 脱敏结果:
|
||||
|
||||
```json
|
||||
{
|
||||
"scope": "M5",
|
||||
"momentsWindow": "moments",
|
||||
"momentCount": 2,
|
||||
"urlParsed": true,
|
||||
"markdownRendered": true,
|
||||
"confirmationGuarded": true,
|
||||
"privacy": "moment authors and content omitted"
|
||||
}
|
||||
```
|
||||
|
||||
验证覆盖朋友圈打开、刷新、只读快照、关闭并返回聊天页。URL 卡片在“文件传输助手”单次发送后读回为链接消息;后续一次结果确认超时按规则返回 `ResultUnconfirmed`,未自动重试。
|
||||
|
||||
语音能力已实现为按住微信“发语音”控件并播放 PCM WAV,且失败后不重试。当前 Windows 主机没有可用麦克风输入,用户明确要求跳过语音真机发送验收;保留 Beta 能力和明确诊断,不以文件消息冒充语音消息。
|
||||
|
||||
朋友圈发布、点赞、评论和拍一拍未对真实联系人内容执行;只验证输入、确认门禁、编译和只读页面定位,符合项目安全规则。
|
||||
|
||||
脱敏证据位于 `artifacts/m5-2026-09-04/`。
|
||||
|
||||
## 官方行为差异
|
||||
|
||||
- `NoteMessage.get_content()` / `to_markdown()` 仅适用于 Note;合并消息当前无公开展开 API。
|
||||
- `SendAudio` 官方标为 Beta 且要求额外配置,本项目只支持单个 PCM WAV,不复制官方默认自动重试。
|
||||
- 朋友圈发布公开文档没有稳定返回合同;本项目不因无异常而盲目重试。
|
||||
Reference in New Issue
Block a user