@yixiaoermail/cli 3.1.3 → 3.2.1
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 +25 -25
- package/bin/ensure-executable.js +25 -25
- package/bin/postinstall.js +18 -18
- package/bin/resolve-binary.js +36 -36
- package/bin/yxer.js +65 -65
- package/dist/yxer-darwin-amd64 +0 -0
- package/dist/yxer-darwin-arm64 +0 -0
- package/dist/yxer-linux-amd64 +0 -0
- package/dist/yxer-linux-arm64 +0 -0
- package/dist/yxer-windows-amd64.exe +0 -0
- package/dist/yxer-windows-arm64.exe +0 -0
- package/package.json +2 -2
- package/references/cli/command-design.md +305 -0
- package/references/cli/command-reference.md +35 -27
- package/references/cli/skill-install.md +24 -24
- package/references/legacy/capabilities.md +13 -8
- package/references/workflows/payload-sourcing.md +17 -10
- package/references/workflows/publish-troubleshooting.md +10 -4
- package/schemas/platforms/acfun.article.schema.json +117 -117
- 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/baijiahao.article.schema.json +103 -103
- package/schemas/platforms/baijiahao.imageText.schema.json +6 -5
- package/schemas/platforms/baijiahao.video.schema.json +180 -179
- package/schemas/platforms/bilibili.article.schema.json +109 -109
- package/schemas/platforms/bilibili.video.schema.json +175 -175
- package/schemas/platforms/chejiahao.article.schema.json +108 -108
- 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/dayuhao.video.schema.json +153 -153
- package/schemas/platforms/dewu.video.schema.json +134 -134
- package/schemas/platforms/douban.article.schema.json +48 -48
- package/schemas/platforms/douyin.article.schema.json +318 -318
- package/schemas/platforms/douyin.imageText.schema.json +287 -217
- package/schemas/platforms/douyin.video.schema.json +852 -744
- package/schemas/platforms/duoduoshipin.video.schema.json +108 -108
- package/schemas/platforms/facebook.video.schema.json +28 -0
- package/schemas/platforms/fengwang.video.schema.json +135 -135
- package/schemas/platforms/instagram.video.schema.json +28 -0
- package/schemas/platforms/jianshu.article.schema.json +33 -33
- package/schemas/platforms/kuaichuanhao.article.schema.json +83 -83
- package/schemas/platforms/kuaishou.imageText.schema.json +171 -170
- package/schemas/platforms/kuaishou.video.schema.json +243 -240
- package/schemas/platforms/meipai.video.schema.json +123 -123
- 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/shipinhao.imageText.schema.json +139 -138
- package/schemas/platforms/shipinhao.video.schema.json +237 -236
- package/schemas/platforms/souhuhao.article.schema.json +73 -73
- package/schemas/platforms/souhushipin.video.schema.json +115 -115
- package/schemas/platforms/tengxunshipin.video.schema.json +114 -114
- package/schemas/platforms/tiktok.video.schema.json +72 -0
- package/schemas/platforms/toutiaohao.article.schema.json +114 -113
- package/schemas/platforms/toutiaohao.imageText.schema.json +83 -83
- package/schemas/platforms/toutiaohao.video.schema.json +134 -134
- package/schemas/platforms/wangyihao.article.schema.json +85 -85
- package/schemas/platforms/wangyihao.video.schema.json +151 -151
- package/schemas/platforms/weishi.video.schema.json +101 -101
- package/schemas/platforms/weixin.account.article.schema.json +148 -148
- package/schemas/platforms/xhs.imageText.schema.json +88 -76
- package/schemas/platforms/xiaohongshu.video.schema.json +225 -224
- package/schemas/platforms/xiaohongshushop.video.schema.json +142 -141
- package/schemas/platforms/xinlang.article.schema.json +69 -69
- package/schemas/platforms/xinlang.imageText.schema.json +86 -85
- package/schemas/platforms/xinlang.video.schema.json +152 -151
- 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/yidianhao.article.schema.json +77 -77
- package/schemas/platforms/yidianhao.video.schema.json +152 -152
- package/schemas/platforms/youtube.video.schema.json +92 -0
- 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/QUICKSTART.md +4 -4
- package/skills/yixiaoer/SKILL.md +2 -1
- package/skills/yixiaoer/plugin.json +1 -1
- package/skills/yixiaoer/references/cli/command-reference.md +30 -22
- package/skills/yixiaoer/references/cli/skill-install.md +12 -12
- package/skills/yixiaoer/references/cli-install-uninstall.md +14 -14
- package/skills/yixiaoer/references/create-account-group.md +27 -0
- package/skills/yixiaoer/references/delete-account-group.md +20 -0
- package/skills/yixiaoer/references/domains/accounts-and-env.md +17 -15
- package/skills/yixiaoer/references/domains/install-and-sync.md +15 -15
- package/skills/yixiaoer/references/domains/publish.md +11 -9
- package/skills/yixiaoer/references/execution-standard.md +18 -18
- package/skills/yixiaoer/references/get-account-groups.md +14 -0
- package/skills/yixiaoer/references/get-members.md +28 -0
- package/skills/yixiaoer/references/material-resource.md +8 -9
- package/skills/yixiaoer/references/platforms/imageText/baijiahao.md +41 -41
- package/skills/yixiaoer/references/platforms/video/facebook.md +37 -0
- package/skills/yixiaoer/references/platforms/video/index.md +7 -3
- package/skills/yixiaoer/references/platforms/video/instagram.md +40 -0
- package/skills/yixiaoer/references/platforms/video/tiktok.md +50 -0
- package/skills/yixiaoer/references/platforms/video/youtube.md +53 -0
- package/skills/yixiaoer/references/proxy-management.md +9 -8
- package/skills/yixiaoer/references/topic-tags.md +31 -30
- package/skills/yixiaoer/references/troubleshooting-guide.md +2 -2
- package/skills/yixiaoer/references/update-account-group.md +28 -0
- package/skills/yixiaoer/references/upload-resource.md +6 -2
- package/skills/yixiaoer/references/workflows/common-rules.md +29 -22
- package/skills/yixiaoer/references/workflows/data-accuracy.md +83 -0
- package/skills/yixiaoer/references/workflows/payload-sourcing.md +24 -14
- package/skills/yixiaoer/references/workflows/publish-troubleshooting.md +10 -4
|
@@ -14,24 +14,26 @@
|
|
|
14
14
|
```bash
|
|
15
15
|
yxer doctor
|
|
16
16
|
yxer config get
|
|
17
|
-
yxer config init --api-key <apiKey>
|
|
18
|
-
yxer config set-local-client-id <clientId>
|
|
19
|
-
yxer accounts list [platform] [--name 关键词] [--status 1] [--page 1] [--size 20] [--all] [--json]
|
|
20
|
-
yxer query
|
|
21
|
-
yxer query
|
|
22
|
-
yxer query
|
|
23
|
-
yxer query
|
|
24
|
-
yxer
|
|
25
|
-
yxer
|
|
26
|
-
yxer skill
|
|
17
|
+
yxer config init --api-key <apiKey>
|
|
18
|
+
yxer config set-local-client-id <clientId>
|
|
19
|
+
yxer accounts list [platform] [--name 关键词] [--status 1] [--page 1] [--size 20] [--all] [--json]
|
|
20
|
+
yxer query members [--page 1] [--size 10] [--status notJoined|pending|joined] [--query 关键词] [--role master|admin|member]
|
|
21
|
+
yxer query account-overviews --platform P [--name 关键词] [--group 分组] [--login-status 1] [--member-id ID] [--page 1] [--size 10]
|
|
22
|
+
yxer query content-overviews [--platform P] [--account-id ID] [--publish-user-id ID] [--type video|article|miniVideo|dynamic] [--title 关键词] [--publish-start-time 毫秒] [--publish-end-time 毫秒]
|
|
23
|
+
yxer query proxies [--size 9999]
|
|
24
|
+
yxer query proxy-areas
|
|
25
|
+
yxer accounts update <account_id> [--proxy-id ID] [--kuaidaili-area CODE] [--remark 文本] [--group ID] --dry-run
|
|
26
|
+
yxer skill show
|
|
27
|
+
yxer skill sync [--global]
|
|
27
28
|
```
|
|
28
29
|
|
|
29
30
|
## 规则
|
|
30
31
|
|
|
31
32
|
- 首次使用、环境不明、或失败排查后,先 `yxer doctor`
|
|
32
33
|
- `doctor` 失败时先修环境,不继续业务流程
|
|
33
|
-
- 涉及本机发布前的 `clientId` 判断时,先查询现有配置和账号列表
|
|
34
|
-
- `yxer accounts list` 默认查第 `1` 页、每页 `20` 条;传 `--page`、`--size` 可控制单页范围,传 `--all` 时才继续翻页
|
|
35
|
-
- `yxer update
|
|
36
|
-
-
|
|
37
|
-
-
|
|
34
|
+
- 涉及本机发布前的 `clientId` 判断时,先查询现有配置和账号列表
|
|
35
|
+
- `yxer accounts list` 默认查第 `1` 页、每页 `20` 条;传 `--page`、`--size` 可控制单页范围,传 `--all` 时才继续翻页
|
|
36
|
+
- `yxer accounts update` 是写操作,正式执行前必须先用同一参数执行 `--dry-run`
|
|
37
|
+
- 涉及账号分组的 `visibleUsers`、指定成员可见、按成员挑选负责人时,先执行 `yxer query members` 获取真实成员 ID
|
|
38
|
+
- 命中多个账号时,结构化列出候选并让用户确认;只有一个可用账号时可自动选中并说明
|
|
39
|
+
- 用户明确说“先不要发布,只查环境/账号”时,完成本域后直接停下,不擅自继续发布流程
|
|
@@ -19,19 +19,19 @@ yxer --version
|
|
|
19
19
|
yxer doctor
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
## 安装命令
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
yxer skill sync
|
|
26
|
-
yxer skill sync --global
|
|
27
|
-
npx skills add "<repo>\\skills\\yixiaoer" -y
|
|
28
|
-
npx skills add "<repo>\\skills\\yixiaoer" -g -y
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## 规则
|
|
32
|
-
|
|
33
|
-
- 如果 CLI 来自 npm 成品包,优先使用 `yxer skill sync`,让本地随包 skill 直接同步到宿主
|
|
34
|
-
- `yxer --version` 升级后,应提示重新同步 skill
|
|
35
|
-
- `SKILL.md` 或 `references/` 中影响 Agent 行为的文档更新后,应提示重新同步
|
|
36
|
-
- `yxer doctor` 返回 `_notice.skills` 时,优先执行 `yxer skill sync`
|
|
22
|
+
## 安装命令
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
yxer skill sync
|
|
26
|
+
yxer skill sync --global
|
|
27
|
+
npx skills add "<repo>\\skills\\yixiaoer" -y
|
|
28
|
+
npx skills add "<repo>\\skills\\yixiaoer" -g -y
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 规则
|
|
32
|
+
|
|
33
|
+
- 如果 CLI 来自 npm 成品包,优先使用 `yxer skill sync`,让本地随包 skill 直接同步到宿主
|
|
34
|
+
- `yxer --version` 升级后,应提示重新同步 skill
|
|
35
|
+
- `SKILL.md` 或 `references/` 中影响 Agent 行为的文档更新后,应提示重新同步
|
|
36
|
+
- `yxer doctor` 返回 `_notice.skills` 时,优先执行 `yxer skill sync`
|
|
37
37
|
- 用户明确说“只想同步 skill / 看安装方法”时,完成本域说明后直接停下
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
## 读取顺序
|
|
9
9
|
|
|
10
|
-
1. [`../workflows/common-rules.md`](../workflows/common-rules.md)
|
|
11
|
-
2. [`../workflows/
|
|
12
|
-
3. [`../workflows/
|
|
13
|
-
4. [`../workflows/
|
|
14
|
-
5.
|
|
10
|
+
1. [`../workflows/common-rules.md`](../workflows/common-rules.md)
|
|
11
|
+
2. [`../workflows/data-accuracy.md`](../workflows/data-accuracy.md)
|
|
12
|
+
3. [`../workflows/account-selection.md`](../workflows/account-selection.md)
|
|
13
|
+
4. [`../workflows/local-vs-cloud.md`](../workflows/local-vs-cloud.md)
|
|
14
|
+
5. [`../workflows/payload-sourcing.md`](../workflows/payload-sourcing.md)
|
|
15
|
+
6. 按类型继续读取:
|
|
15
16
|
- 图文:[`../workflows/publish-imageText.md`](../workflows/publish-imageText.md)
|
|
16
17
|
- 视频:[`../workflows/publish-video.md`](../workflows/publish-video.md)
|
|
17
18
|
- 文章:[`../workflows/publish-article.md`](../workflows/publish-article.md)
|
|
@@ -34,10 +35,11 @@
|
|
|
34
35
|
|
|
35
36
|
## 强制门禁
|
|
36
37
|
|
|
37
|
-
- 未执行 `yxer doctor` 不进入发布流程
|
|
38
|
-
- 未确认 `accounts list` 中账号 `status=1` 不继续
|
|
39
|
-
- 未执行 `prepare` / `schema fields` 不组装 payload;只有需要 payload 骨架时再补 `schema get`
|
|
40
|
-
-
|
|
38
|
+
- 未执行 `yxer doctor` 不进入发布流程
|
|
39
|
+
- 未确认 `accounts list` 中账号 `status=1` 不继续
|
|
40
|
+
- 未执行 `prepare` / `schema fields` 不组装 payload;只有需要 payload 骨架时再补 `schema get`
|
|
41
|
+
- 未按 `data-accuracy.md` 完成动态字段查询和多候选确认,不继续写 payload 或发布
|
|
42
|
+
- 未先 `validate` 与 `publish --dry-run` 不执行正式 `publish`
|
|
41
43
|
|
|
42
44
|
## 常用命令
|
|
43
45
|
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
## 2. 错误分类与标准码 (Standardized Error Codes)
|
|
16
16
|
|
|
17
|
-
为了准确区分“Agent
|
|
18
|
-
|
|
19
|
-
| 错误代码 (
|
|
17
|
+
为了准确区分“Agent 使用错误”与“后端系统错误”,所有错误 envelope 必须包含 `error.code` 字段:
|
|
18
|
+
|
|
19
|
+
| 错误代码 (`error.code`) | 分类 | 触发场景 |
|
|
20
20
|
| :--- | :--- | :--- |
|
|
21
21
|
| `YIXIAOER_USAGE_ERR` | Agent 侧错误 | 参数缺失、JSON 格式错误、平台枚举值非法、资源未上传即发布。 |
|
|
22
22
|
| `YIXIAOER_REMOTE_ERR` | 远端 API 错误 | 蚁小二后端返回 4xx/5xx、API Key 失效、配额超限。 |
|
|
@@ -67,18 +67,18 @@ Agent 在执行任务时必须遵循以下“分级检索”逻辑:
|
|
|
67
67
|
### 成功响应示例
|
|
68
68
|
```json
|
|
69
69
|
{
|
|
70
|
-
"
|
|
71
|
-
"action": "publish",
|
|
72
|
-
"version": "1.
|
|
73
|
-
"data": {
|
|
74
|
-
"task_set_id": "TS12345678"
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## 6. 错误处理与自检流程 (Error Handling & Self-Diagnosis)
|
|
80
|
-
|
|
81
|
-
|
|
70
|
+
"ok": true,
|
|
71
|
+
"action": "publish",
|
|
72
|
+
"version": "3.1.3",
|
|
73
|
+
"data": {
|
|
74
|
+
"task_set_id": "TS12345678"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 6. 错误处理与自检流程 (Error Handling & Self-Diagnosis)
|
|
80
|
+
|
|
81
|
+
当 CLI 执行失败并返回 `ok: false` 时,Agent 或开发者**必须**按照以下顺序进行自检:
|
|
82
82
|
|
|
83
83
|
### 第零步:优先匹配避坑指南 (Step 0: Check Troubleshooting Guide)
|
|
84
84
|
- 在进行任何深度调试前,**必须首先查阅**:[🛡️ 蚁小二 Skill 避坑与故障排查手册](./troubleshooting-guide.md)。
|
|
@@ -107,9 +107,9 @@ Agent 在执行任务时必须遵循以下“分级检索”逻辑:
|
|
|
107
107
|
- **资源上传专项排查**:在上传阶段如果出现 `SignatureDoesNotMatch` 错误,优先检查 `contentType` 定义是否与上传时的 Header **完全对齐**。Agent 在调用 `action: "upload-resource"` 时传入的 `contentType` 必须与后续 PUT 请求中的 `Content-Type` 字节级一致。
|
|
108
108
|
- **发布通道与代理校验**:
|
|
109
109
|
- 若执行发布任务返回“获取在线设备列表失败”或提示“客户端不在线”,原因为选择了 **本机发布 (publishChannel: 'local')** 但环境中未运行蚁小二客户端。建议保持客户端在线,或修改为 **云发布 (publishChannel: 'cloud')**。
|
|
110
|
-
- 若**云发布**返回“账号代理不存在”,原因为账号绑定的独立代理 (proxyId) 失效或该平台强制需要代理配置。Agent 应先检查账号的 `proxyId` 或 `kuaidailiArea` 是否设置,并提示用户通过 `update
|
|
110
|
+
- 若**云发布**返回“账号代理不存在”,原因为账号绑定的独立代理 (proxyId) 失效或该平台强制需要代理配置。Agent 应先检查账号的 `proxyId` 或 `kuaidailiArea` 是否设置,并提示用户通过 `yxer accounts update` 绑定新的代理。
|
|
111
111
|
- **执行逻辑**:如果怀疑使用了缓存导致的异常,必须清理相关临时文件并严格按照最新技能定义的流程重新执行(如重新执行 `upload` 流程)。
|
|
112
|
-
- **草稿处理逻辑 (Draft Selection)**:当涉及“草稿”时,Agent 必须通过语义判断用户是指 **“蚁小二内部草稿”** (
|
|
112
|
+
- **草稿处理逻辑 (Draft Selection)**:当涉及“草稿”时,Agent 必须通过语义判断用户是指 **“蚁小二内部草稿”** (`yxer draft save`) 还是 **“发布到平台草稿箱”** (`yxer publish` + `pubType: 0`)。**若语义不明确,Agent 必须询问用户以确认,严禁在未明确用户意图时随意选取一种或默认执行。**
|
|
113
113
|
- **平台草稿兼容性补丁**:若用户指定“发布到平台草稿箱”,Agent 遵循以下执行链:
|
|
114
114
|
1. **pubType 优先**:若平台定义了 `pubType`,使用 `pubType: 0`。
|
|
115
115
|
2. **visibleType 次之**:若无 `pubType` 但有 `visibleType` (或 `status`/`privacy`),将其设为 **`1` (私密)**。对应的,`0` 表示公开。
|
|
@@ -137,7 +137,7 @@ Agent 在执行任务时必须遵循以下“分级检索”逻辑:
|
|
|
137
137
|
| **任务卡在发布中/待发布** | 虽然 API 接收了请求,但表单内容不合规导致引擎挂起。 | **规则校验**:检查表单是否严格按照文档规则填入,特别是 `raw` 数据透传。 |
|
|
138
138
|
| **发布失败:必填项缺失** | 忽略了平台要求的必填核心字段(如标题、分类)。 | **必填项自检**:检查文档中标记为“必填”的字段是否已全部填入。 |
|
|
139
139
|
| **上传失败/签名不匹配** | `contentType` 在获取上传地址与执行 PUT 时不一致。 | **一致性校验**:必须确保 `action: "upload-resource"` 时传入的 `contentType` 与实际上传一致。 |
|
|
140
|
-
| **云发布报错:账号代理不存在** | 账号绑定的独立代理 (`proxyId`) 已失效,或云发布环境未配置代理。 | **修复建议**:通过 `update
|
|
140
|
+
| **云发布报错:账号代理不存在** | 账号绑定的独立代理 (`proxyId`) 已失效,或云发布环境未配置代理。 | **修复建议**:通过 `yxer accounts update` 为账号设置 `kuaidailiArea`(内置代理)或有效的 `proxyId`(独立代理)。 |
|
|
141
141
|
|
|
142
142
|
---
|
|
143
143
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# 获取成员列表
|
|
2
|
+
|
|
3
|
+
用于查询团队成员列表,对应接口 `GET /members`。
|
|
4
|
+
|
|
5
|
+
## 推荐命令
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yxer query members
|
|
9
|
+
yxer query members --status joined --query 张三
|
|
10
|
+
yxer query members --role member --page 1 --size 10
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 请求说明
|
|
14
|
+
|
|
15
|
+
- 支持分页参数:`--page`、`--size`
|
|
16
|
+
- 支持成员状态过滤:`--status notJoined|pending|joined`
|
|
17
|
+
- 支持成员角色过滤:`--role master|admin|member`
|
|
18
|
+
- 支持按成员名称或手机号搜索:`--query`(`--keyword` 为别名)
|
|
19
|
+
|
|
20
|
+
## 使用建议
|
|
21
|
+
|
|
22
|
+
- 当账号分组需要填写 `visibleUsers`、或用户说“指定成员可见”时,应先执行 `yxer query members` 获取真实成员 ID。
|
|
23
|
+
- `visibleUsers` 必须直接使用 CLI 返回结果中的真实用户 ID,不要手写或猜测。
|
|
24
|
+
|
|
25
|
+
## 输出说明
|
|
26
|
+
|
|
27
|
+
- 返回成员列表。
|
|
28
|
+
- 具体字段以 CLI 实际 JSON 输出为准,Agent 应直接消费返回结果,不要手写成员对象。
|
|
@@ -9,9 +9,8 @@
|
|
|
9
9
|
- “我的宣传片已经传好了,帮我入库”
|
|
10
10
|
- “将这个 Key 对应的图片登记到素材管理中”
|
|
11
11
|
|
|
12
|
-
> [!TIP]
|
|
13
|
-
>
|
|
14
|
-
> 当用户意图是“把文件放进素材库”,优先直接使用:
|
|
12
|
+
> [!TIP]
|
|
13
|
+
> 当用户意图是“把文件放进素材库”,直接使用:
|
|
15
14
|
>
|
|
16
15
|
> ```bash
|
|
17
16
|
> yxer material add --file ./demo.mp4
|
|
@@ -39,12 +38,12 @@
|
|
|
39
38
|
1. **链路检查**:确认资源是否已通过 `upload` 动作上传(建议使用 `bucket: "material-library"`)。
|
|
40
39
|
2. **元数据提取**:识别文件的真实名称、宽高及类型。
|
|
41
40
|
3. **参数装配**:构造 `action: "material"` 及完整元数据。
|
|
42
|
-
4.
|
|
41
|
+
4. **指令执行**:调用 `yxer material add --file ...`;只有高级定制时再拆分成 `upload + material create`。
|
|
43
42
|
5. **入库反馈**:向用户确认素材 ID 及入库成功状态。
|
|
44
43
|
|
|
45
|
-
##
|
|
46
|
-
|
|
47
|
-
1.
|
|
44
|
+
## 执行链路
|
|
45
|
+
|
|
46
|
+
1. 直接使用:
|
|
48
47
|
|
|
49
48
|
```bash
|
|
50
49
|
yxer material add --file ./demo.mp4
|
|
@@ -60,13 +59,13 @@ yxer material add --file ./demo.mp4
|
|
|
60
59
|
yxer material create material-payload.json
|
|
61
60
|
```
|
|
62
61
|
|
|
63
|
-
|
|
62
|
+
也可直接上传并登记:
|
|
64
63
|
|
|
65
64
|
```bash
|
|
66
65
|
yxer material add --file ./demo.mp4
|
|
67
66
|
```
|
|
68
67
|
|
|
69
|
-
|
|
68
|
+
如需手工控制资源 key 或缩略图,先执行:
|
|
70
69
|
|
|
71
70
|
```bash
|
|
72
71
|
yxer upload ./demo.mp4 --bucket material-library
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
- “同步这条动态到Baijiahao”
|
|
13
13
|
|
|
14
14
|
## 执行逻辑 (Logic Flow)
|
|
15
|
-
1. **资源校验**:确保所有图片均已上传并获得 Key。
|
|
16
|
-
2. **参数装配**:图文内容使用 `contentPublishForm.images` 传图;账号层仍需同步提供 `cover` 和 `coverKey`。
|
|
15
|
+
1. **资源校验**:确保所有图片均已上传并获得 Key。
|
|
16
|
+
2. **参数装配**:图文内容使用 `contentPublishForm.images` 传图;账号层仍需同步提供 `cover` 和 `coverKey`。
|
|
17
17
|
3. **指令执行**:先执行 `yxer validate <platform> <type> <payload.json>`,再执行 `yxer publish <type> <platform> <payload.json> [clientId]`。
|
|
18
18
|
|
|
19
19
|
本平台图文发布通过 `contentPublishForm` 承载以下参数。
|
|
@@ -25,22 +25,22 @@
|
|
|
25
25
|
| `formType` | `string` | **是** | 固定值: `task` | `task` |
|
|
26
26
|
| `title` | `string` | **是** | 标题 (1-20 字符) | - |
|
|
27
27
|
| `description` | `string` | **是** | 图文描述,支持 HTML (`<p>`, `<topic>`)。 (1-1000 字符) | - |
|
|
28
|
-
| `images` | `Array` | **是** | 图片数组 (`OldImage[]`, 至少 1 张) | - |
|
|
29
|
-
| `pubType` | `number` | **是** | 发布类型: 0-草稿, 1-直接发布 | - |
|
|
30
|
-
| `declaration` | `number` | **是** | 创作声明: 0-不声明, 1-内容由 AI 生成 | - |
|
|
31
|
-
| `location` | `Object` | 否 | 位置信息 (`PlatformDataItem`) | - |
|
|
32
|
-
| `scheduledTime` | `number` | 否 | 定时发布时间 (13 位 Unix 时间戳,单位: 毫秒) | - |
|
|
28
|
+
| `images` | `Array` | **是** | 图片数组 (`OldImage[]`, 至少 1 张) | - |
|
|
29
|
+
| `pubType` | `number` | **是** | 发布类型: 0-草稿, 1-直接发布 | - |
|
|
30
|
+
| `declaration` | `number` | **是** | 创作声明: 0-不声明, 1-内容由 AI 生成 | - |
|
|
31
|
+
| `location` | `Object` | 否 | 位置信息 (`PlatformDataItem`) | - |
|
|
32
|
+
| `scheduledTime` | `number` | 否 | 定时发布时间 (13 位 Unix 时间戳,单位: 毫秒) | - |
|
|
33
33
|
|
|
34
34
|
## 2. 复杂对象结构说明
|
|
35
35
|
|
|
36
|
-
### 复杂对象:OldImage
|
|
37
|
-
| 字段名 | 类型 | 必填 | 说明 | 默认值 |
|
|
38
|
-
| :--- | :--- | :--- | :--- | :--- |
|
|
39
|
-
| `width` | `number` | **是** | 图片宽度 | - |
|
|
40
|
-
| `height` | `number` | **是** | 图片高度 | - |
|
|
41
|
-
| `size` | `number` | **是** | 文件大小 (Bytes) | - |
|
|
42
|
-
| `key` | `string` | **是** | 资源 Key (通过上传接口获取) | - |
|
|
43
|
-
| `format` | `string` | 否 | 文件格式 (`jpg/png/webp` 等) | - |
|
|
36
|
+
### 复杂对象:OldImage
|
|
37
|
+
| 字段名 | 类型 | 必填 | 说明 | 默认值 |
|
|
38
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
39
|
+
| `width` | `number` | **是** | 图片宽度 | - |
|
|
40
|
+
| `height` | `number` | **是** | 图片高度 | - |
|
|
41
|
+
| `size` | `number` | **是** | 文件大小 (Bytes) | - |
|
|
42
|
+
| `key` | `string` | **是** | 资源 Key (通过上传接口获取) | - |
|
|
43
|
+
| `format` | `string` | 否 | 文件格式 (`jpg/png/webp` 等) | - |
|
|
44
44
|
|
|
45
45
|
### 复杂对象:PlatformDataItem
|
|
46
46
|
| 字段名 | 类型 | 必填 | 说明 | 默认值 |
|
|
@@ -64,31 +64,31 @@
|
|
|
64
64
|
"platforms": ["百家号"],
|
|
65
65
|
"publishArgs": {
|
|
66
66
|
"accountForms": [
|
|
67
|
-
{
|
|
68
|
-
"platformAccountId": "acc_bjh_it_001",
|
|
69
|
-
"cover": {
|
|
70
|
-
"key": "img_key_123",
|
|
71
|
-
"size": 102400,
|
|
72
|
-
"width": 800,
|
|
73
|
-
"height": 600
|
|
74
|
-
},
|
|
75
|
-
"coverKey": "img_key_123",
|
|
76
|
-
"contentPublishForm": {
|
|
77
|
-
"formType": "task",
|
|
78
|
-
"title": "百家号图文标题",
|
|
79
|
-
"description": "<p>内容摘要 <topic text='科技' raw='{\"yixiaoerId\":\"123\",\"yixiaoerName\":\"科技\",\"raw\":{\"id\":\"xxx\",\"topic\":\"科技\"}}'>#科技</topic></p>",
|
|
80
|
-
"images": [
|
|
81
|
-
{
|
|
82
|
-
"key": "img_key_123",
|
|
83
|
-
"size": 102400,
|
|
84
|
-
"width": 800,
|
|
85
|
-
"height": 600,
|
|
86
|
-
"format": "jpg"
|
|
87
|
-
}
|
|
88
|
-
],
|
|
89
|
-
"pubType": 1,
|
|
90
|
-
"declaration": 0
|
|
91
|
-
}
|
|
67
|
+
{
|
|
68
|
+
"platformAccountId": "acc_bjh_it_001",
|
|
69
|
+
"cover": {
|
|
70
|
+
"key": "img_key_123",
|
|
71
|
+
"size": 102400,
|
|
72
|
+
"width": 800,
|
|
73
|
+
"height": 600
|
|
74
|
+
},
|
|
75
|
+
"coverKey": "img_key_123",
|
|
76
|
+
"contentPublishForm": {
|
|
77
|
+
"formType": "task",
|
|
78
|
+
"title": "百家号图文标题",
|
|
79
|
+
"description": "<p>内容摘要 <topic text='科技' raw='{\"yixiaoerId\":\"123\",\"yixiaoerName\":\"科技\",\"raw\":{\"id\":\"xxx\",\"topic\":\"科技\"}}'>#科技</topic></p>",
|
|
80
|
+
"images": [
|
|
81
|
+
{
|
|
82
|
+
"key": "img_key_123",
|
|
83
|
+
"size": 102400,
|
|
84
|
+
"width": 800,
|
|
85
|
+
"height": 600,
|
|
86
|
+
"format": "jpg"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"pubType": 1,
|
|
90
|
+
"declaration": 0
|
|
91
|
+
}
|
|
92
92
|
}
|
|
93
93
|
]
|
|
94
94
|
}
|
|
@@ -99,4 +99,4 @@
|
|
|
99
99
|
|
|
100
100
|
| 目标数据 | 对应 Action | 相关文档 |
|
|
101
101
|
| :--- | :--- | :--- |
|
|
102
|
-
| `images.key` / `coverKey` | `upload` | [资源上传](../../upload-resource.md) |
|
|
102
|
+
| `images.key` / `coverKey` | `upload` | [资源上传](../../upload-resource.md) |
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Facebook 视频发布
|
|
2
|
+
|
|
3
|
+
> [!IMPORTANT]
|
|
4
|
+
> 先阅读 [视频发布首页](./index.md) 的标准 Payload 结构。本页仅说明 `contentPublishForm` 内的平台字段。
|
|
5
|
+
|
|
6
|
+
## contentPublishForm 字段
|
|
7
|
+
|
|
8
|
+
| 字段名 | 类型 | 必填 | 说明 | 默认值 |
|
|
9
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
10
|
+
| `formType` | string | 是 | 固定为 `task` | `task` |
|
|
11
|
+
| `title` | string | 否 | 视频标题,最多 128 字符 | - |
|
|
12
|
+
| `description` | string | 否 | 视频描述,最多 2048 字符 | - |
|
|
13
|
+
|
|
14
|
+
`thumbnail` 和 `videoKey` 是前端中间态字段;CLI 发布时应使用 `yxer upload` 后的 `accountForms[].video`、`accountForms[].cover` 和 `coverKey`。
|
|
15
|
+
|
|
16
|
+
## 示例
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"action": "publish",
|
|
21
|
+
"publishType": "video",
|
|
22
|
+
"platforms": ["Facebook"],
|
|
23
|
+
"publishArgs": {
|
|
24
|
+
"accountForms": [
|
|
25
|
+
{
|
|
26
|
+
"platformAccountId": "FACEBOOK_ACC_ID",
|
|
27
|
+
"video": { "key": "video_key", "size": 1024000, "width": 1920, "height": 1080 },
|
|
28
|
+
"contentPublishForm": {
|
|
29
|
+
"formType": "task",
|
|
30
|
+
"title": "Campaign video",
|
|
31
|
+
"description": "Campaign story"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
@@ -140,9 +140,13 @@
|
|
|
140
140
|
| :--- | :--- | :--- |
|
|
141
141
|
| **头条号** | `Toutiaohao` | [toutiaohao.md](./toutiaohao.md) |
|
|
142
142
|
| **哔哩哔哩** | `Bilibili` | [bilibili.md](./bilibili.md) |
|
|
143
|
-
| **抖音** | `Douyin` | [douyin.md](./douyin.md) |
|
|
144
|
-
| **视频号** | `Shipinhao` | [shipinhao.md](./shipinhao.md) |
|
|
145
|
-
|
|
|
143
|
+
| **抖音** | `Douyin` | [douyin.md](./douyin.md) |
|
|
144
|
+
| **视频号** | `Shipinhao` | [shipinhao.md](./shipinhao.md) |
|
|
145
|
+
| **TikTok** | `Tiktok` | [tiktok.md](./tiktok.md) |
|
|
146
|
+
| **Youtube** | `Youtube` | [youtube.md](./youtube.md) |
|
|
147
|
+
| **Facebook** | `Facebook` | [facebook.md](./facebook.md) |
|
|
148
|
+
| **Instagram** | `Instagram` | [instagram.md](./instagram.md) |
|
|
149
|
+
| ... | ... | ... |
|
|
146
150
|
|
|
147
151
|
## 4. 通用规则 (Common DTO Rules)
|
|
148
152
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Instagram 视频发布
|
|
2
|
+
|
|
3
|
+
> [!IMPORTANT]
|
|
4
|
+
> 先阅读 [视频发布首页](./index.md) 的标准 Payload 结构。本页仅说明 `contentPublishForm` 内的平台字段。
|
|
5
|
+
|
|
6
|
+
## contentPublishForm 字段
|
|
7
|
+
|
|
8
|
+
| 字段名 | 类型 | 必填 | 说明 | 默认值 |
|
|
9
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
10
|
+
| `formType` | string | 是 | 固定为 `task` | `task` |
|
|
11
|
+
| `description` | string | 否 | 视频描述,最多 2200 字符 | - |
|
|
12
|
+
| `share_to_feed` | boolean | 否 | 是否分享到动态 | `false` |
|
|
13
|
+
|
|
14
|
+
`thumbnail` 和 `videoKey` 是前端中间态字段;CLI 发布时应使用 `yxer upload` 后的 `accountForms[].video`、`accountForms[].cover` 和 `coverKey`。
|
|
15
|
+
|
|
16
|
+
> [!CAUTION]
|
|
17
|
+
> Instagram 是 Meta 容器式发布。Meta 会在“创建发布容器”阶段主动下载 `accountForms[].video.key` 对应的媒体 URL。若上传资源的原文件名或最终 key 路径含中文等非 ASCII 字符,Meta 可能直接返回 HTTP 400,导致容器创建失败。处理方式是把原视频改成英文文件名后重新执行 `yxer upload`,再更新 payload 中的 `video.key`。
|
|
18
|
+
|
|
19
|
+
## 示例
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"action": "publish",
|
|
24
|
+
"publishType": "video",
|
|
25
|
+
"platforms": ["Instagram"],
|
|
26
|
+
"publishArgs": {
|
|
27
|
+
"accountForms": [
|
|
28
|
+
{
|
|
29
|
+
"platformAccountId": "INSTAGRAM_ACC_ID",
|
|
30
|
+
"video": { "key": "video_key", "size": 1024000, "width": 1080, "height": 1920 },
|
|
31
|
+
"contentPublishForm": {
|
|
32
|
+
"formType": "task",
|
|
33
|
+
"description": "New reel",
|
|
34
|
+
"share_to_feed": false
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# TikTok 视频发布
|
|
2
|
+
|
|
3
|
+
> [!IMPORTANT]
|
|
4
|
+
> 先阅读 [视频发布首页](./index.md) 的标准 Payload 结构。本页仅说明 `contentPublishForm` 内的平台字段。
|
|
5
|
+
|
|
6
|
+
## contentPublishForm 字段
|
|
7
|
+
|
|
8
|
+
| 字段名 | 类型 | 必填 | 说明 | 默认值 |
|
|
9
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
10
|
+
| `formType` | string | 是 | 固定为 `task` | `task` |
|
|
11
|
+
| `description` | string | 是 | 视频描述,最多 2200 字符 | - |
|
|
12
|
+
| `visible` | string | 否 | 可见性:`public`、`friends`、`private` | `public` |
|
|
13
|
+
| `comment` | boolean | 否 | 是否允许评论 | `true` |
|
|
14
|
+
| `stitch` | boolean | 否 | 是否允许 Stitch | `true` |
|
|
15
|
+
| `duet` | boolean | 否 | 是否允许 Duet | `true` |
|
|
16
|
+
| `aigc` | boolean | 否 | 是否 AI 生成内容 | `false` |
|
|
17
|
+
| `business` | boolean | 否 | 是否品牌与商业合作披露 | `false` |
|
|
18
|
+
| `yourOwn` | boolean | 否 | 是否你的品牌 | `false` |
|
|
19
|
+
| `collaborative` | boolean | 否 | 是否合作品牌 | `false` |
|
|
20
|
+
| `fps` | number | 否 | 封面帧毫秒偏移;也可在 `accountForms[]` 层填写 | `10` |
|
|
21
|
+
| `isAdVideo` | boolean | 否 | 是否广告视频 | `false` |
|
|
22
|
+
|
|
23
|
+
`thumbnail` 和 `videoKey` 是前端中间态字段;CLI 发布时应使用 `yxer upload` 后的 `accountForms[].video`、`accountForms[].cover` 和 `coverKey`。
|
|
24
|
+
|
|
25
|
+
## 示例
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"action": "publish",
|
|
30
|
+
"publishType": "video",
|
|
31
|
+
"platforms": ["TikTok"],
|
|
32
|
+
"publishArgs": {
|
|
33
|
+
"accountForms": [
|
|
34
|
+
{
|
|
35
|
+
"platformAccountId": "TIKTOK_ACC_ID",
|
|
36
|
+
"video": { "key": "video_key", "size": 1024000, "width": 1080, "height": 1920 },
|
|
37
|
+
"contentPublishForm": {
|
|
38
|
+
"formType": "task",
|
|
39
|
+
"description": "A short product demo",
|
|
40
|
+
"visible": "public",
|
|
41
|
+
"comment": true,
|
|
42
|
+
"stitch": true,
|
|
43
|
+
"duet": true,
|
|
44
|
+
"fps": 10
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Youtube 视频发布
|
|
2
|
+
|
|
3
|
+
> [!IMPORTANT]
|
|
4
|
+
> 先阅读 [视频发布首页](./index.md) 的标准 Payload 结构。本页仅说明 `contentPublishForm` 内的平台字段。
|
|
5
|
+
|
|
6
|
+
## contentPublishForm 字段
|
|
7
|
+
|
|
8
|
+
| 字段名 | 类型 | 必填 | 说明 | 默认值 |
|
|
9
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
10
|
+
| `formType` | string | 是 | 固定为 `task` | `task` |
|
|
11
|
+
| `title` | string | 是 | 视频标题,最多 100 字符 | - |
|
|
12
|
+
| `description` | string | 否 | 视频简介,最多 5000 字符 | - |
|
|
13
|
+
| `tags` | string[] | 否 | 标签列表 | `[]` |
|
|
14
|
+
| `category` | string | 否 | 分类 ID:`1`,`2`,`10`,`15`,`17`,`19`,`20`,`22`,`23`,`24`,`25`,`26`,`27`,`28`,`29` | `22` |
|
|
15
|
+
| `license` | string | 否 | `youtube` 或 `creativeCommon` | `youtube` |
|
|
16
|
+
| `embeddable` | boolean | 否 | 是否允许嵌入 | `true` |
|
|
17
|
+
| `madeForKids` | boolean | 否 | 是否面向儿童 | `false` |
|
|
18
|
+
| `visible` | string | 否 | 公开范围:`public`、`unlisted`、`private` | `public` |
|
|
19
|
+
| `containsSyntheticMedia` | boolean | 否 | 是否包含逼真的加工或合成内容 | `false` |
|
|
20
|
+
| `fps` | number | 否 | 封面帧毫秒偏移;也可在 `accountForms[]` 层填写 | `10` |
|
|
21
|
+
|
|
22
|
+
`thumbnail` 和 `videoKey` 是前端中间态字段;CLI 发布时应使用 `yxer upload` 后的 `accountForms[].video`、`accountForms[].cover` 和 `coverKey`。
|
|
23
|
+
|
|
24
|
+
## 示例
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"action": "publish",
|
|
29
|
+
"publishType": "video",
|
|
30
|
+
"platforms": ["Youtube"],
|
|
31
|
+
"publishArgs": {
|
|
32
|
+
"accountForms": [
|
|
33
|
+
{
|
|
34
|
+
"platformAccountId": "YOUTUBE_ACC_ID",
|
|
35
|
+
"video": { "key": "video_key", "size": 1024000, "width": 1920, "height": 1080 },
|
|
36
|
+
"cover": { "key": "cover_key", "size": 204800, "width": 1280, "height": 720 },
|
|
37
|
+
"coverKey": "cover_key",
|
|
38
|
+
"contentPublishForm": {
|
|
39
|
+
"formType": "task",
|
|
40
|
+
"title": "Launch recap",
|
|
41
|
+
"description": "Highlights from the launch",
|
|
42
|
+
"category": "22",
|
|
43
|
+
"license": "youtube",
|
|
44
|
+
"visible": "public",
|
|
45
|
+
"embeddable": true,
|
|
46
|
+
"madeForKids": false,
|
|
47
|
+
"containsSyntheticMedia": false
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
@@ -49,19 +49,20 @@
|
|
|
49
49
|
为指定账号设置代理信息。
|
|
50
50
|
|
|
51
51
|
### 参数定义 (Parameters)
|
|
52
|
-
| 字段名 | 类型 | 是否必填 | 描述 |
|
|
53
|
-
| :--- | :--- | :--- | :--- |
|
|
54
|
-
| `action` | `string` | **是** | 固定值:`update
|
|
55
|
-
| `account_id` | `string` | **是** | 平台的账号 ID |
|
|
52
|
+
| 字段名 | 类型 | 是否必填 | 描述 |
|
|
53
|
+
| :--- | :--- | :--- | :--- |
|
|
54
|
+
| `action` | `string` | **是** | 固定值:`accounts.update` |
|
|
55
|
+
| `account_id` | `string` | **是** | 平台的账号 ID |
|
|
56
56
|
| `proxyId` | `string` | 否 | 团队代理 ID |
|
|
57
57
|
| `kuaidailiArea` | `string` | 否 | 内置代理地区编码。直辖市取一级 `code`,普通城市取 `cities` 下的 `code`。 |
|
|
58
58
|
| `remark` | `string` | 否 | 账号备注 |
|
|
59
59
|
| `groups` | `string[]` | 否 | 分组 ID 列表 |
|
|
60
60
|
|
|
61
|
-
### 执行逻辑 (Logic Flow)
|
|
62
|
-
1. **前置查询**:必须先获得目标 `account_id` 及代理 `id`/`code`。
|
|
63
|
-
2.
|
|
64
|
-
3.
|
|
61
|
+
### 执行逻辑 (Logic Flow)
|
|
62
|
+
1. **前置查询**:必须先获得目标 `account_id` 及代理 `id`/`code`。
|
|
63
|
+
2. **预览请求**:先执行 `yxer accounts update <account_id> ... --dry-run`,检查返回的 `action: "accounts.update.dry-run"` 和 `data.request`。
|
|
64
|
+
3. **更新执行**:确认无误后执行 `yxer accounts update <account_id> ...`,成功输出 `action: "accounts.update"`。
|
|
65
|
+
4. **验证反馈**:确认账号代理详情已变更。
|
|
65
66
|
|
|
66
67
|
## 注意事项
|
|
67
68
|
- 云发布环境下,未设置代理的账号可能会导致任务执行失败。
|