@yixiaoermail/cli 3.2.20 → 3.2.22

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 (41) hide show
  1. package/checksums.txt +6 -6
  2. package/package.json +1 -1
  3. package/references/cli/command-reference.md +5 -1
  4. package/references/domains/draft-and-material.md +2 -0
  5. package/references/domains/publish.md +2 -2
  6. package/references/execution-standard.md +2 -1
  7. package/references/get-friends.md +25 -13
  8. package/references/legacy/capabilities.md +1 -1
  9. package/references/platforms/article/weixingongzhonghao.md +2 -0
  10. package/references/platforms/imageText/xiaohongshu.md +8 -8
  11. package/references/platforms/index.md +1 -1
  12. package/references/platforms/video/baijiahao.md +45 -4
  13. package/references/platforms/video/index.md +2 -0
  14. package/references/platforms/video/xiaohongshu.md +8 -8
  15. package/references/upload-resource.md +1 -1
  16. package/references/usage-workflow.md +1 -1
  17. package/references/workflows/common-rules.md +1 -1
  18. package/references/workflows/data-accuracy.md +1 -1
  19. package/references/workflows/draft-workflow.md +3 -0
  20. package/references/workflows/publish-video.md +2 -0
  21. package/schemas/platforms/baijiahao.video.schema.json +43 -13
  22. package/schemas/platforms/bilibili-open.video.schema.json +93 -113
  23. package/skills/yixiaoer/SKILL.md +1 -1
  24. package/skills/yixiaoer/references/cli/command-reference.md +5 -1
  25. package/skills/yixiaoer/references/domains/draft-and-material.md +2 -0
  26. package/skills/yixiaoer/references/domains/publish.md +2 -2
  27. package/skills/yixiaoer/references/execution-standard.md +2 -1
  28. package/skills/yixiaoer/references/get-friends.md +25 -13
  29. package/skills/yixiaoer/references/legacy/capabilities.md +1 -1
  30. package/skills/yixiaoer/references/platforms/article/weixingongzhonghao.md +2 -0
  31. package/skills/yixiaoer/references/platforms/imageText/xiaohongshu.md +8 -8
  32. package/skills/yixiaoer/references/platforms/index.md +1 -1
  33. package/skills/yixiaoer/references/platforms/video/baijiahao.md +45 -4
  34. package/skills/yixiaoer/references/platforms/video/index.md +2 -0
  35. package/skills/yixiaoer/references/platforms/video/xiaohongshu.md +8 -8
  36. package/skills/yixiaoer/references/upload-resource.md +1 -1
  37. package/skills/yixiaoer/references/usage-workflow.md +1 -1
  38. package/skills/yixiaoer/references/workflows/common-rules.md +1 -1
  39. package/skills/yixiaoer/references/workflows/data-accuracy.md +1 -1
  40. package/skills/yixiaoer/references/workflows/draft-workflow.md +3 -0
  41. package/skills/yixiaoer/references/workflows/publish-video.md +2 -0
package/checksums.txt CHANGED
@@ -1,6 +1,6 @@
1
- d3d1e5b8efaa3139c0c7908a93500e1d56739cf479ef4bf99ca37f99e8723580 yxer-cli-3.2.20-windows-amd64.zip
2
- dd4b5fb6cb5145038dd889a12f2845c11c90e728f49f4bc9db4fc7d6a2ef1e53 yxer-cli-3.2.20-windows-arm64.zip
3
- d00f94b6c2d8709c88280c7d0c997286d52cef2dce27e6cab010fb4880e2656a yxer-cli-3.2.20-darwin-amd64.tar.gz
4
- fd8f9e4778c3a1c1bae637af3ce504db40ce3a75c221d4562526730ae7508143 yxer-cli-3.2.20-darwin-arm64.tar.gz
5
- 8aff2597102ea425610ef57ad15816b4df5cce583e8d30fe0a2b7d4f472e8337 yxer-cli-3.2.20-linux-amd64.tar.gz
6
- dac96007f067efdba421d2843c995a9c9b04b459afe5147f53dd5028a24aec5a yxer-cli-3.2.20-linux-arm64.tar.gz
1
+ 3fe1ccb308fe589137a259dc56b35f3bb21a7a568b695adab8cd359365bca8aa yxer-cli-3.2.22-windows-amd64.zip
2
+ 100c731aaa4d0c8bd000d3ee90b491a390f043c528535a604ecffc37b7786cb4 yxer-cli-3.2.22-windows-arm64.zip
3
+ 1f594916a4f47ef897c3985dc456c666f2cbdee8f96d9367e3fcdf4541e754f7 yxer-cli-3.2.22-darwin-amd64.tar.gz
4
+ b0aa0401f2281b633ee0ecb7bd296dd089d8ca0bf2df52d987489736558c181d yxer-cli-3.2.22-darwin-arm64.tar.gz
5
+ 6ae2b87949d285885389478bea500634ec3e924dc674645e1c753e348497ef27 yxer-cli-3.2.22-linux-amd64.tar.gz
6
+ 82617751de4f80b455f42b1fa91b600850673a917ab5bb4b2ef691b72e366a28 yxer-cli-3.2.22-linux-arm64.tar.gz
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yixiaoermail/cli",
3
- "version": "3.2.20",
3
+ "version": "3.2.22",
4
4
  "description": "Yixiaoer CLI packaged for npm global installation",
5
5
  "bin": {
6
6
  "yxer": "bin/yxer.js"
@@ -62,6 +62,7 @@ yxer publish form export <session.json> [--output payload.json] [--dry-run]
62
62
 
63
63
  ```bash
64
64
  yxer draft save <payload.json> [--dry-run]
65
+ yxer draft import <article.docx> --cover <horizontal-cover.jpg> --account-id <online-account-id> [--author 蚁小二] [--original-author <original-author>] [--draft-id <existing-draft-id>] [--title <title>] [--digest <digest>] [--dry-run]
65
66
  yxer material create <payload.json> [--dry-run]
66
67
  yxer material add --file <文件路径或URL> [--thumb <缩略图路径或URL>] [--type image|video|file] [--dry-run]
67
68
  yxer material list [--name <file_name>] [--type image|video|file] [--page 1] [--size 100]
@@ -84,7 +85,7 @@ yxer query entitlements <account_id>
84
85
  yxer query collections <account_id> [--type video|article]
85
86
  yxer query drama-tasks <account_id> [--query 关键词] [--keyword 关键词]
86
87
  yxer query members [--page 1] [--size 10] [--status notJoined|pending|joined] [--query 关键词] [--role master|admin|member]
87
- yxer query friends <account_id> [--red-id 小红书号]
88
+ yxer query friends <account_id> [--red-id 小红书号] [--query 关键词]
88
89
  yxer query challenges <account_id> [--query 关键词] [--type video]
89
90
  yxer query records [--platform P] [--limit N] [--status S] [--json]
90
91
  yxer query account-increments --start-date YYYY-MM-DD --end-date YYYY-MM-DD [--group-id GROUP_ID]
@@ -109,6 +110,9 @@ yxer schema get <platform> <type>
109
110
  - 新建或补字段时,先执行 `yxer prepare <platform> <type>` / `yxer publish form start` 和 `yxer schema fields <platform> <type>`;`schema fields` 默认返回扁平路径清单,只有需要完整 payload 骨架时再执行 `yxer schema get <platform> <type>`
110
111
  - `payload.json` 只支持标准 `publishArgs` 结构,所有平台统一
111
112
  - `article` 发布可通过 `--content-file <article.md>` 指定 Markdown 正文源;CLI 会将 Markdown 渲染为 HTML,并按 Markdown 文件目录解析本地图片
113
+ - `yxer draft import <article.docx>` 是微信公众号文章的 DOCX 导入入口:读取 Word 正文和内嵌图片,封面必须在导入前提供横版图片;默认不声明原创
114
+ - DOCX 导入会把封面上传到 `cloud-publish`,把正文内嵌图片上传到 `material-library`,并把正文 `<img src>` 改成稳定可访问 URL,避免草稿编辑器显示黑图
115
+ - DOCX 导入不会自动裁剪竖版封面;宽度必须大于高度,建议按公众号常用的 900×383 横版比例准备封面
112
116
  - `--content-file` 支持 `![alt](path)`、`![[path]]`、`<img src="path">` 和远程图片 URL;正式 `publish` 会上传图片并把 `publishArgs.content` 中的引用替换为稳定可访问 URL
113
117
  - CLI 会根据 `publishArgs` 自动补齐最外层 `cover`、`coverKey`、`desc`、`isDraft`、`isAppContent`
114
118
  - 云发布是默认模式
@@ -18,6 +18,7 @@
18
18
 
19
19
  ```bash
20
20
  yxer draft save <payload.json> [--dry-run]
21
+ yxer draft import <article.docx> --cover <horizontal-cover.jpg> --account-id <online-account-id> [--author 蚁小二] [--original-author <original-author>] [--draft-id <existing-draft-id>] [--dry-run]
21
22
  yxer material add --file <文件路径或URL> [--thumb <缩略图路径或URL>] [--type image|video|file] [--dry-run]
22
23
  yxer upload --file <file_path> --bucket material-library
23
24
  yxer upload --url <resource_url> --bucket material-library
@@ -35,5 +36,6 @@ yxer material groups [--page 1] [--size 50]
35
36
  - 用户已有上传结果,只差登记素材时,再用 `material create`
36
37
  - 用户要移动素材库中的已有素材时,优先使用 `material move-by-name <文件名>`;它会通过真实查询结果匹配素材 ID。文件名重名时必须从候选 ID 中选择,再用 `material move`;先以 `--dry-run` 核对请求
37
38
  - 草稿和素材写操作必须先 dry-run;资源字段必须保留上传来源,不能手写 key、尺寸或格式
39
+ - 微信公众号文章从 DOCX 导入时,使用 `yxer draft import`;正文内嵌图片会上传到素材库并改写为稳定 URL,封面必须传入宽度大于高度的横版图片
38
40
  - 素材任务不自动进入发布主流程;只有用户明确要“上传后马上发布”时,再切回发布域
39
41
  - 用户明确说“先存一下,别发”时,停在本域,不擅自回切发布域
@@ -68,7 +68,7 @@ yxer query syncapps <account_id>
68
68
  yxer query games <account_id> [--query 关键词]
69
69
  yxer query hot-events <account_id> [--type video|article]
70
70
  yxer query groups <account_id>
71
- yxer query friends <account_id> [--red-id 小红书号]
71
+ yxer query friends <account_id> [--red-id 小红书号] [--query 关键词]
72
72
  yxer query activities <account_id> [--type video|article] [--category-id ID] [--query 关键词]
73
73
  yxer query challenges <account_id> [--query 关键词] [--type video] [--next-page TOKEN]
74
74
  yxer validate <platform> <type> <payload.json> [--publish-channel cloud|local] [--client-id <clientId>]
@@ -83,5 +83,5 @@ yxer publish <type> <platform> <payload.json> [--publish-channel cloud|local] [-
83
83
  - 用户要填分类、位置、音乐、合集、话题、商品时,先查询,再回填完整对象;多多视频的 `shopping_cart.goods_id` 由用户手工提供,固定 `source=pdd`,不使用商品查询返回的 `yixiaoerId`;视频号剧集使用 `yxer query drama-tasks`,只写入查询结果的 `yixiaoerId`、`yixiaoerImageUrl`、`yixiaoerName`,不添加 `raw`。
84
84
  - 用户要挂载小程序或选择同步发布应用时,先执行 `yxer query miniapps` / `yxer query syncapps`,再把 CLI 返回对象完整回填到 payload。
85
85
  - 用户要挂载游戏、绑定热点或选择群聊时,先执行 `yxer query games` / `yxer query hot-events` / `yxer query groups`,再把 CLI 返回对象完整回填到 payload。
86
- - 用户要在小红书描述中艾特好友时,先执行 `yxer query friends <account_id> [--red-id 小红书号]`,将选中的完整对象 JSON 序列化后写入 `<friend raw='...'>@好友名</friend>`;不要新增未被 schema 声明的 `friends` 字段。
86
+ - 用户要在小红书描述中艾特用户(包括陌生人)时,先执行 `yxer query friends <account_id> --red-id <小红书号> --json`,将选中的完整对象 JSON 序列化后写入 `<friend raw='...'>@用户名</friend>`;不要新增未被 schema 声明的 `friends` 字段。
87
87
  - 用户要按音乐分类找配乐或参加平台活动时,先执行 `yxer query music-categories` / `yxer query activities`,再把 CLI 返回对象完整回填到 payload。
@@ -40,12 +40,13 @@
40
40
 
41
41
  ### 3.1 标准请求体兼容约定 (Standard Publish Request Compatibility)
42
42
 
43
- - CLI 现已兼容“标准请求体”输入格式。推荐将共享资源放在 `publishArgs` 根级,例如 `video`、`images`、`cover`、`coverKey`、`content`。
43
+ - CLI 现已兼容“标准请求体”输入格式。推荐将共享资源放在 `publishArgs` 根级,例如 `video`、`images`、`cover`、`coverKey`、`verticalCover`、`content`。
44
44
  - CLI 在执行 `validate` / `publish` 时,会在 `accountForms[]` 缺失对应资源字段时自动补齐:
45
45
  - `publishArgs.video` -> `accountForms[i].video`
46
46
  - `publishArgs.images` -> `accountForms[i].images`
47
47
  - `publishArgs.cover` -> `accountForms[i].cover`
48
48
  - `publishArgs.coverKey` -> `accountForms[i].coverKey`
49
+ - `publishArgs.verticalCover` -> `accountForms[i].contentPublishForm.verticalCover`(仅当平台 schema 暴露该字段时使用)
49
50
  - `publishArgs.content` -> `accountForms[i].contentPublishForm.content`
50
51
  - 业务扩展字段如 `mediaId`、`platformName`、`publishContentId`、`fps`、`isAppContent` 会被 CLI 保留并原样透传,不参与额外业务改写。
51
52
  - 命令层仍保持**单平台执行模型**:即使标准请求体本身可表达多平台,`yxer publish` 仍需按平台逐次调用。
@@ -1,36 +1,48 @@
1
- # 获取好友/关联对象 (Get Friends)
1
+ # 获取小红书用户/艾特对象 (Get Friends)
2
2
 
3
- 用于查询可在小红书描述中艾特的好友对象。查询结果是发布时 `<friend>` 标签的唯一数据来源。
3
+ 用于查询可在小红书描述中艾特的完整用户对象,支持按小红书号搜索不在当前账号好友列表中的陌生人。查询结果是发布时 `<friend>` 标签的唯一数据来源。
4
4
 
5
5
  ## 1. 调用指令
6
6
 
7
+ 按小红书号精确查询:
8
+
9
+ ```bash
10
+ yxer query friends <account_id> --red-id <小红书号> --json
11
+ ```
12
+
13
+ 也可以按小红书号或昵称搜索:
14
+
7
15
  ```bash
8
- yxer query friends <account_id> [--red-id <小红书号>] --json
16
+ yxer query friends <account_id> --query <关键词> --json
17
+ # --keyword 是 --query 的别名
9
18
  ```
10
19
 
11
- `account_id` 必须是小红书账号的蚁小二账号 ID。CLI 会将后端返回的好友列表原样放在 JSON 的 `data` 中;不要根据昵称或其他自然语言自行构造好友对象。
20
+ `account_id` 必须是小红书账号的蚁小二账号 ID。`--red-id` 会把小红书号作为远端搜索关键词发送,再对返回对象的 `raw.red_id` 做精确匹配,因此不会局限于好友列表。
21
+
22
+ 契约对照:CLI 网关参数名是 `keyWord`;蚁小二客户端直连小红书接口的参数名是 `keyword`。两者语义相同,都是用户搜索关键词。
12
23
 
13
- 指定 `--red-id` 时,CLI 会按查询结果中好友对象的 `raw.red_id` 做精确筛选;该参数不会改变后端请求,也不会猜测后端筛选字段。
24
+ CLI 会保留后端返回的完整用户对象放在 JSON 的 `data` 中;不要根据昵称或其他自然语言自行构造对象。
14
25
 
15
- ## 2. 在小红书描述中艾特好友
26
+ ## 2. 在小红书描述中艾特用户
16
27
 
17
28
  小红书的艾特内容写在 `contentPublishForm.description` 的 HTML 中,不是单独的 `friends` 字段:
18
29
 
19
30
  ```html
20
- <p>记录生活 <friend raw='好友查询结果的完整 JSON 序列化字符串'>@好友名称</friend></p>
31
+ <p>记录生活 <friend raw='用户查询结果的完整 JSON 序列化字符串'>@用户名称</friend></p>
21
32
  ```
22
33
 
23
34
  组装规则:
24
35
 
25
- 1. 执行 `yxer query friends <account_id> --json`,从 `data.list` 中选择目标好友。
26
- 2. 将选中的完整好友对象序列化为 JSON,写入 `<friend>` 的 `raw` 属性;不能只保留 ID、昵称或内部 `raw` 子对象。
36
+ 1. 执行 `yxer query friends <account_id> --red-id <小红书号> --json`,从 `data.list` 中选择目标用户。
37
+ 2. 将选中的完整用户对象序列化为 JSON,写入 `<friend>` 的 `raw` 属性;不能只保留 ID、昵称或内部 `raw` 子对象。
27
38
  3. 标签正文使用 `@` 加上查询结果中的 `yixiaoerName`,并将最终 HTML 放入 `description`。
28
39
  4. 用同一份 payload 执行 `yxer validate` 和 `yxer publish --dry-run`;CLI 会保留 `<friend>` 标签,不会把它改写成普通文本。
29
40
 
30
- `raw` 是 HTML 属性中的字符串,因此生成 JSON payload 时需要按 JSON 规则转义其中的双引号。上面的 HTML 仅展示结构,好友对象必须来自本次 CLI 查询。
41
+ `raw` 是 HTML 属性中的字符串,因此生成 JSON payload 时需要按 JSON 规则转义其中的双引号。用户对象必须来自本次 CLI 查询。
31
42
 
32
43
  ## 3. 返回对象使用约束
33
44
 
34
- - `data.list` 中的每一项都是一个完整好友对象,发布时整体透传。
35
- - 查询结果为空时不要编造兜底对象,应让用户确认账号登录状态或好友关系。
36
- - 返回多个好友时,应根据用户明确的昵称或稳定 ID 选择,不能默认选择第一项。
45
+ - `data.list` 中的每一项都是一个完整用户对象,发布时整体透传。
46
+ - 对陌生人也必须使用查询返回的完整对象;不要手写 `red_id`、昵称或一个简化的 `raw` 对象。
47
+ - 查询结果为空时不要编造兜底对象,应让用户确认小红书号、账号登录状态或平台返回结果。
48
+ - 返回多个用户时,应根据用户明确的小红书号、昵称或稳定 ID 选择,不能默认选择第一项。
@@ -25,7 +25,7 @@
25
25
  | 同步发布应用 | 已覆盖 | `yxer query syncapps <account_id>` | `skills/yixiaoer/references/get-sync-apps.md` |
26
26
  | 热点列表 | 已覆盖 | `yxer query hot-events <account_id>` | `skills/yixiaoer/references/get-hot-events.md` |
27
27
  | 群聊列表 | 已覆盖 | `yxer query groups <account_id>` | `skills/yixiaoer/references/get-groups.md` |
28
- | 小红书好友艾特对象 | 已覆盖 | `yxer query friends <account_id> [--red-id 小红书号]` | `skills/yixiaoer/references/get-friends.md` |
28
+ | 小红书用户艾特对象(支持陌生人) | 已覆盖 | `yxer query friends <account_id> --red-id 小红书号` | `skills/yixiaoer/references/get-friends.md` |
29
29
  | 账号分组列表 | 已覆盖 | `yxer account-group list [--page 1] [--size 10]` | `skills/yixiaoer/references/get-account-groups.md` |
30
30
  | 创建账号分组 | 已覆盖 | `yxer account-group create <name> [--dry-run]` | `skills/yixiaoer/references/create-account-group.md` |
31
31
  | 更新账号分组 | 已覆盖 | `yxer account-group update <group_id> <name> [--visible-scope all|specific] [--visible-user USER_ID]... [--dry-run]` | `skills/yixiaoer/references/update-account-group.md` |
@@ -115,6 +115,8 @@
115
115
 
116
116
  对于封面和分类对象,均需包含 `raw` 字段。
117
117
 
118
+ 公众号文章的 DOCX 导入契约要求封面为横版输入(宽度大于高度)。CLI 会在上传前检查宽高,竖版或正方形封面直接拒绝,不会静默裁剪;建议使用约 900×383(2.35:1)的横版封面。
119
+
118
120
  | 字段名 (Cover) | 类型 | 说明 |
119
121
  | :--- | :--- | :--- |
120
122
  | `key` | `string` | **是**: 资源资源 Key (优先使用) |
@@ -5,10 +5,10 @@
5
5
  > 在使用本平台的特定参数之前,你 **必须** 已经阅读并理解了 [图文发布首页 (Index)](./index.md) 中定义的 Payload 根结构。本页仅描述 `contentPublishForm` 内部的平台差异化字段。
6
6
 
7
7
  ## 触发场景 (Trigger)
8
- - **意图辨析**:用户指定在“小红书”平台发布图文笔记,且需要配置如“标记话题”、“艾特好友”、“地点挂载”、“多级分类挂载”或“定时发布”等功能时触发。
8
+ - **意图辨析**:用户指定在“小红书”平台发布图文笔记,且需要配置如“标记话题”、“按小红书号艾特用户(含陌生人)”、“地点挂载”、“多级分类挂载”或“定时发布”等功能时触发。
9
9
  - **典型提示词**:
10
10
  - “帮我发一篇小红书笔记,带上 #穿搭 话题”
11
- - “小红书笔记里艾特这个好友”
11
+ - “小红书笔记里按小红书号艾特这个用户”
12
12
  - “小红书发布,地点选在上海东方明珠”
13
13
  - “把这两张图存为小红书草稿,设置仅好友可见”
14
14
  - “查询小红书的分类并设置”
@@ -17,7 +17,7 @@
17
17
  1. **内容识别**:识别笔记标题、正文及内嵌话题(小红书正文支持 HTML 话题标签)。
18
18
  2. **辅助检索**:
19
19
  - 话题:调用 `challenges` 获取标准话题 DTO。
20
- - 好友:调用 `friends` 获取可艾特好友的完整对象。
20
+ - 用户艾特:调用 `friends` 按小红书号搜索可艾特用户(包括陌生人)的完整对象。
21
21
  - 地点:调用 `locations` 获取 POI 数据。
22
22
  3. **参数装配**:将处理后的字段填入 `accountForms[i].contentPublishForm`。
23
23
  4. **指令执行**:先执行 `yxer validate <platform> <type> <payload.json>`,再执行 `yxer publish <type> <platform> <payload.json> [--publish-channel local --client-id <clientId>]`。
@@ -28,7 +28,7 @@
28
28
  | :--- | :--- | :--- | :--- | :--- |
29
29
  | `formType` | `string` | **是** | 固定值: `task` | `task` |
30
30
  | `title` | `string` | 否 | 标题 (笔记标题,最多 20 字) | - |
31
- | `description` | `string` | **是** | 笔记描述,支持 HTML (`<p>`, `<topic>`, `<friend>`)。好友艾特必须使用 `yxer query friends` 返回的完整对象生成 `raw`。最多 1000 字符。 | - |
31
+ | `description` | `string` | **是** | 笔记描述,支持 HTML (`<p>`, `<topic>`, `<friend>`)。用户艾特(含陌生人)必须使用 `yxer query friends --red-id` 返回的完整对象生成 `raw`。最多 1000 字符。 | - |
32
32
  | `images` | `Array` | **是** | 图片数组 (`OldImage[]`) | - |
33
33
  | `location` | `Object` | 否 | 位置对象 (`PlatformDataItem`) | - |
34
34
  | `scheduledTime` | `number` | 否 | 定时发布时间 (13 位 Unix 时间戳,单位: 毫秒) | - |
@@ -52,13 +52,13 @@
52
52
 
53
53
  ### description 标签说明
54
54
 
55
- 小红书图文的好友艾特使用 `description` 中的 `<friend>` 标签,不增加额外的 `friends` 字段:
55
+ 小红书图文的用户艾特(含陌生人)使用 `description` 中的 `<friend>` 标签,不增加额外的 `friends` 字段:
56
56
 
57
57
  ```html
58
- <p>今日分享 <friend raw='好友查询结果的完整 JSON 序列化字符串'>@好友名称</friend></p>
58
+ <p>今日分享 <friend raw='用户查询结果的完整 JSON 序列化字符串'>@用户名称</friend></p>
59
59
  ```
60
60
 
61
- 先执行 `yxer query friends <account_id> [--red-id 小红书号] --json`,从 `data.list` 选择好友,并将完整对象序列化后写入 `raw`。标签正文使用 `@` 加查询结果的 `yixiaoerName`。具体约束见 [获取好友/关联对象](../../get-friends.md)。
61
+ 先执行 `yxer query friends <account_id> --red-id <小红书号> --json`,从 `data.list` 选择用户,并将完整对象序列化后写入 `raw`。标签正文使用 `@` 加查询结果的 `yixiaoerName`。具体约束见 [获取小红书用户/艾特对象](../../get-friends.md)。
62
62
 
63
63
  ## 3. Payload 完整示例
64
64
 
@@ -94,5 +94,5 @@
94
94
  | `location` | `locations` | [获取位置信息](../../get-locations.md) |
95
95
  | `collection` | `collections` | [获取合集列表](../../get-collections.md) |
96
96
  | `tags/topic`| `challenges` | [获取话题/挑战](../../get-challenges.md) |
97
- | `description.friend` | `friends` | [获取好友/关联对象](../../get-friends.md) |
97
+ | `description.friend` | `friends` | [获取小红书用户/艾特对象](../../get-friends.md) |
98
98
  | `images.key`| `upload` | [资源上传](../../upload-resource.md) |
@@ -12,7 +12,7 @@
12
12
 
13
13
  1. 先走工作流和 `yxer` CLI。
14
14
  2. 只有在构造平台特有字段时,才继续查具体平台文档。
15
- 3. 如果字段来源可以由 `yxer query categories`、`yxer query locations`、`yxer query music`、`yxer query friends` 等命令获得,优先用命令,不要手写对象。
15
+ 3. 如果字段来源可以由 `yxer query categories`、`yxer query locations`、`yxer query music`、`yxer query friends` 等命令获得,优先用命令,不要手写对象;小红书用户艾特支持用 `--red-id` 查询陌生人。
16
16
 
17
17
  ## 维护约束
18
18
 
@@ -17,6 +17,13 @@
17
17
  3. **指令执行**:先执行 `yxer validate <platform> <type> <payload.json>`,再执行 `yxer publish <type> <platform> <payload.json> [--publish-channel local --client-id <clientId>]`。
18
18
 
19
19
 
20
+ ## 封面契约
21
+
22
+ - **主/横版封面**:使用必填的 `publishArgs.accountForms[].cover` 和 `publishArgs.accountForms[].coverKey`;`coverKey` 必须等于 `cover.key`。标准请求体也可以把二者共享放在 `publishArgs.cover` / `publishArgs.coverKey`,CLI 会补齐到账号项。资源使用 `OldCover` 形态,至少包含 `key`、`size`、`width`、`height`。
23
+ - **竖版封面**:使用可选的 `publishArgs.accountForms[].contentPublishForm.verticalCover`,也可以共享填写 `publishArgs.verticalCover`,CLI 会补齐到 `contentPublishForm`。资源同样使用 `OldCover` 形态,至少包含 `key`、`size`、`width`、`height`。
24
+ - 客户端会把输入的主/横版封面和竖版封面分别序列化为内部的 `covers[0]` 和 `verticalCovers[0]`;没有提供竖版封面时,百家号 Worker 使用主封面作为竖版封面兜底。
25
+ - 百家号视频没有独立的 `horizontalCover` CLI 字段,也不直接填写客户端内部的 `verticalCovers` 数组。当前客户端视频规格要求主封面,主封面大小上限为 5 MB;未暴露单独的竖版必填、比例或像素限制。
26
+
20
27
  在本平台视频发布通过 `contentPublishForm` 承载以下参数。
21
28
 
22
29
  ## 1. contentPublishForm 参数定义
@@ -24,16 +31,27 @@
24
31
  | 字段名 | 类型 | 必填 | 说明 | 默认值 |
25
32
  | :--- | :--- | :--- | :--- | :--- |
26
33
  | `formType` | `string` | **是** | 固定为 `task` | `task` |
27
- | `title` | `string` | **是** | 视频标题 (1-30 字符) | - |
34
+ | `title` | `string` | 否 | 视频标题 (1-30 字符) | - |
28
35
  | `description` | `string` | **是** | 视频描述 (1-100 字符) | - |
29
- | `tags` | `string[]` | **是** | 视频标签 (1-6 个) | - |
36
+ | `tags` | `string[]` | 否 | 视频标签 (1-6 个) | - |
30
37
  | `pubType` | `number` | **是** | 发布类型: 0-草稿, 1-直接发布 | 1 |
31
- | `declaration` | `number` | 否 | 声明: 0-不声明, 1-内容由 AI 生成 | 0 |
38
+ | `statement` | `object` | 否 | 内容声明对象;未声明时可省略 | - |
32
39
  | `location` | `Object` | 否 | 位置信息,使用 `PlatformDataItem` 结构 | - |
33
40
  | `scheduledTime` | `number` | 否 | 定时发布时间戳 (13 位 Unix 时间戳,单位: 毫秒) | - |
34
41
  | `collection` | `Object` | 否 | 合集信息 (`yixiaoerId`, `yixiaoerName`, `raw`) | - |
35
42
  | `activity` | `Object` | 否 | 征文活动信息 (`yixiaoerId`, `yixiaoerName`, `raw`) | - |
36
43
 
44
+ ### 1.1 statement 声明对象
45
+
46
+ 当前蚁小二客户端使用 `statement` 对象,同时支持“声明”和“补充声明”;未选择任何声明时可省略整个对象。不要使用旧的顶层 `declaration` 字段,也不要把 `isAigc` 作为输入字段。
47
+
48
+ | 字段名 | 类型 | 必填 | 说明 | 默认值 |
49
+ | :--- | :--- | :--- | :--- | :--- |
50
+ | `type` | `integer` | **是(当 statement 存在时)** | 主声明:`0` 不声明,`1` 内容由AI生成,`16` 内容为转载,`4` 含虚构演绎内容,`8` 内容含有营销信息,`32` 个人观点,仅供参考 | 未选择时省略 |
51
+ | `subType` | `integer` | 否 | 补充声明:`0` 不选择,`1` 内容可能引人不适,`2` 内容含有高危险行为,`4` 请理性适度消费,`8` 未成年人请在监护人指导下浏览 | 未选择时省略(界面显示 `0`) |
52
+
53
+ 客户端会把 `statement.type` 和 `statement.subType` 转换为百家号请求字段 `publish_statement` 和 `publish_statement_sub`,并根据主声明派生 `activity_list.aigc_bjh_status`;CLI 只接收 `statement` 对象,不要直接填写这些平台请求字段。
54
+
37
55
  ## 2. Payload 完整示例
38
56
 
39
57
  ```json
@@ -42,6 +60,26 @@
42
60
  "publishType": "video",
43
61
  "platforms": ["百家号"],
44
62
  "publishArgs": {
63
+ "video": {
64
+ "key": "video_oss_key",
65
+ "size": 1024000,
66
+ "width": 1920,
67
+ "height": 1080,
68
+ "duration": 60
69
+ },
70
+ "cover": {
71
+ "key": "cover_oss_key",
72
+ "size": 102400,
73
+ "width": 1920,
74
+ "height": 1080
75
+ },
76
+ "coverKey": "cover_oss_key",
77
+ "verticalCover": {
78
+ "key": "vertical_cover_oss_key",
79
+ "size": 102400,
80
+ "width": 1080,
81
+ "height": 1440
82
+ },
45
83
  "accountForms": [
46
84
  {
47
85
  "platformAccountId": "acc_bjh_video_001",
@@ -58,7 +96,10 @@
58
96
  "description": "视频精彩描述内容...",
59
97
  "tags": ["科技", "未来"],
60
98
  "pubType": 1,
61
- "declaration": 0,
99
+ "statement": {
100
+ "type": 1,
101
+ "subType": 4
102
+ },
62
103
  "location": {
63
104
  "yixiaoerId": "loc_001",
64
105
  "yixiaoerName": "北京市",
@@ -70,11 +70,13 @@
70
70
  | `cover` | `Object` | 否 | **标准请求体共享封面资源**。CLI 校验时会在缺失时复制到各 `accountForms[i].cover` | - |
71
71
  | `coverKey` | `string` | 否 | **标准请求体共享封面 Key**。CLI 校验时会在缺失时复制到各 `accountForms[i].coverKey` | - |
72
72
  | `horizontalCover` | `Object` | 否 | **标准请求体共享横版封面资源**。仅适用于平台 schema 暴露 `horizontalCover` 的视频平台;CLI 校验时会复制到各 `accountForms[i].contentPublishForm.horizontalCover` | - |
73
+ | `verticalCover` | `Object` | 否 | **标准请求体共享竖版封面资源**。仅适用于平台 schema 暴露 `verticalCover` 的视频平台;CLI 校验时会复制到各 `accountForms[i].contentPublishForm.verticalCover` | - |
73
74
 
74
75
  > [!TIP]
75
76
  > **CLI 输入兼容规则**:
76
77
  > - 推荐优先使用“标准请求体”形态,即在 `publishArgs` 中声明共享的 `video`、`cover`、`coverKey`,再在 `accountForms[]` 中补平台差异字段。
77
78
  > - 若平台支持横版封面,推荐在 `publishArgs.horizontalCover` 声明共享横版封面,或直接填写 `accountForms[].contentPublishForm.horizontalCover`;不要放在 `accountForms[].horizontalCover`。
79
+ > - 若平台支持竖版封面,推荐在 `publishArgs.verticalCover` 声明共享竖版封面,或直接填写 `accountForms[].contentPublishForm.verticalCover`;不要放在 `accountForms[].verticalCover`。百家号视频的主/横版封面仍是 `cover`,不是 `horizontalCover`。
78
80
  > - CLI 当前仍按**单平台命令**执行:`yxer publish video <platform> <payload.json> [--publish-channel local --client-id <clientId>]`。即使请求体里可以表达多平台,命令本身仍需逐个平台调用。
79
81
  > - `yxer validate` 与 `yxer publish` 都接受完整标准请求体;在共享资源字段存在而账号项缺失时,CLI 会在校验阶段自动补齐到对应 `accountForms[]`。
80
82
 
@@ -9,12 +9,12 @@
9
9
  - **意图辨析**:用户指定在“小红书”平台分发视频内容时触发。
10
10
  - **典型提示词**:
11
11
  - “把这个视频发布到小红书”
12
- - “发布到小红书时艾特这个好友”
12
+ - “发布到小红书时按小红书号艾特这个用户”
13
13
  - “同步视频到小红书”
14
14
 
15
15
  ## 执行逻辑 (Logic Flow)
16
16
  1. **意图确认**:确认目标平台为小红书。
17
- 2. **参数装配**:识别并填充标题、描述等平台特定字段至 `contentPublishForm`;如需艾特好友,将 `<friend>` HTML 标签写入 `description`。
17
+ 2. **参数装配**:识别并填充标题、描述等平台特定字段至 `contentPublishForm`;如需艾特用户(含陌生人),将 `<friend>` HTML 标签写入 `description`。
18
18
  3. **指令执行**:先执行 `yxer validate <platform> <type> <payload.json>`,再执行 `yxer publish <type> <platform> <payload.json> [--publish-channel local --client-id <clientId>]`。
19
19
 
20
20
  > [!TIP]
@@ -28,7 +28,7 @@
28
28
  | :--- | :--- | :--- | :--- | :--- |
29
29
  | `formType` | `string` | **是** | 固定为 `task` | `task` |
30
30
  | `title` | `string` | 否 | 视频标题 (最多 20 字) | - |
31
- | `description` | `string` | 否 | 视频描述,支持 `<friend>` HTML 标签;好友对象必须来自 `yxer query friends`。最多 1000 字。 | - |
31
+ | `description` | `string` | 否 | 视频描述,支持 `<friend>` HTML 标签;用户对象(含陌生人)必须来自 `yxer query friends --red-id`。最多 1000 字。 | - |
32
32
  | `declaration` | `number` | 否 | 内容类型申明: 1-虚构演绎, 2-笔记含 AI 合成内容 | - |
33
33
  | `createType` | `number` | 否 | 创作类型: 1-原创, 0-不申明 | 0 |
34
34
  | `location` | `object` | 否 | 视频位置,使用 `PlatformDataItem` 结构 | - |
@@ -84,15 +84,15 @@
84
84
 
85
85
  ## 3. 复杂对象结构说明
86
86
 
87
- ### 3.1 description 中艾特好友
87
+ ### 3.1 description 中艾特用户(含陌生人)
88
88
 
89
- 小红书好友艾特不是 `contentPublishForm` 的独立字段,而是描述 HTML 的一部分:
89
+ 小红书用户艾特不是 `contentPublishForm` 的独立字段,而是描述 HTML 的一部分;目标用户可以不是当前账号的好友:
90
90
 
91
91
  ```html
92
- <p>视频内容 <friend raw='好友查询结果的完整 JSON 序列化字符串'>@好友名称</friend></p>
92
+ <p>视频内容 <friend raw='用户查询结果的完整 JSON 序列化字符串'>@用户名称</friend></p>
93
93
  ```
94
94
 
95
- 先执行 `yxer query friends <account_id> [--red-id 小红书号] --json`,选择 `data.list` 中的完整好友对象,将其 JSON 序列化后写入 `raw`,并使用查询结果的 `yixiaoerName` 生成标签正文。详见 [获取好友/关联对象](../../get-friends.md)。
95
+ 先执行 `yxer query friends <account_id> --red-id <小红书号> --json`,选择 `data.list` 中的完整用户对象,将其 JSON 序列化后写入 `raw`,并使用查询结果的 `yixiaoerName` 生成标签正文。详见 [获取小红书用户/艾特对象](../../get-friends.md)。
96
96
 
97
97
  ### 3.2 PlatformDataItem (位置)
98
98
 
@@ -145,6 +145,6 @@
145
145
  | `location` | `locations` | [获取位置信息](../../get-locations.md) |
146
146
  | `collection` | `collections` | [获取合集列表](../../get-collections.md) |
147
147
  | `group` | `groups` | [获取群聊列表](../../get-groups.md) |
148
- | `description.friend` | `friends` | [获取好友/关联对象](../../get-friends.md) |
148
+ | `description.friend` | `friends` | [获取小红书用户/艾特对象](../../get-friends.md) |
149
149
  | `shopping_cart` | `goods` | [获取商品列表](../../get-goods.md) |
150
150
  | `video.key` | `upload` | [资源上传](../../upload-resource.md) |
@@ -51,7 +51,7 @@
51
51
  "bucket": "cloud-publish"
52
52
  }
53
53
  ```
54
- **注意**: 在发布文章或视频时,请直接传入返回的 `key` 字符串作为封面或图片地址。
54
+ **注意**: 封面/媒体字段使用返回对象中的 `key`;如果资源要出现在 HTML `<img src>` 中,不能把裸 `key` 当成浏览器地址,必须通过文章导入/正文图片物化流程换成稳定 URL。
55
55
 
56
56
  ## 调用指令 (Command)
57
57
 
@@ -78,7 +78,7 @@ yxer upload --file .\cover.jpg
78
78
  yxer query categories <account_id> --type video
79
79
  yxer query locations <account_id> --query 上海
80
80
  yxer query music <account_id> --query 热门
81
- yxer query friends <account_id> [--red-id 小红书号]
81
+ yxer query friends <account_id> [--red-id 小红书号] [--query 关键词]
82
82
  ```
83
83
 
84
84
  ### 步骤 6:填写 payload
@@ -239,7 +239,7 @@ yxer publish <type> <platform> .\payload.json --publish-channel local --client-i
239
239
  | `collection` / `sub_collection` | `yxer query collections <account_id> [--type video]` | 整个 `yxer query collections` 返回对象 |
240
240
  | 视频号 `drama` | `yxer query drama-tasks <account_id> [--query 关键词]` | 只保留 `yixiaoerId`、`yixiaoerImageUrl`、`yixiaoerName`,不使用 `raw` |
241
241
  | `challenge` | `yxer query challenges <account_id> [--query 关键词]` | 整个 `yxer query challenges` 返回对象 |
242
- | 小红书 `description` 中的 `<friend>` | `yxer query friends <account_id> [--red-id 小红书号]` | 将整个好友对象 JSON 序列化到标签 `raw`,标签正文使用查询结果名称 |
242
+ | 小红书 `description` 中的 `<friend>` | `yxer query friends <account_id> --red-id <小红书号>` | 将整个用户对象 JSON 序列化到标签 `raw`,支持陌生人,标签正文使用查询结果名称 |
243
243
  | `category` | `yxer query categories <account_id> [--type video\|article]` | 整个 `yxer query categories` 返回对象 |
244
244
  | `goods` | `yxer query goods <account_id> [--query 关键词]` | 整个 `yxer query goods` 返回对象 |
245
245
 
@@ -63,7 +63,7 @@
63
63
  | 合集 | `yxer query collections` | 使用完整合集对象并保留 `raw` |
64
64
  | 视频号剧集 | `yxer query drama-tasks` | 使用完整三字段对象:`yixiaoerId`、`yixiaoerImageUrl`、`yixiaoerName`;不添加 `raw` |
65
65
  | 话题/挑战 | `yxer query challenges` 或平台文档规定格式 | 不凭热门词手写 raw |
66
- | 小红书描述中的好友艾特 | `yxer query friends` | 将完整好友对象 JSON 序列化到 `<friend>` 的 `raw`,不手写好友对象 |
66
+ | 小红书描述中的用户艾特(含陌生人) | `yxer query friends --red-id` | 将完整用户对象 JSON 序列化到 `<friend>` 的 `raw`,不手写用户对象 |
67
67
  | 活动/热点 | `yxer query activities` / `hot-events` | 使用完整返回对象 |
68
68
  | 小程序/同步应用/游戏/群组 | 对应 `yxer query miniapps/syncapps/games/groups` | 使用 CLI 返回对象 |
69
69
 
@@ -24,6 +24,8 @@
24
24
  4. 生成或修正草稿 payload
25
25
  5. 执行 `yxer draft save <payload.json> [--dry-run]`
26
26
 
27
+ 微信公众号文章如果来源是 Word 文档,使用 `yxer draft import <article.docx>`,并同时传入账号 ID 和横版封面。该入口会提取 DOCX 内嵌图片、上传到素材库并替换为稳定 URL;竖版或正方形封面在上传前拒绝,不自动裁剪。
28
+
27
29
  ## 规则
28
30
 
29
31
  - `yxer draft save` 保存的是蚁小二内部草稿,不等同于平台草稿箱
@@ -35,6 +37,7 @@
35
37
  ```bash
36
38
  yxer draft save .\draft-payload.json --dry-run
37
39
  yxer draft save .\draft-payload.json
40
+ yxer draft import .\article.docx --cover .\horizontal-cover.jpg --account-id <online-account-id> --author 蚁小二 --draft-id <existing-draft-id> --dry-run
38
41
  ```
39
42
 
40
43
  ## 严禁行为
@@ -42,8 +42,10 @@ yxer schema get <platform> video
42
42
  - 发布前必须确认目标账号 `status=1`
43
43
  - 视频只能有一个,封面必须单独上传
44
44
  - 用户未提供封面时,必须补问,不要自动截帧
45
+ - 百家号视频的主/横版封面使用账号级 `cover` + `coverKey`(必填且 `coverKey` 必须等于 `cover.key`);竖版封面使用可选的 `contentPublishForm.verticalCover`,也可放在共享的 `publishArgs.verticalCover`。客户端内部会生成 `covers[0]` / `verticalCovers[0]`,未提供竖版时以主封面兜底;不要给百家号传 `horizontalCover`
45
46
  - 可选复杂对象必须通过查询命令取得完整对象后再填入;多多视频 `shopping_cart.goods_id` 由用户输入,不使用商品查询对象,`source` 固定为 `pdd`
46
47
  - 多多视频声明使用 `contentPublishForm.declaration`,允许值为 `0/1/3/5/7/8`;`0` 表示无需声明且不转换为 `statement`,非 `0` 由服务端转换为 `statement.type`,不要手写旧的 `statement` 对象
48
+ - 百家号视频声明使用 `contentPublishForm.statement` 对象;`type` 是主声明,当前值为 `0`(不声明)、`1`(内容由AI生成)、`16`(内容为转载)、`4`(含虚构演绎内容)、`8`(内容含有营销信息)、`32`(个人观点,仅供参考);`subType` 是补充声明,值为 `0`(不选择)、`1`(内容可能引人不适)、`2`(内容含有高危险行为)、`4`(请理性适度消费)、`8`(未成年人请在监护人指导下浏览)。`statement` 可省略;不要使用旧的顶层 `declaration`,也不要传 `isAigc`
47
49
  - 视频号 `drama` 必须通过当前账号的 `drama-tasks` 查询并使用 `publish form choose` 选择;对象只保留 `yixiaoerId`、`yixiaoerImageUrl`、`yixiaoerName`,不要求 `raw`。`collection` 仍按合集规则使用完整 `raw`。
48
50
  - 话题/标签必须直接按 `../topic-tags.md` 的目标格式传入;不要依赖 CLI 从 `description` 自动改写
49
51
  - 视频号原创声明必须按平台文档映射:用户说“勾选原创”“声明原创”或“开启原创”时,在 `publishArgs.accountForms[].contentPublishForm` 写 `createType: 1`;未提及或明确关闭/转载时写 `createType: 2`。不要把 `pubType` 当作原创开关
@@ -38,14 +38,6 @@
38
38
  ],
39
39
  "default": 1
40
40
  },
41
- "declaration": {
42
- "type": "number",
43
- "enum": [
44
- 0,
45
- 1
46
- ],
47
- "default": 0
48
- },
49
41
  "statement": {
50
42
  "type": "object",
51
43
  "required": [
@@ -53,17 +45,30 @@
53
45
  ],
54
46
  "properties": {
55
47
  "type": {
56
- "type": "number",
48
+ "type": "integer",
57
49
  "enum": [
58
50
  0,
59
- 1
60
- ]
51
+ 1,
52
+ 16,
53
+ 4,
54
+ 8,
55
+ 32
56
+ ],
57
+ "description": "声明:0-不声明,1-内容由AI生成,16-内容为转载,4-含虚构演绎内容,8-内容含有营销信息,32-个人观点,仅供参考。"
61
58
  },
62
59
  "subType": {
63
- "type": "number"
60
+ "type": "integer",
61
+ "enum": [
62
+ 0,
63
+ 1,
64
+ 2,
65
+ 4,
66
+ 8
67
+ ],
68
+ "description": "补充声明:0-不选择,1-内容可能引人不适,2-内容含有高危险行为,4-请理性适度消费,8-未成年人请在监护人指导下浏览。"
64
69
  }
65
70
  },
66
- "additionalProperties": true
71
+ "additionalProperties": false
67
72
  },
68
73
  "location": {
69
74
  "type": "object",
@@ -164,6 +169,7 @@
164
169
  },
165
170
  "cover": {
166
171
  "type": "object",
172
+ "description": "百家号视频主封面(客户端内部作为横版/主封面使用)。",
167
173
  "required": [
168
174
  "key",
169
175
  "size",
@@ -188,6 +194,30 @@
188
194
  "coverKey": {
189
195
  "type": "string"
190
196
  },
197
+ "verticalCover": {
198
+ "type": "object",
199
+ "description": "百家号视频可选竖版封面;未提供时客户端使用主封面兜底。",
200
+ "required": [
201
+ "key",
202
+ "size",
203
+ "width",
204
+ "height"
205
+ ],
206
+ "properties": {
207
+ "key": {
208
+ "type": "string"
209
+ },
210
+ "size": {
211
+ "type": "integer"
212
+ },
213
+ "width": {
214
+ "type": "integer"
215
+ },
216
+ "height": {
217
+ "type": "integer"
218
+ }
219
+ }
220
+ },
191
221
  "scheduledTime": {
192
222
  "type": "number",
193
223
  "minimum": 0