@yixiaoermail/cli 3.2.25 → 3.2.27
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.
- package/README.md +13 -4
- package/checksums.txt +6 -6
- package/package.json +3 -3
- package/references/platforms/article/toutiaohao.md +3 -1
- package/references/platforms/imageText/toutiaohao.md +3 -1
- package/references/platforms/video/toutiaohao.md +3 -1
- package/references/upload-resource.md +72 -70
- package/references/workflows/common-rules.md +291 -289
- package/schemas/platforms/acfun.video.schema.json +139 -139
- package/schemas/platforms/aiqiyi.article.schema.json +29 -29
- package/schemas/platforms/aiqiyi.video.schema.json +154 -154
- package/schemas/platforms/bilibili.article.schema.json +109 -109
- package/schemas/platforms/bilibili.video.schema.json +175 -175
- package/schemas/platforms/chejiahao.video.schema.json +111 -111
- package/schemas/platforms/csdn.article.schema.json +106 -106
- package/schemas/platforms/dayuhao.article.schema.json +106 -106
- package/schemas/platforms/douban.article.schema.json +48 -48
- package/schemas/platforms/jianshu.article.schema.json +33 -33
- package/schemas/platforms/meiyou.video.schema.json +96 -96
- package/schemas/platforms/pipixia.video.schema.json +94 -94
- package/schemas/platforms/qiehao.article.schema.json +89 -89
- package/schemas/platforms/qiehao.video.schema.json +147 -147
- package/schemas/platforms/souhuhao.article.schema.json +73 -73
- package/schemas/platforms/toutiaohao.article.schema.json +6 -10
- package/schemas/platforms/toutiaohao.imageText.schema.json +5 -2
- package/schemas/platforms/toutiaohao.video.schema.json +6 -3
- package/schemas/platforms/weishi.video.schema.json +101 -101
- package/schemas/platforms/xinlang.article.schema.json +69 -69
- package/schemas/platforms/xueqiuhao.article.schema.json +84 -84
- package/schemas/platforms/yichehao.article.schema.json +140 -140
- package/schemas/platforms/yichehao.video.schema.json +101 -101
- package/schemas/platforms/zhihu.article.schema.json +104 -104
- package/schemas/platforms/zhihu.imageText.schema.json +61 -61
- package/schemas/platforms/zhihu.video.schema.json +144 -144
- package/skills/yixiaoer/SKILL.md +98 -98
- package/skills/yixiaoer/references/platforms/article/toutiaohao.md +3 -1
- package/skills/yixiaoer/references/platforms/imageText/toutiaohao.md +3 -1
- package/skills/yixiaoer/references/platforms/video/toutiaohao.md +3 -1
- package/skills/yixiaoer/references/upload-resource.md +72 -70
- package/skills/yixiaoer/references/workflows/common-rules.md +291 -289
package/skills/yixiaoer/SKILL.md
CHANGED
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
name: yixiaoer
|
|
3
|
-
version: 3.2.
|
|
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.27
|
|
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`。
|
|
@@ -31,9 +31,11 @@
|
|
|
31
31
|
| `location` | `Object` | 否 | 位置对象 (`PlatformDataItem`) | - |
|
|
32
32
|
| `scheduledTime` | `number` | 否 | 定时发布时间 (13 位 Unix 时间戳,单位: 毫秒) | - |
|
|
33
33
|
| `advertisement` | `number` | 否 | 广告投放收益: 2-无收益, 3-投放广告赚收益 | `3` |
|
|
34
|
-
| `declaration
|
|
34
|
+
| `declaration` | `number` | 否 | 创作声明:`0`-不声明,`1`-取材网络,`2`-个人观点,仅供参考,`3`-引用 AI,`6`-虚构演绎/故事经历,`7`-投资观点,仅供参考,`8`-健康医疗分享,仅供参考;`9`-独家精选(需 `right_exclusive_selection`),`10`-首发精选(需 `right_first_selection`) | `0` |
|
|
35
35
|
| `pubType` | `number` | **是** | 发布类型: 0-草稿, 1-直接发布 | 1 |
|
|
36
36
|
|
|
37
|
+
普通声明值 `0/1/2/3/6/7/8` 不受精选权益影响;`9/10` 只有账号信息返回对应权益时才填写,否则使用 `0` 或省略。CLI 接收 `declaration` 数字,并会在 `validate`、`publish`(含 `--dry-run`)前查询 `/platform-accounts/{id}/account-info`,拒绝无对应权益的值;服务端会将其转换为 `statement.type` 透传给头条号。`isFirst=true` 表示“头条首发”,与 `declaration=10` 的“首发精选”是两个独立字段。
|
|
38
|
+
|
|
37
39
|
## 2. Payload 完整示例
|
|
38
40
|
|
|
39
41
|
```json
|
|
@@ -25,9 +25,11 @@
|
|
|
25
25
|
| `formType` | `string` | **是** | 固定值: `task` | `task` |
|
|
26
26
|
| `description` | `string` | **是** | 图文描述,支持 HTML 和话题标签 (`<topic>`)。最多 1000 字符。 | - |
|
|
27
27
|
| `images` | `Array` | **是** | 图片数组 (`OldImage[]`) | - |
|
|
28
|
-
| `declaration` | `number` | 否 |
|
|
28
|
+
| `declaration` | `number` | 否 | 创作声明:`0`-不声明,`1`-取材网络,`2`-个人观点,仅供参考,`3`-引用 AI,`6`-虚构演绎/故事经历,`7`-投资观点,仅供参考,`8`-健康医疗分享,仅供参考;`9`-独家精选(需 `right_exclusive_selection`),`10`-首发精选(需 `right_first_selection`) | `0` |
|
|
29
29
|
| `pubType` | `number` | **是** | 发布类型: 0-草稿, 1-直接发布 | - |
|
|
30
30
|
|
|
31
|
+
普通声明值 `0/1/2/3/6/7/8` 不受精选权益影响;`9/10` 只有账号信息返回对应权益时才填写,否则使用 `0` 或省略。CLI 接收 `declaration` 数字,并会在 `validate`、`publish`(含 `--dry-run`)前查询 `/platform-accounts/{id}/account-info`,拒绝无对应权益的值;服务端会将其转换为 `statement.type` 透传给头条号。
|
|
32
|
+
|
|
31
33
|
## 2. 复杂对象结构说明
|
|
32
34
|
|
|
33
35
|
### 复杂对象:OldImage
|
|
@@ -27,11 +27,13 @@
|
|
|
27
27
|
| `title` | `string` | **是** | 视频标题 (1-30 字符) | - |
|
|
28
28
|
| `description` | `string` | **是** | 视频描述 (1-400 字符) | - |
|
|
29
29
|
| `tags` | `string[]` | **是** | 视频标签 (1-5 个,字符串数组) | - |
|
|
30
|
-
| `declaration` | `number` | 否 |
|
|
30
|
+
| `declaration` | `number` | 否 | 创作声明:`0`-无需声明,`2`-取自站外,`1`-自行拍摄,`3`-AI 生成,`6`-虚构演绎/故事经历,`7`-投资观点,仅供参考,`8`-健康医疗分享,仅供参考;`9`-独家精选(需 `right_exclusive_selection`),`10`-首发精选(需 `right_first_selection`) | `0` |
|
|
31
31
|
| `scheduledTime` | `number` | 否 | 定时发布时间戳(13 位 Unix 时间戳,单位:毫秒) | - |
|
|
32
32
|
| `visibleType` | `number` | **是** | 可见性: 0-公开, 1-私密 | 0 |
|
|
33
33
|
| `pubType` | `number` | **是** | 发布类型: 0-草稿, 1-直接发布 | 1 |
|
|
34
34
|
|
|
35
|
+
普通声明值 `0/1/2/3/6/7/8` 不受精选权益影响;`9/10` 只有账号信息返回对应权益时才填写,否则使用 `0` 或省略。CLI 接收 `declaration` 数字,并会在 `validate`、`publish`(含 `--dry-run`)前查询 `/platform-accounts/{id}/account-info`,拒绝无对应权益的值;服务端会将其转换为 `statement.type` 透传给头条号。
|
|
36
|
+
|
|
35
37
|
## 2. Payload 完整示例
|
|
36
38
|
|
|
37
39
|
```json
|
|
@@ -1,70 +1,72 @@
|
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
>
|
|
37
|
-
>
|
|
38
|
-
>
|
|
39
|
-
|
|
40
|
-
>
|
|
41
|
-
|
|
42
|
-
>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
>
|
|
66
|
-
|
|
67
|
-
>
|
|
68
|
-
|
|
69
|
-
>
|
|
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
|
+
视频在上传前会由 CLI 使用 FFmpeg 完整解码视频和音频帧;本地文件在读取期间发生变化、远程地址只返回部分内容、文件损坏或截断时,CLI 会返回结构化错误并停止上传。请确保 `ffmpeg` 可从 `PATH` 找到;如需自动提取视频宽高和时长,再传 `--auto-meta` 并确保 `ffprobe` 可用。
|
|
35
|
+
|
|
36
|
+
> [!IMPORTANT]
|
|
37
|
+
> **视频号 512KB 图片限制**:
|
|
38
|
+
> 上传视频号视频封面或视频号图文图片时,必须带平台用途参数:
|
|
39
|
+
> `yxer upload <图片路径或URL> --platform 视频号 --usage cover` 或 `--usage image`。
|
|
40
|
+
> 当图片超过 512KB 时,CLI 会在内部压缩后再上传,并在 JSON 返回中标记 `compressed: true`、`originalSize` 和压缩后的 `size`;后续 payload 必须使用这次上传返回的完整对象。
|
|
41
|
+
|
|
42
|
+
> [!IMPORTANT]
|
|
43
|
+
> **Instagram / Meta 兼容性**:
|
|
44
|
+
> 若后续要发 Instagram 视频,原视频文件名不要使用中文、空格或其它非 ASCII 字符。Meta 会主动回拉蚁小二返回的媒体 URL;若 URL 路径中带中文,Meta 下载器可能直接返回 HTTP 400,导致“创建发布容器失败 / The media could not be fetched from the provided URI”。
|
|
45
|
+
|
|
46
|
+
## 输出结果 (Output)
|
|
47
|
+
|
|
48
|
+
输出生成的资源标识,供发布脚本引用:
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"key": "cloud-publish/2026/03/26/66b2xxx/xxx.jpg",
|
|
52
|
+
"name": "xxx.jpg",
|
|
53
|
+
"bucket": "cloud-publish"
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
**注意**: 封面/媒体字段使用返回对象中的 `key`;如果资源要出现在 HTML `<img src>` 中,不能把裸 `key` 当成浏览器地址,必须通过文章导入/正文图片物化流程换成稳定 URL。
|
|
57
|
+
|
|
58
|
+
## 调用指令 (Command)
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
yxer upload https://example.com/image.jpg --bucket cloud-publish
|
|
62
|
+
yxer upload ./cover.png --platform 视频号 --usage cover
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
> [!IMPORTANT]
|
|
66
|
+
> **发布合规性提醒**:
|
|
67
|
+
> 所有的封面图、图文图片、视频文件均**严禁直接使用外部网络 URL**,必须通过本项目提供的上传接口进行处理并获取 `key` 后进行发布。不遵守此规范将直接导致任务失败。
|
|
68
|
+
|
|
69
|
+
> [!CAUTION]
|
|
70
|
+
> **ContentType 签名一致性**:
|
|
71
|
+
> 在上传资源时,必须确保获取上传地址所传入的 `contentType` 参数与 PUT 请求实际发送的 `Content-Type` Header **完全一致**。
|
|
72
|
+
|