@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.
Files changed (40) hide show
  1. package/README.md +13 -4
  2. package/checksums.txt +6 -6
  3. package/package.json +3 -3
  4. package/references/platforms/article/toutiaohao.md +3 -1
  5. package/references/platforms/imageText/toutiaohao.md +3 -1
  6. package/references/platforms/video/toutiaohao.md +3 -1
  7. package/references/upload-resource.md +72 -70
  8. package/references/workflows/common-rules.md +291 -289
  9. package/schemas/platforms/acfun.video.schema.json +139 -139
  10. package/schemas/platforms/aiqiyi.article.schema.json +29 -29
  11. package/schemas/platforms/aiqiyi.video.schema.json +154 -154
  12. package/schemas/platforms/bilibili.article.schema.json +109 -109
  13. package/schemas/platforms/bilibili.video.schema.json +175 -175
  14. package/schemas/platforms/chejiahao.video.schema.json +111 -111
  15. package/schemas/platforms/csdn.article.schema.json +106 -106
  16. package/schemas/platforms/dayuhao.article.schema.json +106 -106
  17. package/schemas/platforms/douban.article.schema.json +48 -48
  18. package/schemas/platforms/jianshu.article.schema.json +33 -33
  19. package/schemas/platforms/meiyou.video.schema.json +96 -96
  20. package/schemas/platforms/pipixia.video.schema.json +94 -94
  21. package/schemas/platforms/qiehao.article.schema.json +89 -89
  22. package/schemas/platforms/qiehao.video.schema.json +147 -147
  23. package/schemas/platforms/souhuhao.article.schema.json +73 -73
  24. package/schemas/platforms/toutiaohao.article.schema.json +6 -10
  25. package/schemas/platforms/toutiaohao.imageText.schema.json +5 -2
  26. package/schemas/platforms/toutiaohao.video.schema.json +6 -3
  27. package/schemas/platforms/weishi.video.schema.json +101 -101
  28. package/schemas/platforms/xinlang.article.schema.json +69 -69
  29. package/schemas/platforms/xueqiuhao.article.schema.json +84 -84
  30. package/schemas/platforms/yichehao.article.schema.json +140 -140
  31. package/schemas/platforms/yichehao.video.schema.json +101 -101
  32. package/schemas/platforms/zhihu.article.schema.json +104 -104
  33. package/schemas/platforms/zhihu.imageText.schema.json +61 -61
  34. package/schemas/platforms/zhihu.video.schema.json +144 -144
  35. package/skills/yixiaoer/SKILL.md +98 -98
  36. package/skills/yixiaoer/references/platforms/article/toutiaohao.md +3 -1
  37. package/skills/yixiaoer/references/platforms/imageText/toutiaohao.md +3 -1
  38. package/skills/yixiaoer/references/platforms/video/toutiaohao.md +3 -1
  39. package/skills/yixiaoer/references/upload-resource.md +72 -70
  40. package/skills/yixiaoer/references/workflows/common-rules.md +291 -289
package/README.md CHANGED
@@ -8,8 +8,6 @@ Packaged `yxer` CLI for global npm installation.
8
8
  npm install -g @yixiaoermail/cli
9
9
  ```
10
10
 
11
- The npm package installs a lightweight launcher. During install or first run it downloads the matching platform binary from `https://yixiaoer-lite-asserts.tos-cn-shanghai.volces.com/yxer/releases/v<version>/`.
12
-
13
11
  ## Verify
14
12
 
15
13
  ```bash
@@ -28,7 +26,7 @@ Use `yxer skill sync --global` if your host expects a global skill install.
28
26
 
29
27
  ## Release Packaging
30
28
 
31
- This package expects assets in the versioned TOS directory named like:
29
+ This package expects assets in the versioned TOS directory named like:
32
30
 
33
31
  ```text
34
32
  yxer-cli-<version>-windows-amd64.zip
@@ -42,4 +40,15 @@ checksums.txt
42
40
 
43
41
  To override the versioned download directory, set `YXER_DOWNLOAD_BASE_URL` before installation.
44
42
 
45
- Release builds and publishing are performed from the repository owner's local machine with `scripts/publish-release.ps1`. The script previews by default; pass `-Execute` only after reviewing the TOS and npm dry-run output.
43
+ Release builds and publication run locally. GitLab tags mark the source version and do not trigger CLI build or publication jobs. The package name and download root remain tracked in `npm/package.json`.
44
+
45
+ For local releases, use `scripts/publish-release.ps1` from the `yixiaoer-skill` directory. The script previews by default; pass `-Execute` only after reviewing the TOS and npm dry-run output.
46
+
47
+ From the `yixiaoer-universal` repository root, use these package scripts:
48
+
49
+ ```bash
50
+ npm run release:cli:dryrun
51
+ npm run release:cli
52
+ ```
53
+
54
+ These commands require Go, Node.js/npm, AWS CLI, and curl on `PATH`. The Node.js launcher prefers PowerShell 7 (`pwsh`), also checks its standard installation directory on Windows, and falls back to built-in Windows PowerShell when PowerShell 7 is unavailable. macOS/Linux require `pwsh` on `PATH`. Keep the version in `internal/domain/response.go` consistent with `skills/yixiaoer/SKILL.md` and use an unpublished version. Fill the three credential files in `yixiaoer-skill/.local-release`: `TOS_ACCESS_KEY_ID.txt`, `TOS_SECRET_ACCESS_KEY.txt`, and `NPM_TOKEN.txt`, each with a single raw value. Environment variables take precedence over these files. The release command runs tests, builds all six platform archives and the npm package, verifies artifacts, uploads to TOS, verifies downloads, and publishes npm automatically. Outputs are written to `yixiaoer-skill/out/release` and `yixiaoer-skill/out/npm`.
package/checksums.txt CHANGED
@@ -1,6 +1,6 @@
1
- 9df0978fc301c7d5e9d5d6522479d84ddad282bc6a79d82238c31d0041dad503 yxer-cli-3.2.25-windows-amd64.zip
2
- 75ac2b129f23fa864a836baa907a7687d6595605d545ac48116d414695dcdb62 yxer-cli-3.2.25-windows-arm64.zip
3
- b2f1983018b354423aacd7747dd906b4582b679889178419fe12cfddd408c90a yxer-cli-3.2.25-darwin-amd64.tar.gz
4
- c45761103681bee0246f3c5ae98e1cfb7ee706739a3ff5003253e3e622c5ce85 yxer-cli-3.2.25-darwin-arm64.tar.gz
5
- d7a9614ddc945da3954a2f56ca309fbebe1c6f3f4e4c555b8704192850cfb125 yxer-cli-3.2.25-linux-amd64.tar.gz
6
- 7d9593fc1b1e85ca25832c2002766644dae232186eeec85602a0fa2741c74ba2 yxer-cli-3.2.25-linux-arm64.tar.gz
1
+ 9f874fc789bb2757fb75658a589aa54fdd2536d09c112afc4cf3dbee2d0b7303 yxer-cli-3.2.27-windows-amd64.zip
2
+ 3cd00d785528deb4df00ab158691511e3b04cec8faa39bc77a92bda1039c5de3 yxer-cli-3.2.27-windows-arm64.zip
3
+ 040efbd8c7e6abad345f599a593dee7c8571e47c45b5886f0ef4a00d63f5d303 yxer-cli-3.2.27-darwin-amd64.tar.gz
4
+ 05bff6e9be2707ea8bd8ff2f1d5d48d096e833f1fdfc04befa370245d852679d yxer-cli-3.2.27-darwin-arm64.tar.gz
5
+ 8c819cace3a19fe44f3d188ab23353f8dd554e2b44df005124ff1593559a75fd yxer-cli-3.2.27-linux-amd64.tar.gz
6
+ fbdc2658f0b05451d981d2ff727f981dd5ffe72d55286b1aaa73f31bc2a79bea yxer-cli-3.2.27-linux-arm64.tar.gz
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
- {
1
+ {
2
2
  "name": "@yixiaoermail/cli",
3
- "version": "3.2.25",
3
+ "version": "3.2.27",
4
4
  "yxerDownloadRootUrl": "https://yixiaoer-lite-asserts.tos-cn-shanghai.volces.com/yxer/releases",
5
5
  "description": "Yixiaoer CLI packaged for npm global installation",
6
6
  "bin": {
@@ -28,4 +28,4 @@
28
28
  "engines": {
29
29
  "node": "\u003e=18"
30
30
  }
31
- }
31
+ }
@@ -31,9 +31,11 @@
31
31
  | `location` | `Object` | 否 | 位置对象 (`PlatformDataItem`) | - |
32
32
  | `scheduledTime` | `number` | 否 | 定时发布时间 (13 位 Unix 时间戳,单位: 毫秒) | - |
33
33
  | `advertisement` | `number` | 否 | 广告投放收益: 2-无收益, 3-投放广告赚收益 | `3` |
34
- | `declaration`| `number` | 否 | 创作类型 1:自行拍摄 2:取自站外 3:AI生成 6:虚构演绎 7:投资观点 8:健康医疗 | - |
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` | 否 | 创作类型 1:自行拍摄 2:取自站外 3:AI生成 6:虚构演绎,故事经历 7:投资观点,仅供参考 8:健康医疗分享,仅供参考 | - |
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` | 否 | 创作者申明:1-自行拍摄, 2-取自站外, 3-AI生成, 6-虚构演绎故事经历, 7-投资观点仅供参考, 8-健康医疗分享仅供参考 | - |
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
- > [!IMPORTANT]
35
- > **视频号 512KB 图片限制**:
36
- > 上传视频号视频封面或视频号图文图片时,必须带平台用途参数:
37
- > `yxer upload <图片路径或URL> --platform 视频号 --usage cover` 或 `--usage image`。
38
- > 当图片超过 512KB 时,CLI 会在内部压缩后再上传,并在 JSON 返回中标记 `compressed: true`、`originalSize` 和压缩后的 `size`;后续 payload 必须使用这次上传返回的完整对象。
39
-
40
- > [!IMPORTANT]
41
- > **Instagram / Meta 兼容性**:
42
- > 若后续要发 Instagram 视频,原视频文件名不要使用中文、空格或其它非 ASCII 字符。Meta 会主动回拉蚁小二返回的媒体 URL;若 URL 路径中带中文,Meta 下载器可能直接返回 HTTP 400,导致“创建发布容器失败 / The media could not be fetched from the provided URI”。
43
-
44
- ## 输出结果 (Output)
45
-
46
- 输出生成的资源标识,供发布脚本引用:
47
- ```json
48
- {
49
- "key": "cloud-publish/2026/03/26/66b2xxx/xxx.jpg",
50
- "name": "xxx.jpg",
51
- "bucket": "cloud-publish"
52
- }
53
- ```
54
- **注意**: 封面/媒体字段使用返回对象中的 `key`;如果资源要出现在 HTML `<img src>` 中,不能把裸 `key` 当成浏览器地址,必须通过文章导入/正文图片物化流程换成稳定 URL。
55
-
56
- ## 调用指令 (Command)
57
-
58
- ```bash
59
- yxer upload https://example.com/image.jpg --bucket cloud-publish
60
- yxer upload ./cover.png --platform 视频号 --usage cover
61
- ```
62
-
63
- > [!IMPORTANT]
64
- > **发布合规性提醒**:
65
- > 所有的封面图、图文图片、视频文件均**严禁直接使用外部网络 URL**,必须通过本项目提供的上传接口进行处理并获取 `key` 后进行发布。不遵守此规范将直接导致任务失败。
66
-
67
- > [!CAUTION]
68
- > **ContentType 签名一致性**:
69
- > 在上传资源时,必须确保获取上传地址所传入的 `contentType` 参数与 PUT 请求实际发送的 `Content-Type` Header **完全一致**。
70
-
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
+