@yixiaoermail/cli 3.1.0 → 3.1.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/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 +1 -1
- package/skills/yixiaoer/SKILL.md +1 -1
- package/skills/yixiaoer/plugin.json +1 -1
- package/skills/yixiaoer/references/platforms/article/toutiaohao.md +28 -28
- package/skills/yixiaoer/references/platforms/imageText/baijiahao.md +41 -30
package/dist/yxer-darwin-amd64
CHANGED
|
Binary file
|
package/dist/yxer-darwin-arm64
CHANGED
|
Binary file
|
package/dist/yxer-linux-amd64
CHANGED
|
Binary file
|
package/dist/yxer-linux-arm64
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/skills/yixiaoer/SKILL.md
CHANGED
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
> **前提条件 (Prerequisite)**:
|
|
5
5
|
> 在使用本平台的特定参数之前,你 **必须** 已经阅读并理解了 [文章发布首页 (Index)](./index.md) 中定义的 Payload 根结构。本页仅描述 `contentPublishForm` 内部的平台差异化字段。
|
|
6
6
|
|
|
7
|
-
## 触发场景 (Trigger)
|
|
8
|
-
- **意图辨析**:用户指定在“今日头条 (头条号)”发布长文章或新闻资讯,且需要配置如“广告收益 (Advertisement)”、“头条首发”、“地点挂载”或“创作者申明”等头条特有商业与分发逻辑时。
|
|
9
|
-
- **典型提示词**:
|
|
10
|
-
- “发一篇今日头条的文章,开启广告收益模式”
|
|
11
|
-
- “头条文章发布,声明是我的原创首发内容”
|
|
12
|
-
- “在头条文章里加上我所在的物理位置”
|
|
13
|
-
- “帮我同步这个图文到头条号并存为草稿”
|
|
7
|
+
## 触发场景 (Trigger)
|
|
8
|
+
- **意图辨析**:用户指定在“今日头条 (头条号)”发布长文章或新闻资讯,且需要配置如“广告收益 (Advertisement)”、“头条首发”、“地点挂载”或“创作者申明”等头条特有商业与分发逻辑时。
|
|
9
|
+
- **典型提示词**:
|
|
10
|
+
- “发一篇今日头条的文章,开启广告收益模式”
|
|
11
|
+
- “头条文章发布,声明是我的原创首发内容”
|
|
12
|
+
- “在头条文章里加上我所在的物理位置”
|
|
13
|
+
- “帮我同步这个图文到头条号并存为草稿”
|
|
14
14
|
|
|
15
|
-
## 执行逻辑 (Logic Flow)
|
|
16
|
-
1. **封面适配**:头条号对封面 (`covers`) 数量有严格要求(1 张或 3 张)。
|
|
17
|
-
2. **位置检索**:若需精准挂载位置,调用 `locations` 接口获取 DTO。
|
|
18
|
-
3. **收益装配**:根据意图注入 `advertisement: 3`(赚取收益)或 `2`(不投放广告)。
|
|
19
|
-
4. **参数装配**:构造 `accountForms[i].contentPublishForm`。
|
|
20
|
-
5. **指令执行**:先执行 `yxer validate <platform> <type> <payload.json>`,再执行 `yxer publish <type> <platform> <payload.json> [clientId]`。
|
|
15
|
+
## 执行逻辑 (Logic Flow)
|
|
16
|
+
1. **封面适配**:头条号对封面 (`covers`) 数量有严格要求(1 张或 3 张)。
|
|
17
|
+
2. **位置检索**:若需精准挂载位置,调用 `locations` 接口获取 DTO。
|
|
18
|
+
3. **收益装配**:根据意图注入 `advertisement: 3`(赚取收益)或 `2`(不投放广告)。
|
|
19
|
+
4. **参数装配**:构造 `accountForms[i].contentPublishForm`。
|
|
20
|
+
5. **指令执行**:先执行 `yxer validate <platform> <type> <payload.json>`,再执行 `yxer publish <type> <platform> <payload.json> [clientId]`。
|
|
21
21
|
|
|
22
22
|
## 1. contentPublishForm 参数定义
|
|
23
23
|
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
| `title` | `string` | **是** | 文章标题 (1-50 字符) | - |
|
|
28
28
|
| `content` | `string` | **是** | 文章内容 (HTML 字符串,最多 50000 字符) | - |
|
|
29
29
|
| `covers` | `Array` | **是** | 文章封面列表 (`OldCover[]`, 1-9 张) | - |
|
|
30
|
-
| `isFirst` | `boolean` | 否 | 是否头条首发 | `false` |
|
|
31
|
-
| `location` | `Object` | 否 | 位置对象 (`PlatformDataItem`) | - |
|
|
32
|
-
| `scheduledTime` | `number` | 否 | 定时发布时间 (13 位 Unix 时间戳,单位: 毫秒) | - |
|
|
33
|
-
| `advertisement` | `number` | 否 | 广告投放收益: 2-无收益, 3-投放广告赚收益 | `3` |
|
|
34
|
-
| `declaration`| `number` | 否 | 创作类型 1:自行拍摄 2:取自站外 3:AI生成 6:虚构演绎 7:投资观点 8:健康医疗 | - |
|
|
35
|
-
| `pubType` | `number` | **是** | 发布类型: 0-草稿, 1-直接发布 | 1 |
|
|
30
|
+
| `isFirst` | `boolean` | 否 | 是否头条首发 | `false` |
|
|
31
|
+
| `location` | `Object` | 否 | 位置对象 (`PlatformDataItem`) | - |
|
|
32
|
+
| `scheduledTime` | `number` | 否 | 定时发布时间 (13 位 Unix 时间戳,单位: 毫秒) | - |
|
|
33
|
+
| `advertisement` | `number` | 否 | 广告投放收益: 2-无收益, 3-投放广告赚收益 | `3` |
|
|
34
|
+
| `declaration`| `number` | 否 | 创作类型 1:自行拍摄 2:取自站外 3:AI生成 6:虚构演绎 7:投资观点 8:健康医疗 | - |
|
|
35
|
+
| `pubType` | `number` | **是** | 发布类型: 0-草稿, 1-直接发布 | 1 |
|
|
36
36
|
|
|
37
37
|
## 2. Payload 完整示例
|
|
38
38
|
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"covers": [
|
|
53
53
|
{ "key": "cover_key_001", "width": 800, "height": 600, "size": 150000 }
|
|
54
54
|
],
|
|
55
|
-
"advertisement": 3,
|
|
56
|
-
"isFirst": true,
|
|
57
|
-
"pubType": 1
|
|
58
|
-
}
|
|
59
|
-
}
|
|
55
|
+
"advertisement": 3,
|
|
56
|
+
"isFirst": true,
|
|
57
|
+
"pubType": 1
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
60
|
]
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -67,12 +67,12 @@
|
|
|
67
67
|
### 3.1 OldCover
|
|
68
68
|
包含 `key`, `size`, `width`, `height`。
|
|
69
69
|
|
|
70
|
-
### 3.2 PlatformDataItem (位置信息)
|
|
71
|
-
包含 `yixiaoerId`, `yixiaoerName`, `raw` (必须完整透传)。
|
|
70
|
+
### 3.2 PlatformDataItem (位置信息)
|
|
71
|
+
包含 `yixiaoerId`, `yixiaoerName`, `raw` (必须完整透传)。
|
|
72
72
|
|
|
73
73
|
## 相关接口
|
|
74
74
|
|
|
75
75
|
| 目标字段 | 对应 Action | 文档参考 |
|
|
76
76
|
| :--- | :--- | :--- |
|
|
77
|
-
| `location` | `locations` | [获取位置信息](../../get-locations.md) |
|
|
78
|
-
| `covers.key`| `upload` | [资源上传](../../upload-resource.md) |
|
|
77
|
+
| `location` | `locations` | [获取位置信息](../../get-locations.md) |
|
|
78
|
+
| `covers.key`| `upload` | [资源上传](../../upload-resource.md) |
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
- “同步这条动态到Baijiahao”
|
|
13
13
|
|
|
14
14
|
## 执行逻辑 (Logic Flow)
|
|
15
|
-
1. **资源校验**:确保所有图片均已上传并获得 Key。
|
|
16
|
-
2.
|
|
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,21 +25,22 @@
|
|
|
25
25
|
| `formType` | `string` | **是** | 固定值: `task` | `task` |
|
|
26
26
|
| `title` | `string` | **是** | 标题 (1-20 字符) | - |
|
|
27
27
|
| `description` | `string` | **是** | 图文描述,支持 HTML (`<p>`, `<topic>`)。 (1-1000 字符) | - |
|
|
28
|
-
| `
|
|
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
|
-
### 复杂对象:
|
|
37
|
-
| 字段名 | 类型 | 必填 | 说明 | 默认值 |
|
|
38
|
-
| :--- | :--- | :--- | :--- | :--- |
|
|
39
|
-
| `width` | `number` | **是** | 图片宽度 | - |
|
|
40
|
-
| `height` | `number` | **是** | 图片高度 | - |
|
|
41
|
-
| `size` | `number` | **是** | 文件大小 (Bytes) | - |
|
|
42
|
-
| `key` | `string` | **是** | 资源 Key (通过上传接口获取) | - |
|
|
36
|
+
### 复杂对象:OldImage
|
|
37
|
+
| 字段名 | 类型 | 必填 | 说明 | 默认值 |
|
|
38
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
39
|
+
| `width` | `number` | **是** | 图片宽度 | - |
|
|
40
|
+
| `height` | `number` | **是** | 图片高度 | - |
|
|
41
|
+
| `size` | `number` | **是** | 文件大小 (Bytes) | - |
|
|
42
|
+
| `key` | `string` | **是** | 资源 Key (通过上传接口获取) | - |
|
|
43
|
+
| `format` | `string` | 否 | 文件格式 (`jpg/png/webp` 等) | - |
|
|
43
44
|
|
|
44
45
|
### 复杂对象:PlatformDataItem
|
|
45
46
|
| 字段名 | 类型 | 必填 | 说明 | 默认值 |
|
|
@@ -63,21 +64,31 @@
|
|
|
63
64
|
"platforms": ["百家号"],
|
|
64
65
|
"publishArgs": {
|
|
65
66
|
"accountForms": [
|
|
66
|
-
{
|
|
67
|
-
"platformAccountId": "acc_bjh_it_001",
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
|
|
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
|
+
}
|
|
81
92
|
}
|
|
82
93
|
]
|
|
83
94
|
}
|
|
@@ -88,4 +99,4 @@
|
|
|
88
99
|
|
|
89
100
|
| 目标数据 | 对应 Action | 相关文档 |
|
|
90
101
|
| :--- | :--- | :--- |
|
|
91
|
-
| `images.key` | `upload` | [资源上传](../../upload-resource.md) |
|
|
102
|
+
| `images.key` / `coverKey` | `upload` | [资源上传](../../upload-resource.md) |
|