siluzan-cso-cli 1.1.45-beta.5 → 1.1.46

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 CHANGED
@@ -46,7 +46,7 @@
46
46
  在**用户的目标项目根目录**执行(根据用户使用的助手选择 `--ai`):
47
47
 
48
48
  ```bash
49
- npm install -g siluzan-cso-cli@beta
49
+ npm install -g siluzan-cso-cli
50
50
  siluzan-cso init --ai cursor # 写入 Cursor(默认)
51
51
  siluzan-cso init --ai cursor,claude # 同时写入多个平台
52
52
  siluzan-cso init --ai all # 写入所有支持的平台
@@ -54,7 +54,6 @@ siluzan-cso init -d /path/to/skills # 写入自定义目录
54
54
  siluzan-cso init --force # 强制覆盖已存在文件
55
55
  ```
56
56
 
57
- > **注意**:当前为测试版(1.1.45-beta.5),供内部测试使用。正式发布后安装命令将改为 `npm install -g siluzan-cso-cli`。
58
57
 
59
58
  | 助手 | 建议 `--ai` |
60
59
  | ----------------------- | ------------------------------------ |
package/dist/index.js CHANGED
@@ -1936,11 +1936,11 @@ var require_semver2 = __commonJS({
1936
1936
  });
1937
1937
 
1938
1938
  // ../common/dist/index.js
1939
- var import_semver = __toESM(require_semver2(), 1);
1940
1939
  import * as fs from "fs";
1941
1940
  import * as path from "path";
1942
1941
  import * as os from "os";
1943
1942
  import lockfile from "proper-lockfile";
1943
+ var import_semver = __toESM(require_semver2(), 1);
1944
1944
  import * as https from "https";
1945
1945
  import * as http from "http";
1946
1946
  import * as zlib from "zlib";
@@ -2317,7 +2317,6 @@ function buildSiluzanClientIdentityHeaders() {
2317
2317
  return headers;
2318
2318
  }
2319
2319
  var DEFAULT_TIMEOUT_MS = 10 * 60 * 1e3;
2320
- var MAX_RESPONSE_BYTES = 50 * 1024 * 1024;
2321
2320
  var httpsAgent = new https.Agent({
2322
2321
  keepAlive: true,
2323
2322
  keepAliveMsecs: 3e4,
@@ -2344,15 +2343,43 @@ function emitPerf(record) {
2344
2343
  } catch {
2345
2344
  }
2346
2345
  }
2346
+ var RequestAbortedError = class extends Error {
2347
+ code = "SILUZAN_REQUEST_CANCELLED";
2348
+ constructor(method, url) {
2349
+ super(`\u8BF7\u6C42\u5DF2\u53D6\u6D88\uFF1A${method} ${url}`);
2350
+ this.name = "RequestAbortedError";
2351
+ }
2352
+ };
2347
2353
  function rawRequest(url, options) {
2348
2354
  const perfOn = isPerfEnabled();
2349
2355
  const t0 = perfOn ? performance.now() : 0;
2350
2356
  const method = options.method ?? "GET";
2351
- return new Promise((resolve52, reject) => {
2357
+ return new Promise((resolvePromise, rejectPromise) => {
2358
+ const signal = options.signal;
2359
+ if (signal?.aborted) {
2360
+ rejectPromise(new RequestAbortedError(method, url));
2361
+ return;
2362
+ }
2363
+ let settled = false;
2364
+ let onAbort;
2365
+ const settle = () => {
2366
+ settled = true;
2367
+ if (onAbort) signal?.removeEventListener("abort", onAbort);
2368
+ };
2369
+ const resolve52 = (value) => {
2370
+ if (settled) return;
2371
+ settle();
2372
+ resolvePromise(value);
2373
+ };
2374
+ const reject = (err) => {
2375
+ if (settled) return;
2376
+ settle();
2377
+ rejectPromise(err);
2378
+ };
2352
2379
  const parsed = new URL(url);
2353
2380
  const transport = parsed.protocol === "https:" ? https : http;
2354
2381
  const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
2355
- const maxBytes = options.maxResponseBytes ?? MAX_RESPONSE_BYTES;
2382
+ const maxBytes = options.maxResponseBytes ?? 0;
2356
2383
  const isHttps = parsed.protocol === "https:";
2357
2384
  const headers = {
2358
2385
  ...buildSiluzanClientIdentityHeaders(),
@@ -2390,8 +2417,12 @@ function rawRequest(url, options) {
2390
2417
  } else if (encoding === "br") {
2391
2418
  stream = res.pipe(zlib.createBrotliDecompress());
2392
2419
  }
2393
- const handleStreamError = (err) => {
2420
+ let failed = false;
2421
+ const fail = (err) => {
2422
+ if (failed) return;
2423
+ failed = true;
2394
2424
  res.destroy();
2425
+ if (settled) return;
2395
2426
  if (perfOn) {
2396
2427
  emitPerf({
2397
2428
  method,
@@ -2400,43 +2431,37 @@ function rawRequest(url, options) {
2400
2431
  elapsedMs: performance.now() - t0,
2401
2432
  bytes: 0,
2402
2433
  ok: false,
2403
- error: `decompress error: ${err.message}`
2434
+ error: err.message
2404
2435
  });
2405
2436
  }
2406
- reject(new Error(`\u54CD\u5E94\u89E3\u538B\u5931\u8D25\uFF08${encoding || "identity"}\uFF09\uFF1A${err.message}`));
2437
+ reject(err);
2438
+ };
2439
+ const onStreamError = (err) => {
2440
+ fail(new Error(`\u54CD\u5E94\u89E3\u538B\u5931\u8D25\uFF08${encoding || "identity"}\uFF09\uFF1A${err.message}`));
2407
2441
  };
2408
- if (stream !== res) stream.on("error", handleStreamError);
2409
- res.on("error", handleStreamError);
2410
- let data = "";
2442
+ if (stream !== res) stream.on("error", onStreamError);
2443
+ res.on("error", onStreamError);
2444
+ const chunks = [];
2411
2445
  let byteLen = 0;
2412
- stream.setEncoding("utf8");
2413
2446
  stream.on("data", (chunk) => {
2414
- byteLen += Buffer.byteLength(chunk, "utf8");
2415
- if (maxBytes && byteLen > maxBytes) {
2416
- res.destroy();
2417
- if (perfOn) {
2418
- emitPerf({
2419
- method,
2420
- url,
2421
- status: res.statusCode ?? 0,
2422
- elapsedMs: performance.now() - t0,
2423
- bytes: byteLen,
2424
- ok: false,
2425
- error: "response body exceeded limit"
2426
- });
2427
- }
2428
- reject(
2447
+ if (failed) return;
2448
+ const buf = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
2449
+ byteLen += buf.length;
2450
+ if (maxBytes > 0 && byteLen > maxBytes) {
2451
+ fail(
2429
2452
  new Error(`\u54CD\u5E94\u4F53\u8D85\u8FC7\u4E0A\u9650\uFF08${(maxBytes / 1024 / 1024).toFixed(0)} MB\uFF09\uFF0C\u5DF2\u4E2D\u65AD\u8FDE\u63A5`)
2430
2453
  );
2431
2454
  return;
2432
2455
  }
2433
- data += chunk;
2456
+ chunks.push(buf);
2434
2457
  });
2435
2458
  stream.on("end", () => {
2436
- const headers2 = {};
2459
+ if (failed) return;
2460
+ const text = Buffer.concat(chunks).toString("utf8");
2461
+ const responseHeaders = {};
2437
2462
  for (const [key, val] of Object.entries(res.headers)) {
2438
2463
  if (val !== void 0) {
2439
- headers2[key.toLowerCase()] = Array.isArray(val) ? val[0] : val;
2464
+ responseHeaders[key.toLowerCase()] = Array.isArray(val) ? val[0] : val;
2440
2465
  }
2441
2466
  }
2442
2467
  const status = res.statusCode ?? 0;
@@ -2450,7 +2475,7 @@ function rawRequest(url, options) {
2450
2475
  ok: status >= 200 && status < 300
2451
2476
  });
2452
2477
  }
2453
- resolve52({ status, text: data, headers: headers2 });
2478
+ resolve52({ status, text, headers: responseHeaders });
2454
2479
  });
2455
2480
  });
2456
2481
  req.on("timeout", () => {
@@ -2469,6 +2494,7 @@ function rawRequest(url, options) {
2469
2494
  reject(new Error(`\u8BF7\u6C42\u8D85\u65F6\uFF08${(timeoutMs / 1e3).toFixed(0)} \u79D2\uFF09\uFF1A${method} ${url}`));
2470
2495
  });
2471
2496
  req.on("error", (err) => {
2497
+ if (settled) return;
2472
2498
  if (perfOn) {
2473
2499
  emitPerf({
2474
2500
  method,
@@ -2482,7 +2508,32 @@ function rawRequest(url, options) {
2482
2508
  }
2483
2509
  reject(err);
2484
2510
  });
2485
- if (options.body) req.write(options.body);
2511
+ if (signal) {
2512
+ onAbort = () => {
2513
+ if (settled) return;
2514
+ if (perfOn) {
2515
+ emitPerf({
2516
+ method,
2517
+ url,
2518
+ status: 0,
2519
+ elapsedMs: performance.now() - t0,
2520
+ bytes: 0,
2521
+ ok: false,
2522
+ error: "cancelled"
2523
+ });
2524
+ }
2525
+ reject(new RequestAbortedError(method, url));
2526
+ req.destroy();
2527
+ };
2528
+ signal.addEventListener("abort", onAbort, { once: true });
2529
+ }
2530
+ if (options.body !== void 0) {
2531
+ const payload = typeof options.body === "string" ? Buffer.from(options.body) : options.body;
2532
+ if (!headers["Content-Length"] && !headers["content-length"]) {
2533
+ req.setHeader("Content-Length", payload.length);
2534
+ }
2535
+ req.write(payload);
2536
+ }
2486
2537
  req.end();
2487
2538
  });
2488
2539
  }
@@ -2579,7 +2630,46 @@ function formatHttpError(status, rawBody, opts) {
2579
2630
  function buildAuthHeaders(config) {
2580
2631
  return buildSiluzanAuthHeaders(config);
2581
2632
  }
2582
- async function apiFetch(url, config, options = {}, verbose = false) {
2633
+ async function parseApiResponse(status, text, verbose) {
2634
+ if (status < 200 || status >= 300) {
2635
+ const err = new Error(formatHttpError(status, text, { verbose }));
2636
+ Object.assign(err, { status, rawBody: text });
2637
+ throw err;
2638
+ }
2639
+ if (!text.trim()) return null;
2640
+ try {
2641
+ return parseJsonWithStringIds(text);
2642
+ } catch {
2643
+ if (verbose) {
2644
+ console.error(` \u26A0\uFE0F \u54CD\u5E94\u975E JSON\uFF0C\u539F\u59CB\u5185\u5BB9\uFF1A${redactSensitive(text).slice(0, 200)}`);
2645
+ }
2646
+ return text;
2647
+ }
2648
+ }
2649
+ function isTransientNetworkError(err) {
2650
+ if (err instanceof RequestAbortedError) return false;
2651
+ const msg = err instanceof Error ? err.message : String(err);
2652
+ const code = err?.code;
2653
+ if (typeof code === "string" && ["ECONNRESET", "EPIPE", "ETIMEDOUT", "ECONNABORTED"].includes(code)) {
2654
+ return true;
2655
+ }
2656
+ return /响应解压失败|aborted|socket hang up|ECONNRESET|unexpected end of file/i.test(msg);
2657
+ }
2658
+ var GET_RETRY_DELAYS_MS = [1e3, 3e3];
2659
+ async function requestWithReadRetry(url, options) {
2660
+ const method = (options.method ?? "GET").toUpperCase();
2661
+ for (let attempt = 0; ; attempt++) {
2662
+ try {
2663
+ return await rawRequest(url, options);
2664
+ } catch (err) {
2665
+ if (method !== "GET" || options.signal?.aborted || attempt >= GET_RETRY_DELAYS_MS.length || !isTransientNetworkError(err)) {
2666
+ throw err;
2667
+ }
2668
+ await new Promise((r) => setTimeout(r, GET_RETRY_DELAYS_MS[attempt]));
2669
+ }
2670
+ }
2671
+ }
2672
+ async function apiFetch(url, config, options = {}, verbose = false, timeoutMs) {
2583
2673
  const method = options.method ?? "GET";
2584
2674
  const reqHeaders = {
2585
2675
  "Content-Type": "application/json",
@@ -2592,24 +2682,14 @@ async function apiFetch(url, config, options = {}, verbose = false) {
2592
2682
  ...options.headers ?? {}
2593
2683
  };
2594
2684
  const body = typeof options.body === "string" ? options.body : void 0;
2595
- const res = await rawRequest(url, {
2685
+ const res = await requestWithReadRetry(url, {
2596
2686
  method,
2597
2687
  headers: reqHeaders,
2598
- body
2688
+ body,
2689
+ signal: options.signal ?? void 0,
2690
+ ...timeoutMs !== void 0 ? { timeoutMs } : {}
2599
2691
  });
2600
- const text = res.text;
2601
- if (res.status < 200 || res.status >= 300) {
2602
- throw new Error(formatHttpError(res.status, text, { verbose }));
2603
- }
2604
- if (!text.trim()) return null;
2605
- try {
2606
- return parseJsonWithStringIds(text);
2607
- } catch {
2608
- if (verbose) {
2609
- console.error(` \u26A0\uFE0F \u54CD\u5E94\u975E JSON\uFF0C\u539F\u59CB\u5185\u5BB9\uFF1A${redactSensitive(text).slice(0, 200)}`);
2610
- }
2611
- return text;
2612
- }
2692
+ return parseApiResponse(res.status, res.text, verbose);
2613
2693
  }
2614
2694
  function decodeJwtClaims(token) {
2615
2695
  try {
@@ -3097,7 +3177,8 @@ async function emitCliJsonOrSnapshot(opts, params) {
3097
3177
  commandHint: params.commandHint,
3098
3178
  idSuffix: params.idSuffix
3099
3179
  });
3100
- console.log(JSON.stringify(summary));
3180
+ const line = params.summaryExtras ? { ...summary, ...params.summaryExtras } : summary;
3181
+ console.log(JSON.stringify(line));
3101
3182
  return true;
3102
3183
  }
3103
3184
  return false;
@@ -3530,11 +3611,11 @@ import { Command } from "commander";
3530
3611
  import { Option } from "commander";
3531
3612
 
3532
3613
  // src/config/defaults.ts
3533
- var BUILD_ENV = "test";
3534
- var DEFAULT_API_BASE = "https://api-ci.siluzan.com";
3535
- var DEFAULT_CSO_BASE = "https://cso-ci.siluzan.com";
3536
- var DEFAULT_WEB_BASE = "https://www-ci.siluzan.com";
3537
- var DEFAULT_AGENT_BASE = "https://agent-ci.mysiluzan.com";
3614
+ var BUILD_ENV = "production";
3615
+ var DEFAULT_API_BASE = "https://api.siluzan.com";
3616
+ var DEFAULT_CSO_BASE = "https://cso.siluzan.com";
3617
+ var DEFAULT_WEB_BASE = "https://www.siluzan.com";
3618
+ var DEFAULT_AGENT_BASE = "https://agent.mysiluzan.com";
3538
3619
 
3539
3620
  // src/commands/init.ts
3540
3621
  import * as fs6 from "fs/promises";
@@ -4812,9 +4893,8 @@ function buildCoverPayload(cover, videoId, currentUserId) {
4812
4893
  imageSourceType: cover.imageSourceType,
4813
4894
  sourceImageId: cover.sourceImageId ?? videoId,
4814
4895
  imageCreateUserId: cover.imageCreateUserId ?? currentUserId ?? void 0,
4815
- // belongTo / belongToId:CLI 无法获取组织信息,统一与前端素材库视频行为保持一致
4816
- belongTo: -1,
4817
- belongToId: null,
4896
+ belongTo: cover.belongTo ?? -1,
4897
+ belongToId: cover.belongToId ?? null,
4818
4898
  replica: false,
4819
4899
  coverTsp: 0,
4820
4900
  compositeCover: false,
@@ -5041,6 +5121,20 @@ function buildImageChannels(posts, currentUserId) {
5041
5121
  }
5042
5122
 
5043
5123
  // src/commands/publish/preview.ts
5124
+ function previewCoverUrl(value, verbose) {
5125
+ if (!value) return "\u26A0\uFE0F \u672A\u8BBE\u7F6E";
5126
+ if (verbose) return value;
5127
+ try {
5128
+ const url = new URL(value);
5129
+ url.username = "";
5130
+ url.password = "";
5131
+ url.search = "";
5132
+ url.hash = "";
5133
+ return url.href;
5134
+ } catch {
5135
+ return "\uFF08\u5C01\u9762\u5730\u5740\u5DF2\u9690\u85CF\uFF09";
5136
+ }
5137
+ }
5044
5138
  function formatTopics(topics) {
5045
5139
  if (!topics?.length) return "";
5046
5140
  return topics.map((t) => `#${t}`).join(" ");
@@ -5076,7 +5170,7 @@ ${SEP}`);
5076
5170
  console.log(` \u6807\u7B7E \uFF1A${topicsStr}`);
5077
5171
  }
5078
5172
  console.log(` \u53D1\u5E03\u6A21\u5F0F \uFF1A${formatPublishMode(item.publishMode, item.publishAt)}`);
5079
- console.log(` \u5C01\u9762 URL \uFF1A${item.cover?.imageUrl || "\u26A0\uFE0F \u672A\u8BBE\u7F6E"}`);
5173
+ console.log(` \u5C01\u9762 URL \uFF1A${previewCoverUrl(item.cover?.imageUrl, verbose)}`);
5080
5174
  if (item.cover?.sourceImageId) {
5081
5175
  console.log(` \u5C01\u9762 ID \uFF1A${item.cover.sourceImageId}`);
5082
5176
  }
@@ -5107,7 +5201,7 @@ ${SEP}`);
5107
5201
  }
5108
5202
  if (override.cover) {
5109
5203
  const cover = resolveVideoCover(item, override);
5110
- console.log(` \u5C01\u9762\u8986\u76D6 \uFF1A${cover.imageUrl || "\u26A0\uFE0F \u672A\u8BBE\u7F6E"}`);
5204
+ console.log(` \u5C01\u9762\u8986\u76D6 \uFF1A${previewCoverUrl(cover.imageUrl, verbose)}`);
5111
5205
  if (cover.sourceImageId) console.log(` \u5C01\u9762 ID \uFF1A${cover.sourceImageId}`);
5112
5206
  }
5113
5207
  }
@@ -5183,6 +5277,195 @@ ${SEP}`);
5183
5277
  // src/commands/publish/commands.ts
5184
5278
  import * as fs8 from "fs";
5185
5279
  import * as path8 from "path";
5280
+
5281
+ // src/utils/cover-validation.ts
5282
+ import * as http2 from "http";
5283
+ import * as https2 from "https";
5284
+ import { imageSize } from "image-size";
5285
+
5286
+ // src/utils/material-info.ts
5287
+ async function fetchMaterialInfo(config, id, verbose = false) {
5288
+ try {
5289
+ const url = new URL(`${config.csoBaseUrl}/cutapi/v1/material/get`);
5290
+ url.searchParams.set("id", id);
5291
+ const response = await apiFetch2(url.href, config, {}, verbose);
5292
+ if (response.code !== 1 || !response.data || typeof response.data.type !== "number") {
5293
+ throw new Error("Invalid material response");
5294
+ }
5295
+ return response.data;
5296
+ } catch {
5297
+ throw new Error("\u83B7\u53D6\u7D20\u6750\u4FE1\u606F\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7D20\u6750 ID\u3001\u8BBF\u95EE\u6743\u9650\u53CA\u670D\u52A1\u72B6\u6001");
5298
+ }
5299
+ }
5300
+ function materialAccessUrl(resourceUrl, previewSas = "") {
5301
+ const url = new URL(resourceUrl);
5302
+ if (!url.searchParams.has("sig")) {
5303
+ const sas = new URLSearchParams(previewSas.replace(/^[?&]/, ""));
5304
+ for (const [key, value] of sas) url.searchParams.set(key, value);
5305
+ }
5306
+ return url.href;
5307
+ }
5308
+
5309
+ // src/utils/cover-validation.ts
5310
+ var MAX_BYTES = 10 * 1024 * 1024;
5311
+ var TIMEOUT_MS = 15e3;
5312
+ var MAX_REDIRECTS = 3;
5313
+ var GUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
5314
+ function imageUrl(value) {
5315
+ let url;
5316
+ try {
5317
+ url = new URL(value);
5318
+ } catch {
5319
+ throw new Error("\u5C01\u9762\u5730\u5740\u4E0D\u662F\u6709\u6548\u7684 HTTP(S) URL");
5320
+ }
5321
+ if (!["http:", "https:"].includes(url.protocol) || url.username || url.password) {
5322
+ throw new Error("\u5C01\u9762\u5730\u5740\u5FC5\u987B\u662F\u65E0\u7528\u6237\u540D\u5BC6\u7801\u7684 HTTP(S) URL");
5323
+ }
5324
+ return url;
5325
+ }
5326
+ function readImageResponse(url, maxBytes, deadline) {
5327
+ return new Promise((resolve10, reject) => {
5328
+ const transport = url.protocol === "https:" ? https2 : http2;
5329
+ const request = transport.get(url, { headers: { Accept: "image/*" } }, (response) => {
5330
+ const status = response.statusCode ?? 0;
5331
+ const contentType = (response.headers["content-type"] ?? "").split(";", 1)[0].trim().toLowerCase();
5332
+ const location = response.headers.location;
5333
+ if (status < 200 || status >= 300) {
5334
+ clearTimeout(timer);
5335
+ response.destroy();
5336
+ resolve10({ status, contentType, location, body: Buffer.alloc(0) });
5337
+ return;
5338
+ }
5339
+ if (!contentType.startsWith("image/")) {
5340
+ clearTimeout(timer);
5341
+ response.destroy();
5342
+ reject(new Error("\u5C01\u9762\u8FD4\u56DE\u7684\u5185\u5BB9\u4E0D\u662F\u56FE\u7247\uFF08\u53EF\u80FD\u662F JSON \u9519\u8BEF\u6216\u767B\u5F55\u9875\u9762\uFF09"));
5343
+ return;
5344
+ }
5345
+ if (Number(response.headers["content-length"]) > maxBytes) {
5346
+ clearTimeout(timer);
5347
+ response.destroy();
5348
+ reject(new Error("\u5C01\u9762\u56FE\u7247\u8D85\u8FC7\u5927\u5C0F\u4E0A\u9650"));
5349
+ return;
5350
+ }
5351
+ const chunks = [];
5352
+ let size = 0;
5353
+ response.on("data", (chunk) => {
5354
+ size += chunk.length;
5355
+ if (size > maxBytes) {
5356
+ clearTimeout(timer);
5357
+ reject(new Error("\u5C01\u9762\u56FE\u7247\u8D85\u8FC7\u5927\u5C0F\u4E0A\u9650"));
5358
+ response.destroy();
5359
+ return;
5360
+ }
5361
+ chunks.push(chunk);
5362
+ });
5363
+ response.on("error", () => {
5364
+ clearTimeout(timer);
5365
+ reject(new Error("\u5C01\u9762\u56FE\u7247\u8BFB\u53D6\u5931\u8D25"));
5366
+ });
5367
+ response.on("aborted", () => {
5368
+ clearTimeout(timer);
5369
+ reject(new Error("\u5C01\u9762\u56FE\u7247\u8BFB\u53D6\u4E2D\u65AD"));
5370
+ });
5371
+ response.on("end", () => {
5372
+ clearTimeout(timer);
5373
+ resolve10({ status, contentType, body: Buffer.concat(chunks) });
5374
+ });
5375
+ });
5376
+ const timer = setTimeout(
5377
+ () => {
5378
+ reject(new Error("\u5C01\u9762\u56FE\u7247\u8BFB\u53D6\u8D85\u65F6"));
5379
+ request.destroy();
5380
+ },
5381
+ Math.max(1, deadline - Date.now())
5382
+ );
5383
+ request.on("error", () => {
5384
+ clearTimeout(timer);
5385
+ reject(new Error("\u5C01\u9762\u56FE\u7247\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u5730\u5740\u548C\u7F51\u7EDC"));
5386
+ });
5387
+ });
5388
+ }
5389
+ async function validateCoverImageUrl(value, limits = {}) {
5390
+ let url = imageUrl(value);
5391
+ const deadline = Date.now() + (limits.timeoutMs ?? TIMEOUT_MS);
5392
+ for (let redirects = 0; ; redirects++) {
5393
+ const response = await readImageResponse(url, limits.maxBytes ?? MAX_BYTES, deadline);
5394
+ if ([301, 302, 303, 307, 308].includes(response.status)) {
5395
+ if (!response.location || redirects >= MAX_REDIRECTS) {
5396
+ throw new Error("\u5C01\u9762\u5730\u5740\u91CD\u5B9A\u5411\u8FC7\u591A\u6216\u65E0\u6709\u6548\u76EE\u6807");
5397
+ }
5398
+ url = imageUrl(new URL(response.location, url).href);
5399
+ continue;
5400
+ }
5401
+ if (response.status < 200 || response.status >= 300) {
5402
+ throw new Error(`\u5C01\u9762\u56FE\u7247\u8BF7\u6C42\u5931\u8D25\uFF08HTTP ${response.status}\uFF09`);
5403
+ }
5404
+ try {
5405
+ const { width, height } = imageSize(response.body);
5406
+ if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) {
5407
+ throw new Error("Invalid dimensions");
5408
+ }
5409
+ return { width, height, size: response.body.length };
5410
+ } catch {
5411
+ throw new Error("\u5C01\u9762\u5185\u5BB9\u65E0\u6CD5\u8BC6\u522B\u4E3A\u6709\u6548\u56FE\u7247\uFF0C\u6216\u56FE\u7247\u5C3A\u5BF8\u65E0\u6548");
5412
+ }
5413
+ }
5414
+ }
5415
+ async function resolveCover(cover, videoId, config) {
5416
+ if (cover.imageSourceType === 0) {
5417
+ const dimensions2 = await validateCoverImageUrl(cover.imageUrl);
5418
+ return { imageUrl: cover.imageUrl, ...dimensions2 };
5419
+ }
5420
+ if (cover.imageSourceType !== 1 && cover.imageSourceType !== 2) {
5421
+ throw new Error("\u5C01\u9762 imageSourceType \u5FC5\u987B\u662F 0\u30011 \u6216 2");
5422
+ }
5423
+ const id = cover.sourceImageId ?? (cover.imageSourceType === 1 ? videoId : "");
5424
+ if (!GUID.test(id))
5425
+ throw new Error("\u7D20\u6750\u5C01\u9762\u9700\u8981\u6B63\u786E\u7684 sourceImageId\uFF08\u56FE\u7247\u7C7B\u578B 2 \u4E0D\u80FD\u56DE\u843D\u5230\u89C6\u9891 ID\uFF09");
5426
+ const material = await fetchMaterialInfo(config, id);
5427
+ const expectedType = cover.imageSourceType === 2 ? 1 : 3;
5428
+ if (material.type !== expectedType) {
5429
+ throw new Error(
5430
+ cover.imageSourceType === 1 && material.type === 1 ? "\u5C01\u9762\u7D20\u6750\u662F\u56FE\u7247\uFF0C\u8BF7\u5C06 imageSourceType \u8BBE\u7F6E\u4E3A 2\uFF0C\u4E0D\u80FD\u6309\u89C6\u9891\u622A\u5E27\u5904\u7406" : "\u5C01\u9762\u6765\u6E90\u7C7B\u578B\u4E0E\u7D20\u6750\u7C7B\u578B\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u6838\u5BF9 sourceImageId"
5431
+ );
5432
+ }
5433
+ const resource = cover.imageSourceType === 2 ? material.url : material.thumbUrl || cover.imageUrl;
5434
+ if (!resource) throw new Error("\u5C01\u9762\u7D20\u6750\u6CA1\u6709\u53EF\u7528\u7684\u56FE\u7247\u5730\u5740");
5435
+ const resolvedUrl = cover.imageSourceType === 1 && !material.thumbUrl ? resource : materialAccessUrl(resource, material.previewSas);
5436
+ const dimensions = await validateCoverImageUrl(resolvedUrl);
5437
+ return {
5438
+ imageUrl: resolvedUrl,
5439
+ sourceImageId: id,
5440
+ imageCreateUserId: material.userId ?? cover.imageCreateUserId,
5441
+ belongTo: material.belongTo ?? cover.belongTo,
5442
+ belongToId: material.belongToId ?? cover.belongToId,
5443
+ ...dimensions
5444
+ };
5445
+ }
5446
+ async function prepareVideoCovers(videos, config) {
5447
+ const checks = /* @__PURE__ */ new Map();
5448
+ for (const video of videos) {
5449
+ const covers = /* @__PURE__ */ new Set([video.cover]);
5450
+ for (const account of video.accounts) {
5451
+ const override = video.platformOverrides?.[account.mediaAccountType]?.cover;
5452
+ if (override) covers.add(override);
5453
+ }
5454
+ for (const cover of covers) {
5455
+ const source = cover.imageSourceType === 0 ? cover.imageUrl : cover.sourceImageId ?? (cover.imageSourceType === 1 ? video.videoId : "");
5456
+ const key = `${cover.imageSourceType}:${source}`;
5457
+ let check = checks.get(key);
5458
+ if (!check) {
5459
+ check = resolveCover(cover, video.videoId, config);
5460
+ checks.set(key, check);
5461
+ }
5462
+ Object.assign(cover, await check);
5463
+ }
5464
+ }
5465
+ return checks.size;
5466
+ }
5467
+
5468
+ // src/commands/publish/commands.ts
5186
5469
  async function runPublish(options) {
5187
5470
  const configPath = path8.resolve(options.config);
5188
5471
  if (!fs8.existsSync(configPath)) {
@@ -5241,6 +5524,21 @@ async function runPublish(options) {
5241
5524
  errorList.forEach((e) => console.error(` \xB7 ${e}`));
5242
5525
  process.exit(1);
5243
5526
  }
5527
+ if (input.contentType === 1 && input.videos) {
5528
+ try {
5529
+ await prepareVideoCovers(input.videos, config);
5530
+ } catch (error) {
5531
+ console.error(
5532
+ `
5533
+ \u274C \u5C01\u9762\u6821\u9A8C\u5931\u8D25\uFF1A${error instanceof Error ? error.message : "\u65E0\u6CD5\u8BFB\u53D6\u6709\u6548\u56FE\u7247"}`
5534
+ );
5535
+ process.exit(1);
5536
+ }
5537
+ ({ channels, videoType, contents } = buildVideoChannels(
5538
+ input.videos,
5539
+ currentUserId
5540
+ ));
5541
+ }
5244
5542
  const body = {
5245
5543
  contents: JSON.stringify(contents),
5246
5544
  channels: Object.values(channels),
@@ -5295,7 +5593,7 @@ async function runPublish(options) {
5295
5593
  import * as fs9 from "fs";
5296
5594
  import * as os5 from "os";
5297
5595
  import * as path9 from "path";
5298
- import { imageSize } from "image-size";
5596
+ import { imageSize as imageSize2 } from "image-size";
5299
5597
  import { ContainerClient } from "@azure/storage-blob";
5300
5598
  var SENSITIVE_PATH_PREFIXES = [
5301
5599
  path9.join(os5.homedir(), ".siluzan"),
@@ -5429,15 +5727,6 @@ async function notifyUploaded(config, body, verbose = false) {
5429
5727
  }
5430
5728
  return res.data.id;
5431
5729
  }
5432
- async function fetchMaterialInfo(config, id, verbose = false) {
5433
- try {
5434
- const url = `${config.csoBaseUrl}/cutapi/v1/material/${id}`;
5435
- const res = await apiFetch2(url, config, {}, verbose);
5436
- return res.data ?? {};
5437
- } catch {
5438
- return {};
5439
- }
5440
- }
5441
5730
  function readMp4Duration(filePath) {
5442
5731
  try {
5443
5732
  const fileSize = fs9.statSync(filePath).size;
@@ -5484,7 +5773,7 @@ function parseMvhdFromBuffer(buf) {
5484
5773
  function readImageDimensions(filePath) {
5485
5774
  try {
5486
5775
  const buf = fs9.readFileSync(filePath);
5487
- const dim = imageSize(buf);
5776
+ const dim = imageSize2(buf);
5488
5777
  return { width: dim.width, height: dim.height, format: (dim.type ?? "").toUpperCase() };
5489
5778
  } catch {
5490
5779
  return { width: 0, height: 0 };
@@ -5494,9 +5783,10 @@ async function uploadImageFile(filePath, config, verbose = false) {
5494
5783
  const fileName = path9.basename(filePath);
5495
5784
  const fileSize = fs9.statSync(filePath).size;
5496
5785
  const format = path9.extname(filePath).replace(".", "").toUpperCase();
5786
+ const dim = readImageDimensions(filePath);
5787
+ if (!dim.width || !dim.height) throw new Error("\u5C01\u9762\u6587\u4EF6\u4E0D\u662F\u6709\u6548\u56FE\u7247\uFF0C\u65E0\u6CD5\u8BFB\u53D6\u56FE\u7247\u5C3A\u5BF8");
5497
5788
  const sas = await generateSas(config, verbose);
5498
5789
  const { resourceUrl } = await uploadToAzure(filePath, sas, void 0);
5499
- const dim = readImageDimensions(filePath);
5500
5790
  const materialId = await notifyUploaded(
5501
5791
  config,
5502
5792
  {
@@ -5514,8 +5804,15 @@ async function uploadImageFile(filePath, config, verbose = false) {
5514
5804
  verbose
5515
5805
  );
5516
5806
  const matInfo = await fetchMaterialInfo(config, materialId, verbose);
5807
+ if (matInfo.type !== 1) throw new Error("\u4E0A\u4F20\u540E\u7684\u5C01\u9762\u7D20\u6750\u7C7B\u578B\u4E0D\u662F\u56FE\u7247");
5808
+ const accessUrl = materialAccessUrl(
5809
+ matInfo.url || resourceUrl,
5810
+ matInfo.previewSas || sas.sasToken
5811
+ );
5812
+ await validateCoverImageUrl(accessUrl);
5517
5813
  return {
5518
5814
  resourceUrl,
5815
+ accessUrl,
5519
5816
  materialId,
5520
5817
  belongToId: matInfo?.belongToId,
5521
5818
  belongTo: matInfo?.belongTo,
@@ -5552,6 +5849,7 @@ async function runUpload(options) {
5552
5849
  \u{1F4C1} \u51C6\u5907\u4E0A\u4F20${kind === "video" ? "\u89C6\u9891" : "\u56FE\u7247"}\uFF1A${fileName}`);
5553
5850
  console.log(` \u5927\u5C0F\uFF1A${(fileSize / 1024 / 1024).toFixed(2)} MB`);
5554
5851
  let thumbUrl = "";
5852
+ let coverAccessUrl = "";
5555
5853
  let coverMaterialId = "";
5556
5854
  let coverBelongToId;
5557
5855
  let coverBelongTo;
@@ -5575,6 +5873,7 @@ async function runUpload(options) {
5575
5873
  try {
5576
5874
  const coverResult = await uploadImageFile(coverPath, config, verbose);
5577
5875
  thumbUrl = coverResult.resourceUrl;
5876
+ coverAccessUrl = coverResult.accessUrl;
5578
5877
  coverMaterialId = coverResult.materialId;
5579
5878
  coverBelongToId = coverResult.belongToId;
5580
5879
  coverBelongTo = coverResult.belongTo;
@@ -5659,7 +5958,7 @@ async function runUpload(options) {
5659
5958
  console.log("4\uFE0F\u20E3 \u83B7\u53D6\u7D20\u6750\u4FE1\u606F \u2026");
5660
5959
  const matInfo = await fetchMaterialInfo(config, materialId, verbose);
5661
5960
  const previewSas = matInfo?.previewSas ?? "";
5662
- const coverUrl = matInfo?.thumbUrl && previewSas ? `${matInfo.thumbUrl}?${previewSas}` : thumbUrl;
5961
+ const coverUrl = coverAccessUrl;
5663
5962
  const accessUrl = previewSas ? `${resourceUrl}?${previewSas}` : `${resourceUrl}?${sas.sasToken}`;
5664
5963
  console.log(`
5665
5964
  \u2705 \u4E0A\u4F20\u6210\u529F\uFF01`);
@@ -5676,7 +5975,7 @@ async function runUpload(options) {
5676
5975
  cover: {
5677
5976
  imageUrl: verbose ? coverUrl || "\uFF08\u8BF7\u624B\u52A8\u586B\u5199\u5C01\u9762\u56FE\u7247 URL\uFF09" : thumbUrl,
5678
5977
  imageName: options.cover ? path10.basename(options.cover) : "cover.jpg",
5679
- imageSourceType: 1,
5978
+ imageSourceType: 2,
5680
5979
  sourceImageId: coverMaterialId || void 0,
5681
5980
  imageCreateUserId: coverUserId || void 0,
5682
5981
  belongTo: coverBelongTo !== void 0 ? coverBelongTo : -1,
@@ -5743,84 +6042,6 @@ function stripMarkdown(input) {
5743
6042
  text = text.replace(/(\*\*|__|\*|_|`|~~)/g, "");
5744
6043
  return text;
5745
6044
  }
5746
- var SPOKEN_BODY_START_HEADINGS = ["\u53E3\u64AD\u811A\u672C", "\u53E3\u64AD\u6B63\u6587"];
5747
- var SPOKEN_BODY_END_HEADINGS = [
5748
- "\u5B57\u5E55\u91CD\u70B9",
5749
- "\u753B\u9762\u5EFA\u8BAE",
5750
- "\u53D1\u5E03\u6587\u6848",
5751
- "\u8BDD\u9898\u6807\u7B7E",
5752
- "\u98CE\u9669\u4E0E\u6838\u9A8C\u9879"
5753
- ];
5754
- var SPOKEN_BODY_META_HEADINGS = [
5755
- "\u5E73\u53F0",
5756
- "\u5185\u5BB9\u76EE\u6807",
5757
- "\u76EE\u6807\u53D7\u4F17",
5758
- "\u5EFA\u8BAE\u65F6\u957F",
5759
- "\u6807\u9898/\u9996\u884C"
5760
- ];
5761
- var ALL_PLATFORM_FORMAT_HEADINGS = [
5762
- ...SPOKEN_BODY_START_HEADINGS,
5763
- ...SPOKEN_BODY_END_HEADINGS,
5764
- ...SPOKEN_BODY_META_HEADINGS
5765
- ];
5766
- function platformHeadingName(line) {
5767
- const trimmed = line.trim();
5768
- if (!trimmed) return null;
5769
- const bracket = trimmed.match(/^【\s*([^】]+?)\s*】/);
5770
- if (bracket) {
5771
- const name2 = bracket[1].trim();
5772
- return ALL_PLATFORM_FORMAT_HEADINGS.includes(name2) ? name2 : null;
5773
- }
5774
- const markdown = trimmed.match(/^#{1,6}\s+(?:【\s*)?(.+?)(?:\s*】)?\s*$/);
5775
- if (!markdown) return null;
5776
- const name = markdown[1].trim();
5777
- return ALL_PLATFORM_FORMAT_HEADINGS.includes(name) ? name : null;
5778
- }
5779
- function isHeadingOf(line, names) {
5780
- const name = platformHeadingName(line);
5781
- return name !== null && names.includes(name);
5782
- }
5783
- function findHeadingIndex(lines, names, from = 0) {
5784
- for (let i = from; i < lines.length; i++) {
5785
- if (isHeadingOf(lines[i], names)) return i;
5786
- }
5787
- return -1;
5788
- }
5789
- function skipMetadataBlocks(lines, from, until) {
5790
- let i = from;
5791
- while (i < until) {
5792
- if (!isHeadingOf(lines[i], SPOKEN_BODY_META_HEADINGS)) break;
5793
- i += 1;
5794
- while (i < until && platformHeadingName(lines[i]) === null) {
5795
- i += 1;
5796
- }
5797
- }
5798
- return i;
5799
- }
5800
- function extractWordCountText(raw) {
5801
- const lines = raw.split(/\r?\n/);
5802
- const startIdx = findHeadingIndex(lines, SPOKEN_BODY_START_HEADINGS);
5803
- const endIdx = findHeadingIndex(lines, SPOKEN_BODY_END_HEADINGS);
5804
- if (startIdx === -1 && endIdx === -1) {
5805
- return { text: raw, scope: "full" };
5806
- }
5807
- let from = 0;
5808
- if (startIdx !== -1) {
5809
- from = startIdx + 1;
5810
- } else {
5811
- const metaIdx = findHeadingIndex(lines, SPOKEN_BODY_META_HEADINGS);
5812
- const until = endIdx === -1 ? lines.length : endIdx;
5813
- if (metaIdx !== -1 && metaIdx < until) {
5814
- from = skipMetadataBlocks(lines, metaIdx, until);
5815
- }
5816
- }
5817
- const to = endIdx !== -1 && endIdx >= from ? endIdx : lines.length;
5818
- const text = lines.slice(from, to).join("\n");
5819
- if (text.trim().length === 0) {
5820
- return { text: raw, scope: "full" };
5821
- }
5822
- return { text, scope: "spoken-body" };
5823
- }
5824
6045
  var LEAK_RULES = [
5825
6046
  { regex: /(?:TF|PA|MF)-?\d{2,}/g, reason: "\u4E09\u5E93\u5185\u90E8\u7F16\u7801\uFF08TF/PA/MF\uFF09\u4E0D\u5E94\u51FA\u73B0\u5728\u6210\u7A3F" },
5826
6047
  { regex: /三库溯源/g, reason: "\u4E09\u5E93\u6EAF\u6E90\u5C5E\u4E8E\u8FC7\u7A0B\u8BB0\u5F55\uFF0C\u4E0D\u5E94\u51FA\u73B0\u5728\u6210\u7A3F" },
@@ -5904,8 +6125,7 @@ async function runValidateContent(options) {
5904
6125
  const countBy = options.countBy ?? "chars-no-space";
5905
6126
  const checkLeak = options.checkLeak !== false;
5906
6127
  const extraForbidden = parseForbidden(options.forbidden);
5907
- const counted = extractWordCountText(raw);
5908
- const textForCount = options.stripMarkdown ? stripMarkdown(counted.text) : counted.text;
6128
+ const textForCount = options.stripMarkdown ? stripMarkdown(raw) : raw;
5909
6129
  const metrics = countMetrics(textForCount);
5910
6130
  const value = pickCount(metrics, countBy);
5911
6131
  const limitProblems = [];
@@ -5927,7 +6147,6 @@ async function runValidateContent(options) {
5927
6147
  {
5928
6148
  source: sourceLabel,
5929
6149
  countBy,
5930
- countScope: counted.scope,
5931
6150
  strippedMarkdown: Boolean(options.stripMarkdown),
5932
6151
  limit: { min: options.min ?? null, max: options.max ?? null, value },
5933
6152
  metrics,
@@ -5943,9 +6162,6 @@ async function runValidateContent(options) {
5943
6162
  }
5944
6163
  console.log(`
5945
6164
  \u{1F4C4} \u6587\u6848\u6821\u9A8C\uFF1A${sourceLabel}`);
5946
- if (counted.scope === "spoken-body") {
5947
- console.log(" \uFF08\u5B57\u6570\u4EC5\u7EDF\u8BA1\u53E3\u64AD\u6B63\u6587\uFF0C\u4E0D\u542B\u5B57\u5E55\u91CD\u70B9 / \u753B\u9762\u5EFA\u8BAE / \u53D1\u5E03\u6587\u6848\u7B49\u6210\u7A3F\u5757\uFF09");
5948
- }
5949
6165
  if (options.stripMarkdown) console.log(" \uFF08\u5DF2\u53BB\u9664 markdown \u8BED\u6CD5 / frontmatter \u540E\u7EDF\u8BA1\uFF09");
5950
6166
  console.log("");
5951
6167
  console.log(` \u603B\u5B57\u7B26\u6570\uFF08\u542B\u7A7A\u767D\uFF09 ${metrics.chars}`);
@@ -9193,7 +9409,7 @@ function registerCsoCommands(program2) {
9193
9409
  );
9194
9410
  const workflowCmd = program2.command("workflow").description("\u5185\u5BB9\u521B\u4F5C\u5DE5\u4F5C\u6D41\u76F8\u5173\u547D\u4EE4\uFF1A\u6587\u6848\u6821\u9A8C\u7B49");
9195
9411
  workflowCmd.command("validate").description(
9196
- "\u6821\u9A8C\u6587\u6848\uFF1A\u7EDF\u8BA1\u5B57\u6570\uFF08\u6C49\u5B57/\u5B57\u7B26/\u5355\u8BCD\uFF09\uFF0C\u6309 --min/--max \u68C0\u67E5\u5B57\u6570\u9650\u5236\uFF08\u53E3\u64AD\u6210\u7A3F\u53EA\u8BA1\u53E3\u64AD\u6B63\u6587\uFF0C\u4E0D\u542B\u5B57\u5E55\u91CD\u70B9/\u753B\u9762\u5EFA\u8BAE\u7B49\uFF09\uFF0C\u5E76\u68C0\u67E5\u4E09\u5E93\u7F16\u7801/\u6EAF\u6E90\u7B49\u5185\u90E8\u5185\u5BB9\u662F\u5426\u6CC4\u6F0F\u5230\u6210\u7A3F\u3002\u6587\u6848\u6765\u6E90\u652F\u6301 -f \u6587\u4EF6\u3001--text \u884C\u5185\u6587\u672C\u3001\u6216 stdin \u7BA1\u9053\uFF08\u5BBF\u4E3B\u65E0\u6587\u4EF6\u5DE5\u5177\u65F6\u7528\u540E\u4E24\u79CD\uFF09"
9412
+ "\u6821\u9A8C\u6587\u6848\uFF1A\u7EDF\u8BA1\u5B57\u6570\uFF08\u6C49\u5B57/\u5B57\u7B26/\u5355\u8BCD\uFF09\uFF0C\u6309 --min/--max \u68C0\u67E5\u5B57\u6570\u9650\u5236\uFF0C\u5E76\u68C0\u67E5\u4E09\u5E93\u7F16\u7801/\u6EAF\u6E90\u7B49\u5185\u90E8\u5185\u5BB9\u662F\u5426\u6CC4\u6F0F\u5230\u6210\u7A3F\u3002\u6587\u6848\u6765\u6E90\u652F\u6301 -f \u6587\u4EF6\u3001--text \u884C\u5185\u6587\u672C\u3001\u6216 stdin \u7BA1\u9053\uFF08\u5BBF\u4E3B\u65E0\u6587\u4EF6\u5DE5\u5177\u65F6\u7528\u540E\u4E24\u79CD\uFF09"
9197
9413
  ).option("-f, --file <path>", "\u5F85\u6821\u9A8C\u7684\u6587\u6848\u6587\u4EF6\u8DEF\u5F84\uFF08.md / .txt\uFF09\uFF1B\u4E0E --text / stdin \u4E09\u9009\u4E00").option("--text <content>", "\u76F4\u63A5\u4F20\u5165\u6587\u6848\u6B63\u6587\uFF08\u5BBF\u4E3B\u65E0\u6587\u4EF6\u5DE5\u5177\u65F6\u7528\uFF09\uFF1B\u4F18\u5148\u7EA7\u9AD8\u4E8E -f \u4E0E stdin").option("--min <n>", "\u5B57\u6570\u4E0B\u9650\uFF08\u6309 --count-by \u53E3\u5F84\uFF09", parseInt).option("--max <n>", "\u5B57\u6570\u4E0A\u9650\uFF08\u6309 --count-by \u53E3\u5F84\uFF09", parseInt).option(
9198
9414
  "--count-by <mode>",
9199
9415
  "\u9650\u5236\u53E3\u5F84\uFF1Achars-no-space\uFF08\u4E0D\u542B\u7A7A\u767D\uFF0C\u9ED8\u8BA4\uFF09| chars\uFF08\u542B\u7A7A\u767D\uFF09| cjk\uFF08\u6C49\u5B57\uFF09| words\uFF08\u82F1\u6587\u5355\u8BCD\uFF09",
@@ -44,6 +44,8 @@ compatibility: Requires siluzan-cso-cli installed and authenticated via `siluzan
44
44
 
45
45
  # siluzan-cso
46
46
 
47
+ 成稿语言跟用户本轮用语:用户用英文或明确要求英文时,文案、口播、Caption 用英文;否则中文。不另建一套英文 Skill。
48
+
47
49
  ## 一键安装
48
50
 
49
51
  如果 CLI 尚未安装,直接帮用户执行对应平台的安装脚本:
@@ -287,6 +289,6 @@ CLI 返回的时间字段(如 `*DateTime` / `*Time` / `createTime` / `publishT
287
289
 
288
290
  > 无对应 CLI 命令的模块,或需要引导用户在网页端查看数据时,查阅 `references/web-pages.md` 获取完整页面清单与链接。
289
291
 
290
- URL 格式:`https://www-ci.siluzan.com/v3/foreign_trade/cso/{页面}`
292
+ URL 格式:`https://www.siluzan.com/v3/foreign_trade/cso/{页面}`
291
293
 
292
294
  常用页面:`task`(任务管理)· `postVideo`(发布页)· `ManageAccounts`(账号管理)· `planning`(AI 内容规划)· `table`(绩效报表)· `Workdata`(作品数据)
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "slug": "siluzan-cso",
3
- "version": "1.1.45-beta.5",
4
- "publishedAt": 1788837748615,
3
+ "version": "1.1.46",
4
+ "publishedAt": 1794833835570,
5
5
  "homepage": "https://www.siluzan.com",
6
6
  "source": "https://dev.azure.com/jack4it/Sammamish/_git/siluzan-skill",
7
7
  "requiredBinaries": [
@@ -22,7 +22,7 @@
22
22
  "cover": {
23
23
  "imageUrl": "https://cdn.example.com/cover.jpg",
24
24
  "imageName": "cover.jpg",
25
- "imageSourceType": 1,
25
+ "imageSourceType": 2,
26
26
  "sourceImageId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
27
27
  },
28
28
 
@@ -59,7 +59,7 @@
59
59
  "cover": {
60
60
  "imageUrl": "https://cdn.example.com/cover-youtube.jpg",
61
61
  "imageName": "cover-youtube.jpg",
62
- "imageSourceType": 1,
62
+ "imageSourceType": 2,
63
63
  "sourceImageId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
64
64
  }
65
65
  }
@@ -158,11 +158,13 @@ AI 可直接帮助润色:加钩子开头、适配平台风格、加 SEO 关键
158
158
 
159
159
  全局 `cover` 作为默认封面;某平台需要不同封面时:
160
160
 
161
+ 上传的独立封面图片使用 `imageSourceType: 2`,`sourceImageId` 填封面图片自己的素材 ID。`1` 仅用于视频素材首帧(填视频素材 ID),`0` 用于直接图片 URL。
162
+
161
163
  ```json
162
164
  "cover": {
163
165
  "imageUrl": "https://cdn.example.com/cover-default.jpg",
164
166
  "imageName": "cover-default.jpg",
165
- "imageSourceType": 1,
167
+ "imageSourceType": 2,
166
168
  "sourceImageId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
167
169
  },
168
170
  "platformOverrides": {
@@ -170,7 +172,7 @@ AI 可直接帮助润色:加钩子开头、适配平台风格、加 SEO 关键
170
172
  "cover": {
171
173
  "imageUrl": "https://cdn.example.com/cover-youtube.jpg",
172
174
  "imageName": "cover-youtube.jpg",
173
- "imageSourceType": 1,
175
+ "imageSourceType": 2,
174
176
  "sourceImageId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
175
177
  }
176
178
  }
@@ -217,6 +219,10 @@ AI 可直接帮助润色:加钩子开头、适配平台风格、加 SEO 关键
217
219
  siluzan-cso publish -c publish-config.json --dry-run
218
220
  ```
219
221
 
222
+ 视频发布的 `--dry-run` 也会读取素材元数据、刷新封面签名,并检查默认封面及已选平台封面。校验覆盖 HTTP 状态、图片响应类型、实际图片尺寸、15 秒超时、10 MiB 大小上限和最多 3 次重定向;失败会阻止提交。预览过程不会创建发布任务。
223
+
224
+ 普通预览中的封面地址隐藏查询参数和签名;仅显式指定 `--verbose` 时显示完整访问地址及请求体。视频首帧素材未提供缩略图时,可使用配置中可访问的帧图片地址,仍会校验其实际内容。
225
+
220
226
  ---
221
227
 
222
228
  ### Step 8:提交发布
@@ -236,7 +242,7 @@ siluzan-cso publish -c publish-config.json
236
242
 
237
243
  > 查询发布状态、处理失败项 → 参见 `references/task.md`
238
244
 
239
- 前往 CSO 任务管理页面查看进度:`https://www-ci.siluzan.com/v3/foreign_trade/cso/task`
245
+ 前往 CSO 任务管理页面查看进度:`https://www.siluzan.com/v3/foreign_trade/cso/task`
240
246
 
241
247
  ---
242
248
 
@@ -1,6 +1,6 @@
1
1
  # rag:RAG 知识库检索
2
2
 
3
- 知识库管理页面在https://www-ci.siluzan.com/knowledge-base/
3
+ 知识库管理页面在https://www.siluzan.com/knowledge-base/
4
4
 
5
5
  用于写稿、产品知识问答、三库素材提取等场景;凡回答依赖「本企业已入库素材」且不应凭模型记忆编造时,优先走 RAG。
6
6
 
@@ -3,7 +3,7 @@
3
3
  ## 安装 CLI
4
4
 
5
5
  ```bash
6
- npm install -g siluzan-cso-cli@beta
6
+ npm install -g siluzan-cso-cli
7
7
  ```
8
8
 
9
9
  环境要求:Node.js 18+
@@ -46,7 +46,7 @@ siluzan-cso config set --token <Token> # 备用:设置 JWT Token
46
46
 
47
47
  > **⚠️ 不要使用 `config set --token <token>` 的方式。** 该方式会将 Token 明文写入 shell history(`~/.bash_history`、`~/.zsh_history`、PowerShell 历史),存在凭证泄露风险。推荐使用 `siluzan-cso login` 交互式输入。
48
48
 
49
- API Key 获取入口:`https://www-ci.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
49
+ API Key 获取入口:`https://www.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
50
50
 
51
51
  ### 通过手机号 + 验证码登录(对话式 AI 推荐)
52
52
 
@@ -123,8 +123,8 @@ siluzan-cso config show
123
123
 
124
124
  ```
125
125
  构建环境 : production
126
- apiBaseUrl : https://api-ci.siluzan.com
127
- csoBaseUrl : https://cso-ci.siluzan.com
126
+ apiBaseUrl : https://api.siluzan.com
127
+ csoBaseUrl : https://cso.siluzan.com
128
128
  apiKey : abcd****1234
129
129
  ```
130
130
 
@@ -22,12 +22,13 @@ siluzan-cso upload -f /path/to/image.jpg
22
22
 
23
23
  命令成功后打印 JSON,包含以下字段,可直接用于发布配置:
24
24
 
25
- | 字段 | 用途 |
26
- | --------------------- | -------------------------------------- |
27
- | `videoId` | 发布配置 `videos[].videoId`(UUID) |
28
- | `videoUrl` | 视频预览地址 |
29
- | `cover.sourceImageId` | 发布配置 `cover.sourceImageId`(UUID) |
30
- | `cover.imageUrl` | 发布配置 `cover.imageUrl` |
25
+ | 字段 | 用途 |
26
+ | ----------------------- | ---------------------------------------- |
27
+ | `videoId` | 发布配置 `videos[].videoId`(UUID) |
28
+ | `videoUrl` | 视频预览地址 |
29
+ | `cover.sourceImageId` | 发布配置 `cover.sourceImageId`(UUID) |
30
+ | `cover.imageSourceType` | 上传的独立封面图片固定为 `2`(图片素材) |
31
+ | `cover.imageUrl` | 发布配置 `cover.imageUrl` |
31
32
 
32
33
  > **⚠️ UUID 字段必须用真实值**,不能使用占位符文本,否则后端会返回 HTTP 500。
33
34
 
@@ -38,6 +39,8 @@ siluzan-cso upload -f /path/to/image.jpg
38
39
  - 上传视频时**封面为必填**(`--cover`),不提供封面则命令报错
39
40
  - 若没有现成封面,可用 `extract-cover` 从视频中截取一帧 → 参见 `references/extract-cover.md`
40
41
  - 支持格式:JPG / PNG / GIF(封面);MP4 / MOV / MKV / AVI 等常见格式(视频)
42
+ - 上传前检查本地图片内容和尺寸;注册后重新获取封面访问地址,检查 HTTP 状态、图片响应类型和实际图片尺寸。封面返回 JSON 错误或失效时,命令会报错并停止后续视频上传。
43
+ - `cover.sourceImageId` 必须使用封面图片自己的素材 ID。不要把图片封面改为 `imageSourceType: 1`;`1` 仅用于视频素材首帧,对应的视频素材 ID 与图片素材 ID 不同。
41
44
 
42
45
  ---
43
46
 
@@ -67,12 +67,12 @@ siluzan-cso workflow validate -f draft.md --max 800 --json
67
67
  | `-f, --file <path>` | 待校验文案文件(`.md` / `.txt`);与 `--text` / stdin 三选一 |
68
68
  | `--text <content>` | 直接传入文案正文(宿主无文件工具时用);优先级最高 |
69
69
  | `--min <n>` | 字数下限(按 `--count-by` 口径) |
70
- | `--max <n>` | 字数上限(按 `--count-by` 口径)。口播成稿只约束口播正文,不含字幕重点 / 画面建议等成稿块 |
70
+ | `--max <n>` | 字数上限(按 `--count-by` 口径) |
71
71
  | `--count-by <mode>` | 限制口径:`chars-no-space`(不含空白,**默认**)· `chars`(含空白)· `cjk`(汉字)· `words`(英文单词) |
72
72
  | `--strip-markdown` | 统计前去除 markdown 语法与 frontmatter,默认 `false` |
73
73
  | `--no-check-leak` | 跳过内部骨架资产泄漏检查(默认开启检查) |
74
74
  | `--forbidden <words>` | 额外禁用子串,逗号分隔,命中即校验不通过 |
75
- | `--json` | JSON 输出(含全部指标、问题列表、`countScope`、`passed`) |
75
+ | `--json` | JSON 输出(含全部指标、问题列表、`passed`) |
76
76
 
77
77
  ---
78
78
 
@@ -84,8 +84,6 @@ siluzan-cso workflow validate -f draft.md --max 800 --json
84
84
  - **平台硬上限(如 X/Twitter 280 字符)**:用 `chars`(含空白)最贴近平台计数。
85
85
 
86
86
  > markdown 文件里 `#`、`*`、`>` 等符号会被计入原始字符数。需要「正文字数」时加 `--strip-markdown`。
87
- >
88
- > **口播 / 视频脚本**:`--min` / `--max` 只统计口播正文(`【口播脚本】` 到 `【字幕重点】` 之前)。【字幕重点】【画面建议】【发布文案】【话题标签】【风险与核验项】以及【平台】【标题/首行】等元数据**不计入**字数上限。泄漏检查仍扫全文。公众号文章等没有这些标题的成稿,仍按整篇统计。JSON 里 `countScope` 为 `spoken-body` 或 `full`。
89
87
 
90
88
  ---
91
89
 
@@ -1,7 +1,7 @@
1
1
  # web-pages — CSO 后台页面速查
2
2
 
3
3
  > 当需要引导用户前往网页端查看数据或执行操作时,使用本文件中的页面链接。
4
- > URL 格式:`https://www-ci.siluzan.com/v3/foreign_trade/cso/{页面路径}`
4
+ > URL 格式:`https://www.siluzan.com/v3/foreign_trade/cso/{页面路径}`
5
5
 
6
6
  ---
7
7
 
@@ -11,9 +11,9 @@
11
11
 
12
12
  | 页面 | 完整链接 | 功能说明 |
13
13
  | -------- | --------------------------------------------------------- | ---------------------------------------------------- |
14
- | 账号管理 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/ManageAccounts` | 绑定/授权/查看媒体账号列表、账号状态、Token 到期时间 |
15
- | 账号分组 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/AccountGroup` | 新建分组、管理分组内账号 |
16
- | 重点账号 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/KeyAccounts` | 配置重点关注账号、数据备份 |
14
+ | 账号管理 | `https://www.siluzan.com/v3/foreign_trade/cso/ManageAccounts` | 绑定/授权/查看媒体账号列表、账号状态、Token 到期时间 |
15
+ | 账号分组 | `https://www.siluzan.com/v3/foreign_trade/cso/AccountGroup` | 新建分组、管理分组内账号 |
16
+ | 重点账号 | `https://www.siluzan.com/v3/foreign_trade/cso/KeyAccounts` | 配置重点关注账号、数据备份 |
17
17
 
18
18
  ---
19
19
 
@@ -21,10 +21,10 @@
21
21
 
22
22
  | 页面 | 完整链接 | 功能说明 |
23
23
  | -------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
24
- | 发布作品 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/postVideo?contentType=1` | 矩阵发布视频、图文、草稿管理、话题组 contentType=1 是视频,contentType=2是图文 |
24
+ | 发布作品 | `https://www.siluzan.com/v3/foreign_trade/cso/postVideo?contentType=1` | 矩阵发布视频、图文、草稿管理、话题组 contentType=1 是视频,contentType=2是图文 |
25
25
 
26
- | 发布日历 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/publishCalendar` | 日历视图规划发布任务、创建/编辑发布任务 |
27
- | 营销日历 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/marketingCalendar` | 营销节点日历、跳转创建发布任务 |
26
+ | 发布日历 | `https://www.siluzan.com/v3/foreign_trade/cso/publishCalendar` | 日历视图规划发布任务、创建/编辑发布任务 |
27
+ | 营销日历 | `https://www.siluzan.com/v3/foreign_trade/cso/marketingCalendar` | 营销节点日历、跳转创建发布任务 |
28
28
 
29
29
  ---
30
30
 
@@ -32,10 +32,10 @@
32
32
 
33
33
  | 页面 | 完整链接 | 功能说明 |
34
34
  | -------- | ------------------------------------------------------- | ----------------------------------------- |
35
- | 任务列表 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/task` | 发布任务列表、状态筛选、任务详情抽屉 |
36
- | 视频管理 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/VideoMgr` | 已发布视频/图文列表、删除、重发、评论查看 |
37
- | 视频搬家 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/relocation` | 将视频搬运到其他平台 |
38
- | 搬家记录 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/MovingRecord` | 搬家任务列表与执行状态 |
35
+ | 任务列表 | `https://www.siluzan.com/v3/foreign_trade/cso/task` | 发布任务列表、状态筛选、任务详情抽屉 |
36
+ | 视频管理 | `https://www.siluzan.com/v3/foreign_trade/cso/VideoMgr` | 已发布视频/图文列表、删除、重发、评论查看 |
37
+ | 视频搬家 | `https://www.siluzan.com/v3/foreign_trade/cso/relocation` | 将视频搬运到其他平台 |
38
+ | 搬家记录 | `https://www.siluzan.com/v3/foreign_trade/cso/MovingRecord` | 搬家任务列表与执行状态 |
39
39
 
40
40
  ---
41
41
 
@@ -43,9 +43,9 @@
43
43
 
44
44
  | 页面 | 完整链接 | 功能说明 |
45
45
  | -------- | ------------------------------------------------------ | --------------------------------------- |
46
- | 私信管理 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/letter` | 按渠道/时间查看与处理私信(多平台 Tab) |
47
- | 评论管理 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/comment` | 收到的评论列表、回复、账号组筛选 |
48
- | 智能互动 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/interaction` | 私信欢迎语、自动回复规则配置 |
46
+ | 私信管理 | `https://www.siluzan.com/v3/foreign_trade/cso/letter` | 按渠道/时间查看与处理私信(多平台 Tab) |
47
+ | 评论管理 | `https://www.siluzan.com/v3/foreign_trade/cso/comment` | 收到的评论列表、回复、账号组筛选 |
48
+ | 智能互动 | `https://www.siluzan.com/v3/foreign_trade/cso/interaction` | 私信欢迎语、自动回复规则配置 |
49
49
 
50
50
  ---
51
51
 
@@ -53,9 +53,9 @@
53
53
 
54
54
  | 页面 | 完整链接 | 功能说明 |
55
55
  | -------- | ------------------------------------------------------ | -------------------------------------------------------------------- |
56
- | 作品数据 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/Workdata` | 作品维度统计、图表、明细(对应 CLI `report fetch`) |
57
- | 账户数据 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/accountdata` | 账户维度汇总数据、趋势图表 |
58
- | 绩效报表 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/table` | 多维度绩效报表、PDF 导出(对应 CLI `report fetch/records/download`) |
56
+ | 作品数据 | `https://www.siluzan.com/v3/foreign_trade/cso/Workdata` | 作品维度统计、图表、明细(对应 CLI `report fetch`) |
57
+ | 账户数据 | `https://www.siluzan.com/v3/foreign_trade/cso/accountdata` | 账户维度汇总数据、趋势图表 |
58
+ | 绩效报表 | `https://www.siluzan.com/v3/foreign_trade/cso/table` | 多维度绩效报表、PDF 导出(对应 CLI `report fetch/records/download`) |
59
59
 
60
60
  ---
61
61
 
@@ -63,11 +63,11 @@
63
63
 
64
64
  | 页面 | 完整链接 | 功能说明 |
65
65
  | -------- | ------------------------------------------------------ | -------------------------------------------------------------- |
66
- | 内容规划 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/planning` | AI 内容规划列表、生成规划、企业维度筛选(对应 CLI `planning`) |
67
- | 营销首页 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/ContentHome` | 工作台总览:账号数、视频数、最新评论与视频 |
66
+ | 内容规划 | `https://www.siluzan.com/v3/foreign_trade/cso/planning` | AI 内容规划列表、生成规划、企业维度筛选(对应 CLI `planning`) |
67
+ | 营销首页 | `https://www.siluzan.com/v3/foreign_trade/cso/ContentHome` | 工作台总览:账号数、视频数、最新评论与视频 |
68
68
 
69
- | 话题组 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/TopicGroup` | 话题组维护、话题内容管理 |
70
- | 知识库 | `https://www-ci.siluzan.com/knowledge-base/` | 知识库管理、编辑及查询 |
69
+ | 话题组 | `https://www.siluzan.com/v3/foreign_trade/cso/TopicGroup` | 话题组维护、话题内容管理 |
70
+ | 知识库 | `https://www.siluzan.com/knowledge-base/` | 知识库管理、编辑及查询 |
71
71
 
72
72
  ---
73
73
 
@@ -9,11 +9,11 @@ $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.45-beta.5'
12
+ $PKG_VERSION = '1.1.46'
13
13
  $CLI_BIN = 'siluzan-cso'
14
14
  $SKILL_LABEL = 'Siluzan CSO'
15
- $INSTALL_CMD = 'npm install -g siluzan-cso-cli@beta'
16
- $WEB_BASE = 'https://www-ci.siluzan.com'
15
+ $INSTALL_CMD = 'npm install -g siluzan-cso-cli'
16
+ $WEB_BASE = 'https://www.siluzan.com'
17
17
 
18
18
  # -- Constants ----------------------------------------------------------------
19
19
  $NODE_MAJOR_MIN = 18
@@ -9,11 +9,11 @@ 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.45-beta.5"
12
+ readonly PKG_VERSION="1.1.46"
13
13
  readonly CLI_BIN="siluzan-cso"
14
14
  readonly SKILL_LABEL="Siluzan CSO"
15
- readonly INSTALL_CMD="npm install -g siluzan-cso-cli@beta"
16
- readonly WEB_BASE="https://www-ci.siluzan.com"
15
+ readonly INSTALL_CMD="npm install -g siluzan-cso-cli"
16
+ readonly WEB_BASE="https://www.siluzan.com"
17
17
 
18
18
  # -- Constants ----------------------------------------------------------------
19
19
  readonly NODE_MAJOR_MIN=18
@@ -161,7 +161,7 @@ siluzan-cso workflow load-libraries --platform <平台> --out <file_path>
161
161
 
162
162
  ### 第 4 步:读取并遵循必读文件指导创作文案
163
163
 
164
- **新生成视频脚本的最终阶段附加规则**:仅当宿主原有选题及方案/提纲确认已经完成、即将正式写稿时,完整读取 `video-script-final.workflow.md`,再按其规则处理本次三库并成稿;确认未完成时禁止提前读取。该文件不得改变前述选题、RAG、方案卡或确认流程。非视频任务忽略本段。若宿主已锁定 `script_kind`,按该文件第 1.0 节进入对应类型写稿:**沿用已加载人设风格**,不要重读本文件第 1–3.5 步、`topic-selection.md`、`collaboration.md` 或 `library-catalog.md`;`sop.md` 只在还缺「成稿输出规范」时补读该节。选号以 `--video-script` 合并文件「视频脚本专项章节」组合表为准,按表内编号回源入选条目全文(句式 / 结构块 / content)并写进口播,禁止只套骨架空写。成稿块仍按已加载平台规则的「输出格式」,不要只交口播正文。
164
+ **新生成视频脚本的最终阶段附加规则**:仅当宿主原有选题及方案/提纲确认已经完成、即将正式写稿时,完整读取 `video-script-final.workflow.md`,再按其规则处理本次三库并成稿;确认未完成时禁止提前读取。该文件不得改变前述选题、RAG、方案卡或确认流程。非视频任务忽略本段。若宿主已锁定 `script_kind`,按该文件第 1.0 节进入对应类型写稿:**沿用已加载人设风格**,不要重读本文件第 1–3.5 步、`topic-selection.md` 或 `collaboration.md`;`sop.md` 只在还缺「成稿输出规范」时补读该节。成稿块仍按已加载平台规则的「输出格式」,不要只交口播正文。
165
165
 
166
166
  **单轨**
167
167
 
@@ -187,7 +187,7 @@ siluzan-cso workflow load-libraries --platform <平台> --out <file_path>
187
187
 
188
188
  - [ ] 第 1 步:人设已就绪(`styleGuide` 已加载或临时人设已明确);碎片风格 / 平台未命中须走临时人设;平台有人设时须由用户选定(未替选)
189
189
  - [ ] 第 1.5 步:若为本期五个平台,已加载当前平台唯一对应的规则文件;结构化字段与 `styleGuide` 冲突时已采用结构化字段并记录冲突;仅规则缺失、为空或不可读时停止生成,且未跨平台兜底
190
- - [ ] 第 2 步:本次三库已按优先级确认。未锁定 `script_kind` 时:兜底已 `load-libraries` 落盘,并**完整读取** `library-catalog.md`(无 `head`/`tail`/截断),本步未把三库条目全文读进上下文。已锁定 `script_kind` 且进入视频终稿时:已 `load-libraries --video-script`,**未读** `library-catalog.md`,已按组合表回源入选全文并写进口播
190
+ - [ ] 第 2 步:本次三库已按优先级确认;兜底已 `load-libraries` 落盘,并**完整读取** `library-catalog.md`(无 `head`/`tail`/截断);本步未把三库条目全文读进上下文
191
191
  - [ ] 第 3 步:RAG 已执行或已明确判定跳过(涉及品牌/产品事实时不得跳过)
192
192
  - [ ] 第 3.5 步:若触发选题生成(热点/资讯/推荐选题且角度未明),已 Read `topic-selection.md`、候选已通过定位对齐与淘汰校验、**用户已确认选题**;未触发则已明确跳过理由
193
193
  - [ ] 第 4 步:生成阶段已严格依照 `sop.md` 流程执行且全部要求落实(选定编号后已在合并文件中回源入选全文;**多轨**时另核对:`multi-track-brief.md` 已确认、各轨独立文件、写后轨未读前轨正文、各轨均已 validate)
@@ -205,7 +205,7 @@ siluzan-cso workflow load-libraries --platform <平台> --out <file_path>
205
205
  - 口播 / 视频脚本:`{人设名}-{主标题}-口播脚本.md` 或 `{主标题}-口播脚本.md`。禁止 `ubi-video-script.md`、`video-script.md`、`script.md`、`口播.md`。细则见 `video-script-final.workflow.md`。
206
206
  - 其他体裁:`{人设名}-{主标题}-成稿.md` 或 `{主标题}-成稿.md`。
207
207
  - 多轨在上述格式的扩展名前加 `-tN-策略`(如 `{人设名}-{主标题}-t1-爆款-口播脚本.md`)。
208
- - **成稿后校验**:每次交付前必须用 `siluzan-cso workflow validate` 校验(含字数、三库泄漏等),不通过须修正重新检测。口播成稿的 `--max` 只约束口播正文,不含字幕重点 / 画面建议等成稿块。文案来源按宿主能力选:有文件工具用 `-f <成稿文件>`;**无文件工具**(成稿只在对话里)则用管道 `printf '%s' "<全文>" | siluzan-cso workflow validate …` 或 `--text "<全文>"` 直接传入。详见 `references/validate-content.md`。
208
+ - **成稿后校验**:每次交付前必须用 `siluzan-cso workflow validate` 校验(含字数、三库泄漏等),不通过须修正重新检测。文案来源按宿主能力选:有文件工具用 `-f <成稿文件>`;**无文件工具**(成稿只在对话里)则用管道 `printf '%s' "<全文>" | siluzan-cso workflow validate …` 或 `--text "<全文>"` 直接传入。详见 `references/validate-content.md`。
209
209
  - **独立文件**:每次交付时一个独立的文件;用户要求修改时新建带版本号的文件(如 `<原名>-v2.md`、`-v3.md`),不覆盖原稿。
210
210
  - **过程与成稿分开**:成稿只含正文,过程内容如需保存单独成文件,不在对话中展示。
211
211
  - **对话只简短说明**:仅报摘要、文件名/路径及后续建议,不贴正文、不含三库相关内容。
@@ -66,7 +66,7 @@
66
66
  siluzan-cso workflow load-libraries --platform <平台> --video-script --out <file_path>
67
67
  ```
68
68
 
69
- 落盘后不要通读合并文件。第 1.0 节已锁定类型时,**禁止读取 `library-catalog.md`**:选号权威是合并文件「视频脚本专项章节」里与锁定类型相关的组合表,不是全量目录。只读该组合表,再按表内编号回源入选条目全文(句式 / 结构块 / content);**写稿必须把这些内容写进口播**,禁止只套目标骨架 + 人设风格 + 热点空写。不要为了重新分类或选号而通读基础库目录或 `sop.md` 选题章节。人设过滤仍用已加载人设,不要为此重读人设入职文档。未锁定时,先完整读取 `library-catalog.md`(含文末「视频专项」),按主 SOP 人设过滤 → 选题命中 → 配额选定编号后,在合并文件中定位入选条目全文,并读「视频脚本专项章节」里与本次 objective / 主类型相关的组合表。未入选的基础库条目不要读进上下文。
69
+ 落盘后不要通读合并文件。第 1.0 节已锁定类型时,不要为重新分类通读 `library-catalog.md` 全量或 `sop.md` 选题章节;只读「视频脚本专项章节」里与锁定类型相关的组合表,再按编号回源入选条目全文。人设过滤仍用已加载人设,不要为此重读人设入职文档。未锁定时,先完整读取 `library-catalog.md`(含文末「视频专项」),按主 SOP 人设过滤 → 选题命中 → 配额选定编号后,在合并文件中定位入选条目全文,并读「视频脚本专项章节」里与本次 objective / 主类型相关的组合表。未入选的基础库条目不要读进上下文。
70
70
 
71
71
  “微信视频号”规范为“视频号”;公众号和非视频任务禁止使用 `--video-script`。用户本轮提供或本地已有三库时,用户文件保持权威且允许沿用原流程优化;视频专项规则不得写回或覆盖用户文件,只从已有条目按语义选取,不创建、改写或强套内置编号。
72
72
 
@@ -113,4 +113,4 @@ siluzan-cso workflow load-libraries --platform <平台> --video-script --out <fi
113
113
  - 成稿文件不附 SOP 自检清单、`verified_facts` 字段名或「来源:RAG」类正文内标签,也不附目标骨架步骤标注。已加载平台规则的「输出格式」必须整套写入成稿(抖音为【口播脚本】【字幕重点】【画面建议】【发布文案】【话题标签】【风险与核验项】等),与是否锁定 `script_kind` 无关,禁止只交口播正文。交付摘要只说明“目标类型 + 正文主类型”(如“转化型公司实力视频”)和仍待补事实。
114
114
  - 每个待交付的最终成稿文件都必须写入 `/mnt/user-data/outputs/`;`/mnt/user-data/workspace/` 只存放草稿、中间结果或内部记录,不得作为最终交付路径。不得用 Bash、`cp` 等未受宿主写入追踪的方式生成最终交付文件。
115
115
  - 口播文件名必须能看出本篇主标题(有人设时加上人设名),格式为 `{人设名}-{主标题}-口播脚本.md` 或 `{主标题}-口播脚本.md`。禁止使用 `ubi-video-script.md`、`video-script.md`、`script.md`、`口播.md` 等占位文件名。主标题取成稿主标题或已确认选题短句;人设名取当前正式人设名称。去掉 `/ \ : * ? " < > |` 等不能进文件名的字符;过长则截断主标题、保留后缀。**已有成稿后再修改、换类型或重写,必须写入新文件**(`{人设名}-{主标题}-口播脚本-vN.md` 或主标题后标明类型),禁止覆盖上一版同名路径;只有用户明确要求覆盖当前稿时才写回原文件。首次落盘使用 `write_file`;覆盖当前稿时才允许对原路径使用 `str_replace` / `patch_file`。
116
- - 对 `/mnt/user-data/outputs/` 中的最终文件完成 `siluzan-cso workflow validate`(用户给了字数上限时加 `--max`,例如 `--max 800`)。`--max` **只约束口播正文**,【字幕重点】【画面建议】【发布文案】等成稿块不计入;细则见 `references/validate-content.md`。通过后使用与写入时完全相同的 outputs 路径调用 `present_files(is_copy=true)`;所有待交付文件均成功呈现后才算本阶段完成。
116
+ - 对 `/mnt/user-data/outputs/` 中的最终文件完成 `siluzan-cso workflow validate`,通过后使用与写入时完全相同的 outputs 路径调用 `present_files(is_copy=true)`;所有待交付文件均成功呈现后才算本阶段完成。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siluzan-cso-cli",
3
- "version": "1.1.45-beta.5",
3
+ "version": "1.1.46",
4
4
  "description": "Siluzan platform AI Skill CLI — multi-platform content publishing (video/image-text) for Cursor, Claude Code, and OpenClaw.",
5
5
  "keywords": [
6
6
  "ai-skill",