siluzan-cso-cli 1.1.8-beta.5 → 1.1.8

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
@@ -12,7 +12,7 @@
12
12
  在**用户的目标项目根目录**执行(根据用户使用的助手选择 `--ai`):
13
13
 
14
14
  ```bash
15
- npm install -g siluzan-cso-cli@beta
15
+ npm install -g siluzan-cso-cli
16
16
  siluzan-cso init --ai cursor # 写入 Cursor(默认)
17
17
  siluzan-cso init --ai cursor,claude # 同时写入多个平台
18
18
  siluzan-cso init --ai all # 写入所有支持的平台
@@ -20,7 +20,6 @@ siluzan-cso init -d /path/to/skills # 写入自定义目录
20
20
  siluzan-cso init --force # 强制覆盖已存在文件
21
21
  ```
22
22
 
23
- > **注意**:当前为测试版(1.1.8-beta.5),供内部测试使用。正式发布后安装命令将改为 `npm install -g siluzan-cso-cli`。
24
23
 
25
24
  | 助手 | 建议 `--ai` |
26
25
  |------|-------------|
package/dist/index.js CHANGED
@@ -1939,11 +1939,11 @@ var require_semver2 = __commonJS({
1939
1939
  import { Command, Option } from "commander";
1940
1940
 
1941
1941
  // src/config/defaults.ts
1942
- var BUILD_ENV = "test";
1943
- var DEFAULT_API_BASE = "https://api-ci.siluzan.com";
1944
- var DEFAULT_CSO_BASE = "https://cso-ci.siluzan.com";
1945
- var DEFAULT_WEB_BASE = "https://www-ci.siluzan.com";
1946
- var DEFAULT_AGENT_BASE = "https://agent-ci.mysiluzan.com";
1942
+ var BUILD_ENV = "production";
1943
+ var DEFAULT_API_BASE = "https://api.siluzan.com";
1944
+ var DEFAULT_CSO_BASE = "https://cso.siluzan.com";
1945
+ var DEFAULT_WEB_BASE = "https://www.siluzan.com";
1946
+ var DEFAULT_AGENT_BASE = "https://agent.mysiluzan.com";
1947
1947
 
1948
1948
  // src/commands/init.ts
1949
1949
  import * as fs2 from "fs/promises";
@@ -2125,11 +2125,11 @@ import * as path3 from "path";
2125
2125
  import * as os2 from "os";
2126
2126
  import * as https from "https";
2127
2127
  import * as http from "http";
2128
- import * as os22 from "os";
2129
2128
  import { randomUUID as _randomUUID } from "crypto";
2130
2129
  import * as fs22 from "fs";
2131
2130
  import * as path22 from "path";
2132
2131
  import { fileURLToPath as fileURLToPath2 } from "url";
2132
+ import * as os22 from "os";
2133
2133
  var SILUZAN_DIR = path3.join(os2.homedir(), ".siluzan");
2134
2134
  var CONFIG_FILE = path3.join(SILUZAN_DIR, "config.json");
2135
2135
  function readStr(raw, key) {
@@ -2242,6 +2242,96 @@ function rawRequest(url, options) {
2242
2242
  req.end();
2243
2243
  });
2244
2244
  }
2245
+ function redactSensitive(input) {
2246
+ let output = input;
2247
+ output = output.replace(/(Bearer\s+)[^\s",]+/gi, "$1***");
2248
+ output = output.replace(
2249
+ /("?(?:apiKey|authToken|accessToken|refreshToken|token|authorization)"?\s*[:=]\s*"?)([^"\s,}]+)/gi,
2250
+ "$1***"
2251
+ );
2252
+ return output;
2253
+ }
2254
+ async function apiFetch(url, config, options = {}, verbose = false) {
2255
+ const method = options.method ?? "GET";
2256
+ const authHeaders = config.apiKey ? { "x-api-key": config.apiKey } : { Authorization: `Bearer ${config.authToken}` };
2257
+ const reqHeaders = {
2258
+ "Content-Type": "application/json",
2259
+ "Accept-Language": "zh-CN",
2260
+ ...authHeaders,
2261
+ // dataPermission 仅 TSO 使用;CSO 未设置时为空字符串,服务端忽略该头
2262
+ Datapermission: config.dataPermission ?? "",
2263
+ ...options.headers ?? {}
2264
+ };
2265
+ const body = typeof options.body === "string" ? options.body : void 0;
2266
+ const res = await rawRequest(url, {
2267
+ method,
2268
+ headers: reqHeaders,
2269
+ body
2270
+ });
2271
+ const text = res.text;
2272
+ if (res.status < 200 || res.status >= 300) {
2273
+ const detail = verbose ? `\uFF1A${redactSensitive(text).slice(0, 300)}` : "";
2274
+ throw new Error(`HTTP ${res.status}${detail}`);
2275
+ }
2276
+ if (!text.trim()) return null;
2277
+ try {
2278
+ return JSON.parse(text);
2279
+ } catch {
2280
+ if (verbose) {
2281
+ console.error(` \u26A0\uFE0F \u54CD\u5E94\u975E JSON\uFF0C\u539F\u59CB\u5185\u5BB9\uFF1A${redactSensitive(text).slice(0, 200)}`);
2282
+ }
2283
+ return text;
2284
+ }
2285
+ }
2286
+ function decodeJwtClaims(token) {
2287
+ try {
2288
+ const parts = token.split(".");
2289
+ if (parts.length < 2) return null;
2290
+ const payload = Buffer.from(parts[1], "base64url").toString("utf8");
2291
+ const parsed = JSON.parse(payload);
2292
+ return parsed.sub ? parsed : null;
2293
+ } catch {
2294
+ return null;
2295
+ }
2296
+ }
2297
+ function isUUID(value) {
2298
+ if (typeof value !== "string") return false;
2299
+ return /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value);
2300
+ }
2301
+ var randomUUID = _randomUUID;
2302
+ function getCurrentVersion(importMetaUrl) {
2303
+ try {
2304
+ const __dirname2 = path22.dirname(fileURLToPath2(importMetaUrl));
2305
+ const pkgPath = path22.join(__dirname2, "..", "package.json");
2306
+ const pkg = JSON.parse(fs22.readFileSync(pkgPath, "utf8"));
2307
+ return pkg.version ?? "0.0.0";
2308
+ } catch {
2309
+ return "0.0.0";
2310
+ }
2311
+ }
2312
+ function npmDistTagForBuildEnv(buildEnv) {
2313
+ return buildEnv === "test" ? "beta" : "latest";
2314
+ }
2315
+ function npmMinRequiredTagForBuildEnv(buildEnv) {
2316
+ return buildEnv === "test" ? "min-required-beta" : "min-required";
2317
+ }
2318
+ function isNewer(a, b) {
2319
+ return import_semver.default.gt(b, a) === true;
2320
+ }
2321
+ async function fetchNpmVersion(pkgName, tag, timeoutMs = 4e3) {
2322
+ try {
2323
+ const url = `https://registry.npmjs.org/${pkgName}/${tag}`;
2324
+ const controller = new AbortController();
2325
+ const timer = setTimeout(() => controller.abort(), timeoutMs);
2326
+ const res = await fetch(url, { signal: controller.signal });
2327
+ clearTimeout(timer);
2328
+ if (!res.ok) return null;
2329
+ const data = await res.json();
2330
+ return data.version ?? null;
2331
+ } catch {
2332
+ return null;
2333
+ }
2334
+ }
2245
2335
  var DEFAULT_SENTRY_DSN = "https://bafcf42aab6fe7b485310619ae041b5e@o4510436169285632.ingest.us.sentry.io/4511103054708736";
2246
2336
  function isSentryDisabled() {
2247
2337
  return process.env.SILUZAN_SENTRY_DISABLED === "1" || process.env.SILUZAN_SENTRY_DISABLED === "true";
@@ -2482,96 +2572,6 @@ function refreshSiluzanUser(apiBase, config) {
2482
2572
  }
2483
2573
  })();
2484
2574
  }
2485
- function redactSensitive(input) {
2486
- let output = input;
2487
- output = output.replace(/(Bearer\s+)[^\s",]+/gi, "$1***");
2488
- output = output.replace(
2489
- /("?(?:apiKey|authToken|accessToken|refreshToken|token|authorization)"?\s*[:=]\s*"?)([^"\s,}]+)/gi,
2490
- "$1***"
2491
- );
2492
- return output;
2493
- }
2494
- async function apiFetch(url, config, options = {}, verbose = false) {
2495
- const method = options.method ?? "GET";
2496
- const authHeaders = config.apiKey ? { "x-api-key": config.apiKey } : { Authorization: `Bearer ${config.authToken}` };
2497
- const reqHeaders = {
2498
- "Content-Type": "application/json",
2499
- "Accept-Language": "zh-CN",
2500
- ...authHeaders,
2501
- // dataPermission 仅 TSO 使用;CSO 未设置时为空字符串,服务端忽略该头
2502
- Datapermission: config.dataPermission ?? "",
2503
- ...options.headers ?? {}
2504
- };
2505
- const body = typeof options.body === "string" ? options.body : void 0;
2506
- const res = await rawRequest(url, {
2507
- method,
2508
- headers: reqHeaders,
2509
- body
2510
- });
2511
- const text = res.text;
2512
- if (res.status < 200 || res.status >= 300) {
2513
- const detail = verbose ? `\uFF1A${redactSensitive(text).slice(0, 300)}` : "";
2514
- throw new Error(`HTTP ${res.status}${detail}`);
2515
- }
2516
- if (!text.trim()) return null;
2517
- try {
2518
- return JSON.parse(text);
2519
- } catch {
2520
- if (verbose) {
2521
- console.error(` \u26A0\uFE0F \u54CD\u5E94\u975E JSON\uFF0C\u539F\u59CB\u5185\u5BB9\uFF1A${redactSensitive(text).slice(0, 200)}`);
2522
- }
2523
- return text;
2524
- }
2525
- }
2526
- function decodeJwtClaims(token) {
2527
- try {
2528
- const parts = token.split(".");
2529
- if (parts.length < 2) return null;
2530
- const payload = Buffer.from(parts[1], "base64url").toString("utf8");
2531
- const parsed = JSON.parse(payload);
2532
- return parsed.sub ? parsed : null;
2533
- } catch {
2534
- return null;
2535
- }
2536
- }
2537
- function isUUID(value) {
2538
- if (typeof value !== "string") return false;
2539
- return /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value);
2540
- }
2541
- var randomUUID = _randomUUID;
2542
- function getCurrentVersion(importMetaUrl) {
2543
- try {
2544
- const __dirname2 = path22.dirname(fileURLToPath2(importMetaUrl));
2545
- const pkgPath = path22.join(__dirname2, "..", "package.json");
2546
- const pkg = JSON.parse(fs22.readFileSync(pkgPath, "utf8"));
2547
- return pkg.version ?? "0.0.0";
2548
- } catch {
2549
- return "0.0.0";
2550
- }
2551
- }
2552
- function npmDistTagForBuildEnv(buildEnv) {
2553
- return buildEnv === "test" ? "beta" : "latest";
2554
- }
2555
- function npmMinRequiredTagForBuildEnv(buildEnv) {
2556
- return buildEnv === "test" ? "min-required-beta" : "min-required";
2557
- }
2558
- function isNewer(a, b) {
2559
- return import_semver.default.gt(b, a) === true;
2560
- }
2561
- async function fetchNpmVersion(pkgName, tag, timeoutMs = 4e3) {
2562
- try {
2563
- const url = `https://registry.npmjs.org/${pkgName}/${tag}`;
2564
- const controller = new AbortController();
2565
- const timer = setTimeout(() => controller.abort(), timeoutMs);
2566
- const res = await fetch(url, { signal: controller.signal });
2567
- clearTimeout(timer);
2568
- if (!res.ok) return null;
2569
- const data = await res.json();
2570
- return data.version ?? null;
2571
- } catch {
2572
- return null;
2573
- }
2574
- }
2575
2575
 
2576
2576
  // src/commands/login.ts
2577
2577
  async function runLogin(opts = {}) {
@@ -123,6 +123,6 @@ account-group ──需要 mediaCustomerId──► list-accounts
123
123
 
124
124
  > 无对应 CLI 命令的模块,或需要引导用户在网页端查看数据时,查阅 `references/web-pages.md` 获取完整页面清单与链接。
125
125
 
126
- URL 格式:`https://www-ci.siluzan.com/v3/foreign_trade/cso/{页面}`
126
+ URL 格式:`https://www.siluzan.com/v3/foreign_trade/cso/{页面}`
127
127
 
128
128
  常用页面:`task`(任务管理)· `postVideo`(发布页)· `ManageAccounts`(账号管理)· `planning`(AI 内容规划)· `table`(绩效报表)· `Workdata`(作品数据)
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "slug": "siluzan-cso",
3
- "version": "1.1.8-beta.5",
4
- "publishedAt": 1775716250883
3
+ "version": "1.1.8",
4
+ "publishedAt": 1775724298669
5
5
  }
@@ -199,7 +199,7 @@ siluzan-cso publish -c publish-config.json
199
199
 
200
200
  > 查询发布状态、处理失败项 → 参见 `references/task.md`
201
201
 
202
- 前往 CSO 任务管理页面查看进度:`https://www-ci.siluzan.com/v3/foreign_trade/cso/task`
202
+ 前往 CSO 任务管理页面查看进度:`https://www.siluzan.com/v3/foreign_trade/cso/task`
203
203
 
204
204
  ---
205
205
 
@@ -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 24+
@@ -44,7 +44,7 @@ siluzan-cso config set --token <Token> # 备用:设置 JWT Token
44
44
 
45
45
  > **⚠️ 不要使用 `config set --token <token>` 的方式。** 该方式会将 Token 明文写入 shell history(`~/.bash_history`、`~/.zsh_history`、PowerShell 历史),存在凭证泄露风险。推荐使用 `siluzan-cso login` 交互式输入。
46
46
 
47
- API Key 获取入口:`https://cso-ci.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
47
+ API Key 获取入口:`https://cso.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
48
48
 
49
49
  **Token 读取优先级(由高到低):**
50
50
  1. 环境变量 `SILUZAN_AUTH_TOKEN`(CI/CD 推荐)
@@ -63,8 +63,8 @@ siluzan-cso config show
63
63
  输出示例:
64
64
  ```
65
65
  构建环境 : production
66
- apiBaseUrl : https://api-ci.siluzan.com
67
- csoBaseUrl : https://cso-ci.siluzan.com
66
+ apiBaseUrl : https://api.siluzan.com
67
+ csoBaseUrl : https://cso.siluzan.com
68
68
  apiKey : abcd****1234
69
69
  ```
70
70
 
@@ -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
  ---
@@ -22,10 +22,10 @@
22
22
 
23
23
  | 页面 | 完整链接 | 功能说明 |
24
24
  |------|----------|----------|
25
- | 发布作品 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/postVideo?contentType=1` | 矩阵发布视频、图文、草稿管理、话题组 contentType=1 是视频,contentType=2是图文 |
25
+ | 发布作品 | `https://www.siluzan.com/v3/foreign_trade/cso/postVideo?contentType=1` | 矩阵发布视频、图文、草稿管理、话题组 contentType=1 是视频,contentType=2是图文 |
26
26
 
27
- | 发布日历 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/publishCalendar` | 日历视图规划发布任务、创建/编辑发布任务 |
28
- | 营销日历 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/marketingCalendar` | 营销节点日历、跳转创建发布任务 |
27
+ | 发布日历 | `https://www.siluzan.com/v3/foreign_trade/cso/publishCalendar` | 日历视图规划发布任务、创建/编辑发布任务 |
28
+ | 营销日历 | `https://www.siluzan.com/v3/foreign_trade/cso/marketingCalendar` | 营销节点日历、跳转创建发布任务 |
29
29
 
30
30
  ---
31
31
 
@@ -33,10 +33,10 @@
33
33
 
34
34
  | 页面 | 完整链接 | 功能说明 |
35
35
  |------|----------|----------|
36
- | 任务列表 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/task` | 发布任务列表、状态筛选、任务详情抽屉 |
37
- | 视频管理 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/VideoMgr` | 已发布视频/图文列表、删除、重发、评论查看 |
38
- | 视频搬家 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/relocation` | 将视频搬运到其他平台 |
39
- | 搬家记录 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/MovingRecord` | 搬家任务列表与执行状态 |
36
+ | 任务列表 | `https://www.siluzan.com/v3/foreign_trade/cso/task` | 发布任务列表、状态筛选、任务详情抽屉 |
37
+ | 视频管理 | `https://www.siluzan.com/v3/foreign_trade/cso/VideoMgr` | 已发布视频/图文列表、删除、重发、评论查看 |
38
+ | 视频搬家 | `https://www.siluzan.com/v3/foreign_trade/cso/relocation` | 将视频搬运到其他平台 |
39
+ | 搬家记录 | `https://www.siluzan.com/v3/foreign_trade/cso/MovingRecord` | 搬家任务列表与执行状态 |
40
40
 
41
41
  ---
42
42
 
@@ -44,9 +44,9 @@
44
44
 
45
45
  | 页面 | 完整链接 | 功能说明 |
46
46
  |------|----------|----------|
47
- | 私信管理 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/letter` | 按渠道/时间查看与处理私信(多平台 Tab) |
48
- | 评论管理 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/comment` | 收到的评论列表、回复、账号组筛选 |
49
- | 智能互动 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/interaction` | 私信欢迎语、自动回复规则配置 |
47
+ | 私信管理 | `https://www.siluzan.com/v3/foreign_trade/cso/letter` | 按渠道/时间查看与处理私信(多平台 Tab) |
48
+ | 评论管理 | `https://www.siluzan.com/v3/foreign_trade/cso/comment` | 收到的评论列表、回复、账号组筛选 |
49
+ | 智能互动 | `https://www.siluzan.com/v3/foreign_trade/cso/interaction` | 私信欢迎语、自动回复规则配置 |
50
50
 
51
51
  ---
52
52
 
@@ -54,9 +54,9 @@
54
54
 
55
55
  | 页面 | 完整链接 | 功能说明 |
56
56
  |------|----------|----------|
57
- | 作品数据 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/Workdata` | 作品维度统计、图表、明细(对应 CLI `report fetch`) |
58
- | 账户数据 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/accountdata` | 账户维度汇总数据、趋势图表 |
59
- | 绩效报表 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/table` | 多维度绩效报表、PDF 导出(对应 CLI `report fetch/records/download`) |
57
+ | 作品数据 | `https://www.siluzan.com/v3/foreign_trade/cso/Workdata` | 作品维度统计、图表、明细(对应 CLI `report fetch`) |
58
+ | 账户数据 | `https://www.siluzan.com/v3/foreign_trade/cso/accountdata` | 账户维度汇总数据、趋势图表 |
59
+ | 绩效报表 | `https://www.siluzan.com/v3/foreign_trade/cso/table` | 多维度绩效报表、PDF 导出(对应 CLI `report fetch/records/download`) |
60
60
 
61
61
  ---
62
62
 
@@ -64,10 +64,10 @@
64
64
 
65
65
  | 页面 | 完整链接 | 功能说明 |
66
66
  |------|----------|----------|
67
- | 内容规划 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/planning` | AI 内容规划列表、生成规划、企业维度筛选(对应 CLI `planning`) |
68
- | 营销首页 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/ContentHome` | 工作台总览:账号数、视频数、最新评论与视频 |
67
+ | 内容规划 | `https://www.siluzan.com/v3/foreign_trade/cso/planning` | AI 内容规划列表、生成规划、企业维度筛选(对应 CLI `planning`) |
68
+ | 营销首页 | `https://www.siluzan.com/v3/foreign_trade/cso/ContentHome` | 工作台总览:账号数、视频数、最新评论与视频 |
69
69
 
70
- | 话题组 | `https://www-ci.siluzan.com/v3/foreign_trade/cso/TopicGroup` | 话题组维护、话题内容管理 |
70
+ | 话题组 | `https://www.siluzan.com/v3/foreign_trade/cso/TopicGroup` | 话题组维护、话题内容管理 |
71
71
 
72
72
 
73
73
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siluzan-cso-cli",
3
- "version": "1.1.8-beta.5",
3
+ "version": "1.1.8",
4
4
  "description": "Siluzan platform AI Skill CLI — multi-platform content publishing (video/image-text) for Cursor, Claude Code, and OpenClaw.",
5
5
  "type": "module",
6
6
  "bin": {