从 social-flow 自媒体发布项目回馈:发现 notify() 只支持纯文本,
导致需要通过企微发 QR 码登录图片时只能在业务层绕道用 spawnSync。
改动:
- notify(message, opts?) 新增可选 opts.imagePaths: string[]
- WeCom 后端(mcp2cli 路径):将 imagePaths 作为 image_paths 写入
send_message_only 的 payload
- WeCom 后端(注入函数路径):opts.imagePaths 透传给 config.send ctx
- 终端后端:imagePaths 非空时额外打印路径(调试可见)
- 向后兼容:不传 opts 行为完全不变
测试:新增 2 条覆盖 imagePaths 透传(注入函数路径)和 opts 缺省场景。
迁移:social-flow/publish.js 移除 sendWecomImage 绕道函数,改用
await notify('msg', { imagePaths: [qrPath] })
Co-authored-by: Cursor <cursoragent@cursor.com>