siluzan-cso-cli 1.1.20 → 1.1.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.
- package/dist/index.js +49 -17
- package/dist/skill/_meta.json +2 -2
- package/dist/skill/assets/publish-config-image.example.json +8 -1
- package/dist/skill/assets/publish-config.example.json +11 -2
- package/dist/skill/references/publish.md +27 -0
- package/dist/skill/references/task.md +6 -6
- package/dist/skill/scripts/install.ps1 +1 -1
- package/dist/skill/scripts/install.sh +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4115,6 +4115,17 @@ function buildPublishTitle(item, mediaType, override, isImagePost = false) {
|
|
|
4115
4115
|
const topicPosition = override?.topicPosition ?? item.topicPosition ?? defaultTopicPosition;
|
|
4116
4116
|
return { title, description, topics, topicPosition };
|
|
4117
4117
|
}
|
|
4118
|
+
function resolvePublishSchedule(item, override) {
|
|
4119
|
+
const publishMode = override?.publishMode ?? item.publishMode ?? "immediate";
|
|
4120
|
+
const rawPublishAt = override?.publishAt ?? item.publishAt;
|
|
4121
|
+
const publishAt = publishMode === "scheduled" ? rawPublishAt : void 0;
|
|
4122
|
+
const sendType = toSendType(publishMode);
|
|
4123
|
+
const publishAtUtc = publishAt ? new Date(publishAt).toISOString() : null;
|
|
4124
|
+
return { publishMode, publishAt, sendType, publishAtUtc };
|
|
4125
|
+
}
|
|
4126
|
+
function resolveVideoCover(item, override) {
|
|
4127
|
+
return override?.cover ?? item.cover;
|
|
4128
|
+
}
|
|
4118
4129
|
function buildImagePayload(img, currentUserId) {
|
|
4119
4130
|
return {
|
|
4120
4131
|
imageUrl: img.imageUrl,
|
|
@@ -4201,13 +4212,18 @@ function buildVideoChannels(videos, currentUserId) {
|
|
|
4201
4212
|
);
|
|
4202
4213
|
}
|
|
4203
4214
|
const mediaType = account.mediaAccountType;
|
|
4204
|
-
const sendType = toSendType(item.publishMode);
|
|
4205
|
-
const publishAtUtc = item.publishAt ? new Date(item.publishAt).toISOString() : null;
|
|
4206
|
-
if (item.publishMode === "scheduled" && !item.publishAt) {
|
|
4207
|
-
errorList.push(`\u89C6\u9891 "${item.videoName}" \u8BBE\u7F6E\u4E86\u5B9A\u65F6\u53D1\u5E03\u4F46\u672A\u586B\u5199 publishAt`);
|
|
4208
|
-
}
|
|
4209
|
-
if (sendType > itemSendType) itemSendType = sendType;
|
|
4210
4215
|
const override = item.platformOverrides?.[mediaType];
|
|
4216
|
+
const schedule = resolvePublishSchedule(item, override);
|
|
4217
|
+
if (schedule.publishMode === "scheduled" && !schedule.publishAt) {
|
|
4218
|
+
errorList.push(
|
|
4219
|
+
`\u89C6\u9891 "${item.videoName}" \u5728\u5E73\u53F0 ${mediaType} \u8BBE\u7F6E\u4E86\u5B9A\u65F6\u53D1\u5E03\u4F46\u672A\u586B\u5199 publishAt`
|
|
4220
|
+
);
|
|
4221
|
+
}
|
|
4222
|
+
if (schedule.sendType > itemSendType) itemSendType = schedule.sendType;
|
|
4223
|
+
const cover = resolveVideoCover(item, override);
|
|
4224
|
+
if (!cover?.imageUrl) {
|
|
4225
|
+
errorList.push(`\u89C6\u9891 "${item.videoName}" \u5728\u5E73\u53F0 ${mediaType} \u5C01\u9762\u53C2\u6570\u7F3A\u5931`);
|
|
4226
|
+
}
|
|
4211
4227
|
const publishTitle = buildPublishTitle(item, mediaType, override);
|
|
4212
4228
|
const youTubeVideoStatus = mediaType === "YouTube" ? {
|
|
4213
4229
|
privacyStatus: item.youtubePrivacy ?? "public",
|
|
@@ -4215,10 +4231,10 @@ function buildVideoChannels(videos, currentUserId) {
|
|
|
4215
4231
|
} : null;
|
|
4216
4232
|
const toBeSent = {
|
|
4217
4233
|
videoId: item.videoId,
|
|
4218
|
-
sendType,
|
|
4219
|
-
publishAt: publishAtUtc,
|
|
4234
|
+
sendType: schedule.sendType,
|
|
4235
|
+
publishAt: schedule.publishAtUtc,
|
|
4220
4236
|
publishTitle,
|
|
4221
|
-
publishCover: buildCoverPayload(
|
|
4237
|
+
publishCover: buildCoverPayload(cover, item.videoId, currentUserId),
|
|
4222
4238
|
youTubeVideoStatus
|
|
4223
4239
|
};
|
|
4224
4240
|
const accountInfo = {
|
|
@@ -4310,18 +4326,17 @@ function buildImageChannels(posts, currentUserId) {
|
|
|
4310
4326
|
);
|
|
4311
4327
|
}
|
|
4312
4328
|
const mediaType = account.mediaAccountType;
|
|
4313
|
-
const sendType = toSendType(item.publishMode);
|
|
4314
|
-
const publishAtUtc = item.publishAt ? new Date(item.publishAt).toISOString() : null;
|
|
4315
|
-
if (item.publishMode === "scheduled" && !item.publishAt) {
|
|
4316
|
-
errorList.push("\u56FE\u6587\u5E16\u5B50\u8BBE\u7F6E\u4E86\u5B9A\u65F6\u53D1\u5E03\u4F46\u672A\u586B\u5199 publishAt");
|
|
4317
|
-
}
|
|
4318
|
-
if (sendType > itemSendType) itemSendType = sendType;
|
|
4319
4329
|
const override = item.platformOverrides?.[mediaType];
|
|
4330
|
+
const schedule = resolvePublishSchedule(item, override);
|
|
4331
|
+
if (schedule.publishMode === "scheduled" && !schedule.publishAt) {
|
|
4332
|
+
errorList.push(`\u56FE\u6587\u5E16\u5B50\u5728\u5E73\u53F0 ${mediaType} \u8BBE\u7F6E\u4E86\u5B9A\u65F6\u53D1\u5E03\u4F46\u672A\u586B\u5199 publishAt`);
|
|
4333
|
+
}
|
|
4334
|
+
if (schedule.sendType > itemSendType) itemSendType = schedule.sendType;
|
|
4320
4335
|
const publishTitle = buildPublishTitle(item, mediaType, override, true);
|
|
4321
4336
|
const toBeSent = {
|
|
4322
4337
|
imageGroupId: vGuid,
|
|
4323
|
-
sendType,
|
|
4324
|
-
publishAt: publishAtUtc,
|
|
4338
|
+
sendType: schedule.sendType,
|
|
4339
|
+
publishAt: schedule.publishAtUtc,
|
|
4325
4340
|
publishTitle
|
|
4326
4341
|
};
|
|
4327
4342
|
const accountInfo = {
|
|
@@ -4420,6 +4435,17 @@ ${SEP}`);
|
|
|
4420
4435
|
if (override.description) console.log(` \u63CF\u8FF0\u8986\u76D6 \uFF1A${pt.description}`);
|
|
4421
4436
|
const ovTopics = formatTopics(override.topics);
|
|
4422
4437
|
if (ovTopics) console.log(` \u6807\u7B7E\u8986\u76D6 \uFF1A${ovTopics}`);
|
|
4438
|
+
const schedule = resolvePublishSchedule(item, override);
|
|
4439
|
+
if (override.publishMode || override.publishAt) {
|
|
4440
|
+
console.log(
|
|
4441
|
+
` \u53D1\u5E03\u8986\u76D6 \uFF1A${formatPublishMode(schedule.publishMode, schedule.publishAt)}`
|
|
4442
|
+
);
|
|
4443
|
+
}
|
|
4444
|
+
if (override.cover) {
|
|
4445
|
+
const cover = resolveVideoCover(item, override);
|
|
4446
|
+
console.log(` \u5C01\u9762\u8986\u76D6 \uFF1A${cover.imageUrl || "\u26A0\uFE0F \u672A\u8BBE\u7F6E"}`);
|
|
4447
|
+
if (cover.sourceImageId) console.log(` \u5C01\u9762 ID \uFF1A${cover.sourceImageId}`);
|
|
4448
|
+
}
|
|
4423
4449
|
}
|
|
4424
4450
|
for (const acc of accounts) {
|
|
4425
4451
|
console.log(` \xB7 ${acc.mediaCustomerName}\uFF08${acc.mediaCustomerId}\uFF09`);
|
|
@@ -4466,6 +4492,12 @@ ${SEP}`);
|
|
|
4466
4492
|
if (override.description) console.log(` \u63CF\u8FF0\u8986\u76D6 \uFF1A${pt.description}`);
|
|
4467
4493
|
const ovTopics = formatTopics(override.topics);
|
|
4468
4494
|
if (ovTopics) console.log(` \u6807\u7B7E\u8986\u76D6 \uFF1A${ovTopics}`);
|
|
4495
|
+
const schedule = resolvePublishSchedule(item, override);
|
|
4496
|
+
if (override.publishMode || override.publishAt) {
|
|
4497
|
+
console.log(
|
|
4498
|
+
` \u53D1\u5E03\u8986\u76D6 \uFF1A${formatPublishMode(schedule.publishMode, schedule.publishAt)}`
|
|
4499
|
+
);
|
|
4500
|
+
}
|
|
4469
4501
|
}
|
|
4470
4502
|
for (const acc of accounts) {
|
|
4471
4503
|
console.log(` \xB7 ${acc.mediaCustomerName}\uFF08${acc.mediaCustomerId}\uFF09`);
|
package/dist/skill/_meta.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"slug": "siluzan-cso",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"publishedAt":
|
|
3
|
+
"version": "1.1.22",
|
|
4
|
+
"publishedAt": 1780043982292,
|
|
5
5
|
"homepage": "https://www.siluzan.com",
|
|
6
6
|
"source": "https://dev.azure.com/jack4it/Sammamish/_git/siluzan-skill",
|
|
7
7
|
"requiredBinaries": [
|
|
@@ -32,7 +32,14 @@
|
|
|
32
32
|
],
|
|
33
33
|
|
|
34
34
|
"publishMode": "scheduled",
|
|
35
|
-
"publishAt": "2026-03-20T10:00:00+08:00"
|
|
35
|
+
"publishAt": "2026-03-20T10:00:00+08:00",
|
|
36
|
+
|
|
37
|
+
"platformOverrides": {
|
|
38
|
+
"Facebook": {
|
|
39
|
+
"publishMode": "scheduled",
|
|
40
|
+
"publishAt": "2026-03-20T15:00:00+08:00"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
36
43
|
}
|
|
37
44
|
]
|
|
38
45
|
}
|
|
@@ -43,7 +43,8 @@
|
|
|
43
43
|
}
|
|
44
44
|
],
|
|
45
45
|
|
|
46
|
-
"publishMode": "
|
|
46
|
+
"publishMode": "scheduled",
|
|
47
|
+
"publishAt": "2026-04-08T10:00:00+08:00",
|
|
47
48
|
|
|
48
49
|
"youtubePrivacy": "public",
|
|
49
50
|
|
|
@@ -52,7 +53,15 @@
|
|
|
52
53
|
"title": "YouTube 专用标题(≤100字)",
|
|
53
54
|
"description": "YouTube 专用描述",
|
|
54
55
|
"topics": ["YouTubeTopic"],
|
|
55
|
-
"topicPosition": 4
|
|
56
|
+
"topicPosition": 4,
|
|
57
|
+
"publishMode": "scheduled",
|
|
58
|
+
"publishAt": "2026-04-08T18:00:00+08:00",
|
|
59
|
+
"cover": {
|
|
60
|
+
"imageUrl": "https://cdn.example.com/cover-youtube.jpg",
|
|
61
|
+
"imageName": "cover-youtube.jpg",
|
|
62
|
+
"imageSourceType": 1,
|
|
63
|
+
"sourceImageId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
64
|
+
}
|
|
56
65
|
}
|
|
57
66
|
}
|
|
58
67
|
}
|
|
@@ -139,6 +139,8 @@ AI 可直接帮助润色:加钩子开头、适配平台风格、加 SEO 关键
|
|
|
139
139
|
|
|
140
140
|
**多平台不同时间发布**
|
|
141
141
|
|
|
142
|
+
全局 `publishMode` / `publishAt` 作为默认值;某平台需要不同时间时,在 `platformOverrides.<平台>` 中覆盖:
|
|
143
|
+
|
|
142
144
|
```json
|
|
143
145
|
"publishMode": "scheduled",
|
|
144
146
|
"publishAt": "2026-04-08T10:00:00+08:00",
|
|
@@ -150,6 +152,31 @@ AI 可直接帮助润色:加钩子开头、适配平台风格、加 SEO 关键
|
|
|
150
152
|
}
|
|
151
153
|
```
|
|
152
154
|
|
|
155
|
+
某平台可单独设为立即发布:`"publishMode": "immediate"`(无需 `publishAt`)。
|
|
156
|
+
|
|
157
|
+
**多平台不同封面(仅视频)**
|
|
158
|
+
|
|
159
|
+
全局 `cover` 作为默认封面;某平台需要不同封面时:
|
|
160
|
+
|
|
161
|
+
```json
|
|
162
|
+
"cover": {
|
|
163
|
+
"imageUrl": "https://cdn.example.com/cover-default.jpg",
|
|
164
|
+
"imageName": "cover-default.jpg",
|
|
165
|
+
"imageSourceType": 1,
|
|
166
|
+
"sourceImageId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
167
|
+
},
|
|
168
|
+
"platformOverrides": {
|
|
169
|
+
"YouTube": {
|
|
170
|
+
"cover": {
|
|
171
|
+
"imageUrl": "https://cdn.example.com/cover-youtube.jpg",
|
|
172
|
+
"imageName": "cover-youtube.jpg",
|
|
173
|
+
"imageSourceType": 1,
|
|
174
|
+
"sourceImageId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
153
180
|
---
|
|
154
181
|
|
|
155
182
|
### Step 6:汇总确认
|
|
@@ -71,12 +71,12 @@ siluzan-cso task detail --publish-id <id> --media YouTube
|
|
|
71
71
|
|
|
72
72
|
**发布项状态:**
|
|
73
73
|
|
|
74
|
-
| 状态 | 含义 |
|
|
75
|
-
| -------- | ---------------- |
|
|
76
|
-
| 发布中 | 正在发布到该平台 |
|
|
77
|
-
| 已发布 | 成功 |
|
|
78
|
-
| 定时发布 | 等待到达设定时间 |
|
|
79
|
-
| 发布失败 | 失败,可重试 |
|
|
74
|
+
| 状态 | 含义 | videoStatus |
|
|
75
|
+
| -------- | ---------------- | ----------- |
|
|
76
|
+
| 发布中 | 正在发布到该平台 | 0或10 |
|
|
77
|
+
| 已发布 | 成功 | 1 |
|
|
78
|
+
| 定时发布 | 等待到达设定时间 | 9 |
|
|
79
|
+
| 发布失败 | 失败,可重试 | 3 |
|
|
80
80
|
|
|
81
81
|
---
|
|
82
82
|
|
|
@@ -9,7 +9,7 @@ $ErrorActionPreference = 'Stop'
|
|
|
9
9
|
# -- Package info (injected at build time) ------------------------------------
|
|
10
10
|
$PKG_NAME = 'siluzan-cso-cli'
|
|
11
11
|
# PKG_VERSION 锁定到与本脚本同批构建产物一致的版本,避免与 dist/skill 错位
|
|
12
|
-
$PKG_VERSION = '1.1.
|
|
12
|
+
$PKG_VERSION = '1.1.22'
|
|
13
13
|
$CLI_BIN = 'siluzan-cso'
|
|
14
14
|
$SKILL_LABEL = 'Siluzan CSO'
|
|
15
15
|
$INSTALL_CMD = 'npm install -g siluzan-cso-cli'
|
|
@@ -9,7 +9,7 @@ set -euo pipefail
|
|
|
9
9
|
# -- Package info (injected at build time) ------------------------------------
|
|
10
10
|
readonly PKG_NAME="siluzan-cso-cli"
|
|
11
11
|
# PKG_VERSION 锁定到与本脚本同批构建产物一致的版本,避免与 dist/skill 错位
|
|
12
|
-
readonly PKG_VERSION="1.1.
|
|
12
|
+
readonly PKG_VERSION="1.1.22"
|
|
13
13
|
readonly CLI_BIN="siluzan-cso"
|
|
14
14
|
readonly SKILL_LABEL="Siluzan CSO"
|
|
15
15
|
readonly INSTALL_CMD="npm install -g siluzan-cso-cli"
|
package/package.json
CHANGED