Files
memind/docs/wechat-draft-publication-standard.md
T
john d8eaef3fbd feat(wechat): MindSpace public draft push with 143 host defaults
Add public-page WeChat draft button, publication standard conversion for poem/prose/generic pages, and quick push APIs. Default Studio release SSH targets to john@180.159.29.143 with 105 edge upstream via 10.10.0.2.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-11 12:32:13 +08:00

58 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 公众号草稿推送格式标准
版本:`2026-09-11`(代码常量 `WECHAT_DRAFT_PUBLICATION_STANDARD_VERSION`
本规范随公众号推送能力与 MindSpace 发布链路演进**持续更新完善**;版本号标识当前快照,发现规范缺口或实现偏差时,应同步修订本文档、校验用例与代码常量。
## 适用范围
所有 MindSpace 页面推送到**用户绑定公众号草稿箱**的流程,包括:
- 页面详情「推送到公众号草稿箱」
- **公开页右下角「公众号」按钮**(页面 owner 登录后可见,服务端注入)
- 公开页 quick API`mindspace-chat-wechat-draft.mjs`
- 后续新增的页面级草稿推送入口
**必须**走 `mindspace-wechat-page-draft.mjs``pushPageDraft()`,禁止旁路拼装 HTML 或直接调用微信 draft API。
每日新闻早报定时推送(`wechat-news-morning-draft.mjs`)复用同一套底部 layout(阅读原文 + 关注区),栏目正文保持早报专用结构。
## 正文 layoutMindSpace 页面)
自上而下:
1. **Hero 实图**(若有):与页面 `mindspace-cover.cover` / hero 背景 / 侧车缩略图同源,经 `uploadimg` 上传
2. **页面正文**:按 profile 转换(诗页 / 散文 / 技能模板 / 通用语义提取)
3. **阅读原文**:12px 小胶囊链接,位于正文末尾、关注区之前;有 `publicUrl` 时必须出现
4. **欢迎关注 TKMind 智趣** + 公众号二维码(无 logo、无额外导语)
## 封面(thumb_media_id
优先级:
1. **Hero 位图**webp/png/jpeg 等,与正文顶部 hero 同源)
2. `{页面}.thumbnail.png` 侧车图(仅当无 hero 时)
3. `{页面}.thumbnail.svg` 矢量侧车图(无 PNG 时,推送前转为 PNG)
4. TKMind 占位图
无 AI 生成图时,正文 Hero 与封面均可回退到 PNG/SVG 侧车缩略图。
## 校验
本地/CI
```bash
npm run verify:mindspace-wechat-mp
```
核心断言见 `wechat-draft-publication-standard.test.mjs`
## 相关文件
| 文件 | 职责 |
|------|------|
| `wechat-draft-publication-standard.mjs` | 标准常量 + 合规校验 |
| `wechat-draft-article-layout.mjs` | 阅读原文 + 底部关注区 |
| `mindspace-wechat-page-draft.mjs` | 转换、封面上传、`pushPageDraft` |
| `mindspace-chat-wechat-draft.mjs` | 公开页 quick 推送(委托 `pushPageDraft` |