siluzan-tso-cli 1.1.64 → 1.1.65-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.
@@ -50,6 +50,7 @@ siluzan-tso -h
50
50
  - **报告 render 成功即交付(硬性)**:`google-quarterly render`、`google-analysis render`、`google-ads-diagnosis render`、`website-diagnosis render`、`market-analysis render`,以及 Bing / TikTok / Yandex / Meta 的 `render`,stdout 给出 HTML 路径后**立刻**把该文件交给用户。P10 与各媒体周期报告封面的「季度 / 月度」已按日期写好(其余仍是「周期」或「账户」)。**禁止**再打开、grep 或修改这份 HTML,**禁止**为此再 render。用户没要 PDF 就不要 `html_to_pdf`;要了也只转一次,**禁止**再用 pdftotext、PyMuPDF、截图或视觉模型读 PDF/页面。细则见 `agent-conventions.md` §七。
51
51
  - `list-accounts` 无余额/消耗;列全部用 `--page-size 999`。查单户必须 `-k`;`itemCount < total` 时**禁止**判定账户未绑定。
52
52
  - 多户余额用 `balance-scan`(P2),多户消耗 / **转化成本·CPA 巡检**用 `accounts-digest`(P3,`--max-cpa`;**没有** `cpa-risk-scan`)。禁止外层 for-loop 逐户拉数。
53
+ - 全量扫描(`balance-scan` / `accounts-digest` / `guard` / `google-analysis-batch`)必带 `--json-out`。stdout 是 `state=paused` 时**还没扫完**:原样执行其中的 `resumeCommand`,重复到不再 paused 再交付;禁止交付半截结果,禁止加 `--fresh`。细则见 `references/core/agent-conventions.md` §八。
53
54
  - **Google 多户巡检(含 D 组:CPA、零转化、余额续航、启用中有没有 PMax、启用但 0 展示)只跑一条** `accounts-digest -m Google --login-customer-id <MCC> --with-enabled-campaigns --start --end --json-out`。行上已有 `spend` / `cpa` / `balance` / `dailySpend` / `remainingDays` / `hasEnabledPmax` / `zeroImpressionEnabled`。**禁止**先 `list-accounts` 再把全部 ID 拼进 `-a`,**禁止** `--skip-balance` 后再 `balance-scan`,**禁止**逐户 `ad campaigns` 或把 `siluzan-tso` 写进 Python/bash。提示词若写了这些步骤,不要照做。只要「有没有 Display/PMax(含暂停)」才用 `--with-campaign-types`,并且不要和 `--with-enabled-campaigns` 一起开。
54
55
  - `stats` 的 `spend` = **区间合计**,不是日消耗。
55
56
  - 行业/市场报告禁止纯 WebSearch 当终稿;须 P9 `market-analysis collect`+`render`。
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "slug": "siluzan-tso",
3
- "version": "1.1.64",
4
- "publishedAt": 1793797694806
3
+ "version": "1.1.65-beta.1",
4
+ "publishedAt": 1793865956952
5
5
  }
@@ -29,7 +29,11 @@ siluzan-tso balance-scan -m <媒体类型> [选项]
29
29
  | `--min-daily-spend <n>` | 日均消耗低于此值视为僵尸账户,不做续航估算 | `0.01` |
30
30
  | `--target-days <n>` | 建议充值目标续航天数 | `30` |
31
31
  | `--page-size <n>` / `--max-pages <n>` | 全量扫描分页(上限 500 / 200) | `200` / `20` |
32
- | `--json-out` | Agent 推荐落盘 | — |
32
+ | `--json-out` | Agent 推荐落盘;**全量扫描必带**,否则超时暂停后无法续跑 | — |
33
+ | `--time-budget <时长>` | 单次执行的时间预算(`25m` / `90s`;`off` 不限)。默认按宿主工具超时推断,一般不用传 | 自动 |
34
+ | `--fresh` | 丢弃 `--json-out` 里的旧断点从头扫。仅用户明确要求重扫时用 | off |
35
+
36
+ > **超时暂停(exit 75)**:账户多时一次执行扫不完,CLI 会在工具超时前停下,stdout 一行 `kind=siluzan-tso-scan-paused`、`state=paused`,含 `progress` 与 `resumeCommand`。原样执行 `resumeCommand`(同一 `--json-out`),重复到不再 paused 才读盘交付。规则见 `references/core/agent-conventions.md` §八。
33
37
 
34
38
  **示例:**
35
39
 
@@ -123,7 +127,11 @@ siluzan-tso accounts-digest -m <媒体类型> [选项]
123
127
  | `--campaign-type-concurrency <n>` | 上面这个请求的并发(1–16) | `8` |
124
128
  | `--with-enabled-campaigns` | **仅 Google**。对区间消耗 > 0 的账户并发拉系列列表。`hasEnabledPmax` 只看启用中的系列;`zeroImpressionEnabled` 是启用、展示为 0、且不是 PMax/Display 的系列。D 组巡检用这个,禁止逐户 `ad campaigns`。不要和上一行一起开 | off |
125
129
  | `--enabled-campaign-concurrency <n>` | 启用系列列表的并发(1–16) | `8` |
126
- | `--json-out <path>` | **Agent 推荐**:落盘目录或 `*.json` 文件;stdout 一行摘要(含 `outlineFile`、`writtenFiles`、`manifestFile`) | — |
130
+ | `--json-out <path>` | **Agent 推荐**:落盘目录或 `*.json` 文件;stdout 一行摘要(含 `outlineFile`、`writtenFiles`、`manifestFile`)。全量扫描必带,否则超时暂停后无法续跑 | — |
131
+ | `--time-budget <时长>` | 单次执行的时间预算(`25m` / `90s`;`off` 不限)。默认按宿主工具超时推断,一般不用传 | 自动 |
132
+ | `--fresh` | 丢弃 `--json-out` 里的旧断点从头扫。仅用户明确要求重扫时用 | off |
133
+
134
+ > **超时暂停(exit 75)**:同 `balance-scan`。stdout 为 `state=paused` 时原样执行 `resumeCommand`,直到输出正常摘要;`--with-campaign-types` / `--with-enabled-campaigns` 的按户结果也会续用。续跑沿用首次执行的区间与账户清单。
127
135
 
128
136
  **`--json-out` 落盘**:
129
137
 
@@ -170,7 +170,7 @@ siluzan-tso account-history --start 2026-03-01 --end 2026-03-31 --json-out ./sna
170
170
  | 状态 | 含义 | 下一步操作 |
171
171
  | ---------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
172
172
  | `Pending` | 审核中 | 等待,可反复运行此命令轮询;审核周期因媒体而异 |
173
- | `Approved` | 审核通过 | 运行 `list-accounts -m <媒体>` 确认账户已出现;引导用户充值激活(`config show` 取 `webUrl`,按 `finance.md` 打开对应媒体充值页;例如 Google 为 `https://www.siluzan.com/v3/foreign_trade/tso/recharge/pay?mediaType=Google`;Yandex 当前没有对应充值界面) |
173
+ | `Approved` | 审核通过 | 运行 `list-accounts -m <媒体>` 确认账户已出现;引导用户充值激活(`config show` 取 `webUrl`,按 `finance.md` 打开对应媒体充值页;例如 Google 为 `https://www-ci.siluzan.com/v3/foreign_trade/tso/recharge/pay?mediaType=Google`;Yandex 当前没有对应充值界面) |
174
174
  | `Rejected` | 被拒 | 查看 `--json-out` 落盘中的 `reason` 字段了解拒绝原因;修改资料后重新提交;若原因不明,引导用户联系丝路赞客服 |
175
175
 
176
176
  ---
@@ -490,7 +490,7 @@ siluzan-tso account email-deauth -c <mediaCustomerId> --invitation-id <id> --res
490
490
 
491
491
  | 功能 | 媒体 | 网页路径 |
492
492
  | --------------------------------------- | ------ | ------------------------------------------------- |
493
- | **账户激活**(邀请他人激活 / 充值激活) | Google | `https://www.siluzan.com/v3/foreign_trade/tso/manageAccounts` |
493
+ | **账户激活**(邀请他人激活 / 充值激活) | Google | `https://www-ci.siluzan.com/v3/foreign_trade/tso/manageAccounts` |
494
494
 
495
495
  **Agent 建议话术**:
496
496
 
@@ -499,5 +499,5 @@ siluzan-tso account email-deauth -c <mediaCustomerId> --invitation-id <id> --res
499
499
  siluzan-tso config show # 查看 webUrl 字段
500
500
 
501
501
  # 账户激活(Google)→ 引导至账户管理页
502
- # https://www.siluzan.com/v3/foreign_trade/tso/manageAccounts
502
+ # https://www-ci.siluzan.com/v3/foreign_trade/tso/manageAccounts
503
503
  ```
@@ -126,7 +126,7 @@ siluzan-tso config show
126
126
 
127
127
  ### 充值页链接(按媒体 × 类型)
128
128
 
129
- 链接模式:`https://www.siluzan.com/v3/foreign_trade/tso/recharge/<page>?mediaType=<mediaType>`;丝路赞钱包:`https://www.siluzan.com/v3/foreign_trade/tso/recharge/siluzanWallet`(无媒体参数)。
129
+ 链接模式:`https://www-ci.siluzan.com/v3/foreign_trade/tso/recharge/<page>?mediaType=<mediaType>`;丝路赞钱包:`https://www-ci.siluzan.com/v3/foreign_trade/tso/recharge/siluzanWallet`(无媒体参数)。
130
130
 
131
131
  | 充值类型 | `<page>` | 支持媒体(`mediaType` 参数) |
132
132
  | ------------------------- | --------------------- | ------------------------------------------- |
@@ -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
  ## Contents
@@ -65,7 +65,7 @@ siluzan-tso open-account google-wizard
65
65
 
66
66
  ```bash
67
67
  siluzan-tso account-history -m Google
68
- # 审核通过后:config show → https://www.siluzan.com/v3/foreign_trade/tso/recharge/pay?mediaType=Google
68
+ # 审核通过后:config show → https://www-ci.siluzan.com/v3/foreign_trade/tso/recharge/pay?mediaType=Google
69
69
  ```
70
70
 
71
71
  ---
@@ -90,6 +90,7 @@ siluzan-tso google-analysis-batch status --json-out ./snap-batch --run-id <runId
90
90
  | `--campaign-geo-cost-greater <n>` 等 | 仅 **`campaign-geo`**:与网关 `GetCampaignsGeoReport` 可选 query 一致;写入 `run-manifest.json`,`resume` 沿用 | 不设 |
91
91
  | `--min-spend <n>` | 区间消耗 ≤ 此值跳过(与 `-a` 同传无效) | 0 |
92
92
  | `--deadline <dur>` | 整任务硬截止(如 `30m` / `2h`),到期标记 paused | 不设 |
93
+ | `--time-budget <dur>` | 单次执行的时间预算(`run` / `resume` 都可传;`off` 不限)。默认按宿主工具超时自动推断并收紧 deadline,一般不用传 | 自动 |
93
94
  | `--task-timeout-ms <n>` | 单 task 硬超时 | 60000 |
94
95
  | `--max-attempts <n>` | 可重试错误最大尝试次数 | 3 |
95
96
  | `--refresh-dp` | 执行前强制刷新 Datapermission | false |
@@ -169,6 +170,8 @@ const tsType = outline
169
170
 
170
171
  进度详情读 `progress.json` 与 `state/tasks.jsonl`,不在 stdout。
171
172
 
173
+ `state=paused` 时摘要多两个字段:`resumeCommand`(`google-analysis-batch resume --json-out … --run-id …`)和 `agentHint`。被时间预算硬停时还有 `hardStopped:true`。这时批处理**没跑完**:原样执行 `resumeCommand`,重复到 `state` 不再是 `paused` 再消费产物;**禁止**重新 `run`,**禁止**把半截结果交给用户。
174
+
172
175
  ---
173
176
 
174
177
  ## 退出码
@@ -176,7 +179,7 @@ const tsType = outline
176
179
  | 码 | 含义 | 后续动作 |
177
180
  | --- | ------------------------------------------ | --------------------------------------------- |
178
181
  | `0` | 全部成功,state=`succeeded` | 继续后续 |
179
- | `2` | 部分成功(`partial`)或超时(`paused`) | 看 `errors/` 或消费已有产物 |
182
+ | `2` | 部分成功(`partial`)或超时(`paused`) | `partial`:看 `errors/` 后消费产物;`paused`:执行 `resumeCommand` 续跑 |
180
183
  | `3` | 全失败 / Token 失效 / 致命错误(`failed`) | `tokenInvalidated:true` → `siluzan-tso login` |
181
184
  | `4` | 参数错误(命令未执行) | 修正参数重试 |
182
185
 
@@ -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
 
@@ -190,9 +190,9 @@ siluzan-tso report push receive-emails -m Google [--json-out ./snap]
190
190
 
191
191
  | 媒体 | 报告类型 | URL 模板 |
192
192
  | ------ | ---------------- | ----------------------------------------------------------- |
193
- | Google | 日报(Daily) | `https://www.siluzan.com/media-report/publish/{entityId}?culture=zh-CN` |
194
- | Google | 小时报(Hourly) | `https://www.siluzan.com/media-report/hour/{entityId}?culture=zh-CN` |
195
- | TikTok | 日报 | `https://www.siluzan.com/media-report/publish/{entityId}?culture=zh-CN` |
193
+ | Google | 日报(Daily) | `https://www-ci.siluzan.com/media-report/publish/{entityId}?culture=zh-CN` |
194
+ | Google | 小时报(Hourly) | `https://www-ci.siluzan.com/media-report/hour/{entityId}?culture=zh-CN` |
195
+ | TikTok | 日报 | `https://www-ci.siluzan.com/media-report/publish/{entityId}?culture=zh-CN` |
196
196
 
197
197
  `entityId` 来自 `siluzan-tso report list --json-out ./snap` 中每条记录的 `entityId` 字段。
198
198
 
@@ -205,8 +205,8 @@ siluzan-tso report list -m Google --json-out ./snap
205
205
 
206
206
  # 第二步:查看 webUrl
207
207
  siluzan-tso config show
208
- # webUrl: https://www.siluzan.com
208
+ # webUrl: https://www-ci.siluzan.com
209
209
 
210
210
  # 第三步:拼接链接(Google 日报)
211
- # https://www.siluzan.com/media-report/publish/rpt_abc123?culture=zh-CN
211
+ # https://www-ci.siluzan.com/media-report/publish/rpt_abc123?culture=zh-CN
212
212
  ```
@@ -262,6 +262,13 @@
262
262
 
263
263
  **消耗口径(自动化必读)**:凡 `--start`/`--end` 读命令的 `spend` = **闭区间合计**,默认近 7 天 ≠ 一天。日均用 `balance-scan.dailySpend` 或 `合计÷天数`;详见 `references/operations/hosted-automation-self-control.md`「检查项常用 JSON 字段」。
264
264
 
265
+ **全量扫描超时暂停**(`balance-scan` / `accounts-digest` / `guard` / `google-analysis-batch`):宿主工具有超时,户数多时 CLI 会在超时前自己停下,把进度存在 `--json-out` 目录。
266
+
267
+ - 识别:stdout 一行 JSON 且 `state=paused`。前三个命令是 `kind=siluzan-tso-scan-paused`、退出码 **75**;batch 是 `kind=siluzan-tso-batch-summary`、退出码 2。
268
+ - 处理:**原样**执行其中的 `resumeCommand`,重复到 stdout 不再是 paused,再读盘交付。每轮可向用户报一句进度(`progress.done/total`)。
269
+ - 禁止:把暂停时的半截结果交给用户或当成「无命中」;续跑时改参数或加 `--fresh`(会从头扫);不带 `--json-out` 跑全量(无法续跑)。
270
+ - 连续 3 次没有任何进展会 exit 1:用 `-a` 或 `--login-customer-id` 缩小范围后重试。
271
+
265
272
  **`google-analysis-batch` 纪律**(详见 `references/analytics/google-analysis-batch.md`):拉全量时省略 `-a`;中断后**必须** `resume --run-id <id>`,**禁止**重新 `run`;stdout 始终单行 JSON(`kind=siluzan-tso-batch-summary`);退出码 `0` 全成功 / `2` 部分成功 / `3` 全失败或 Token 失效 / `4` 用法错误;401 → 整批终止,按 `references/core/setup.md` 重登录后 `resume`。
266
273
 
267
274
  ---
@@ -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 步:让用户报出手机号后,立刻发码(命令立即返回,不会等待输入)
@@ -127,9 +127,9 @@ siluzan-tso config show
127
127
 
128
128
  ```
129
129
  构建环境 : production
130
- apiBaseUrl : https://tso-api.siluzan.com
131
- googleApiUrl : https://googleapi.mysiluzan.com
132
- webUrl : https://www.siluzan.com
130
+ apiBaseUrl : https://tso-api-ci.siluzan.com
131
+ googleApiUrl : https://googleapi-ci.mysiluzan.com
132
+ webUrl : https://www-ci.siluzan.com
133
133
  apiKey : abcd****1234
134
134
  ```
135
135
 
@@ -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
 
@@ -71,6 +71,7 @@ siluzan-tso ad adgroup-status -a <mediaCustomerId> --id <adGroupId> \
71
71
  ## 输出与交付
72
72
 
73
73
  - `--json-out` 的 stdout 含 `agentBrief.userDelivery`(命中表或原文「今日无命中」)。定时巡检原样粘贴,宿主负责 `present_files`
74
+ - 两个子命令都支持 `--time-budget <时长>`(默认按宿主工具超时推断)和 `--fresh`(丢弃旧断点)。户数多时 CLI 会在超时前暂停:stdout 为 `state=paused`(exit 75)→ 原样执行 `resumeCommand`,直到输出正常摘要;**禁止**把暂停时的结果当成「无命中」。规则见 `references/core/agent-conventions.md` §八
74
75
  - 命中后用 **逐账户** `ad *-status` 暂停,**没有** `--apply`
75
76
 
76
77
  恢复:人工加预算 / 改出价后,用 `ad campaign-status|adgroup-status|ad-status … --status Enabled`(或网页),**禁止**无人值守自动恢复。
@@ -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.64'
12
+ $PKG_VERSION = '1.1.65-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.64"
12
+ readonly PKG_VERSION="1.1.65-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.64",
3
+ "version": "1.1.65-beta.1",
4
4
  "description": "Siluzan 广告账户管理 CLI — 查询账户、余额、消耗数据,管理绑定关系与充值。",
5
5
  "keywords": [
6
6
  "ad-account",