siluzan-tso-cli 1.1.17-beta.1 → 1.1.17

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 报告模板引用以下 CDN:`cdn.tailwindcss.com`、`cdnjs.cloudflare.co
43
43
  在**用户的目标项目根目录**执行(根据用户使用的助手选择 `--ai`):
44
44
 
45
45
  ```bash
46
- npm install -g siluzan-tso-cli@beta
46
+ npm install -g siluzan-tso-cli
47
47
  siluzan-tso init --ai cursor # 写入 Cursor(默认)
48
48
  siluzan-tso init --ai cursor,claude # 同时写入多个平台
49
49
  siluzan-tso init --ai all # 写入所有支持的平台
@@ -51,7 +51,6 @@ siluzan-tso init -d /path/to/skills # 写入自定义目录
51
51
  siluzan-tso init --force # 强制覆盖已存在文件
52
52
  ```
53
53
 
54
- > **注意**:当前为测试版(1.1.17-beta.1),供内部测试使用。正式发布后安装命令将改为 `npm install -g siluzan-tso-cli`。
55
54
 
56
55
  | 助手 | 建议 `--ai` |
57
56
  | ----------------------- | ------------------------------------ |
package/dist/index.js CHANGED
@@ -2791,7 +2791,7 @@ var DEFAULT_API_BASE;
2791
2791
  var init_defaults = __esm({
2792
2792
  "src/config/defaults.ts"() {
2793
2793
  "use strict";
2794
- DEFAULT_API_BASE = "https://tso-api-ci.siluzan.com";
2794
+ DEFAULT_API_BASE = "https://tso-api.siluzan.com";
2795
2795
  }
2796
2796
  });
2797
2797
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "slug": "siluzan-tso",
3
- "version": "1.1.17-beta.1",
4
- "publishedAt": 1778229807646
3
+ "version": "1.1.17",
4
+ "publishedAt": 1778231383288
5
5
  }
@@ -7,7 +7,7 @@
7
7
 
8
8
  ## invoice-info — 发票抬头管理
9
9
 
10
- 对应页面:`https://www-ci.siluzan.com/v3/foreign_trade/settings/invoiceInformation`
10
+ 对应页面:`https://www.siluzan.com/v3/foreign_trade/settings/invoiceInformation`
11
11
 
12
12
  发票抬头是开票申请时使用的公司/企业信息模板,支持三种类型:
13
13
 
@@ -133,10 +133,10 @@ siluzan-tso config show
133
133
  **示例:**
134
134
 
135
135
  ```
136
- - 现金充值(单笔):https://www-ci.siluzan.com/recharge/pay
137
- - 现金充值(批量):https://www-ci.siluzan.com/recharge/pay_batch
138
- - 月结充值: https://www-ci.siluzan.com/recharge/accountBillingQuota
139
- - 丝路赞钱包: https://www-ci.siluzan.com/recharge/siluzanWallet
136
+ - 现金充值(单笔):https://www.siluzan.com/recharge/pay
137
+ - 现金充值(批量):https://www.siluzan.com/recharge/pay_batch
138
+ - 月结充值: https://www.siluzan.com/recharge/accountBillingQuota
139
+ - 丝路赞钱包: https://www.siluzan.com/recharge/siluzanWallet
140
140
  ```
141
141
 
142
142
  ---
@@ -214,8 +214,8 @@ siluzan-tso report list -m Google --json
214
214
 
215
215
  # 第二步:查看 webUrl
216
216
  siluzan-tso config show
217
- # webUrl: https://www-ci.siluzan.com
217
+ # webUrl: https://www.siluzan.com
218
218
 
219
219
  # 第三步:拼接链接(Google 日报)
220
- # https://www-ci.siluzan.com/media-report/publish/rpt_abc123?culture=zh-CN
220
+ # https://www.siluzan.com/media-report/publish/rpt_abc123?culture=zh-CN
221
221
  ```
@@ -10,7 +10,7 @@
10
10
  ## 安装 CLI
11
11
 
12
12
  ```bash
13
- npm install -g siluzan-tso-cli@beta
13
+ npm install -g siluzan-tso-cli
14
14
  ```
15
15
 
16
16
  ---
@@ -47,7 +47,7 @@ siluzan-tso config set --api-key <Key> # 或通过 config set 直接写入
47
47
  siluzan-tso config set --token <Token> # 备用:设置 JWT Token
48
48
  ```
49
49
 
50
- API Key 获取入口:`https://www-ci.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
50
+ API Key 获取入口:`https://www.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
51
51
 
52
52
  ### 通过环境变量传入凭据(CI/CD 推荐)
53
53
 
@@ -82,9 +82,9 @@ siluzan-tso config show
82
82
 
83
83
  ```
84
84
  构建环境 : production
85
- apiBaseUrl : https://tso-api-ci.siluzan.com
86
- googleApiUrl : https://googleapi-ci.mysiluzan.com
87
- webUrl : https://www-ci.siluzan.com
85
+ apiBaseUrl : https://tso-api.siluzan.com
86
+ googleApiUrl : https://googleapi.mysiluzan.com
87
+ webUrl : https://www.siluzan.com
88
88
  apiKey : abcd****1234
89
89
  ```
90
90
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  用 `siluzan-tso config show` 读取 **`webUrl`**,再拼接路径:
8
8
 
9
- 首页地址:`https://www-ci.siluzan.com/v3/foreign_trade/tso/home`
9
+ 首页地址:`https://www.siluzan.com/v3/foreign_trade/tso/home`
10
10
 
11
11
  > 若用户已登录 TSO,也可从左侧菜单进入「首页」。
12
12
 
@@ -10,12 +10,14 @@ $ErrorActionPreference = 'Stop'
10
10
  $PKG_NAME = 'siluzan-tso-cli'
11
11
  $CLI_BIN = 'siluzan-tso'
12
12
  $SKILL_LABEL = 'Siluzan TSO'
13
- $INSTALL_CMD = 'npm install -g siluzan-tso-cli@beta'
14
- $WEB_BASE = 'https://www-ci.siluzan.com'
13
+ $INSTALL_CMD = 'npm install -g siluzan-tso-cli'
14
+ $WEB_BASE = 'https://www.siluzan.com'
15
15
 
16
16
  # -- Constants ----------------------------------------------------------------
17
- $NODE_MAJOR_MIN = 18
18
- $NPM_MIRROR = 'https://registry.npmmirror.com'
17
+ $NODE_MAJOR_MIN = 18
18
+ $NPM_MIRROR = 'https://registry.npmmirror.com'
19
+ # Git for Windows installer (mirrored on Siluzan CDN; bump version here when needed)
20
+ $GIT_INSTALLER_URL = 'https://staticpn.siluzan.com/assets/git/Git-2.54.0-64-bit.exe'
19
21
 
20
22
  # -- Helpers ------------------------------------------------------------------
21
23
  function Write-Info { param([string]$Msg) Write-Host "[OK] $Msg" -ForegroundColor Green }
@@ -80,6 +82,85 @@ function Install-NodeFallback {
80
82
  throw 'Node.js is required'
81
83
  }
82
84
 
85
+ # -- Git for Windows ----------------------------------------------------------
86
+ # Some agent clients (Cursor / Claude Code / etc.) have known quirks running
87
+ # PowerShell or cmd commands. We install Git for Windows ahead of time so the
88
+ # user always has a Git Bash fallback to run the equivalent bash installer
89
+ # (`bash <(curl -fsSL .../install.sh)`) when the PowerShell channel misbehaves.
90
+ function Test-GitInstalled {
91
+ return $null -ne (Get-Command git -ErrorAction SilentlyContinue)
92
+ }
93
+
94
+ function Test-IsAdmin {
95
+ try {
96
+ $id = [Security.Principal.WindowsIdentity]::GetCurrent()
97
+ $principal = New-Object Security.Principal.WindowsPrincipal($id)
98
+ return $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
99
+ } catch {
100
+ return $false
101
+ }
102
+ }
103
+
104
+ function Install-Git {
105
+ $tmpFile = Join-Path $env:TEMP 'siluzan-git-installer.exe'
106
+
107
+ Write-Info "Downloading Git for Windows: $GIT_INSTALLER_URL"
108
+ try {
109
+ $prevProgress = $ProgressPreference
110
+ $ProgressPreference = 'SilentlyContinue'
111
+ Invoke-WebRequest -Uri $GIT_INSTALLER_URL -OutFile $tmpFile -UseBasicParsing
112
+ $ProgressPreference = $prevProgress
113
+ } catch {
114
+ Write-Warn "Git installer download failed: $($_.Exception.Message)"
115
+ return $false
116
+ }
117
+
118
+ if (-not (Test-Path $tmpFile)) {
119
+ Write-Warn 'Git installer file not found after download'
120
+ return $false
121
+ }
122
+
123
+ # Inno Setup silent flags. When not admin we point /DIR to %LOCALAPPDATA% so
124
+ # the installer doesn't try to write to Program Files (which would trigger UAC
125
+ # or just fail). The installer auto-detects ALLUSERS vs CURRENTUSER mode based
126
+ # on whether the current process is elevated, so we don't pass /CURRENTUSER
127
+ # explicitly (not all Git for Windows builds accept that flag).
128
+ $installArgs = @('/VERYSILENT', '/NORESTART', '/NOCANCEL', '/SP-', '/CLOSEAPPLICATIONS', '/RESTARTAPPLICATIONS')
129
+ if (Test-IsAdmin) {
130
+ Write-Info 'Installing Git for Windows system-wide (admin detected)...'
131
+ } else {
132
+ $userDir = Join-Path $env:LOCALAPPDATA 'Programs\Git'
133
+ Write-Info "Installing Git for Windows for current user: $userDir"
134
+ $installArgs += @("/DIR=$userDir")
135
+ }
136
+
137
+ try {
138
+ Start-Process -FilePath $tmpFile -ArgumentList $installArgs -Wait -NoNewWindow
139
+ } catch {
140
+ Write-Warn "Git installer launch failed: $($_.Exception.Message)"
141
+ Remove-Item $tmpFile -ErrorAction SilentlyContinue
142
+ return $false
143
+ }
144
+ Remove-Item $tmpFile -ErrorAction SilentlyContinue
145
+
146
+ Refresh-Path
147
+ if (-not (Test-GitInstalled)) {
148
+ # 安装器有时不会立刻刷新 PATH,按已知路径手动补一次
149
+ $candidates = @(
150
+ (Join-Path $env:LOCALAPPDATA 'Programs\Git\cmd'),
151
+ (Join-Path $env:ProgramFiles 'Git\cmd')
152
+ )
153
+ foreach ($p in $candidates) {
154
+ if (Test-Path (Join-Path $p 'git.exe')) {
155
+ $env:Path = "$p;$env:Path"
156
+ break
157
+ }
158
+ }
159
+ }
160
+
161
+ return Test-GitInstalled
162
+ }
163
+
83
164
  # -- Main ---------------------------------------------------------------------
84
165
  function Main {
85
166
  Write-Host ''
@@ -87,10 +168,6 @@ function Main {
87
168
  Write-Host "| $SKILL_LABEL -- Install |" -ForegroundColor White
88
169
  Write-Host '+---------------------------------------------+' -ForegroundColor White
89
170
  Write-Host ''
90
- Write-Warn 'Windows note: some agent clients may fail when running PowerShell/cmd commands.'
91
- Write-Host ' If this install fails unexpectedly, install Git for Windows and rerun the Bash installer in Git Bash:' -ForegroundColor DarkGray
92
- Write-Host ' https://git-scm.com/download/win' -ForegroundColor DarkGray
93
- Write-Host ''
94
171
 
95
172
  # Step 1: Environment check
96
173
  Write-Step 'Step 1/4: Environment check'
@@ -123,6 +200,23 @@ function Main {
123
200
  }
124
201
  Write-Info 'npm ready'
125
202
 
203
+ # Git for Windows: pre-install as a Bash fallback path for agent clients
204
+ # whose PowerShell/cmd channel is unreliable. Failure here is non-fatal.
205
+ if (Test-GitInstalled) {
206
+ Write-Info 'Git for Windows already installed (Git Bash fallback ready)'
207
+ } else {
208
+ Write-Warn 'Git for Windows not found, installing as Bash fallback for agent clients...'
209
+ $gitOk = $false
210
+ try { $gitOk = Install-Git } catch { Write-Warn "Git install error: $($_.Exception.Message)" }
211
+ if ($gitOk) {
212
+ Write-Info 'Git for Windows installed (Git Bash fallback ready)'
213
+ } else {
214
+ Write-Warn 'Git for Windows install was skipped or failed; CLI install will continue.'
215
+ Write-Host ' If your agent later fails to run PowerShell commands, install Git manually:' -ForegroundColor DarkGray
216
+ Write-Host " $GIT_INSTALLER_URL" -ForegroundColor DarkGray
217
+ }
218
+ }
219
+
126
220
  $currentRegistry = ''
127
221
  try { $currentRegistry = (npm config get registry 2>$null).Trim() } catch {}
128
222
  if ($currentRegistry -ne $NPM_MIRROR -and $currentRegistry -ne "$NPM_MIRROR/") {
@@ -164,6 +258,11 @@ function Main {
164
258
  Write-Host ''
165
259
  Write-Host " Update CLI & Skill files: $CLI_BIN update"
166
260
  Write-Host ''
261
+ if (Test-GitInstalled) {
262
+ Write-Host ' Tip: if your agent client has trouble running PowerShell/cmd commands later,' -ForegroundColor DarkGray
263
+ Write-Host ' open Git Bash and re-run the equivalent bash installer instead.' -ForegroundColor DarkGray
264
+ Write-Host ''
265
+ }
167
266
  Write-Info "Need help? Visit $WEB_BASE"
168
267
  Write-Host ''
169
268
  }
@@ -10,8 +10,8 @@ set -euo pipefail
10
10
  readonly PKG_NAME="siluzan-tso-cli"
11
11
  readonly CLI_BIN="siluzan-tso"
12
12
  readonly SKILL_LABEL="Siluzan TSO"
13
- readonly INSTALL_CMD="npm install -g siluzan-tso-cli@beta"
14
- readonly WEB_BASE="https://www-ci.siluzan.com"
13
+ readonly INSTALL_CMD="npm install -g siluzan-tso-cli"
14
+ readonly WEB_BASE="https://www.siluzan.com"
15
15
 
16
16
  # -- Constants ----------------------------------------------------------------
17
17
  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.17-beta.1",
3
+ "version": "1.1.17",
4
4
  "description": "Siluzan 广告账户管理 CLI — 查询账户、余额、消耗数据,管理绑定关系与充值。",
5
5
  "keywords": [
6
6
  "ad-account",