siluzan-tso-cli 1.1.64 → 1.1.65
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/dist/index.js +1732 -954
- package/dist/skill/SKILL.md +1 -0
- package/dist/skill/_meta.json +2 -2
- package/dist/skill/references/accounts/accounts-balance-stats.md +10 -2
- package/dist/skill/references/analytics/google-analysis-batch.md +4 -1
- package/dist/skill/references/core/agent-conventions.md +7 -0
- package/dist/skill/references/operations/guard.md +1 -0
- package/dist/skill/scripts/install.ps1 +1 -1
- package/dist/skill/scripts/install.sh +1 -1
- package/package.json +1 -1
package/dist/skill/SKILL.md
CHANGED
|
@@ -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`。
|
package/dist/skill/_meta.json
CHANGED
|
@@ -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
|
|
|
@@ -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`) |
|
|
182
|
+
| `2` | 部分成功(`partial`)或超时(`paused`) | `partial`:看 `errors/` 后消费产物;`paused`:执行 `resumeCommand` 续跑 |
|
|
180
183
|
| `3` | 全失败 / Token 失效 / 致命错误(`failed`) | `tokenInvalidated:true` → `siluzan-tso login` |
|
|
181
184
|
| `4` | 参数错误(命令未执行) | 修正参数重试 |
|
|
182
185
|
|
|
@@ -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
|
---
|
|
@@ -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,7 +9,7 @@ $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.
|
|
12
|
+
$PKG_VERSION = '1.1.65'
|
|
13
13
|
$CLI_BIN = 'siluzan-tso'
|
|
14
14
|
$SKILL_LABEL = 'Siluzan TSO'
|
|
15
15
|
$INSTALL_CMD = 'npm install -g siluzan-tso-cli'
|
|
@@ -9,7 +9,7 @@ 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.
|
|
12
|
+
readonly PKG_VERSION="1.1.65"
|
|
13
13
|
readonly CLI_BIN="siluzan-tso"
|
|
14
14
|
readonly SKILL_LABEL="Siluzan TSO"
|
|
15
15
|
readonly INSTALL_CMD="npm install -g siluzan-tso-cli"
|