siluzan-tso-cli 1.1.32 → 1.1.33-beta.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/README.md CHANGED
@@ -43,7 +43,7 @@ HTML 报告模板外部资源:**ECharts** 统一使用 `https://staticpn.siluz
43
43
  在**用户的目标项目根目录**执行(根据用户使用的助手选择 `--ai`):
44
44
 
45
45
  ```bash
46
- npm install -g siluzan-tso-cli
46
+ npm install -g siluzan-tso-cli@beta
47
47
  siluzan-tso init --ai cursor # 写入 Cursor(默认)
48
48
  siluzan-tso init --ai cursor,claude # 同时写入多个平台
49
49
  siluzan-tso init --ai all # 写入所有支持的平台
@@ -51,6 +51,7 @@ siluzan-tso init -d /path/to/skills # 写入自定义目录
51
51
  siluzan-tso init --force # 强制覆盖已存在文件
52
52
  ```
53
53
 
54
+ > **注意**:当前为测试版(1.1.33-beta.1),供内部测试使用。正式发布后安装命令将改为 `npm install -g siluzan-tso-cli`。
54
55
 
55
56
  | 助手 | 建议 `--ai` |
56
57
  | ----------------------- | ------------------------------------ |
package/dist/index.js CHANGED
@@ -1980,6 +1980,7 @@ import * as fs3 from "fs/promises";
1980
1980
  import * as path3 from "path";
1981
1981
  import * as fs4 from "fs/promises";
1982
1982
  import * as path4 from "path";
1983
+ import { spawn as spawn2 } from "child_process";
1983
1984
  import * as path5 from "path";
1984
1985
  import { chmod, mkdir as mkdir3, open, readdir, stat, unlink } from "fs/promises";
1985
1986
  import * as path6 from "path";
@@ -2933,6 +2934,60 @@ function installProcessHandlers() {
2933
2934
  process.exit(1);
2934
2935
  });
2935
2936
  }
2937
+ function tryOpenHttpsUrlInBrowser(url) {
2938
+ try {
2939
+ const parsed = new URL(url);
2940
+ if (parsed.protocol !== "https:") {
2941
+ return false;
2942
+ }
2943
+ if (process.platform === "win32") {
2944
+ const child = spawn2("rundll32", ["url.dll,FileProtocolHandler", parsed.toString()], {
2945
+ detached: true,
2946
+ stdio: "ignore",
2947
+ windowsHide: true
2948
+ });
2949
+ child.unref();
2950
+ } else if (process.platform === "darwin") {
2951
+ const child = spawn2("open", [parsed.toString()], { detached: true, stdio: "ignore" });
2952
+ child.unref();
2953
+ } else {
2954
+ const child = spawn2("xdg-open", [parsed.toString()], { detached: true, stdio: "ignore" });
2955
+ child.unref();
2956
+ }
2957
+ return true;
2958
+ } catch {
2959
+ return false;
2960
+ }
2961
+ }
2962
+ function deliverMediaAccountOAuthLink(opts) {
2963
+ const { mediaLabel, redirectUrl, tryOpenBrowser: tryOpenBrowser2 } = opts;
2964
+ if (isSiluzanAgentEnv()) {
2965
+ console.log(
2966
+ `
2967
+ \u2139\uFE0F \u68C0\u6D4B\u5230 Siluzan Agent \u73AF\u5883\uFF08IS_SILUZAN_AGENT_ENV=true\uFF09\u3002
2968
+ \u8BF7\u6253\u5F00\u4EE5\u4E0B\u94FE\u63A5\u5B8C\u6210 ${mediaLabel} \u5E7F\u544A\u8D26\u6237\u6388\u6743\uFF08\u6C99\u7BB1\u5185\u4E0D\u4F1A\u81EA\u52A8\u6253\u5F00\u6D4F\u89C8\u5668\uFF09\uFF1A
2969
+
2970
+ ${redirectUrl}
2971
+ `
2972
+ );
2973
+ return;
2974
+ }
2975
+ if (tryOpenBrowser2) {
2976
+ const opened = tryOpenBrowser2(redirectUrl);
2977
+ if (opened) {
2978
+ console.log(`
2979
+ \u2705 \u5DF2\u5728\u9ED8\u8BA4\u6D4F\u89C8\u5668\u4E2D\u6253\u5F00 ${mediaLabel} \u6388\u6743\u9875\u9762\u3002`);
2980
+ console.log(` \u5B8C\u6210\u6388\u6743\u540E\u6D4F\u89C8\u5668\u4F1A\u81EA\u52A8\u8DF3\u56DE\u4E1D\u8DEF\u8D5E\uFF0C\u8D26\u6237\u7ED1\u5B9A\u5373\u751F\u6548\u3002
2981
+ `);
2982
+ } else {
2983
+ console.log(`
2984
+ \u26A0\uFE0F \u65E0\u6CD5\u81EA\u52A8\u6253\u5F00\u6D4F\u89C8\u5668\uFF0C\u8BF7\u624B\u52A8\u590D\u5236\u4EE5\u4E0B\u94FE\u63A5\u5230\u6D4F\u89C8\u5668\u4E2D\u5B8C\u6210\u6388\u6743\uFF1A
2985
+ `);
2986
+ }
2987
+ }
2988
+ console.log(` ${redirectUrl}
2989
+ `);
2990
+ }
2936
2991
  function printAuthMissingHelp(binName) {
2937
2992
  if (isSiluzanAgentEnv()) {
2938
2993
  console.error(
@@ -3774,7 +3829,7 @@ var DEFAULT_API_BASE;
3774
3829
  var init_defaults = __esm({
3775
3830
  "src/config/defaults.ts"() {
3776
3831
  "use strict";
3777
- DEFAULT_API_BASE = "https://tso-api.siluzan.com";
3832
+ DEFAULT_API_BASE = "https://tso-api-ci.siluzan.com";
3778
3833
  }
3779
3834
  });
3780
3835
 
@@ -120909,35 +120964,11 @@ async function runAccountShareDetail(opts) {
120909
120964
 
120910
120965
  // src/commands/account-manage/oauth.ts
120911
120966
  init_auth();
120912
- import { spawn as spawn2 } from "child_process";
120967
+ init_dist();
120913
120968
  function toApiMediaType(media) {
120914
120969
  return media === "Meta" ? "FacebookAds" : media;
120915
120970
  }
120916
- function tryOpenBrowser(url) {
120917
- try {
120918
- const parsed = new URL(url);
120919
- if (parsed.protocol !== "https:") {
120920
- return false;
120921
- }
120922
- if (process.platform === "win32") {
120923
- const child = spawn2("rundll32", ["url.dll,FileProtocolHandler", parsed.toString()], {
120924
- detached: true,
120925
- stdio: "ignore",
120926
- windowsHide: true
120927
- });
120928
- child.unref();
120929
- } else if (process.platform === "darwin") {
120930
- const child = spawn2("open", [parsed.toString()], { detached: true, stdio: "ignore" });
120931
- child.unref();
120932
- } else {
120933
- const child = spawn2("xdg-open", [parsed.toString()], { detached: true, stdio: "ignore" });
120934
- child.unref();
120935
- }
120936
- return true;
120937
- } catch {
120938
- return false;
120939
- }
120940
- }
120971
+ var tryOpenBrowser = tryOpenHttpsUrlInBrowser;
120941
120972
  async function runAccountAuth(opts) {
120942
120973
  const config = loadConfig(opts.token);
120943
120974
  const apiMediaType = toApiMediaType(opts.media);
@@ -120963,17 +120994,11 @@ async function runAccountAuth(opts) {
120963
120994
  `);
120964
120995
  process.exit(1);
120965
120996
  }
120966
- const opened = tryOpenBrowser(redirectUrl);
120967
- if (opened) {
120968
- console.log(`\u2705 \u5DF2\u5728\u9ED8\u8BA4\u6D4F\u89C8\u5668\u4E2D\u6253\u5F00 ${opts.media} \u6388\u6743\u9875\u9762\u3002`);
120969
- console.log(` \u5B8C\u6210\u6388\u6743\u540E\u6D4F\u89C8\u5668\u4F1A\u81EA\u52A8\u8DF3\u56DE\u4E1D\u8DEF\u8D5E\uFF0C\u8D26\u6237\u7ED1\u5B9A\u5373\u751F\u6548\u3002
120970
- `);
120971
- } else {
120972
- console.log(`\u26A0\uFE0F \u65E0\u6CD5\u81EA\u52A8\u6253\u5F00\u6D4F\u89C8\u5668\uFF0C\u8BF7\u624B\u52A8\u590D\u5236\u4EE5\u4E0B\u94FE\u63A5\u5230\u6D4F\u89C8\u5668\u4E2D\u5B8C\u6210\u6388\u6743\uFF1A
120973
- `);
120974
- }
120975
- console.log(` ${redirectUrl}
120976
- `);
120997
+ deliverMediaAccountOAuthLink({
120998
+ mediaLabel: opts.media,
120999
+ redirectUrl,
121000
+ tryOpenBrowser: tryOpenHttpsUrlInBrowser
121001
+ });
120977
121002
  }
120978
121003
 
120979
121004
  // src/commands/account-manage/google-mcc.ts
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "slug": "siluzan-tso",
3
- "version": "1.1.32",
4
- "publishedAt": 1782807133114
3
+ "version": "1.1.33-beta.1",
4
+ "publishedAt": 1782810997774
5
5
  }
@@ -280,7 +280,7 @@ siluzan-tso account-history --start 2026-03-01 --end 2026-03-31 --json-out ./sna
280
280
  | 状态 | 含义 | 下一步操作 |
281
281
  | ---------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
282
282
  | `Pending` | 审核中 | 等待,可反复运行此命令轮询;审核周期因媒体而异 |
283
- | `Approved` | 审核通过 | 运行 `list-accounts -m <媒体>` 确认账户已出现;引导用户充值激活(`config show` 取 `webUrl`,按 `finance.md` 打开对应媒体充值页;例如 Google 为 `https://www.siluzan.com/v3/foreign_trade/tso/recharge/pay?mediaType=Google`;Kwai、Yandex 当前没有对应充值界面) |
283
+ | `Approved` | 审核通过 | 运行 `list-accounts -m <媒体>` 确认账户已出现;引导用户充值激活(`config show` 取 `webUrl`,按 `finance.md` 打开对应媒体充值页;例如 Google 为 `https://www-ci.siluzan.com/v3/foreign_trade/tso/recharge/pay?mediaType=Google`;Kwai、Yandex 当前没有对应充值界面) |
284
284
  | `Rejected` | 被拒 | 查看 `--json-out` 落盘中的 `reason` 字段了解拒绝原因;修改资料后重新提交;若原因不明,引导用户联系丝路赞客服 |
285
285
 
286
286
  ---
@@ -854,7 +854,7 @@ siluzan-tso account email-deauth -c <mediaCustomerId> --invitation-id <id> --res
854
854
 
855
855
  | 功能 | 媒体 | 网页路径 |
856
856
  | --------------------------------------- | ------ | ------------------------------------------------- |
857
- | **账户激活**(邀请他人激活 / 充值激活) | Google | `https://www.siluzan.com/v3/foreign_trade/tso/manageAccounts` |
857
+ | **账户激活**(邀请他人激活 / 充值激活) | Google | `https://www-ci.siluzan.com/v3/foreign_trade/tso/manageAccounts` |
858
858
 
859
859
  **Agent 建议话术**:
860
860
 
@@ -863,5 +863,5 @@ siluzan-tso account email-deauth -c <mediaCustomerId> --invitation-id <id> --res
863
863
  siluzan-tso config show # 查看 webUrl 字段
864
864
 
865
865
  # 账户激活(Google)→ 引导至账户管理页
866
- # https://www.siluzan.com/v3/foreign_trade/tso/manageAccounts
866
+ # https://www-ci.siluzan.com/v3/foreign_trade/tso/manageAccounts
867
867
  ```
@@ -117,7 +117,7 @@ siluzan-tso config show
117
117
 
118
118
  ### 充值页链接(按媒体 × 类型)
119
119
 
120
- 链接模式:`https://www.siluzan.com/v3/foreign_trade/tso/recharge/<page>?mediaType=<mediaType>`;丝路赞钱包:`https://www.siluzan.com/v3/foreign_trade/tso/recharge/siluzanWallet`(无媒体参数)。
120
+ 链接模式:`https://www-ci.siluzan.com/v3/foreign_trade/tso/recharge/<page>?mediaType=<mediaType>`;丝路赞钱包:`https://www-ci.siluzan.com/v3/foreign_trade/tso/recharge/siluzanWallet`(无媒体参数)。
121
121
 
122
122
  | 充值类型 | `<page>` | 支持媒体(`mediaType` 参数) |
123
123
  | ------------------------- | --------------------- | ------------------------------------------- |
@@ -1,6 +1,6 @@
1
1
  # 各媒体开户
2
2
 
3
- > 网页链接:`https://www.siluzan.com/v3/foreign_trade/tso/accountOpeningHistory?tso=%2Fv3umijs%2Ftso%2FaccountOpeningHistory`
3
+ > 网页链接:`https://www-ci.siluzan.com/v3/foreign_trade/tso/accountOpeningHistory?tso=%2Fv3umijs%2Ftso%2FaccountOpeningHistory`
4
4
  > 多命令串联见 `references/core/workflows.md` § 流程一。
5
5
 
6
6
  ## 首次响应硬规范(必读)
@@ -60,7 +60,7 @@ siluzan-tso open-account google-wizard
60
60
 
61
61
  ```bash
62
62
  siluzan-tso account-history -m Google
63
- # 审核通过后:config show → https://www.siluzan.com/v3/foreign_trade/tso/recharge/pay?mediaType=Google
63
+ # 审核通过后:config show → https://www-ci.siluzan.com/v3/foreign_trade/tso/recharge/pay?mediaType=Google
64
64
  ```
65
65
 
66
66
  ---
@@ -1,6 +1,6 @@
1
1
  # rag:知识库检索(TSO 广告投放辅助)
2
2
 
3
- 知识库管理页面在 https://www.siluzan.com/knowledge-base/
3
+ 知识库管理页面在 https://www-ci.siluzan.com/knowledge-base/
4
4
 
5
5
  为 **广告投放、账户分析、拓词、诊断报告** 等 TSO 业务提供**企业已入库**的产品、行业、客户背景事实依据。
6
6
 
@@ -192,9 +192,9 @@ siluzan-tso report push receive-emails -m Google [--json-out ./snap]
192
192
 
193
193
  | 媒体 | 报告类型 | URL 模板 |
194
194
  | ------ | ---------------- | ----------------------------------------------------------- |
195
- | Google | 日报(Daily) | `https://www.siluzan.com/media-report/publish/{entityId}?culture=zh-CN` |
196
- | Google | 小时报(Hourly) | `https://www.siluzan.com/media-report/hour/{entityId}?culture=zh-CN` |
197
- | TikTok | 日报 | `https://www.siluzan.com/media-report/publish/{entityId}?culture=zh-CN` |
195
+ | Google | 日报(Daily) | `https://www-ci.siluzan.com/media-report/publish/{entityId}?culture=zh-CN` |
196
+ | Google | 小时报(Hourly) | `https://www-ci.siluzan.com/media-report/hour/{entityId}?culture=zh-CN` |
197
+ | TikTok | 日报 | `https://www-ci.siluzan.com/media-report/publish/{entityId}?culture=zh-CN` |
198
198
 
199
199
  `entityId` 来自 `siluzan-tso report list --json-out ./snap` 中每条记录的 `entityId` 字段。
200
200
 
@@ -207,8 +207,8 @@ siluzan-tso report list -m Google --json-out ./snap
207
207
 
208
208
  # 第二步:查看 webUrl
209
209
  siluzan-tso config show
210
- # webUrl: https://www.siluzan.com
210
+ # webUrl: https://www-ci.siluzan.com
211
211
 
212
212
  # 第三步:拼接链接(Google 日报)
213
- # https://www.siluzan.com/media-report/publish/rpt_abc123?culture=zh-CN
213
+ # https://www-ci.siluzan.com/media-report/publish/rpt_abc123?culture=zh-CN
214
214
  ```
@@ -10,7 +10,7 @@
10
10
  ## 安装 CLI
11
11
 
12
12
  ```bash
13
- npm install -g siluzan-tso-cli
13
+ npm install -g siluzan-tso-cli@beta
14
14
  ```
15
15
 
16
16
  ---
@@ -64,7 +64,7 @@ siluzan-tso config set --api-key <Key> # 或 config 直接写入
64
64
  siluzan-tso config set --token <Token> # 备用:设置 JWT Token
65
65
  ```
66
66
 
67
- API Key 获取入口:`https://www.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
67
+ API Key 获取入口:`https://www-ci.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
68
68
 
69
69
  ```bash
70
70
  # 第 1 步:让用户报出手机号后,立刻发码(命令立即返回,不会等待输入)
@@ -129,9 +129,9 @@ siluzan-tso config show
129
129
 
130
130
  ```
131
131
  构建环境 : production
132
- apiBaseUrl : https://tso-api.siluzan.com
133
- googleApiUrl : https://googleapi.mysiluzan.com
134
- webUrl : https://www.siluzan.com
132
+ apiBaseUrl : https://tso-api-ci.siluzan.com
133
+ googleApiUrl : https://googleapi-ci.mysiluzan.com
134
+ webUrl : https://www-ci.siluzan.com
135
135
  apiKey : abcd****1234
136
136
  ```
137
137
 
@@ -6,7 +6,7 @@
6
6
  siluzan-tso config show # 取 webUrl
7
7
  ```
8
8
 
9
- 首页地址:`https://www.siluzan.com/v3/foreign_trade/tso/home`
9
+ 首页地址:`https://www-ci.siluzan.com/v3/foreign_trade/tso/home`
10
10
 
11
11
  ---
12
12
 
@@ -25,7 +25,7 @@ siluzan-tso config show # 取 webUrl
25
25
 
26
26
  ## 推荐话术
27
27
 
28
- 1. **「和首页一样的总览」** → 打开 `https://www.siluzan.com/v3/foreign_trade/tso/home`。
28
+ 1. **「和首页一样的总览」** → 打开 `https://www-ci.siluzan.com/v3/foreign_trade/tso/home`。
29
29
  2. **「某个 Google 账户昨天花了多少」** → `list-accounts -m Google` + `stats -m Google -a <id>`。
30
30
  3. **「有待充值账户」** → 说明聚合数据在首页;CLI 可 `list-accounts` + `balance` 逐户排查,或引导充值页。
31
31
 
@@ -9,11 +9,11 @@ $ErrorActionPreference = 'Stop'
9
9
  # -- Package info (injected at build time) ------------------------------------
10
10
  $PKG_NAME = 'siluzan-tso-cli'
11
11
  # PKG_VERSION 锁定到与本脚本同批构建产物一致的版本,避免与 dist/skill 错位
12
- $PKG_VERSION = '1.1.32'
12
+ $PKG_VERSION = '1.1.33-beta.1'
13
13
  $CLI_BIN = 'siluzan-tso'
14
14
  $SKILL_LABEL = 'Siluzan TSO'
15
- $INSTALL_CMD = 'npm install -g siluzan-tso-cli'
16
- $WEB_BASE = 'https://www.siluzan.com'
15
+ $INSTALL_CMD = 'npm install -g siluzan-tso-cli@beta'
16
+ $WEB_BASE = 'https://www-ci.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-tso-cli"
11
11
  # PKG_VERSION 锁定到与本脚本同批构建产物一致的版本,避免与 dist/skill 错位
12
- readonly PKG_VERSION="1.1.32"
12
+ readonly PKG_VERSION="1.1.33-beta.1"
13
13
  readonly CLI_BIN="siluzan-tso"
14
14
  readonly SKILL_LABEL="Siluzan TSO"
15
- readonly INSTALL_CMD="npm install -g siluzan-tso-cli"
16
- readonly WEB_BASE="https://www.siluzan.com"
15
+ readonly INSTALL_CMD="npm install -g siluzan-tso-cli@beta"
16
+ readonly WEB_BASE="https://www-ci.siluzan.com"
17
17
 
18
18
  # -- Constants ----------------------------------------------------------------
19
19
  readonly NODE_MAJOR_MIN=18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siluzan-tso-cli",
3
- "version": "1.1.32",
3
+ "version": "1.1.33-beta.1",
4
4
  "description": "Siluzan 广告账户管理 CLI — 查询账户、余额、消耗数据,管理绑定关系与充值。",
5
5
  "keywords": [
6
6
  "ad-account",