@yixiaoermail/cli 3.2.30 → 3.2.31

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 (48) hide show
  1. package/checksums.txt +6 -6
  2. package/package.json +1 -1
  3. package/references/cli/command-reference.md +16 -1
  4. package/references/domains/install-and-sync.md +17 -0
  5. package/references/domains/publish.md +5 -1
  6. package/references/platforms/video/bilibili-open.md +2 -2
  7. package/references/platforms/video/facebook.md +5 -0
  8. package/references/platforms/video/xiaohongshushop.md +1 -1
  9. package/references/platforms/video/youtube.md +7 -0
  10. package/references/protocols/execution.md +6 -3
  11. package/references/protocols/provenance.md +3 -0
  12. package/references/protocols/publish-plan.md +5 -0
  13. package/references/workflows/data-accuracy.md +2 -0
  14. package/references/workflows/publish-article.md +2 -0
  15. package/references/workflows/publish-imageText.md +2 -0
  16. package/references/workflows/publish-plan.md +53 -0
  17. package/references/workflows/publish-video.md +2 -0
  18. package/references/yixiaoer-shared.md +2 -2
  19. package/schemas/platforms/baijiahao.video.schema.json +4 -2
  20. package/schemas/platforms/bilibili-open.video.schema.json +4 -2
  21. package/schemas/platforms/bilibili.video.schema.json +31 -0
  22. package/schemas/platforms/douyin.video.schema.json +18 -0
  23. package/schemas/platforms/facebook.video.schema.json +8 -0
  24. package/schemas/platforms/kuaishou.video.schema.json +1 -0
  25. package/schemas/platforms/shipinhao.video.schema.json +9 -1
  26. package/schemas/platforms/souhuhao.article.schema.json +17 -0
  27. package/schemas/platforms/toutiaohao.article.schema.json +4 -0
  28. package/schemas/platforms/weixin.account.article.schema.json +22 -0
  29. package/schemas/platforms/weixin.account.imageText.schema.json +48 -0
  30. package/schemas/platforms/youtube.video.schema.json +8 -0
  31. package/skills/yixiaoer/QUICKSTART.md +38 -244
  32. package/skills/yixiaoer/SKILL.md +100 -98
  33. package/skills/yixiaoer/references/cli/command-reference.md +16 -1
  34. package/skills/yixiaoer/references/domains/install-and-sync.md +17 -0
  35. package/skills/yixiaoer/references/domains/publish.md +5 -1
  36. package/skills/yixiaoer/references/platforms/video/bilibili-open.md +2 -2
  37. package/skills/yixiaoer/references/platforms/video/facebook.md +5 -0
  38. package/skills/yixiaoer/references/platforms/video/xiaohongshushop.md +1 -1
  39. package/skills/yixiaoer/references/platforms/video/youtube.md +7 -0
  40. package/skills/yixiaoer/references/protocols/execution.md +6 -3
  41. package/skills/yixiaoer/references/protocols/provenance.md +3 -0
  42. package/skills/yixiaoer/references/protocols/publish-plan.md +5 -0
  43. package/skills/yixiaoer/references/workflows/data-accuracy.md +2 -0
  44. package/skills/yixiaoer/references/workflows/publish-article.md +2 -0
  45. package/skills/yixiaoer/references/workflows/publish-imageText.md +2 -0
  46. package/skills/yixiaoer/references/workflows/publish-plan.md +53 -0
  47. package/skills/yixiaoer/references/workflows/publish-video.md +2 -0
  48. package/skills/yixiaoer/references/yixiaoer-shared.md +2 -2
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "title": "Youtube Video Publish Form",
3
3
  "type": "object",
4
+ "x-publish-constraints": {
5
+ "scheduledMinDelayMilliseconds": 1
6
+ },
4
7
  "required": [
5
8
  "formType",
6
9
  "title"
@@ -75,6 +78,11 @@
75
78
  ],
76
79
  "default": "public"
77
80
  },
81
+ "scheduledTime": {
82
+ "type": "number",
83
+ "minimum": 1,
84
+ "description": "Optional native scheduled publish time: a future 13-digit integer Unix timestamp in milliseconds. Interpret user-entered date/time as Beijing time (UTC+8), then send the absolute timestamp unchanged. Omit for immediate publishing; the provider uploads privately and schedules public release."
85
+ },
78
86
  "containsSyntheticMedia": {
79
87
  "type": "boolean",
80
88
  "default": false
@@ -1,265 +1,59 @@
1
1
  # 蚁小二发布快速开始
2
2
 
3
- **5 分钟完成首次发布**
3
+ 使用严格来源表单导出标准 payload,依次校验、预览和发布。完整规则见 [发布执行协议](references/protocols/publish-plan.md) 和 [标准发布工作流](references/workflows/publish-plan.md)。
4
4
 
5
- 本指南帮助 AI Agent 和人类用户快速完成第一次发布,跳过复杂的文档层级。
5
+ ## 1. 检查环境和契约
6
6
 
7
- **使用边界:本文只提供最短上手路径,不替代正式规则。若与 [`references/yixiaoer-shared.md`](./references/yixiaoer-shared.md) 或 `references/workflows/` 中的 workflow 有冲突,以共享规则和 workflow 为准。**
7
+ 执行 doctor、prepare、schema fields,确认目标平台、发布类型和真实在线账号;按字段说明和枚举标签填写,不猜 ID 或数字含义。
8
8
 
9
- ---
10
-
11
- ## 🚀 5 步发布流程
12
-
13
- ### 1️⃣ 环境检查(30秒)
14
-
15
- ```bash
9
+ ~~~bash
16
10
  yxer doctor
17
- yxer accounts list 抖音 --status 1 --json
18
- ```
19
-
20
- **检查点:**
21
- - ✅ `doctor` 返回 `ok: true`
22
- - ✅ `accounts list` 至少返回一个 `status: 1` 的账号
23
- - ❌ 如果失败,先执行 `yxer config init --api-key <apiKey>`
24
-
25
- **保存信息:**
26
- - `platformAccountId`(从 accounts list 获取)
27
-
28
- ---
29
-
30
- ### 2️⃣ 获取字段清单(1分钟)
31
-
32
- ```bash
33
- # 推荐:先看字段列表(输出简洁)
11
+ yxer prepare 抖音 video
34
12
  yxer schema fields 抖音 video
13
+ yxer publish form start 抖音 video --output form.json
14
+ yxer publish form account form.json --id <online_account_id>
15
+ ~~~
35
16
 
36
- # 备选:需要完整结构骨架时才执行
37
- yxer schema get 抖音 video
38
- ```
39
-
40
- **关注重点:**
41
- - `required` 字段:必须填写
42
- - `complex` 字段:需要查询命令获取(如 location, music, challenge)
43
- - `queryCommands`:告诉你如何查询复杂字段
44
-
45
- **保存信息:**
46
- - 必填字段列表
47
- - 复杂字段的查询命令
48
-
49
- ---
50
-
51
- ### 3️⃣ 准备资源(2分钟)
52
-
53
- ```bash
54
- # 上传视频
55
- yxer upload ./video.mp4
56
-
57
- # 上传封面
58
- yxer upload ./cover.jpg
59
- ```
17
+ ## 2. 记录资源与动态候选
60
18
 
61
- **保存信息:**
62
- - 视频上传返回的完整对象:`{key, size, width, height, duration, format}`
63
- - 封面上传返回的完整对象:`{key, size, width, height, format}`
19
+ ~~~bash
20
+ yxer upload --file video.mp4 --auto-meta --record --json
21
+ yxer upload --file cover.jpg --auto-meta --record --json
22
+ yxer query music <account_id> --query 关键词 --record --json
23
+ ~~~
64
24
 
65
- **⚠️ 重要:**
66
- - 必须使用 CLI 返回的**完整对象**,不能只用 `key`
67
- - 不能手动编造 `size/width/height` 等字段
25
+ 每次记录的 ID 在外层 _notice.resultId,结果数据仍在 data。保存对应的真实 ID,不混用查询与上传回执。只查询用户需要的动态字段。
68
26
 
69
- ---
27
+ ## 3. 填写会话
70
28
 
71
- ### 4️⃣ 填写 payload(3分钟)
29
+ ~~~bash
30
+ yxer publish form set form.json publishArgs.accountForms[0].video --result-id <video_result_id>
31
+ yxer publish form set form.json publishArgs.accountForms[0].cover --result-id <cover_result_id>
32
+ yxer publish form set form.json publishArgs.accountForms[0].coverKey --result-id <cover_result_id>
33
+ yxer publish form set form.json publishArgs.accountForms[0].contentPublishForm.title --value "用户确认的标题"
34
+ yxer publish form set form.json publishArgs.accountForms[0].contentPublishForm.description --value "用户确认的描述"
35
+ yxer publish form choose form.json music --result-id <music_result_id> --id <candidate_id>
36
+ yxer publish form verify form.json
37
+ yxer publish form review form.json
38
+ ~~~
72
39
 
73
- 创建 `payload.json`:
40
+ 资源路径按目标契约选择;图文通常使用 images,部分平台用首图作为封面。普通文案、字符串标签和业务枚举可用 set;动态对象必须 choose。多候选先确认,再选择。
74
41
 
75
- ```json
76
- {
77
- "action": "publish",
78
- "publishType": "video",
79
- "platforms": ["抖音"],
80
- "publishArgs": {
81
- "accountForms": [
82
- {
83
- "platformAccountId": "<步骤1获取的账号ID>",
84
- "video": {
85
- "key": "<步骤3返回>",
86
- "size": 12345678,
87
- "width": 1080,
88
- "height": 1920,
89
- "duration": 15000,
90
- "format": "mp4"
91
- },
92
- "cover": {
93
- "key": "<步骤3返回>",
94
- "size": 234567,
95
- "width": 1080,
96
- "height": 1920,
97
- "format": "jpg"
98
- },
99
- "contentPublishForm": {
100
- "formType": "task",
101
- "title": "我的第一个视频",
102
- "description": "这是一个测试视频"
103
- }
104
- }
105
- ]
106
- }
107
- }
108
- ```
42
+ ## 4. 导出、校验并预览请求
109
43
 
110
- **结构说明:**
111
- - 顶层:`action`, `publishType`, `platforms`, `publishArgs`(固定结构)
112
- - `publishArgs.accountForms[]`:账号级表单数组
113
- - `contentPublishForm`:平台特定的业务字段
114
-
115
- ---
116
-
117
- ### 5️⃣ 校验和发布(1分钟)
118
-
119
- ```bash
120
- # 校验 payload
44
+ ~~~bash
45
+ yxer publish form export form.json --output payload.json
121
46
  yxer validate 抖音 video payload.json
122
-
123
- # 预览(dry-run)
124
47
  yxer publish video 抖音 payload.json --dry-run
48
+ ~~~
125
49
 
126
- # 正式发布
127
- yxer publish video 抖音 payload.json
128
- ```
129
-
130
- **注意:**
131
- - 必须按顺序执行:validate → dry-run → publish
132
- - 每次修改 payload 后都要重新 validate
133
-
134
- ---
135
-
136
- ## 🎯 常见场景
137
-
138
- ### 场景 1:添加地理位置
139
-
140
- ```bash
141
- # 1. 查询位置
142
- yxer query locations <account_id> --query 北京
143
-
144
- # 2. 在 contentPublishForm 中添加
145
- {
146
- "location": {
147
- "yixiaoerId": "<返回的ID>",
148
- "yixiaoerName": "<返回的名称>",
149
- "raw": {<返回的完整raw对象>}
150
- }
151
- }
152
- ```
153
-
154
- ### 场景 2:添加背景音乐
155
-
156
- ```bash
157
- # 1. 查询音乐
158
- yxer query music <account_id> --query 歌曲名
159
-
160
- # 2. 在 contentPublishForm 中添加
161
- {
162
- "music": {
163
- "yixiaoerId": "<返回的ID>",
164
- "yixiaoerName": "<返回的名称>",
165
- "duration": 180000,
166
- "playUrl": "<返回的URL>",
167
- "raw": {<返回的完整raw对象>}
168
- }
169
- }
170
- ```
50
+ 检查预览中的账号、文案、资源、可见范围、声明、时间及通道。payload 有修改时重新校验和预览;validate、dry-run 与正式发布使用同一份 payload 和通道参数。
171
51
 
172
- ### 场景 3:本机发布(客户端发布)
52
+ ## 5. 已授权后提交并查结果
173
53
 
174
- ```bash
175
- # 1. 配置 clientId(一次性)
176
- yxer config set-local-client-id <clientId>
177
-
178
- # 2. 发布时指定通道
179
- yxer validate 抖音 video payload.json --publish-channel local
180
- yxer publish video 抖音 payload.json --publish-channel local --dry-run
181
- yxer publish video 抖音 payload.json --publish-channel local
182
- ```
183
-
184
- ---
185
-
186
- ## ⚠️ 常见错误速查
187
-
188
- | 错误信息 | 原因 | 解决方案 |
189
- |---------|------|----------|
190
- | `missing publishArgs` | payload 结构不对 | 确保顶层有 `publishArgs` 字段 |
191
- | `missing platformAccountId` | 缺少账号 ID | 从 `yxer accounts list` 获取 |
192
- | `missing required field "title"` | 缺少必填字段 | 查看 `yxer schema fields` 的 `required` 列表 |
193
- | `invalid resource key` | 资源未上传 | 先执行 `yxer upload <file>` |
194
- | `unexpected field` | 字段名错误或不存在 | 对照 `yxer schema fields` 检查字段名 |
195
- | `Schema validation failed` | 字段类型或值不对 | 查看错误信息中的 `suggestions` |
196
-
197
- ---
198
-
199
- ## 🔍 错误诊断检查清单
200
-
201
- 如果发布失败,按顺序检查:
202
-
203
- - [ ] 已执行 `yxer doctor` 且返回成功
204
- - [ ] 已执行 `yxer accounts list` 并确认有在线账号
205
- - [ ] 已执行 `yxer schema fields` 查看字段定义
206
- - [ ] payload 顶层包含 `publishArgs`
207
- - [ ] 业务字段在 `publishArgs.accountForms[].contentPublishForm`
208
- - [ ] 资源通过 `yxer upload` 上传并使用返回的**完整对象**
209
- - [ ] 复杂对象(location/music等)通过查询命令获取
210
- - [ ] 已执行 `yxer validate` 且通过
211
- - [ ] 已执行 `yxer publish --dry-run` 预览
212
-
213
- ---
214
-
215
- ## 📚 进阶学习
216
-
217
- 完成首次发布后,可以继续学习:
218
-
219
- ### 不同发布类型
220
-
221
- - **图文发布**:`references/workflows/publish-imageText.md`
222
- - **文章发布**:`references/workflows/publish-article.md`
223
-
224
- ### 复杂功能
225
-
226
- - **复杂字段查询**:`references/workflows/payload-sourcing.md`
227
- - **发布通道选择**:`references/workflows/local-vs-cloud.md`
228
- - **账号选择策略**:`references/workflows/account-selection.md`
229
-
230
- ### 平台差异
231
-
232
- - **平台文档索引**:`references/platforms/index.md`
233
- - **视频平台**:`references/platforms/video/`
234
- - **图文平台**:`references/platforms/imageText/`
235
- - **文章平台**:`references/platforms/article/`
236
-
237
- ---
238
-
239
- ## 💡 AI Agent 使用建议
240
-
241
- 如果你是 AI Agent,使用本指南时:
242
-
243
- 1. **优先阅读本文档**,而不是从 `SKILL.md` 开始读 7 个文档
244
- 2. **真正进入写操作前,仍必须回读** `references/yixiaoer-shared.md` 和对应 workflow
245
- 3. **优先使用 `schema fields`**,只在需要完整结构时才用 `schema get`
246
- 4. **关注错误信息中的 `suggestions`**,而不是自己猜测
247
- 5. **使用 CLI 返回的完整对象**,不要手动编造字段值
248
- 6. **遇到复杂字段时查看 `queryCommands`**,使用对应的查询命令
249
-
250
- ---
251
-
252
- ## 🎓 总结
253
-
254
- **记住这 3 个核心原则:**
255
-
256
- 1. **结构标准化**:所有平台使用相同的 payload 结构
257
- 2. **字段从 CLI 获取**:资源和复杂对象必须通过 CLI 命令获取
258
- 3. **先 validate 后 publish**:永远不要跳过校验步骤
259
-
260
- **5 分钟流程回顾:**
261
- ```
262
- doctor → accounts list → schema fields → upload → fill payload → validate → dry-run → publish
263
- ```
54
+ ~~~bash
55
+ yxer publish video 抖音 payload.json
56
+ yxer query details <task_set_id> --json
57
+ ~~~
264
58
 
265
- 祝你发布顺利!🎉
59
+ 拿到 taskSetId 仅表示任务集创建成功,平台最终结果以 details 为准。必要的封面压缩和正文图片转存在正式发布时执行;dry-run 返回相应预览。CLI 按每次明确的发布调用提交请求,不维护发布去重记录。结果不明时先查询 records/details 确认实际状态。
@@ -1,98 +1,100 @@
1
- ---
2
- name: yixiaoer
3
- version: 3.2.30
4
- description: "通过 yxer CLI 操作蚁小二多平台内容分发:账号查询、资源上传、发布前准备、payload 校验、云发布/本机发布、草稿保存、素材登记、发布记录排查与技能同步。"
5
- metadata:
6
- category: "productivity"
7
- requires:
8
- bins: ["yxer"]
9
- cliHelp: "yxer --help; yxer doctor; yxer accounts list --help; yxer publish --help; yxer validate --help"
10
- ---
11
-
12
- # 蚁小二 Skill
13
-
14
- 你是 AI Agent,通过 `yxer` CLI 操作蚁小二资源。真正执行一律走 CLI,不要假设存在旧 Node 脚本入口、隐式 API 或手工脚本。
15
-
16
- **🚀 首次使用?先读 [`./QUICKSTART.md`](./QUICKSTART.md) - 5 分钟完成首次发布**
17
-
18
- **CRITICAL - 开始前 MUST 先读取 [`./references/yixiaoer-shared.md`](./references/yixiaoer-shared.md),其中包含环境检查、发布通道、同步和输出协议。**
19
- **AI EXECUTION PROTOCOL - 涉及查询、payload 修订、草稿、素材或发布时,MUST 先读取 [`./references/protocols/execution.md`](./references/protocols/execution.md),并按状态机推进。**
20
- **BLOCKING REQUIREMENT - 涉及正式写操作时,禁止凭记忆拼 payload、禁止跳过 workflow、禁止绕过 `yxer` CLI 直接执行旧脚本或隐式 API。**
21
-
22
- ## 能力索引
23
-
24
- 根据用户需求,必须先读取对应业务域文档,再进入具体 workflow 或 reference。不要直接凭记忆拼 payload 或执行正式发布。
25
-
26
- - AI 执行协议
27
- - 入口:[`./references/protocols/execution.md`](./references/protocols/execution.md)
28
- - 候选确认:[`./references/protocols/confirmation.md`](./references/protocols/confirmation.md)
29
- - 字段来源追踪:[`./references/protocols/provenance.md`](./references/protocols/provenance.md)
30
- - 错误恢复:[`./references/protocols/error-recovery.md`](./references/protocols/error-recovery.md)
31
- - 覆盖状态机、写操作门禁、多候选确认、payload 来源追踪和失败后的最小修复策略。
32
-
33
- - 发布与 payload 修订
34
- - 入口:[`./references/domains/publish.md`](./references/domains/publish.md)
35
- - 覆盖视频、图文、文章发布,账号选择,云/本机通道判断,payload 来源纪律,动态字段查询,平台差异文档入口。
36
- - 账号、环境与 skill 同步
37
- - 入口:[`./references/domains/accounts-and-env.md`](./references/domains/accounts-and-env.md)
38
- - 覆盖 `doctor`、`config`、账号查询与技能同步。
39
- - 草稿与素材库
40
- - 入口:[`./references/domains/draft-and-material.md`](./references/domains/draft-and-material.md)
41
- - 覆盖蚁小二草稿、平台草稿判断、素材上传、素材登记与“上传后立即发布”的切换路径。
42
- - 发布记录与失败排查
43
- - 入口:[`./references/domains/troubleshooting.md`](./references/domains/troubleshooting.md)
44
- - 覆盖 `query records`、按作品信息删除已发布内容、校验失败修复、本机/云发布错误分流与回退策略。
45
- - 安装、升级与分发
46
- - 入口:[`./references/domains/install-and-sync.md`](./references/domains/install-and-sync.md)
47
- - 覆盖 skill 安装、同步、升级和宿主侧接入说明。
48
-
49
- ## 意图分流
50
-
51
- | 用户意图 / 说法 | 先读入口 | 后续动作 |
52
- | --- | --- | --- |
53
- | “帮我发一下”“发个抖音/小红书”“发布视频/图文/文章” | [`./references/domains/publish.md`](./references/domains/publish.md) | 再按类型进入对应 workflow;已有完整 payload 时走 `validate -> publish --dry-run -> publish`,缺账号/字段/资源时先补 `doctor -> accounts list -> prepare/form -> upload/query` |
54
- | “先别发,只生成/修一下 payload” | [`./references/domains/publish.md`](./references/domains/publish.md) | 强制读取 payload 来源和类型 workflow,只做字段修订,不擅自正式发布 |
55
- | “查下账号/环境”“怎么配置 clientId”“看看 skill 要不要同步” | [`./references/domains/accounts-and-env.md`](./references/domains/accounts-and-env.md) | 先做环境检查,再决定是否继续业务流程 |
56
- | “存草稿”“传素材”“放到素材库里” | [`./references/domains/draft-and-material.md`](./references/domains/draft-and-material.md) | 先区分草稿和素材,再判断是否需要回切发布域 |
57
- | “为什么失败了”“查发布记录”“删除已发布作品”“解释 validate / publish 报错” | [`./references/domains/troubleshooting.md`](./references/domains/troubleshooting.md) | 先定位失败阶段;删除时预览作品信息、按序号 dry-run,再执行 |
58
- | “安装 skill”“升级后怎么同步”“怎么接入这个技能” | [`./references/domains/install-and-sync.md`](./references/domains/install-and-sync.md) | 优先走 skill 展示、同步和安装说明 |
59
-
60
- ## 命令探索
61
-
62
- ```bash
63
- yxer --help
64
- yxer doctor
65
- yxer <command> --help
66
- yxer prepare <platform> <type>
67
- yxer schema fields <platform> <type>
68
- yxer schema get <platform> <type>
69
- ```
70
-
71
- ## 全局规则
72
-
73
- - 发布、草稿、素材、排查都只允许通过 `yxer` CLI 执行。
74
- - 任何涉及查询、候选选择、payload 修订或写操作的任务,必须先遵循 AI 执行协议中的状态机、确认协议和错误恢复协议。
75
- - 涉及写操作或 payload 修订时,必须遵守 [`./references/workflows/data-accuracy.md`](./references/workflows/data-accuracy.md):先查询真实数据,再确认候选,最后 validate / dry-run / 写入。
76
- - BLOCKING REQUIREMENT: 正式发布前必须先用同一份 `payload.json`、同一套发布通道参数完成 `yxer validate -> yxer publish --dry-run`;缺账号、字段、资源或动态对象时,先补 `doctor -> accounts list -> prepare/form -> upload/query`。
77
- - `prepare`/`publish form`、`schema fields` / `schema get`、workflow、平台文档和 CLI 实际输出,是组装 payload 的唯一依据。
78
- - `prepare` 返回的 `data.form` 是可恢复的页面式表单契约;新建复杂 payload 时优先使用 `yxer publish form start/inspect/set/choose/verify/review/export`,不要自行发明字段或路径。form 会话不能直接发布,必须先 verify 并 export 成标准 `payload.json`。
79
- - 图片、视频、封面等资源必须先上传,且只能复用 `yxer upload` 返回的真实字段。
80
- - `category`、`location`、`music`、`collection`、`challenge`、`goods`、`drama` 等动态字段必须先通过 `yxer query ...` 查询,不能手写对象;视频号 `drama` 只保留查询结果中的 `yixiaoerId`、`yixiaoerImageUrl`、`yixiaoerName`,不添加 `raw`。多多视频例外:`shopping_cart.goods_id` 是用户手工提供的业务商品 ID,CLI 固定补充 `source=pdd`,不得从 `yxer query goods` 的 `yixiaoerId` 映射。
81
- - 淘宝光合 `shopping_cart` 必须先通过目标账号、相同发布类型的 `taobao-guanghe-goods-tabs` 查询可用来源,再使用显式 `--source` 执行 `yxer query taobao-guanghe-goods`;完整保留商品对象和 `raw`,每个账号最多 6 件;不得依赖省略来源时的服务端默认商品池。
82
- - CRITICAL: `validate`、`publish --dry-run`、正式 `publish` 必须使用同一套发布通道参数。
83
-
84
- ## 页面式表单会话
85
-
86
- 当一次性编辑 `payload.json` 无法表达页面中的完整流程时,使用本地会话逐步推进:
87
-
88
- ```bash
89
- yxer publish form start <platform> <type> --output publish-form.json
90
- yxer publish form inspect publish-form.json
91
- yxer publish form set publish-form.json <payload.path> --value '<json-value>'
92
- yxer publish form choose publish-form.json <field> --value-file query-result.json --id <candidate_id> --source-command "yxer query ... --json"
93
- yxer publish form verify publish-form.json
94
- yxer publish form review publish-form.json
95
- yxer publish form export publish-form.json --output payload.json
96
- ```
97
-
98
- `set` / `choose` / `verify` / `review` 只更新或检查本地会话,不会触发发布;动态字段必须用 `choose` 从 `query` 返回候选中选择,并用 `--source-command` 记录实际执行的 `yxer query ... --json` 命令。多多视频 `shopping_cart.goods_id` 不属于动态查询字段,使用 `set` 手工填写,CLI 固定 `source=pdd`。`set` 只能写 form contract 声明过的路径;`choose` 只写 `dynamicFieldExamples` 声明的字段,且 query 账号必须匹配目标账号。资源应直接使用 `upload` 返回的完整对象。文本字段可直接传文本,复杂对象使用 JSON。导出前 `verify` / `review` / `export` 会校验来源记录和当前 payload 是否一致;导出后仍必须按同一份 payload 和同一套发布通道参数执行 `validate payload.json -> publish payload.json --dry-run -> 用户授权 -> publish payload.json`。所有写本地文件的会话命令都支持 `--dry-run`。
1
+ ---
2
+ name: yixiaoer
3
+ version: 3.2.31
4
+ description: "通过 yxer CLI 操作蚁小二多平台内容分发:账号查询、资源上传、发布前准备、payload 校验、云发布/本机发布、草稿保存、素材登记、发布记录排查与技能同步。"
5
+ metadata:
6
+ category: "productivity"
7
+ requires:
8
+ bins: ["yxer"]
9
+ cliHelp: "yxer --help; yxer doctor; yxer accounts list --help; yxer publish --help; yxer validate --help"
10
+ ---
11
+
12
+ # 蚁小二 Skill
13
+
14
+ **新建发布任务必须先读取 [标准发布工作流](./references/workflows/publish-plan.md),使用默认严格会话、query/upload --record、form set/choose --result-id,导出 payload 后执行 validate、publish --dry-run 和正式 publish。下文外部 JSON 候选示例仅适用于明确的历史数据导入,不能用于默认新会话;不得为绕过来源检查启用兼容模式。**
15
+
16
+ 你是 AI Agent,通过 `yxer` CLI 操作蚁小二资源。真正执行一律走 CLI,不要假设存在旧 Node 脚本入口、隐式 API 或手工脚本。
17
+
18
+ **🚀 首次使用?先读 [`./QUICKSTART.md`](./QUICKSTART.md) - 5 分钟完成首次发布**
19
+
20
+ **CRITICAL - 开始前 MUST 先读取 [`./references/yixiaoer-shared.md`](./references/yixiaoer-shared.md),其中包含环境检查、发布通道、同步和输出协议。**
21
+ **AI EXECUTION PROTOCOL - 涉及查询、payload 修订、草稿、素材或发布时,MUST 先读取 [`./references/protocols/execution.md`](./references/protocols/execution.md),并按状态机推进。**
22
+ **BLOCKING REQUIREMENT - 涉及正式写操作时,禁止凭记忆拼 payload、禁止跳过 workflow、禁止绕过 `yxer` CLI 直接执行旧脚本或隐式 API。**
23
+
24
+ ## 能力索引
25
+
26
+ 根据用户需求,必须先读取对应业务域文档,再进入具体 workflow 或 reference。不要直接凭记忆拼 payload 或执行正式发布。
27
+
28
+ - AI 执行协议
29
+ - 入口:[`./references/protocols/execution.md`](./references/protocols/execution.md)
30
+ - 候选确认:[`./references/protocols/confirmation.md`](./references/protocols/confirmation.md)
31
+ - 字段来源追踪:[`./references/protocols/provenance.md`](./references/protocols/provenance.md)
32
+ - 错误恢复:[`./references/protocols/error-recovery.md`](./references/protocols/error-recovery.md)
33
+ - 覆盖状态机、写操作门禁、多候选确认、payload 来源追踪和失败后的最小修复策略。
34
+
35
+ - 发布与 payload 修订
36
+ - 入口:[`./references/domains/publish.md`](./references/domains/publish.md)
37
+ - 覆盖视频、图文、文章发布,账号选择,云/本机通道判断,payload 来源纪律,动态字段查询,平台差异文档入口。
38
+ - 账号、环境与 skill 同步
39
+ - 入口:[`./references/domains/accounts-and-env.md`](./references/domains/accounts-and-env.md)
40
+ - 覆盖 `doctor`、`config`、账号查询与技能同步。
41
+ - 草稿与素材库
42
+ - 入口:[`./references/domains/draft-and-material.md`](./references/domains/draft-and-material.md)
43
+ - 覆盖蚁小二草稿、平台草稿判断、素材上传、素材登记与“上传后立即发布”的切换路径。
44
+ - 发布记录与失败排查
45
+ - 入口:[`./references/domains/troubleshooting.md`](./references/domains/troubleshooting.md)
46
+ - 覆盖 `query records`、按作品信息删除已发布内容、校验失败修复、本机/云发布错误分流与回退策略。
47
+ - 安装、升级与分发
48
+ - 入口:[`./references/domains/install-and-sync.md`](./references/domains/install-and-sync.md)
49
+ - 覆盖 skill 安装、同步、升级和宿主侧接入说明。
50
+
51
+ ## 意图分流
52
+
53
+ | 用户意图 / 说法 | 先读入口 | 后续动作 |
54
+ | --- | --- | --- |
55
+ | “帮我发一下”“发个抖音/小红书”“发布视频/图文/文章” | [`./references/domains/publish.md`](./references/domains/publish.md) | 按类型进入 workflow,确认真实来源并导出 payload,执行 validate/dry-run/publish;已有 payload 也需确认字段来源 |
56
+ | “先别发,只生成/修一下 payload” | [`./references/domains/publish.md`](./references/domains/publish.md) | 强制读取 payload 来源和类型 workflow,只做字段修订,不擅自正式发布 |
57
+ | “查下账号/环境”“怎么配置 clientId”“看看 skill 要不要同步” | [`./references/domains/accounts-and-env.md`](./references/domains/accounts-and-env.md) | 先做环境检查,再决定是否继续业务流程 |
58
+ | “存草稿”“传素材”“放到素材库里” | [`./references/domains/draft-and-material.md`](./references/domains/draft-and-material.md) | 先区分草稿和素材,再判断是否需要回切发布域 |
59
+ | “为什么失败了”“查发布记录”“删除已发布作品”“解释 validate / publish 报错” | [`./references/domains/troubleshooting.md`](./references/domains/troubleshooting.md) | 先定位失败阶段;删除时预览作品信息、按序号 dry-run,再执行 |
60
+ | “安装 skill”“升级后怎么同步”“怎么接入这个技能” | [`./references/domains/install-and-sync.md`](./references/domains/install-and-sync.md) | 优先走 skill 展示、同步和安装说明 |
61
+
62
+ ## 命令探索
63
+
64
+ ```bash
65
+ yxer --help
66
+ yxer doctor
67
+ yxer <command> --help
68
+ yxer prepare <platform> <type>
69
+ yxer schema fields <platform> <type>
70
+ yxer schema get <platform> <type>
71
+ ```
72
+
73
+ ## 全局规则
74
+
75
+ - 发布、草稿、素材、排查都只允许通过 `yxer` CLI 执行。
76
+ - 任何涉及查询、候选选择、payload 修订或写操作的任务,必须先遵循 AI 执行协议中的状态机、确认协议和错误恢复协议。
77
+ - 涉及写操作或 payload 修订时,必须遵守 [`./references/workflows/data-accuracy.md`](./references/workflows/data-accuracy.md):先查询真实数据,再确认候选,最后 validate / dry-run / 写入。
78
+ - BLOCKING REQUIREMENT: 正式发布前确认字段来源,必须以同一份 payload 和同一套通道参数完成 `validate -> publish --dry-run -> publish`。
79
+ - `prepare`/`publish form`、`schema fields` / `schema get`、workflow、平台文档和 CLI 实际输出,是组装 payload 的唯一依据。
80
+ - `prepare` 返回的 `data.form` 是可恢复的页面式表单契约;新建发布任务使用 `publish form` 维护字段与来源,不要自行发明字段或路径。通过 `export` 导出标准 payload,再执行校验、预览和发布。
81
+ - 图片、视频、封面等资源必须先上传,且只能复用 `yxer upload` 返回的真实字段。
82
+ - `category`、`location`、`music`、`collection`、`challenge`、`goods`、`drama` 等动态字段必须先通过 `yxer query ...` 查询,不能手写对象;视频号 `drama` 只保留查询结果中的 `yixiaoerId`、`yixiaoerImageUrl`、`yixiaoerName`,不添加 `raw`。多多视频例外:`shopping_cart.goods_id` 是用户手工提供的业务商品 ID,CLI 固定补充 `source=pdd`,不得从 `yxer query goods` 的 `yixiaoerId` 映射。
83
+ - 淘宝光合 `shopping_cart` 必须先通过目标账号、相同发布类型的 `taobao-guanghe-goods-tabs` 查询可用来源,再使用显式 `--source` 执行 `yxer query taobao-guanghe-goods`;完整保留商品对象和 `raw`,每个账号最多 6 件;不得依赖省略来源时的服务端默认商品池。
84
+ - CRITICAL: `validate`、`publish --dry-run`、正式 `publish` 必须使用同一套发布通道参数。
85
+
86
+ ## 页面式表单会话
87
+
88
+ 默认严格会话与来源记录的命令见 [标准发布工作流](./references/workflows/publish-plan.md)。以下是用户明确选择历史数据导入时的外部 JSON 示例;`--allow-unverified-sources` 会话不强制 CLI 回执,仍需确认真实字段来源:
89
+
90
+ ```bash
91
+ yxer publish form start <platform> <type> --output publish-form.json --allow-unverified-sources
92
+ yxer publish form inspect publish-form.json
93
+ yxer publish form set publish-form.json <payload.path> --value '<json-value>'
94
+ yxer publish form choose publish-form.json <field> --value-file query-result.json --id <candidate_id> --source-command "yxer query ... --json"
95
+ yxer publish form verify publish-form.json
96
+ yxer publish form review publish-form.json
97
+ yxer publish form export publish-form.json --output payload.json
98
+ ```
99
+
100
+ `set` / `choose` / `verify` / `review` 只更新或检查本地会话,不会触发发布;动态字段必须用 `choose` 从 `query` 返回候选中选择,并用 `--source-command` 记录实际执行的 `yxer query ... --json` 命令。多多视频 `shopping_cart.goods_id` 不属于动态查询字段,使用 `set` 手工填写,CLI 固定 `source=pdd`。`set` 只能写 form contract 声明过的路径;`choose` 只写 `dynamicFieldExamples` 声明的字段,且 query 账号必须匹配目标账号。资源应直接使用 `upload` 返回的完整对象。文本字段可直接传文本,复杂对象使用 JSON。导出前 `verify` / `review` / `export` 会检查来源信息是否完整,不会比较当前字段值与历史值;来源记录及其 hash 仅供追溯。字段可以修改、重新选择或移除可选项,修改后使用 `validate` 检查当前 payload 的必填、类型、长度等平台规则。导出后仍必须按同一份 payload 和同一套发布通道参数执行 `validate payload.json -> publish payload.json --dry-run -> 用户授权 -> publish payload.json`。所有写本地文件的会话命令都支持 `--dry-run`。
@@ -1,5 +1,20 @@
1
1
  # yxer CLI 命令参考
2
2
 
3
+ 默认新表单使用严格来源,完整流程见 [标准发布工作流](../workflows/publish-plan.md)。常用命令:
4
+
5
+ ```bash
6
+ yxer query <resource> <account_id> [查询参数] --record [--dry-run]
7
+ yxer upload --file <path> --auto-meta --record [--dry-run]
8
+ yxer publish form set <session.json> <resource.path> --result-id <upload_result_id> [--dry-run]
9
+ yxer publish form choose <session.json> <field> --result-id <query_result_id> --id <candidate_id> [--dry-run]
10
+ yxer publish form export <session.json> --output payload.json [--dry-run]
11
+ yxer validate <platform> <type> payload.json
12
+ yxer publish <type> <platform> payload.json --dry-run
13
+ yxer publish <type> <platform> payload.json
14
+ ```
15
+
16
+ 结果回执位于 _notice.resultId。下文 --value-file/--source-command 的候选导入只用于 start --allow-unverified-sources 的旧数据会话;导入后同样校验、预览和发布。
17
+
3
18
  `yxer` 是本技能唯一执行入口。Agent 和用户都应直接使用它。
4
19
 
5
20
  ## 命令分组
@@ -139,7 +154,7 @@ yxer schema get <platform> <type>
139
154
  - `publish form choose` 只用于 `dynamicFieldExamples` 声明的动态字段,必须带 `--source-command` 记录产生候选的 `yxer query ... --json` 命令;若 query 账号和目标账号不一致会被拒绝。
140
155
  - 多多视频推广商品使用 `publish form set` 手工填写 `publishArgs.accountForms[].contentPublishForm.shopping_cart.goods_id`;CLI 固定 `source=pdd`,不使用 `publish form choose` 或 `yxer query goods` 的 `yixiaoerId`。
141
156
  - 视频号剧集使用 `yxer query drama-tasks` 查询,并通过 `publish form choose ... drama` 写入;剧集对象只保留 `yixiaoerId`、`yixiaoerImageUrl`、`yixiaoerName`,不使用 `raw`。合集仍使用 `collections` / `collection`,继续保留完整 `raw`。
142
- - `publish form verify`、`review`、`export` 会校验会话来源记录和当前 payload 是否一致;如果候选值被手工改写,需要重新执行 `set` 或 `choose`。
157
+ - `publish form verify`、`review`、`export` 会检查会话来源信息完整性,不比较当前字段值与历史值;修改字段或重新选择候选后,使用 `validate` 检查当前 payload 的必填、类型、长度等平台规则。
143
158
  - 所有请求字段都必须来自 schema、平台文档或 CLI 返回结果;严禁虚构字段、乱猜枚举、手写 `raw` 对象或编造资源元数据
144
159
 
145
160
  ## 快速示例
@@ -4,6 +4,23 @@
4
4
 
5
5
  **CRITICAL - 用户意图是安装、升级或同步时,先完成本域动作,不要跳到发布流程里“顺手再发一次”验证。**
6
6
 
7
+ ## 读取顺序
8
+
9
+ 1. 先阅读 [共享规则](../yixiaoer-shared.md),确认 CLI 与 Skill 的版本和分发来源。
10
+ 2. 根据用户目标选择下方安装、升级或卸载流程。
11
+ 3. 安装或升级后运行 `yxer doctor`;只有用户另有发布需求时才进入发布域。
12
+
13
+ ## 常用命令
14
+
15
+ ```bash
16
+ yxer --version
17
+ yxer skill show
18
+ yxer skill check
19
+ yxer update --check
20
+ yxer update
21
+ yxer doctor
22
+ ```
23
+
7
24
  ## 标准安装流程
8
25
 
9
26
  ```bash
@@ -1,14 +1,17 @@
1
1
  # 发布与 Payload
2
2
 
3
+ 新建任务先遵循 [标准发布工作流](../workflows/publish-plan.md)。默认使用来源回执和表单维护字段,export 后按 validate、publish --dry-run、publish 执行。用户仅要求检查/修 payload 时停留在校验或预览阶段。
4
+
3
5
  适用范围:用户要发布视频、图文、文章,或要修订发布 payload、解释字段归属、确认发布通道。
4
6
 
5
7
  **CRITICAL - 只要用户意图落在本域,MUST 先读取下方 workflow,再决定是否执行任何 `prepare`、字段查询、`validate` 或 `publish`。**
6
- **BLOCKING REQUIREMENT - 未使用同一份 `payload.json` 和同一套发布通道参数完成 `validate`、`publish --dry-run` 前,绝对禁止正式 `publish`。缺账号、字段、资源或动态对象时,必须先完成 `doctor`、账号确认、`prepare/form`、`schema fields`、上传和查询。**
8
+ **BLOCKING REQUIREMENT - 必须使用同一份 payload 和同一套通道参数完成 validate、publish --dry-run 和正式 publish。缺账号、字段、资源或动态对象时,先补齐真实来源。**
7
9
  **AI EXECUTION PROTOCOL - 发布域任务必须先按协议状态机推进,不允许越过 `validated` / `dry_run_passed` 状态直接发布。**
8
10
 
9
11
  ## 读取顺序
10
12
 
11
13
  1. [`../protocols/execution.md`](../protocols/execution.md)
14
+ 新建任务按本页入口的标准发布工作流执行,再读取目标类型的字段要求。
12
15
  2. [`../protocols/confirmation.md`](../protocols/confirmation.md)
13
16
  3. [`../protocols/provenance.md`](../protocols/provenance.md)
14
17
  4. [`../protocols/error-recovery.md`](../protocols/error-recovery.md)
@@ -44,6 +47,7 @@
44
47
  - 已有完整 payload 时,可直接进入 `validate -> publish --dry-run`;但不得跳过正式发布前用户授权
45
48
  - 缺账号、字段、资源或动态对象时,未执行 `yxer doctor` 不进入组装流程
46
49
  - 缺账号或账号不确定时,未确认 `accounts list` 中账号 `status=1` 不继续
50
+ - 正式发布会实时检测账号有效性;仅检测明确返回 `loginStatus=0` 时以 `account_session_expired` 拦截,需在蚁小二重新授权。未知状态、检测不支持、空响应及检测请求异常均放行。云端有凭证的 dry-run 同样检测,离线预览通过不能代替提交时检测。
47
51
  - 需要组装或补字段时,未执行 `prepare` / `publish form` / `schema fields` 不组装 payload;只有需要 payload 骨架时再补 `schema get`
48
52
  - 未按 `data-accuracy.md` 完成需要查询的动态字段和多候选确认,不继续写 payload 或发布;多多视频 `shopping_cart.goods_id` 按平台规则使用用户明确输入
49
53
  - 未先 `validate` 与 `publish --dry-run` 不执行正式 `publish`
@@ -15,8 +15,8 @@
15
15
  | 字段名 | 类型 | 必填 | 说明 | 默认值 |
16
16
  | :--- | :--- | :--- | :--- | :--- |
17
17
  | `formType` | `string` | 是 | 固定为 `task` | `task` |
18
- | `title` | `string` | 是 | 视频标题 | - |
19
- | `description` | `string` | 否 | 视频描述 | - |
18
+ | `title` | `string` | 是 | 视频标题,最多 80 字符 | - |
19
+ | `description` | `string` | 否 | 视频描述,最多 250 字符 | - |
20
20
  | `tags` | `string[]` | 是 | 视频标签,1-12 个,单个最多 20 字 | - |
21
21
  | `category` | `Array` | 是 | 视频分类,使用 `CascadingPlatformDataItem[]`,必须来自 `query categories` | - |
22
22
  | `allowReprint` | `number` | 否 | 是否允许转载:0-允许,1-不允许 | 0 |