@yixiaoermail/cli 3.2.3 → 3.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/bin/install.js +46 -2
  2. package/bin/yxer.js +31 -2
  3. package/checksums.txt +6 -6
  4. package/package.json +1 -1
  5. package/references/cli/command-design.md +1 -1
  6. package/references/cli/command-reference.md +30 -39
  7. package/references/cli/publish-channels.md +77 -0
  8. package/references/create-account-group.md +27 -0
  9. package/references/delete-account-group.md +20 -0
  10. package/references/domains/accounts-and-env.md +43 -0
  11. package/references/domains/draft-and-material.md +34 -0
  12. package/references/domains/install-and-sync.md +63 -0
  13. package/references/domains/publish.md +84 -0
  14. package/references/domains/troubleshooting.md +34 -0
  15. package/references/execution-standard.md +144 -0
  16. package/references/get-account-groups.md +15 -0
  17. package/references/get-account-overviews.md +56 -0
  18. package/references/get-challenges.md +14 -0
  19. package/references/get-collections.md +34 -0
  20. package/references/get-content-overviews.md +59 -0
  21. package/references/get-friends.md +9 -0
  22. package/references/get-games.md +39 -0
  23. package/references/get-goods.md +42 -0
  24. package/references/get-groups.md +35 -0
  25. package/references/get-hot-events.md +14 -0
  26. package/references/get-locations.md +48 -0
  27. package/references/get-members.md +28 -0
  28. package/references/get-miniapps.md +38 -0
  29. package/references/get-music-categories.md +41 -0
  30. package/references/get-music.md +67 -0
  31. package/references/get-publish-activities.md +40 -0
  32. package/references/get-publish-categories.md +62 -0
  33. package/references/get-sync-apps.md +14 -0
  34. package/references/get-topics.md +13 -0
  35. package/references/go-live-process.md +160 -0
  36. package/references/keyword-reference.md +114 -0
  37. package/references/legacy/capabilities.md +1 -1
  38. package/references/material-resource.md +88 -0
  39. package/references/platform-doc-maintenance.md +33 -0
  40. package/references/platform.md +62 -0
  41. package/references/platforms/article/acfun.md +90 -0
  42. package/references/platforms/article/aiqiyi.md +56 -0
  43. package/references/platforms/article/baijiahao.md +94 -0
  44. package/references/platforms/article/bilibili.md +88 -0
  45. package/references/platforms/article/chejiahao.md +81 -0
  46. package/references/platforms/article/csdn.md +86 -0
  47. package/references/platforms/article/dayuhao.md +78 -0
  48. package/references/platforms/article/douban.md +62 -0
  49. package/references/platforms/article/douyin.md +106 -0
  50. package/references/platforms/article/index.md +157 -0
  51. package/references/platforms/article/jianshu.md +58 -0
  52. package/references/platforms/article/kuaichuanhao.md +78 -0
  53. package/references/platforms/article/qiehao.md +78 -0
  54. package/references/platforms/article/souhuhao.md +75 -0
  55. package/references/platforms/article/toutiaohao.md +78 -0
  56. package/references/platforms/article/wangyihao.md +79 -0
  57. package/references/platforms/article/weixingongzhonghao.md +135 -0
  58. package/references/platforms/article/xinlangweibo.md +75 -0
  59. package/references/platforms/article/xueqiuhao.md +73 -0
  60. package/references/platforms/article/yichehao.md +92 -0
  61. package/references/platforms/article/yidianhao.md +76 -0
  62. package/references/platforms/article/zhihu.md +75 -0
  63. package/references/platforms/imageText/baijiahao.md +102 -0
  64. package/references/platforms/imageText/douyin.md +111 -0
  65. package/references/platforms/imageText/index.md +113 -0
  66. package/references/platforms/imageText/kuaishou.md +106 -0
  67. package/references/platforms/imageText/shipinhao.md +112 -0
  68. package/references/platforms/imageText/toutiaohao.md +76 -0
  69. package/references/platforms/imageText/xiaohongshu.md +85 -0
  70. package/references/platforms/imageText/xinlangweibo.md +77 -0
  71. package/references/platforms/imageText/zhihu.md +92 -0
  72. package/references/platforms/index.md +6 -6
  73. package/references/platforms/video/acfun.md +82 -0
  74. package/references/platforms/video/aiqiyi.md +89 -0
  75. package/references/platforms/video/baijiahao.md +89 -0
  76. package/references/platforms/video/bilibili-open.md +59 -0
  77. package/references/platforms/video/bilibili.md +80 -0
  78. package/references/platforms/video/chejiahao.md +63 -0
  79. package/references/platforms/video/dayuhao.md +91 -0
  80. package/references/platforms/video/dewu.md +80 -0
  81. package/references/platforms/video/douyin.md +173 -0
  82. package/references/platforms/video/duoduoshipin.md +64 -0
  83. package/references/platforms/video/facebook.md +37 -0
  84. package/references/platforms/video/fengwang.md +81 -0
  85. package/references/platforms/video/index.md +173 -0
  86. package/references/platforms/video/instagram.md +40 -0
  87. package/references/platforms/video/kuaishou-open.md +44 -0
  88. package/references/platforms/video/kuaishou.md +77 -0
  89. package/references/platforms/video/meipai.md +79 -0
  90. package/references/platforms/video/meiyou.md +59 -0
  91. package/references/platforms/video/pipixia.md +58 -0
  92. package/references/platforms/video/qiehao.md +91 -0
  93. package/references/platforms/video/shipinhao.md +100 -0
  94. package/references/platforms/video/souhuhao.md +91 -0
  95. package/references/platforms/video/souhushipin.md +64 -0
  96. package/references/platforms/video/tengxunshipin.md +63 -0
  97. package/references/platforms/video/tiktok.md +50 -0
  98. package/references/platforms/video/toutiaohao.md +66 -0
  99. package/references/platforms/video/wangyihao.md +93 -0
  100. package/references/platforms/video/weishi.md +61 -0
  101. package/references/platforms/video/xiaohongshu.md +133 -0
  102. package/references/platforms/video/xiaohongshushop.md +92 -0
  103. package/references/platforms/video/xinlangweibo.md +79 -0
  104. package/references/platforms/video/yichehao.md +61 -0
  105. package/references/platforms/video/yidianhao.md +85 -0
  106. package/references/platforms/video/youtube.md +53 -0
  107. package/references/platforms/video/zhihu.md +85 -0
  108. package/references/protocols/confirmation.md +62 -0
  109. package/references/protocols/error-recovery.md +50 -0
  110. package/references/protocols/execution.md +65 -0
  111. package/references/protocols/provenance.md +61 -0
  112. package/references/proxy-management.md +69 -0
  113. package/references/query-accounts.md +85 -0
  114. package/references/save-draft.md +75 -0
  115. package/references/topic-tags.md +140 -0
  116. package/references/troubleshooting-guide.md +105 -0
  117. package/references/update-account-group.md +28 -0
  118. package/references/upload-resource.md +70 -0
  119. package/references/usage-workflow.md +207 -0
  120. package/references/workflows/common-rules.md +57 -27
  121. package/references/workflows/data-accuracy.md +83 -0
  122. package/references/workflows/local-vs-cloud.md +12 -5
  123. package/references/workflows/payload-sourcing.md +3 -0
  124. package/references/workflows/publish-article.md +5 -3
  125. package/references/workflows/publish-imageText.md +5 -3
  126. package/references/workflows/publish-troubleshooting.md +1 -1
  127. package/references/workflows/publish-video.md +6 -4
  128. package/references/yixiaoer-shared.md +106 -0
  129. package/schemas/platforms/acfun.article.schema.json +9 -9
  130. package/schemas/platforms/baijiahao.article.schema.json +8 -0
  131. package/schemas/platforms/baijiahao.video.schema.json +19 -2
  132. package/schemas/platforms/bilibili-open.video.schema.json +188 -0
  133. package/schemas/platforms/chejiahao.article.schema.json +7 -7
  134. package/schemas/platforms/dayuhao.video.schema.json +26 -0
  135. package/schemas/platforms/douyin.article.schema.json +8 -0
  136. package/schemas/platforms/douyin.imageText.schema.json +16 -2
  137. package/schemas/platforms/douyin.video.schema.json +88 -6
  138. package/schemas/platforms/kuaichuanhao.article.schema.json +20 -8
  139. package/schemas/platforms/kuaishou-open.video.schema.json +102 -0
  140. package/schemas/platforms/kuaishou.imageText.schema.json +12 -2
  141. package/schemas/platforms/kuaishou.video.schema.json +31 -0
  142. package/schemas/platforms/shipinhao.imageText.schema.json +13 -1
  143. package/schemas/platforms/shipinhao.video.schema.json +31 -0
  144. package/schemas/platforms/souhushipin.video.schema.json +3 -3
  145. package/schemas/platforms/tengxunshipin.video.schema.json +1 -0
  146. package/schemas/platforms/toutiaohao.imageText.schema.json +2 -1
  147. package/schemas/platforms/toutiaohao.video.schema.json +2 -1
  148. package/schemas/platforms/wangyihao.article.schema.json +6 -5
  149. package/schemas/platforms/wangyihao.video.schema.json +1 -0
  150. package/schemas/platforms/xhs.imageText.schema.json +27 -25
  151. package/schemas/platforms/xiaohongshu.video.schema.json +2 -1
  152. package/schemas/platforms/xinlang.imageText.schema.json +23 -2
  153. package/schemas/platforms/xinlang.video.schema.json +40 -10
  154. package/schemas/platforms/yidianhao.article.schema.json +1 -0
  155. package/schemas/platforms/yidianhao.video.schema.json +9 -8
  156. package/skills/yixiaoer/SKILL.md +30 -4
  157. package/skills/yixiaoer/references/cli/command-design.md +305 -0
  158. package/skills/yixiaoer/references/cli/command-reference.md +21 -8
  159. package/skills/yixiaoer/references/cli/publish-channels.md +77 -0
  160. package/skills/yixiaoer/references/domains/accounts-and-env.md +6 -2
  161. package/skills/yixiaoer/references/domains/draft-and-material.md +8 -3
  162. package/skills/yixiaoer/references/domains/install-and-sync.md +5 -7
  163. package/skills/yixiaoer/references/domains/publish.md +17 -10
  164. package/skills/yixiaoer/references/domains/troubleshooting.md +6 -2
  165. package/skills/yixiaoer/references/get-account-groups.md +2 -1
  166. package/skills/yixiaoer/references/go-live-process.md +2 -2
  167. package/skills/yixiaoer/references/keyword-reference.md +3 -2
  168. package/skills/yixiaoer/references/legacy/capabilities.md +37 -0
  169. package/skills/yixiaoer/references/platform.md +2 -1
  170. package/skills/yixiaoer/references/platforms/article/acfun.md +1 -1
  171. package/skills/yixiaoer/references/platforms/article/aiqiyi.md +1 -1
  172. package/skills/yixiaoer/references/platforms/article/baijiahao.md +1 -1
  173. package/skills/yixiaoer/references/platforms/article/bilibili.md +1 -1
  174. package/skills/yixiaoer/references/platforms/article/chejiahao.md +1 -1
  175. package/skills/yixiaoer/references/platforms/article/csdn.md +1 -1
  176. package/skills/yixiaoer/references/platforms/article/dayuhao.md +1 -1
  177. package/skills/yixiaoer/references/platforms/article/douban.md +1 -1
  178. package/skills/yixiaoer/references/platforms/article/douyin.md +1 -1
  179. package/skills/yixiaoer/references/platforms/article/index.md +2 -2
  180. package/skills/yixiaoer/references/platforms/article/jianshu.md +1 -1
  181. package/skills/yixiaoer/references/platforms/article/kuaichuanhao.md +1 -1
  182. package/skills/yixiaoer/references/platforms/article/qiehao.md +1 -1
  183. package/skills/yixiaoer/references/platforms/article/souhuhao.md +1 -1
  184. package/skills/yixiaoer/references/platforms/article/toutiaohao.md +1 -1
  185. package/skills/yixiaoer/references/platforms/article/wangyihao.md +1 -1
  186. package/skills/yixiaoer/references/platforms/article/weixingongzhonghao.md +1 -1
  187. package/skills/yixiaoer/references/platforms/article/xinlangweibo.md +1 -1
  188. package/skills/yixiaoer/references/platforms/article/xueqiuhao.md +1 -1
  189. package/skills/yixiaoer/references/platforms/article/yichehao.md +1 -1
  190. package/skills/yixiaoer/references/platforms/article/yidianhao.md +1 -1
  191. package/skills/yixiaoer/references/platforms/article/zhihu.md +1 -1
  192. package/skills/yixiaoer/references/platforms/imageText/baijiahao.md +1 -1
  193. package/skills/yixiaoer/references/platforms/imageText/douyin.md +1 -1
  194. package/skills/yixiaoer/references/platforms/imageText/index.md +5 -8
  195. package/skills/yixiaoer/references/platforms/imageText/kuaishou.md +1 -1
  196. package/skills/yixiaoer/references/platforms/imageText/shipinhao.md +4 -17
  197. package/skills/yixiaoer/references/platforms/imageText/toutiaohao.md +1 -1
  198. package/skills/yixiaoer/references/platforms/imageText/xiaohongshu.md +4 -7
  199. package/skills/yixiaoer/references/platforms/imageText/xinlangweibo.md +1 -1
  200. package/skills/yixiaoer/references/platforms/imageText/zhihu.md +1 -1
  201. package/skills/yixiaoer/references/platforms/video/acfun.md +1 -1
  202. package/skills/yixiaoer/references/platforms/video/aiqiyi.md +1 -1
  203. package/skills/yixiaoer/references/platforms/video/baijiahao.md +1 -1
  204. package/skills/yixiaoer/references/platforms/video/bilibili-open.md +33 -61
  205. package/skills/yixiaoer/references/platforms/video/bilibili.md +1 -1
  206. package/skills/yixiaoer/references/platforms/video/chejiahao.md +1 -1
  207. package/skills/yixiaoer/references/platforms/video/dayuhao.md +3 -1
  208. package/skills/yixiaoer/references/platforms/video/dewu.md +1 -1
  209. package/skills/yixiaoer/references/platforms/video/douyin.md +41 -11
  210. package/skills/yixiaoer/references/platforms/video/duoduoshipin.md +1 -1
  211. package/skills/yixiaoer/references/platforms/video/fengwang.md +1 -1
  212. package/skills/yixiaoer/references/platforms/video/index.md +6 -2
  213. package/skills/yixiaoer/references/platforms/video/kuaishou-open.md +20 -39
  214. package/skills/yixiaoer/references/platforms/video/kuaishou.md +1 -1
  215. package/skills/yixiaoer/references/platforms/video/meipai.md +1 -1
  216. package/skills/yixiaoer/references/platforms/video/meiyou.md +1 -1
  217. package/skills/yixiaoer/references/platforms/video/pipixia.md +1 -1
  218. package/skills/yixiaoer/references/platforms/video/qiehao.md +1 -1
  219. package/skills/yixiaoer/references/platforms/video/shipinhao.md +7 -2
  220. package/skills/yixiaoer/references/platforms/video/souhuhao.md +1 -1
  221. package/skills/yixiaoer/references/platforms/video/souhushipin.md +1 -1
  222. package/skills/yixiaoer/references/platforms/video/tengxunshipin.md +1 -1
  223. package/skills/yixiaoer/references/platforms/video/toutiaohao.md +1 -1
  224. package/skills/yixiaoer/references/platforms/video/wangyihao.md +1 -1
  225. package/skills/yixiaoer/references/platforms/video/weishi.md +1 -1
  226. package/skills/yixiaoer/references/platforms/video/xiaohongshu.md +1 -1
  227. package/skills/yixiaoer/references/platforms/video/xiaohongshushop.md +1 -1
  228. package/skills/yixiaoer/references/platforms/video/xinlangweibo.md +1 -1
  229. package/skills/yixiaoer/references/platforms/video/yichehao.md +1 -1
  230. package/skills/yixiaoer/references/platforms/video/yidianhao.md +1 -1
  231. package/skills/yixiaoer/references/platforms/video/zhihu.md +1 -1
  232. package/skills/yixiaoer/references/protocols/confirmation.md +62 -0
  233. package/skills/yixiaoer/references/protocols/error-recovery.md +50 -0
  234. package/skills/yixiaoer/references/protocols/execution.md +65 -0
  235. package/skills/yixiaoer/references/protocols/provenance.md +61 -0
  236. package/skills/yixiaoer/references/upload-resource.md +7 -0
  237. package/skills/yixiaoer/references/usage-workflow.md +1 -1
  238. package/skills/yixiaoer/references/workflows/common-rules.md +37 -16
  239. package/skills/yixiaoer/references/workflows/local-vs-cloud.md +12 -5
  240. package/skills/yixiaoer/references/workflows/publish-troubleshooting.md +1 -1
  241. package/skills/yixiaoer/references/workflows/publish-video.md +1 -1
  242. package/skills/yixiaoer/references/yixiaoer-shared.md +20 -9
  243. package/skills/yixiaoer/references/platforms/get-locations.md +0 -5
  244. package/skills/yixiaoer/references/platforms/imageText/weixinshipinhao.md +0 -7
@@ -0,0 +1,105 @@
1
+ # 🛡️ 蚁小二 Skill 避坑与故障排查手册 (Pitfall Avoidance Guide)
2
+
3
+ > **版本:** 1.0.2
4
+ > **最后更新:** 2026-04-10
5
+ > **适用范围:** 蚁小二 Universal 自动化技能调用者 (Skill v1.6.1+)
6
+ > **核心原则:** 规范优于补救,校验重于盲试。
7
+
8
+ 本指南汇总了在调用蚁小二自动化能力过程中最常见的四大“坑点”及其解决方案。请在开发或配置过程中严格对照,以确保发布任务的高成功率。
9
+
10
+ ---
11
+
12
+ ## 🚀 核心避坑清单 (Quick Fix Checklist)
13
+
14
+ ### 1. 技能版本不支持该功能
15
+ **现象描述:** 调用某些动作(Action)或使用新增字段时,系统报错提示“该功能不支持”或参数校验失败。
16
+
17
+ > [!IMPORTANT]
18
+ > **解决方案:**
19
+ > * **确认版本:** 请检查 `skills/yixiaoer/SKILL.md` 中的版本号,确保蚁小二插件/技能版本为 **1.6.1** 或更高。
20
+ > * **升级建议:** 如果当前版本低于 1.6.1,请同步最新的 `yixiaoer-skill` 代码仓库并重读配置。
21
+ > * **自检:** 运行 `npx yixiaoer --version`(若适用)核实当前环境加载的实际物理代码版本。
22
+
23
+ ---
24
+
25
+ ### 2. 获取在线设备列表失败
26
+ **现象描述:** 在执行发布任务时,返回错误:“获取在线设备列表失败”。
27
+
28
+ > [!TIP]
29
+ > **排查与解决:**
30
+ > * **模式冲突:** 错误通常发生在选择了 **“本机发布模式 (publishChannel: 'local')”** 时。
31
+ > * **客户端检查:** 确保蚁小二客户端软件已在当前机器启动、登录,且处于 **“在线”** 状态。
32
+ > * **推荐方案:** 若无法保证客户端长期在线,请将发布参数中的 `publishChannel` 修改为 **`'cloud'` (云发布模式)**,通过蚁小二云端服务器直接分发,无需本地客户端参与。
33
+
34
+ ---
35
+
36
+ ### 3. 发布失败 · 表单错误
37
+ **现象描述:** 接口返回“发布失败”,并附带“表单错误”或“参数校验未通过”提示。
38
+
39
+ > [!WARNING]
40
+ > **核心规范:**
41
+ > * **严格核对 DTO:** Agent 在拼装 `publish` 的 Payload 时,必须**强制核对** `skills/yixiaoer/references/platforms/` 目录下对应的平台文档(如 `douyin.md`, `wechat.md`)。
42
+ > * **必填项校验:** 重点检查标题 (title)、分类 (categories)、标签 (tags)、封面 (cover) 是否按照平台要求完整传入。
43
+ > * **格式合规:** 确保类型正确,例如 `categories` 必须是数组 or 特定 ID 字符串,严禁随意填写。
44
+
45
+ ---
46
+
47
+ ### 4. 图片上传失败 / 签名不匹配
48
+ **现象描述:** 使用 `upload-resource` 动作后,执行 PUT 上传时报错 `SignatureDoesNotMatch` 或上传后的资源无法显示。
49
+
50
+ > [!CAUTION]
51
+ > **关键细节:**
52
+ > * **ContentType 字节级对齐:** 在调用接口获取随机上传地址时,传入的 `contentType`(如 `image/png`)必须与你随后执行 PUT 请求时 Header 中的 `Content-Type` **完全一致**。
53
+ > * **报错诱因:** 哪怕是大小写差异或空格,都会导致云端签名计算失效,从而拒绝请求。
54
+ > * **最佳实践:** 预先确定文件 MIME 类型,在获取地址和执行上传两个步骤中透传同一个变量值。
55
+
56
+ ---
57
+
58
+ ### 5. 云发布报错:账号代理不存在
59
+ **现象描述:** 使用 **云发布 (publishChannel: 'cloud')** 时,接口返回错误:“账号代理不存在”。
60
+
61
+ > [!IMPORTANT]
62
+ > **原因与对策:**
63
+ > * **原因:** 账号绑定的独立代理 (proxyId) 已被删除/过期,或该平台强制要求绑定代理才能进行云发布。
64
+ > * **方案 A:** 使用 `yxer query proxy-areas` 查询可用地区码,并使用 `yxer accounts update <account_id> --kuaidaili-area <code> --dry-run` 预览后正式更新。
65
+ > * **方案 B:** 检查 `yxer query proxies` 列表,重新为账号绑定一个有效的 `proxyId`。
66
+ > * **方案 C:** 如果条件允许,切换回 `publishChannel: 'local'`(本机发布),此模式使用本地 IP,不依赖云端代理。
67
+
68
+ ---
69
+
70
+ ### 6. 发布任务状态异常 (Stuck or Abnormal Status)
71
+ **现象描述:** 任务提交后,状态长时间卡在 **“发布中”** 或 **“待发布”**,或者最终转为 **“发布失败”**。
72
+
73
+ > [!CAUTION]
74
+ > **深层原因与自检:**
75
+ > * **卡在“发布中 / 待发布”**:这通常意味着 Payload 虽然通过了初步的 API 校验,但其中的**业务逻辑或表单结构**不符合平台的底层规则。例如:标题含有非法字符、话题格式不严谨、或者动态字段(位置、音乐)透传的 `raw` 数据已过期。
76
+ > * **自检建议:** 请严格对比该平台的专属文档(如 `skills/yixiaoer/references/platforms/video/douyin.md`),检查表单是否按照文档规则填入。
77
+ > * **显示“发布失败”**:这绝大多数情况下是因为 **“必填字段缺失”**。
78
+ > * **自检建议:** 重点排查 `title` (标题)、`description` (描述)、`categories` (平台分类)、`cover` (封面) 等在文档中标记为“是”的核心字段是否填入。
79
+
80
+ ---
81
+
82
+ ### 7. 草稿保存意图不明
83
+ **现象描述:** 用户提及“保存草稿”或“存草稿”,但 Agent 无法判断应存入“蚁小二内部”还是“目标平台”。
84
+
85
+ > [!IMPORTANT]
86
+ > **执行规则:**
87
+ > * **严禁默认:** Agent **严禁**在未确认的情况下默认选择其中一种,或自行猜测。
88
+ > * **强制询问:** 必须向用户询问:“您是希望存为**蚁小二草稿**(仅在蚁小二管理,不推送到平台)还是**平台草稿**(推送到抖音/小红书等平台的草稿箱)?”
89
+ > * **逻辑关联:** 确认后再选取对应的 `action` (save-draft) 或 `publish` (pubType: 0)。
90
+
91
+ ---
92
+
93
+ ## 🛠️ 自诊工作流 (Self-Diagnosis Workflow)
94
+
95
+ 当您遇到无法解决的意外报错时,请遵循以下 SOP 进行排查:
96
+
97
+ 1. **版本审计**:当前 Skill 逻辑是否为最新?(`skills/yixiaoer/SKILL.md`)
98
+ 2. **物理上传校验**:资源是否已经成功通过 `upload-resource` 获取 key?(禁止在发布接口直接传入外部 https:// 链接)
99
+ 3. **模式匹配**:账号状态是否为 1 (有效)?发布通道是否与客户端状态匹配?
100
+ 4. **架构对标**:你的 JSON 结构是否与 `skills/yixiaoer/references/execution-standard.md` 中定义的“分级检索逻辑”一致?
101
+
102
+ ---
103
+
104
+ > [!NOTE]
105
+ > *“让专家做专业的事。如果您通过本指南仍无法定位问题,请在 [Issue 频道] 提交您的 JSON Payload 以供进一步审查。”*
@@ -0,0 +1,28 @@
1
+ # 更新账号分组
2
+
3
+ 用于更新账号分组,对应接口 `PATCH /groups/{groupId}`。
4
+
5
+ ## 推荐命令
6
+
7
+ ```bash
8
+ yxer account-group update group_1 新版核心账号组 --dry-run
9
+ yxer account-group update group_1 新版核心账号组
10
+ yxer account-group update group_1 新版核心账号组 --visible-scope all --dry-run
11
+ yxer account-group update group_1 新版核心账号组 --visible-scope specific --visible-user user_1 --visible-user user_2 --dry-run
12
+ ```
13
+
14
+ ## 请求说明
15
+
16
+ - CLI 请求体支持以下字段:
17
+ - `name`: 分组名
18
+ - `visibleScope`: 可见范围,支持 `all` / `specific`
19
+ - `visibleUsers`: 当 `visibleScope=specific` 时必填,表示可见用户 ID 列表
20
+ - 路径参数 `groupId` 使用命令第一个位置参数传入。
21
+ - `--visible-scope specific` 时,必须至少传入一个 `--visible-user <userId>`。
22
+ - 当涉及“指定成员可见”时,应先执行 [`yxer query members`](./get-members.md) 获取真实成员 ID,再回填到 `--visible-user`。
23
+ - 写操作先执行 `--dry-run`,确认请求体后再正式提交。
24
+
25
+ ## 输出说明
26
+
27
+ - `--dry-run` 返回预览请求,不产生实际副作用。
28
+ - 正式执行返回远端更新结果,字段以 CLI 实际 JSON 输出为准。
@@ -0,0 +1,70 @@
1
+ # 上传资源 (Upload Resource)
2
+
3
+ 将图片、视频或其它素材上传至蚁小二云端存储 (OSS),并获取用于发布的资源 Key。这是自动化发布的前置步骤。
4
+
5
+ ## 触发场景 (Trigger)
6
+ - **意图辨析**:当用户提供原始 URL 或本地路径,并准备进行发布 (publish) 或存入素材库 (material) 之前,必须先将资源“物理上传”以获得系统可识别的 Key。
7
+ - **典型提示词**:
8
+ - “把这个视频传上去”
9
+ - “准备发布,上传封面图”
10
+ - “获取这个短剧资源的 Key”
11
+
12
+ > [!IMPORTANT]
13
+ > **素材库上传特殊说明**: 当用户明确要求“上传到素材库”时,这只是第一步 (`upload`),完成后**必须**紧接着执行第二步 (`material`) 登记入库,否则上传仅停留在临时 OSS 空间。
14
+
15
+ ## 参数定义 (Parameters)
16
+
17
+ ### 参数列表 (Payload Properties)
18
+
19
+ | 字段名 | 类型 | 是否必填 | 描述 |
20
+ | :--- | :--- | :--- | :--- |
21
+ | `action` | `string` | **是** | 固定值:`upload` |
22
+ | `url` | `string` | **是** | 资源的远程 URL 或本地绝对路径 |
23
+ | `bucket` | `string` | **否** | OSS 存储桶。默认 `cloud-publish`;若后续要调用素材库 `action: "material"`,必须使用 `material-library` |
24
+ | `contentType` | `string` | **是** | 资源的 MIME 类型 (如 `video/mp4`, `image/png`)。**严格要求**: 请求预签名 URL 时声明的 `contentType` 必须与执行 PUT 上传时 Header 中的 `Content-Type` **完全一致**。 |
25
+ | `size` | `number` | 否 | 资源大小 (字节)。 |
26
+
27
+ ## 执行逻辑 (Logic Flow)
28
+ 1. **源检测**:识别 URL 是远程地址还是本地物理路径。
29
+ 2. **目标桶确认**:根据用户是否提到“素材库”决定 `bucket`(`cloud-publish` vs `material-library`)。
30
+ 3. **类型嗅探**:尝试根据后缀名自动推断 `contentType`,若失败则提示用户或使用通用流类型。
31
+ 4. **指令执行**:调用 `yxer upload <file_path_or_url> [--bucket cloud-publish|material-library]`。
32
+ 5. **Key 提取**:获取返回的 `key`,并作为后续发布 Payload 的输入(如 `coverKey`, `video.key`)。
33
+
34
+ > [!IMPORTANT]
35
+ > **视频号 512KB 图片限制**:
36
+ > 上传视频号视频封面或视频号图文图片时,必须带平台用途参数:
37
+ > `yxer upload <图片路径或URL> --platform 视频号 --usage cover` 或 `--usage image`。
38
+ > 当图片超过 512KB 时,CLI 会在内部压缩后再上传,并在 JSON 返回中标记 `compressed: true`、`originalSize` 和压缩后的 `size`;后续 payload 必须使用这次上传返回的完整对象。
39
+
40
+ > [!IMPORTANT]
41
+ > **Instagram / Meta 兼容性**:
42
+ > 若后续要发 Instagram 视频,原视频文件名不要使用中文、空格或其它非 ASCII 字符。Meta 会主动回拉蚁小二返回的媒体 URL;若 URL 路径中带中文,Meta 下载器可能直接返回 HTTP 400,导致“创建发布容器失败 / The media could not be fetched from the provided URI”。
43
+
44
+ ## 输出结果 (Output)
45
+
46
+ 输出生成的资源标识,供发布脚本引用:
47
+ ```json
48
+ {
49
+ "key": "cloud-publish/2026/03/26/66b2xxx/xxx.jpg",
50
+ "name": "xxx.jpg",
51
+ "bucket": "cloud-publish"
52
+ }
53
+ ```
54
+ **注意**: 在发布文章或视频时,请直接传入返回的 `key` 字符串作为封面或图片地址。
55
+
56
+ ## 调用指令 (Command)
57
+
58
+ ```bash
59
+ yxer upload https://example.com/image.jpg --bucket cloud-publish
60
+ yxer upload ./cover.png --platform 视频号 --usage cover
61
+ ```
62
+
63
+ > [!IMPORTANT]
64
+ > **发布合规性提醒**:
65
+ > 所有的封面图、图文图片、视频文件均**严禁直接使用外部网络 URL**,必须通过本项目提供的上传接口进行处理并获取 `key` 后进行发布。不遵守此规范将直接导致任务失败。
66
+
67
+ > [!CAUTION]
68
+ > **ContentType 签名一致性**:
69
+ > 在上传资源时,必须确保获取上传地址所传入的 `contentType` 参数与 PUT 请求实际发送的 `Content-Type` Header **完全一致**。
70
+
@@ -0,0 +1,207 @@
1
+ # yxer 使用流程文档
2
+
3
+ 本文档面向实施、运营和使用同学,说明从首次安装到正式发布的标准使用流程。
4
+
5
+ ## 1. 首次使用流程
6
+
7
+ ### 步骤 1:安装 CLI
8
+
9
+ ```bash
10
+ npm install -g @yixiaoermail/cli
11
+ ```
12
+
13
+ ### 步骤 2:初始化配置
14
+
15
+ ```bash
16
+ yxer --version
17
+ yxer config init --api-key <apiKey>
18
+ ```
19
+
20
+ ### 步骤 3:安装 Skill
21
+
22
+ ```bash
23
+ yxer skill sync
24
+ ```
25
+
26
+ ### 步骤 4:检查环境
27
+
28
+ ```bash
29
+ yxer doctor
30
+ yxer config get
31
+ yxer skill show
32
+ ```
33
+
34
+ ## 2. 日常发布标准流程
35
+
36
+ 所有发布任务建议固定按以下顺序执行。
37
+
38
+ ### 步骤 1:检查环境
39
+
40
+ ```bash
41
+ yxer doctor
42
+ ```
43
+
44
+ ### 步骤 2:查询目标账号
45
+
46
+ ```bash
47
+ yxer accounts list 抖音 --json
48
+ ```
49
+
50
+ 确认目标账号可用,通常需要 `status=1`。
51
+
52
+ ### 步骤 3:获取表单和 Schema
53
+
54
+ ```bash
55
+ yxer prepare 抖音 video
56
+ yxer schema get 抖音 video
57
+ ```
58
+
59
+ 这一步用于确认必填字段、字段结构和枚举值。
60
+
61
+ ### 步骤 4:上传资源
62
+
63
+ ```bash
64
+ yxer upload --file .\video.mp4
65
+ yxer upload --file .\cover.jpg
66
+ ```
67
+
68
+ 说明:
69
+
70
+ - 图片、视频等资源必须先上传
71
+ - 不能直接在 payload 里手填外部 URL 冒充上传结果
72
+
73
+ ### 步骤 5:查询复杂对象
74
+
75
+ 按平台需要查询分类、位置、音乐、商品、合集或话题:
76
+
77
+ ```bash
78
+ yxer query categories <account_id> --type video
79
+ yxer query locations <account_id> --query 上海
80
+ yxer query music <account_id> --query 热门
81
+ ```
82
+
83
+ ### 步骤 6:填写 payload
84
+
85
+ 标准结构示例:
86
+
87
+ ```json
88
+ {
89
+ "action": "publish",
90
+ "publishType": "video",
91
+ "platforms": ["抖音"],
92
+ "publishChannel": "cloud",
93
+ "publishArgs": {
94
+ "accountForms": [
95
+ {
96
+ "platformAccountId": "<platformAccountId>",
97
+ "contentPublishForm": {
98
+ "formType": "task"
99
+ }
100
+ }
101
+ ]
102
+ }
103
+ }
104
+ ```
105
+
106
+ ### 步骤 7:校验
107
+
108
+ ```bash
109
+ yxer validate 抖音 video .\payload.json
110
+ ```
111
+
112
+ ### 步骤 8:预演发布
113
+
114
+ ```bash
115
+ yxer publish video 抖音 .\payload.json --dry-run
116
+ ```
117
+
118
+ ### 步骤 9:正式发布
119
+
120
+ ```bash
121
+ yxer publish video 抖音 .\payload.json
122
+ ```
123
+
124
+ ## 3. 本机发布流程
125
+
126
+ 当用户明确要求本机发布、本地发布或客户端发布时,必须使用 `local` 通道。
127
+
128
+ ### 步骤 1:配置 `clientId`
129
+
130
+ ```bash
131
+ yxer config set-local-client-id <clientId>
132
+ ```
133
+
134
+ ### 步骤 2:按本机模式校验
135
+
136
+ ```bash
137
+ yxer validate 抖音 video .\payload.json --publish-channel local --client-id <clientId>
138
+ ```
139
+
140
+ ### 步骤 3:本机模式预演
141
+
142
+ ```bash
143
+ yxer publish video 抖音 .\payload.json --publish-channel local --client-id <clientId> --dry-run
144
+ ```
145
+
146
+ ### 步骤 4:本机正式发布
147
+
148
+ ```bash
149
+ yxer publish video 抖音 .\payload.json --publish-channel local --client-id <clientId>
150
+ ```
151
+
152
+ ## 4. AI Skill 使用流程
153
+
154
+ 如果是 AI agent 调用本项目,推荐顺序如下:
155
+
156
+ 1. 读取 `skills/yixiaoer/SKILL.md`
157
+ 2. 读取 `skills/yixiaoer/references/workflows/common-rules.md`
158
+ 3. 根据内容类型读取对应 workflow
159
+ 4. 调用 `yxer doctor`
160
+ 5. 调用 `yxer prepare` 和 `yxer schema get`
161
+ 6. 生成 payload 后先 `validate`
162
+ 7. 最后执行 `publish`
163
+
164
+ ## 5. 常见故障处理
165
+
166
+ ### `doctor` 提示 skill 未同步
167
+
168
+ 执行:
169
+
170
+ ```bash
171
+ yxer skill sync
172
+ ```
173
+
174
+ ### 云发布失败,提示代理问题
175
+
176
+ 处理建议:
177
+
178
+ - 检查账号代理配置
179
+ - 必要时改为本机发布
180
+
181
+ ### 本机发布失败,提示客户端不在线
182
+
183
+ 处理建议:
184
+
185
+ - 启动并登录蚁小二客户端
186
+ - 重新执行本机发布
187
+
188
+ ### 校验失败
189
+
190
+ 处理建议:
191
+
192
+ - 回到 `prepare` 和 `schema get` 重新核对字段
193
+ - 不要猜字段,不要手写未经确认的复杂对象
194
+
195
+ ## 6. 最小可用命令集
196
+
197
+ ```bash
198
+ yxer doctor
199
+ yxer config get
200
+ yxer accounts list
201
+ yxer prepare <platform> <type>
202
+ yxer schema get <platform> <type>
203
+ yxer upload --file <file>
204
+ yxer validate <platform> <type> <payload.json>
205
+ yxer publish <type> <platform> <payload.json> --dry-run
206
+ yxer publish <type> <platform> <payload.json>
207
+ ```
@@ -10,28 +10,46 @@
10
10
 
11
11
  ## 强制门禁
12
12
 
13
- 发布类任务必须满足以下顺序;任意一步未完成,都不允许继续到下一步:
13
+ 发布类任务分为两条路径。已有完整标准 `payload.json` 时走快速路径;缺账号、字段、资源或动态字段时走组装路径。
14
14
 
15
- 1. 读取 `skills/yixiaoer/SKILL.md`
15
+ ### 快速路径
16
+
17
+ 1. 读取 `../../SKILL.md`
18
+ 2. 读取当前文件和对应类型 workflow
19
+ 3. 确认 payload 是标准结构且不含占位符
20
+ 4. 执行 `yxer validate`
21
+ 5. 执行 `yxer publish --dry-run`
22
+ 6. 用户授权后执行正式 `yxer publish`
23
+
24
+ ### 组装路径
25
+
26
+ 当 payload 尚未完整,必须满足以下顺序;任意一步未完成,都不允许继续到下一步:
27
+
28
+ 1. 读取 `../../SKILL.md`
16
29
  2. 读取当前文件
17
- 3. 读取 `account-selection.md`、`local-vs-cloud.md`、`payload-sourcing.md`
18
- 4. 读取对应类型 workflow
19
- 5. 执行 `yxer doctor`
20
- 6. 执行 `yxer accounts list`
21
- 7. 执行 `yxer prepare <platform> <type>`
22
- 8. 优先执行 `yxer schema fields <platform> <type>`;需要 payload 骨架时再执行 `yxer schema get <platform> <type>`
23
- 9. 执行 `yxer upload`
24
- 10. 执行动态字段查询命令
25
- 11. 组装 payload
26
- 12. 执行 `yxer validate`
27
- 13. 执行 `yxer publish`
30
+ 3. 读取 `data-accuracy.md`、`account-selection.md`、`local-vs-cloud.md`、`payload-sourcing.md`
31
+ 4. 如涉及话题/标签,读取 `../topic-tags.md`
32
+ 5. 读取对应类型 workflow
33
+ 6. 执行 `yxer doctor`
34
+ 7. 执行 `yxer accounts list`
35
+ 8. 执行 `yxer prepare <platform> <type>` 或 `yxer publish form start/inspect`
36
+ 9. 优先执行 `yxer schema fields <platform> <type>`;需要 payload 骨架时再执行 `yxer schema get <platform> <type>`
37
+ 10. 执行 `yxer upload`
38
+ 11. 执行动态字段查询命令
39
+ 12. 多候选或歧义数据按 `data-accuracy.md` 展示给用户确认
40
+ 13. 组装 payload
41
+ 14. 执行 `yxer validate`
42
+ 15. 执行 `yxer publish --dry-run`
43
+ 16. 用户授权后执行正式 `yxer publish`
28
44
 
29
45
  禁止行为:
30
46
 
31
- - 跳过 `prepare` / `schema fields` / `schema get` 直接手写 payload
47
+ - 缺字段来源时跳过 `prepare` / `publish form` / `schema fields` / `schema get` 直接手写 payload
32
48
  - 先执行 `publish`,失败后再补 `validate`
33
49
  - 从空白 JSON 文件开始猜字段、猜层级、猜顺序
34
50
  - 未读取 workflow 就按历史记忆填平台字段
51
+ - 动态查询返回多个候选时,未让用户确认就直接选择第一项
52
+ - 跳过 `publish --dry-run` 直接正式发布
35
53
 
36
54
  ## 发布前自检清单
37
55
 
@@ -39,15 +57,18 @@
39
57
 
40
58
  - `[ ]` 已读技能入口
41
59
  - `[ ]` 已读通用规则
60
+ - `[ ]` 已读数据准确性工作流
42
61
  - `[ ]` 已读类型 workflow
43
62
  - `[ ]` 已完成环境检查
44
63
  - `[ ]` 已确认账号有效
45
- - `[ ]` 已拿到最新 `prepare` 结果
46
- - `[ ]` 已拿到最新 `schema fields` 结果;如需骨架再补 `schema get`
64
+ - `[ ]` 新建或补字段时已拿到最新 `prepare` / `publish form` 结果
65
+ - `[ ]` 新建或补字段时已拿到最新 `schema fields` 结果;如需骨架再补 `schema get`
47
66
  - `[ ]` 已完成上传,不存在外部 URL 直填
48
67
  - `[ ]` 已查询动态字段,不存在手写 `raw`
68
+ - `[ ]` 多候选账号、分类、位置、音乐、商品、合集、活动等已由用户确认
49
69
  - `[ ]` 当前 payload 不含模板占位符
50
70
  - `[ ]` 当前 payload 已先通过 `validate`
71
+ - `[ ]` 当前 payload 已先通过 `publish --dry-run`
51
72
 
52
73
  ## 数据真实性原则
53
74
 
@@ -55,6 +76,7 @@
55
76
  - 严禁自行猜测字段名、层级、枚举、默认值、示例值、`raw` 对象内容或资源元数据。
56
77
  - 文档未定义、schema 未声明、CLI 未返回的字段,不得写入 payload。
57
78
  - 动态字段和复杂对象必须先查询后填写;查不到时继续查询或向用户确认,不能凭经验编造。
79
+ - 话题/标签字段必须按 `../topic-tags.md` 的最终格式直接写入 payload。CLI 只兜底归一化 `description` 中的普通 `#话题`,不处理 `content`,也不改变 `tags` / `topics` / `challenge` 字段结构。
58
80
 
59
81
  ---
60
82
 
@@ -77,13 +99,14 @@ Agent 在任何 `publish` 之前,都要先读取 [`local-vs-cloud.md`](./local
77
99
  ### 本机发布执行规则
78
100
 
79
101
  - 必须显式使用 `publishChannel=local`
80
- - 必须提供 `clientId`
102
+ - 必须通过 `--client-id` 或 `yxer config set-local-client-id` 提供 `clientId`
81
103
  - `validate`、`publish --dry-run`、正式 `publish` 必须使用同一套发布通道参数,避免“校验通过但执行模式不一致”
82
- - `clientId` 获取优先级:
83
- 1. payload 中已有 `clientId`
84
- 2. 命令 flags:`--client-id <clientId>`
85
- 3. 第四个位置参数:`yxer publish <type> <platform> <payload.json> <clientId>`
86
- 4. 本地配置:`yxer config set-local-client-id <clientId>` 后由 CLI 自动读取
104
+ - 推荐的 `clientId` 来源:
105
+ 1. 命令 flags:`--client-id <clientId>`
106
+ 2. 本地配置:`yxer config set-local-client-id <clientId>` 后由 CLI 自动读取
107
+ 3. payload 中已有 `clientId` 时可沿用
108
+
109
+ 第四个位置参数属于旧版兼容,不再作为 Agent 推荐入口。
87
110
 
88
111
  推荐命令形态:
89
112
 
@@ -103,6 +126,13 @@ yxer publish <type> <platform> .\payload.json --publish-channel local --client-i
103
126
  - 云发布报“账号代理不存在”:
104
127
  - 提示检查账号代理配置
105
128
  - 若用户希望立即绕过代理限制,可改用本机发布
129
+ - 不默认使用 `--auto-fallback-local`;只有用户明确授权“一失败就切本机”时才可使用
130
+
131
+ ### dry-run 语义
132
+
133
+ - `yxer publish --dry-run` 只预览最终请求,不创建发布任务。
134
+ - 云发布且已配置 API key 时,dry-run 会做账号/代理 preflight;local dry-run 不检测客户端在线状态。
135
+ - dry-run 输出中的 `meta.remoteChecks` 表示本次是否实际执行了远端 preflight。
106
136
 
107
137
  ---
108
138
 
@@ -155,10 +185,10 @@ yxer publish <type> <platform> .\payload.json --publish-channel local --client-i
155
185
 
156
186
  在自动填值之前,Agent 必须先读取平台前置数据和 schema:
157
187
 
158
- - 先执行 `yxer prepare <platform> <type>`,确认该平台该类型需要哪些表单字段、账号能力和前置数据
159
- - 先执行 `yxer schema fields <platform> <type>`,确认字段名、类型和必填项;需要根层级骨架时再执行 `yxer schema get <platform> <type>`
160
- - 只有在 `prepare` / `schema fields` / `schema get` 已确认后,才开始填写或补齐 `payload.json`
161
- - Agent 不允许从空白 JSON 手工拼接 payload;必须先基于标准结构或 CLI 模板生成骨架,再按返回结果填值
188
+ - 新建或补字段时,先执行 `yxer prepare <platform> <type>` 或使用 `yxer publish form start/inspect` 获取表单契约
189
+ - 新建或补字段时,先执行 `yxer schema fields <platform> <type>`,确认字段名、类型和必填项;需要根层级骨架时再执行 `yxer schema get <platform> <type>`
190
+ - 只有在 `prepare` / `publish form` / `schema fields` / `schema get` 已确认后,才开始填写或补齐 `payload.json`
191
+ - Agent 不允许从空白 JSON 手工拼接 payload;必须先基于标准结构、publish form 会话或 CLI 模板生成骨架,再按返回结果填值
162
192
 
163
193
  以下字段应先向用户确认,再填入:
164
194
 
@@ -248,7 +278,7 @@ yxer publish <type> <platform> .\payload.json --publish-channel local --client-i
248
278
 
249
279
  - 未确认账号 `status=1` 就构造 payload
250
280
  - 用户明确要求本机发布时,仍然默认走云发布
251
- - 使用本机发布却没有显式提供或确认 `clientId`
281
+ - 使用本机发布却没有通过 flag、配置或 payload 提供 `clientId`
252
282
  - 手动编造 `key` / `size` / `width` / `height` / `duration`
253
283
  - 手动构造 `location` / `music` / `collection` / `challenge` 的 `raw`
254
284
  - 跳过 `yxer validate` 直接执行 `yxer publish`
@@ -0,0 +1,83 @@
1
+ # 数据准确性工作流
2
+
3
+ > 适用范围:任何会创建、修改、发布、保存草稿、登记素材或更新账号配置的任务。
4
+
5
+ 本文档定义 Agent 在写操作前如何确保数据来自真实查询结果,而不是凭自然语言、记忆或示例 JSON 猜测。
6
+
7
+ ## 核心原则
8
+
9
+ - 写接口只接收已解析、已校验、有来源的数据。
10
+ - 自然语言只能用于触发查询、筛选候选和生成用户可确认的业务文案,不能直接作为动态对象写入 payload。
11
+ - `yxer` CLI 输出是唯一事实来源;字段名、枚举、账号、资源 key、分类、位置、音乐、商品、合集、活动等动态数据不得手写。
12
+ - CLI stdout 外层 `data` 只是机器可读结果容器;Agent 取得其中候选后,必须按目标 schema / `dynamicFieldExamples` 装配成发布字段结构,再请求接口。
13
+ - 只要候选结果不唯一,且下一步会产生写入、副作用或发布,必须先展示候选并等待用户明确选择。
14
+ - `validate`、`publish --dry-run`、正式 `publish` 必须使用同一份 payload 和同一套发布通道参数。
15
+
16
+ ## 固定执行链
17
+
18
+ 发布类写操作必须按以下链路执行:
19
+
20
+ 1. 读取 `SKILL.md` 和相关 domain/workflow。
21
+ 2. 执行 `yxer doctor`,确认环境可用。
22
+ 3. 执行 `yxer accounts list <platform> --status 1`,只从有效账号中选择。
23
+ 4. 执行 `yxer prepare <platform> <type>`,获取账号能力、前置数据和平台要求。
24
+ 5. 执行 `yxer schema fields <platform> <type>`,确认字段名、类型、必填项;需要骨架时再执行 `yxer schema get`。
25
+ 6. 对资源执行 `yxer upload`,只使用上传结果中的 key、size、width、height、duration、format 等字段。
26
+ 7. 对动态字段执行对应 `yxer query ...` 命令,保留 CLI 返回对象,不自行精简为 ID 或名称。
27
+ 8. 从 CLI 输出 `data` 中选中候选后,按 schema / `dynamicFieldExamples` 转成目标字段结构;不要把查询响应 envelope 或候选对象直接当成完整发布请求。
28
+ 9. 如果账号、动态对象、时间、发布通道或其他关键选项存在多个候选,先展示候选并等待用户确认。
29
+ 10. 组装或修订 payload,只写入前面步骤已经确认的数据。
30
+ 11. 执行 `yxer validate <platform> <type> <payload.json>`。
31
+ 12. 执行 `yxer publish <type> <platform> <payload.json> --dry-run`。
32
+ 13. 用户已授权正式发布时,才执行不带 `--dry-run` 的 `yxer publish`。
33
+
34
+ ## 候选确认规则
35
+
36
+ 以下情况必须等待用户确认,不能自动选择第一项:
37
+
38
+ - `accounts list` 返回多个可用账号,且用户没有指定账号。
39
+ - 用户按关键词选择分类、位置、音乐、商品、合集、活动、挑战、群组等,查询结果有多个合理候选。
40
+ - 用户给出的发布时间、发布通道、草稿类型或平台目标存在歧义。
41
+ - 本机发布需要 `clientId`,但当前 payload、flag 和配置中没有确定值。
42
+ - 查询结果与用户描述不完全匹配,但 Agent 认为可能可用。
43
+
44
+ 可以自动选择的情况:
45
+
46
+ - 只有一个 `status=1` 的账号,且用户没有指定其他账号。
47
+ - 用户明确给出唯一账号 ID、资源 key、分类对象或查询命令返回项的稳定标识。
48
+ - 字段默认值已被 workflow 明确规定,例如 `formType=task`、默认云发布、封面默认使用首图或已上传封面。
49
+
50
+ 自动选择时必须在面向用户的说明中告知选择依据,但 stdout 仍只输出 JSON。
51
+
52
+ ## 动态对象来源表
53
+
54
+ | 数据类型 | 必须来源 | 写入规则 |
55
+ | --- | --- | --- |
56
+ | 账号 | `yxer accounts list` | 只使用 `status=1` 的账号;多个候选需确认 |
57
+ | 资源 | `yxer upload` | 使用 CLI 返回的完整资源字段,禁止外部 URL 直填 |
58
+ | 分类 | `yxer query categories` | 使用返回的完整对象;多级分类选择叶子节点或完整路径 |
59
+ | 位置 | `yxer query locations` | 使用返回对象,不手写 POI/raw |
60
+ | 音乐 | `yxer query music` / `music-categories` | 保留 playUrl/url 等查询元数据 |
61
+ | 商品 | `yxer query goods` | 使用完整商品对象 |
62
+ | 合集 | `yxer query collections` | 使用完整合集对象 |
63
+ | 话题/挑战 | `yxer query challenges` 或平台文档规定格式 | 不凭热门词手写 raw |
64
+ | 活动/热点 | `yxer query activities` / `hot-events` | 使用完整返回对象 |
65
+ | 小程序/同步应用/游戏/群组 | 对应 `yxer query miniapps/syncapps/games/groups` | 使用 CLI 返回对象 |
66
+
67
+ ## 禁止行为
68
+
69
+ - 从空白 JSON 猜字段、猜层级、猜枚举。
70
+ - 直接把用户自然语言中的名称写成动态对象。
71
+ - 查询结果为空时编造兜底对象。
72
+ - 只复制查询结果中的 ID,丢弃 CLI 返回的 raw 或配套字段。
73
+ - 修改 payload 后跳过 `validate` 或 `publish --dry-run`。
74
+ - `validate` 使用云发布参数,而 `publish` 改成本机发布参数,或反过来。
75
+ - 在用户只要求 dry-run、预览、修 payload 时执行正式写操作。
76
+
77
+ ## 错误恢复
78
+
79
+ - `validate` 失败:只修正报错字段,重新按本工作流校验,不重写整份 payload。
80
+ - 动态字段校验失败:回到对应 `yxer query ...`,重新获取合法对象。
81
+ - 资源字段校验失败:回到 `yxer upload`,不要手写 key 或尺寸。
82
+ - 账号失效:重新执行 `accounts list --status 1`,让用户确认新的账号。
83
+ - 发布通道失败:读取 `local-vs-cloud.md`,保持 validate、dry-run、publish 参数一致后重试。