siluzan-tso-cli 1.1.39 → 1.1.40-beta.2
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 +2 -1
- package/dist/index.js +926 -194
- package/dist/skill/SKILL.md +4 -3
- package/dist/skill/_meta.json +2 -2
- package/dist/skill/references/accounts/accounts-list.md +1 -1
- package/dist/skill/references/accounts/accounts-permissions.md +2 -2
- package/dist/skill/references/accounts/finance.md +1 -1
- package/dist/skill/references/accounts/open-account-by-media.md +72 -68
- package/dist/skill/references/accounts/open-account-google-ui.md +30 -27
- package/dist/skill/references/analytics/rag.md +1 -1
- package/dist/skill/references/analytics/reporting.md +5 -5
- package/dist/skill/references/analytics/website-diagnosis-guide.md +2 -0
- package/dist/skill/references/core/agent-conventions.md +5 -3
- package/dist/skill/references/core/intent-routing.md +10 -7
- package/dist/skill/references/core/playbooks.md +2 -1
- package/dist/skill/references/core/setup.md +5 -5
- package/dist/skill/references/core/workflows.md +7 -6
- package/dist/skill/references/misc/tso-home.md +2 -2
- package/dist/skill/references/operations/forewarning.md +2 -0
- package/dist/skill/references/operations/guard.md +94 -0
- package/dist/skill/references/operations/hosted-automation-self-control.md +35 -15
- package/dist/skill/references/operations/hosted-automation-user-catalog.md +5 -5
- package/dist/skill/references/report-templates/bing-period-report.md +3 -3
- package/dist/skill/references/report-templates/google-period-report.md +1 -1
- package/dist/skill/references/report-templates/meta-account-diagnosis-report.md +1 -1
- package/dist/skill/references/report-templates/meta-period-report.md +2 -2
- package/dist/skill/references/report-templates/tiktok-period-report.md +1 -1
- package/dist/skill/report-templates/bing-period-report.md +3 -3
- package/dist/skill/report-templates/google-period-report.md +1 -1
- package/dist/skill/report-templates/meta-account-diagnosis-report.md +1 -1
- package/dist/skill/report-templates/meta-period-report.md +2 -2
- package/dist/skill/report-templates/tiktok-period-report.md +1 -1
- package/dist/skill/scripts/install.ps1 +3 -3
- package/dist/skill/scripts/install.sh +3 -3
- package/eval/cases/guard-budget-circuit-all-google.scenario.json +25 -0
- package/eval/cases/guard-zero-conv-empty-spend.scenario.json +21 -0
- package/eval/cases/ir-p8-meets-google-ads-requirements-with-url.scenario.json +39 -0
- package/eval/stub-fixtures/guard-budget-circuit.json +36 -0
- package/eval/stub-fixtures/guard-zero-conv.json +41 -0
- package/package.json +1 -1
|
@@ -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
|
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
智能预警允许设置监控规则,当广告账户的消耗、余额、CTR 等指标满足指定条件时,自动通过**微信公众号**发送通知。
|
|
8
8
|
这是siluzan 提供的全链路服务,除非用户提到需要使用这个否则默认不推荐使用这个智能预警
|
|
9
9
|
|
|
10
|
+
> **Siluzan Agent(`IS_SILUZAN_AGENT_ENV=true`)**:全部 `forewarning` 子命令**不执行**(不打 API)。请改为**创建自动化任务**,在任务中调用 siluzan-tso 本 Skill(拉数 / `guard` / 写命令等)完成预警与巡检。必读 `references/operations/hosted-automation-user-catalog.md`。
|
|
11
|
+
|
|
10
12
|
---
|
|
11
13
|
|
|
12
14
|
## 通知机制
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# guard —— Google 全户熔断扫描
|
|
2
|
+
|
|
3
|
+
> 流程见 `hosted-automation-user-catalog.md`(预算/空耗自控)。单户排障仍可用 `ad campaigns` / `ad groups`。
|
|
4
|
+
> **仅 Google**。非 Google 媒体本 CLI 无系列/组/创意暂停写能力。
|
|
5
|
+
|
|
6
|
+
## Contents
|
|
7
|
+
|
|
8
|
+
- 何时用
|
|
9
|
+
- budget-circuit(超预算)
|
|
10
|
+
- zero-conv(空耗)
|
|
11
|
+
- 输出与交付
|
|
12
|
+
- 与旧编排对照
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 何时用
|
|
17
|
+
|
|
18
|
+
| 用户话术 | 命令 |
|
|
19
|
+
| -------- | ---- |
|
|
20
|
+
| 所有账户系列当日花费 ≥ 日预算 110% → 暂停 | `guard budget-circuit` |
|
|
21
|
+
| 空耗熔断:花 ≥ 目标 CPA × N 且转化 0 → 暂停组/创意 | `guard zero-conv` |
|
|
22
|
+
| 只查某一户 / 改预算后复核单系列 | 仍用 `ad campaigns -a … --start=--end` |
|
|
23
|
+
|
|
24
|
+
**禁止**外层 for-loop:`list-accounts` × 多媒体再逐户 `ad campaigns` 做全户熔断。
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## budget-circuit(超预算)
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
siluzan-tso guard budget-circuit -m Google \
|
|
32
|
+
[--date YYYY-MM-DD] [--ratio 1.1] [-a id1,id2] \
|
|
33
|
+
--json-out ./snap-guard
|
|
34
|
+
|
|
35
|
+
# 确认命中后暂停(须全局 --commit)
|
|
36
|
+
siluzan-tso guard budget-circuit -m Google --date 2026-07-28 --ratio 1.1 \
|
|
37
|
+
--apply --json-out ./snap-guard --commit "budget-circuit 2026-07-28"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
| 选项 | 说明 |
|
|
41
|
+
| ---- | ---- |
|
|
42
|
+
| `-m Google` | 必填;其它媒体 exit 1 |
|
|
43
|
+
| `-a` | 子集 mediaCustomerId;省略则扫名下全部 Google 户 |
|
|
44
|
+
| `--date` | 统计日;默认 Asia/Shanghai 今天;**强制当日 spend**(start=end) |
|
|
45
|
+
| `--ratio` | 默认 `1.1`(建议 1.10–1.20) |
|
|
46
|
+
| `--status` | 默认只查 `Enabled`;传 `*` 不过滤 |
|
|
47
|
+
| `--apply` | 默认 dry-run;加此旗才 `Paused` |
|
|
48
|
+
| `--json-out` | Agent 必带 |
|
|
49
|
+
|
|
50
|
+
命中条件:`budget > 0` 且 `spend >= budget * ratio`(`budget`/`spend` 均为元;`spend` 为该日合计)。
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## zero-conv(空耗)
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
siluzan-tso guard zero-conv -m Google \
|
|
58
|
+
[--date YYYY-MM-DD] [--cpa-multiple 3] [--level adgroup|ad|both] \
|
|
59
|
+
[--fallback-target-cpa <元>] \
|
|
60
|
+
--json-out ./snap-guard
|
|
61
|
+
|
|
62
|
+
siluzan-tso guard zero-conv -m Google --cpa-multiple 3 --apply \
|
|
63
|
+
--json-out ./snap-guard --commit "zero-conv 空耗熔断"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
| 选项 | 说明 |
|
|
67
|
+
| ---- | ---- |
|
|
68
|
+
| `--cpa-multiple` | 默认 `3` |
|
|
69
|
+
| `--level` | 默认 `adgroup`;`ad`/`both` 需 `--fallback-target-cpa`(创意无组级 CPA 字段) |
|
|
70
|
+
| `--fallback-target-cpa` | 组无 `targetCpaAmountYuan` 时回退;缺失则进 `skipped[]` |
|
|
71
|
+
| `--apply` / `--json-out` | 同 budget-circuit |
|
|
72
|
+
|
|
73
|
+
命中:`conversions === 0` 且 `spend >= targetCpaYuan * N`。`summary.label` 固定为 **「空耗熔断」**(宿主发 P1 时用此文案;CLI 不代发通知)。
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## 输出与交付
|
|
78
|
+
|
|
79
|
+
- 落盘 section:`guard-budget-circuit` / `guard-zero-conv`
|
|
80
|
+
- 字段:`meta`、`summary`、`hits[]`、`paused[]`、`errors[]`(zero-conv 另有 `skipped[]`)
|
|
81
|
+
- stdout:一行摘要 JSON(若 `--json-out`)+ **人类可读命中表**(无命中也打印「无命中」——巡检必须收口)
|
|
82
|
+
- dry-run 命中后提示追加 `--apply --commit …`
|
|
83
|
+
|
|
84
|
+
恢复:人工加预算 / 改出价后,用 `ad campaign-status|adgroup-status|ad-status … --status Enabled`(或网页),**禁止**无人值守自动恢复。
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 与旧编排对照
|
|
89
|
+
|
|
90
|
+
| 旧(易失败) | 新 |
|
|
91
|
+
| ------------ | -- |
|
|
92
|
+
| 6 媒体 list-accounts → 逐户 ad campaigns → 脚本比 budget | `guard budget-circuit -m Google` |
|
|
93
|
+
| 逐户 ad groups + 手写阈值 | `guard zero-conv -m Google` |
|
|
94
|
+
| `ad campaigns -m Google`(非法) | 单户用 `-a`;全户熔断用 `guard` |
|
|
@@ -56,7 +56,19 @@
|
|
|
56
56
|
|
|
57
57
|
**业务目标**:当**当日**系列花费相对**日预算**达到设定比例(如 **≥ 110%**,建议 **110%–120%** 缓冲 API 延迟)时,**将系列状态置为 Paused**;恢复由人工加预算后在网页或 CLI 再启用。
|
|
58
58
|
|
|
59
|
-
###
|
|
59
|
+
### 首选(全户 / 多户 Google)
|
|
60
|
+
|
|
61
|
+
一条命令扫描名下 Google 户并交付命中表(默认 dry-run):
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
siluzan-tso guard budget-circuit -m Google --date <当日YYYY-MM-DD> --ratio 1.1 --json-out ./snap-guard
|
|
65
|
+
# 确认后:
|
|
66
|
+
siluzan-tso guard budget-circuit -m Google --date <当日> --ratio 1.1 --apply --json-out ./snap-guard --commit "budget-circuit"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
参数与落盘字段见 **`references/operations/guard.md`**。**禁止** `list-accounts` 六媒体循环 + 逐户 `ad campaigns`。
|
|
70
|
+
|
|
71
|
+
### 单户排障(可选细粒度)
|
|
60
72
|
|
|
61
73
|
1. 解析 `mediaCustomerId`(见上文前置)。
|
|
62
74
|
2. 拉系列列表(**必须** `--start` = `--end` = **当日**统计日;**禁止**用默认近 7 天窗口做本场景):
|
|
@@ -71,7 +83,7 @@ siluzan-tso ad campaigns -a <mediaCustomerId> --start <当日YYYY-MM-DD> --end <
|
|
|
71
83
|
- **IF** `spend >= threshold` **且**宿主策略允许对该系列熔断(如排除白名单),则进入写操作。
|
|
72
84
|
- **禁止**:`--start`≠`--end` 时仍用 `spend` 对比 `budget`(会把多日合计误判成单日超预算)。
|
|
73
85
|
|
|
74
|
-
###
|
|
86
|
+
### 最终操作(单户手写时)
|
|
75
87
|
|
|
76
88
|
```bash
|
|
77
89
|
siluzan-tso ad campaign-status -a <mediaCustomerId> --id <campaignId> --status Paused
|
|
@@ -93,9 +105,10 @@ siluzan-tso ad campaign-status -a <mediaCustomerId> --id <campaignId> --status E
|
|
|
93
105
|
|
|
94
106
|
### CLI 能力摘要
|
|
95
107
|
|
|
96
|
-
| 状态 | 说明
|
|
97
|
-
| ---- |
|
|
98
|
-
|
|
|
108
|
+
| 状态 | 说明 |
|
|
109
|
+
| ---- | ---- |
|
|
110
|
+
| 首选 | `guard budget-circuit -m Google`(全户扫描 + 可选 `--apply`) |
|
|
111
|
+
| 单户 | 读:`ad campaigns --json-out`;写:`ad campaign-status`;复核:再次 `ad campaigns` |
|
|
99
112
|
|
|
100
113
|
---
|
|
101
114
|
|
|
@@ -164,7 +177,16 @@ siluzan-tso ad adgroup-edit -a <mediaCustomerId> --id <adGroupId> --max-cpc <主
|
|
|
164
177
|
|
|
165
178
|
**业务目标**:**今日**(或约定日)累计 **`cost`(费用)≥ 目标 CPA × N`** 且 **`conversions = 0`** 时,**暂停**广告组或广告;**P1 告警 + 文案「空耗熔断」** 由宿主通知 skill 发送(本 CLI 不发送 P1)。
|
|
166
179
|
|
|
167
|
-
###
|
|
180
|
+
### 首选(全户 / 多户 Google)
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
siluzan-tso guard zero-conv -m Google --date <当日> --cpa-multiple 3 --level adgroup --json-out ./snap-guard
|
|
184
|
+
# 确认后 --apply --commit …;创意维加 --level ad|both --fallback-target-cpa <元>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
见 **`references/operations/guard.md`**。`summary.label` =「空耗熔断」。
|
|
188
|
+
|
|
189
|
+
### 单户排障(可选)
|
|
168
190
|
|
|
169
191
|
1. 确定「今日」`--start` / `--end`(同场景 1 时区约定)。
|
|
170
192
|
2. **广告组**:
|
|
@@ -173,9 +195,9 @@ siluzan-tso ad adgroup-edit -a <mediaCustomerId> --id <adGroupId> --max-cpc <主
|
|
|
173
195
|
siluzan-tso ad groups -a <mediaCustomerId> --start <当日> --end <当日> --json-out ./snap
|
|
174
196
|
```
|
|
175
197
|
|
|
176
|
-
对 `items[]`:读取 **`spend`**(费用)、**`conversions`**;目标 CPA 来自 **`
|
|
198
|
+
对 `items[]`:读取 **`spend`**(费用)、**`conversions`**;目标 CPA 来自 **`targetCpaAmountYuan`**(元)或宿主配置;计算 `limit = target_cpa * N`。
|
|
177
199
|
|
|
178
|
-
- **IF** `conversions === 0` **且** `spend >= limit
|
|
200
|
+
- **IF** `conversions === 0` **且** `spend >= limit`,则对该 `id` 执行组暂停。
|
|
179
201
|
|
|
180
202
|
3. **广告(创意)**级:若策略在创意维熔断:
|
|
181
203
|
|
|
@@ -185,7 +207,7 @@ siluzan-tso ad list -a <mediaCustomerId> --start <当日> --end <当日> --json-
|
|
|
185
207
|
|
|
186
208
|
同样判断费用与转化;命中则 **`ad ad-status`**。
|
|
187
209
|
|
|
188
|
-
###
|
|
210
|
+
### 最终操作(单户手写时)
|
|
189
211
|
|
|
190
212
|
```bash
|
|
191
213
|
siluzan-tso ad adgroup-status -a <mediaCustomerId> --id <adGroupId> --status Paused
|
|
@@ -193,8 +215,6 @@ siluzan-tso ad adgroup-status -a <mediaCustomerId> --id <adGroupId> --status Pau
|
|
|
193
215
|
siluzan-tso ad ad-status -a <mediaCustomerId> --id <adId> --status Paused
|
|
194
216
|
```
|
|
195
217
|
|
|
196
|
-
(`ad-status` 若需 `--start`/`--end` 见 `references/google-ads/google-ads.md`。)
|
|
197
|
-
|
|
198
218
|
### 通知(宿主)
|
|
199
219
|
|
|
200
220
|
调用组织规定的 **P1** 通道(钉钉/飞书/Slack 等),标题或正文须含 **「空耗熔断」** 及 `mediaCustomerId`、对象类型、对象 `id`、当次 `spend` / 阈值。
|
|
@@ -203,16 +223,16 @@ siluzan-tso ad ad-status -a <mediaCustomerId> --id <adId> --status Paused
|
|
|
203
223
|
|
|
204
224
|
```bash
|
|
205
225
|
siluzan-tso ad groups -a <mediaCustomerId> --start <当日> --end <当日> --json-out ./snap
|
|
206
|
-
# 或 ad list …
|
|
207
226
|
```
|
|
208
227
|
|
|
209
228
|
确认对应 **`statusV2`** 为 **`Paused`**。
|
|
210
229
|
|
|
211
230
|
### CLI 能力摘要
|
|
212
231
|
|
|
213
|
-
| 状态 | 说明
|
|
214
|
-
| ---- |
|
|
215
|
-
|
|
|
232
|
+
| 状态 | 说明 |
|
|
233
|
+
| ---- | ---- |
|
|
234
|
+
| 首选 | `guard zero-conv -m Google` |
|
|
235
|
+
| 单户 | 读:`ad groups` / `ad list`;写:`adgroup-status` / `ad-status`;通知:宿主 |
|
|
216
236
|
|
|
217
237
|
---
|
|
218
238
|
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
|
|
15
15
|
## 预算与 ROI 自控
|
|
16
16
|
|
|
17
|
-
| 场景 | 自动动作(摘要) | SOP
|
|
18
|
-
| ---- | ---------------- |
|
|
19
|
-
| 单日预算熔断 | 当日花费相对日预算达阈值 → 暂停系列 | `references/operations/hosted-automation-self-control.md` |
|
|
17
|
+
| 场景 | 自动动作(摘要) | 首选 CLI / SOP(只读一份) |
|
|
18
|
+
| ---- | ---------------- | -------------------------- |
|
|
19
|
+
| 单日预算熔断 | 当日花费相对日预算达阈值 → 暂停系列 | **首选** `references/operations/guard.md`(`guard budget-circuit`);细节/单户排障见 `hosted-automation-self-control.md` |
|
|
20
20
|
| CPA 飙升自动降价 | 窗内 CPA 超目标 → 下调出价上限 | `references/operations/hosted-automation-optimize-weak-downbid.md` |
|
|
21
|
-
| 连续空耗自动暂停 | 当日花费达阈值且 0 转化 → 暂停组/创意;宿主发 **告警P1**「空耗熔断」 | `references/operations/hosted-automation-self-control.md` |
|
|
21
|
+
| 连续空耗自动暂停 | 当日花费达阈值且 0 转化 → 暂停组/创意;宿主发 **告警P1**「空耗熔断」 | **首选** `references/operations/guard.md`(`guard zero-conv`);细节见 `hosted-automation-self-control.md` |
|
|
22
22
|
|
|
23
|
-
> **消耗 ≠ 日消耗**:`spend` 为 `--start`~`--end`
|
|
23
|
+
> **消耗 ≠ 日消耗**:`spend` 为 `--start`~`--end` 合计。`guard` 命令已强制 `--date` 单日;手写 `ad campaigns` 时须 `start=end=当日`。续航日均用 `balance-scan.dailySpend`。
|
|
24
24
|
|
|
25
25
|
## 异常监控
|
|
26
26
|
|
|
@@ -67,10 +67,10 @@ siluzan-tso bing-analysis render \
|
|
|
67
67
|
|
|
68
68
|
`render` 传 `--snapshot-dir` 时,CLI 自动补全:
|
|
69
69
|
|
|
70
|
-
1. `meta
|
|
71
|
-
2. `tables
|
|
70
|
+
1. `meta`(仅补空字段)
|
|
71
|
+
2. **`kpis` / `tables.*` 一律以 CLI 快照覆盖**(有对应 section 时;本期 KPI 优先 campaigns 累加)——数值口径不以 Agent 预填为准
|
|
72
72
|
|
|
73
|
-
Agent 只需撰写 `narrative`;**禁止手写 HTML
|
|
73
|
+
Agent 只需撰写 `narrative`;**禁止手写 HTML**,也**禁止**自填 `kpis`/`tables` 数值(尤其 `ctr` 须为 CLI 落盘的 0~1 小数)。
|
|
74
74
|
|
|
75
75
|
---
|
|
76
76
|
|
|
@@ -53,7 +53,7 @@ siluzan-tso google-analysis render \
|
|
|
53
53
|
模板源码:`report-templates/google-period-report.html`(结构与样式,ECharts 渲染逻辑已内联)。
|
|
54
54
|
|
|
55
55
|
`render` 会向输出目录写入 HTML,并注入 `window.__GOOGLE_PERIOD_REPORT__`。
|
|
56
|
-
传 `--snapshot-dir` 时 CLI 自动从快照合并 KPI
|
|
56
|
+
传 `--snapshot-dir` 时 CLI 自动从快照合并 KPI、每日趋势图表、周期汇总/系列/设备/地域/关键词表格:**数值一律以 CLI 快照覆盖**(`meta` 仅补空)。本期 KPI 优先 `campaigns` 累加;Agent 只写 `narrative`,勿自填 `kpis`/`tables`。
|
|
57
57
|
|
|
58
58
|
---
|
|
59
59
|
|
|
@@ -24,7 +24,7 @@ siluzan-tso facebook-analysis -a <id> --start <s> --end <e> --json-out ./snap-fb
|
|
|
24
24
|
| **3. 写 JSON** | Agent | 撰写 `meta-account-diagnosis-report.json`:仅 `meta.accountId` + `narrative` 为必填;`kpis`/`tables` 可省略,由 `--snapshot-dir` 自动合并 |
|
|
25
25
|
| **4. 渲染 HTML** | CLI | `facebook-analysis diagnosis-render` — **校验 narrative 11 个分析小节必含字段**(4 个媒体未覆盖小节可标 `notAvailable`),缺项报错不生成 HTML;**禁止** Agent 手写/拼接 HTML |
|
|
26
26
|
|
|
27
|
-
> `--snapshot-dir` 自动补全 `meta` / `kpis`(仅 overview;**禁止**用 ad-sets/creative 行 results 加总对比 overview)与 `tables.*`(按 `facebook-analysis-guide.md`:`adGroups`/`networks`/`countries`/`audiences`/`creatives`/`materials
|
|
27
|
+
> `--snapshot-dir` 自动补全 `meta` / `kpis`(仅 overview;**禁止**用 ad-sets/creative 行 results 加总对比 overview)与 `tables.*`(按 `facebook-analysis-guide.md`:`adGroups`/`networks`/`countries`/`audiences`/`creatives`/`materials`)。**数值一律以 CLI 快照覆盖**(`meta` 仅补空)。
|
|
28
28
|
|
|
29
29
|
### JSON 契约(`meta-account-diagnosis-report.json`)
|
|
30
30
|
|
|
@@ -34,7 +34,7 @@ siluzan-tso facebook-analysis render \
|
|
|
34
34
|
--out ./meta-period-report.html
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
`--snapshot-dir` 与步骤 1 的 `--json-out` 同目录;CLI 自动合并 KPI
|
|
37
|
+
`--snapshot-dir` 与步骤 1 的 `--json-out` 同目录;CLI 自动合并 KPI、平台/国家/受众图表与表格(**数值一律以 CLI 快照覆盖**;`meta` 仅补空)。
|
|
38
38
|
|
|
39
39
|
---
|
|
40
40
|
|
|
@@ -66,7 +66,7 @@ siluzan-tso facebook-analysis render \
|
|
|
66
66
|
- `report-templates/meta-period-report.runtime.js` — 可选外链运行时(逻辑已内联于 HTML;ECharts 渲染 + 章节 DOM 拼装)
|
|
67
67
|
|
|
68
68
|
`render` 会向输出目录写入 HTML + `meta-period-report.runtime.js`,并注入 `window.__META_PERIOD_REPORT__`。
|
|
69
|
-
传 `--snapshot-dir` 时 CLI 自动从快照合并 KPI
|
|
69
|
+
传 `--snapshot-dir` 时 CLI 自动从快照合并 KPI、平台/国家/受众图表数据、广告组与受众表格(**数值以 CLI 为准**,覆盖 Agent 预填)。
|
|
70
70
|
|
|
71
71
|
---
|
|
72
72
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
| **3. 写 JSON** | Agent | 撰写 `tiktok-period-report.json`:仅 `meta.accountId` + `narrative` 为必填;`kpis`/`tables` 可省略,由 `--snapshot-dir` 按网关类型自动合并 |
|
|
19
19
|
| **4. 渲染 HTML** | CLI | `tiktok-analysis render` — **校验 narrative 6 个分析小节必含字段**,缺项报错不生成 HTML;**禁止** Agent 手写/拼接 HTML |
|
|
20
20
|
|
|
21
|
-
> `--snapshot-dir` 自动补全 `meta` / `kpis` / `tables.*`。网关形状见 `src/types/tiktok-analysis-api.ts`(对齐前端 `periodReport/tiktok.js`):`campaigns` 为 `{ campaigns:[] }`;ad-groups/videos/audience 为 `{ data.list[].metrics }`(snake_case);ads 为根数组。**本期 KPI 优先 campaigns
|
|
21
|
+
> `--snapshot-dir` 自动补全 `meta` / `kpis` / `tables.*`。网关形状见 `src/types/tiktok-analysis-api.ts`(对齐前端 `periodReport/tiktok.js`):`campaigns` 为 `{ campaigns:[] }`;ad-groups/videos/audience 为 `{ data.list[].metrics }`(snake_case);ads 为根数组。**本期 KPI 优先 campaigns 累加**。**数值一律以 CLI 快照覆盖**(`meta` 仅补空);Agent 只写 `narrative`。
|
|
22
22
|
|
|
23
23
|
### JSON 契约(`tiktok-period-report.json`)
|
|
24
24
|
|
|
@@ -67,10 +67,10 @@ siluzan-tso bing-analysis render \
|
|
|
67
67
|
|
|
68
68
|
`render` 传 `--snapshot-dir` 时,CLI 自动补全:
|
|
69
69
|
|
|
70
|
-
1. `meta
|
|
71
|
-
2. `tables
|
|
70
|
+
1. `meta`(仅补空字段)
|
|
71
|
+
2. **`kpis` / `tables.*` 一律以 CLI 快照覆盖**(有对应 section 时;本期 KPI 优先 campaigns 累加)——数值口径不以 Agent 预填为准
|
|
72
72
|
|
|
73
|
-
Agent 只需撰写 `narrative`;**禁止手写 HTML
|
|
73
|
+
Agent 只需撰写 `narrative`;**禁止手写 HTML**,也**禁止**自填 `kpis`/`tables` 数值(尤其 `ctr` 须为 CLI 落盘的 0~1 小数)。
|
|
74
74
|
|
|
75
75
|
---
|
|
76
76
|
|
|
@@ -53,7 +53,7 @@ siluzan-tso google-analysis render \
|
|
|
53
53
|
模板源码:`report-templates/google-period-report.html`(结构与样式,ECharts 渲染逻辑已内联)。
|
|
54
54
|
|
|
55
55
|
`render` 会向输出目录写入 HTML,并注入 `window.__GOOGLE_PERIOD_REPORT__`。
|
|
56
|
-
传 `--snapshot-dir` 时 CLI 自动从快照合并 KPI
|
|
56
|
+
传 `--snapshot-dir` 时 CLI 自动从快照合并 KPI、每日趋势图表、周期汇总/系列/设备/地域/关键词表格:**数值一律以 CLI 快照覆盖**(`meta` 仅补空)。本期 KPI 优先 `campaigns` 累加;Agent 只写 `narrative`,勿自填 `kpis`/`tables`。
|
|
57
57
|
|
|
58
58
|
---
|
|
59
59
|
|
|
@@ -24,7 +24,7 @@ siluzan-tso facebook-analysis -a <id> --start <s> --end <e> --json-out ./snap-fb
|
|
|
24
24
|
| **3. 写 JSON** | Agent | 撰写 `meta-account-diagnosis-report.json`:仅 `meta.accountId` + `narrative` 为必填;`kpis`/`tables` 可省略,由 `--snapshot-dir` 自动合并 |
|
|
25
25
|
| **4. 渲染 HTML** | CLI | `facebook-analysis diagnosis-render` — **校验 narrative 11 个分析小节必含字段**(4 个媒体未覆盖小节可标 `notAvailable`),缺项报错不生成 HTML;**禁止** Agent 手写/拼接 HTML |
|
|
26
26
|
|
|
27
|
-
> `--snapshot-dir` 自动补全 `meta` / `kpis`(仅 overview;**禁止**用 ad-sets/creative 行 results 加总对比 overview)与 `tables.*`(按 `facebook-analysis-guide.md`:`adGroups`/`networks`/`countries`/`audiences`/`creatives`/`materials
|
|
27
|
+
> `--snapshot-dir` 自动补全 `meta` / `kpis`(仅 overview;**禁止**用 ad-sets/creative 行 results 加总对比 overview)与 `tables.*`(按 `facebook-analysis-guide.md`:`adGroups`/`networks`/`countries`/`audiences`/`creatives`/`materials`)。**数值一律以 CLI 快照覆盖**(`meta` 仅补空)。
|
|
28
28
|
|
|
29
29
|
### JSON 契约(`meta-account-diagnosis-report.json`)
|
|
30
30
|
|
|
@@ -34,7 +34,7 @@ siluzan-tso facebook-analysis render \
|
|
|
34
34
|
--out ./meta-period-report.html
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
`--snapshot-dir` 与步骤 1 的 `--json-out` 同目录;CLI 自动合并 KPI
|
|
37
|
+
`--snapshot-dir` 与步骤 1 的 `--json-out` 同目录;CLI 自动合并 KPI、平台/国家/受众图表与表格(**数值一律以 CLI 快照覆盖**;`meta` 仅补空)。
|
|
38
38
|
|
|
39
39
|
---
|
|
40
40
|
|
|
@@ -66,7 +66,7 @@ siluzan-tso facebook-analysis render \
|
|
|
66
66
|
- `report-templates/meta-period-report.runtime.js` — 可选外链运行时(逻辑已内联于 HTML;ECharts 渲染 + 章节 DOM 拼装)
|
|
67
67
|
|
|
68
68
|
`render` 会向输出目录写入 HTML + `meta-period-report.runtime.js`,并注入 `window.__META_PERIOD_REPORT__`。
|
|
69
|
-
传 `--snapshot-dir` 时 CLI 自动从快照合并 KPI
|
|
69
|
+
传 `--snapshot-dir` 时 CLI 自动从快照合并 KPI、平台/国家/受众图表数据、广告组与受众表格(**数值以 CLI 为准**,覆盖 Agent 预填)。
|
|
70
70
|
|
|
71
71
|
---
|
|
72
72
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
| **3. 写 JSON** | Agent | 撰写 `tiktok-period-report.json`:仅 `meta.accountId` + `narrative` 为必填;`kpis`/`tables` 可省略,由 `--snapshot-dir` 按网关类型自动合并 |
|
|
19
19
|
| **4. 渲染 HTML** | CLI | `tiktok-analysis render` — **校验 narrative 6 个分析小节必含字段**,缺项报错不生成 HTML;**禁止** Agent 手写/拼接 HTML |
|
|
20
20
|
|
|
21
|
-
> `--snapshot-dir` 自动补全 `meta` / `kpis` / `tables.*`。网关形状见 `src/types/tiktok-analysis-api.ts`(对齐前端 `periodReport/tiktok.js`):`campaigns` 为 `{ campaigns:[] }`;ad-groups/videos/audience 为 `{ data.list[].metrics }`(snake_case);ads 为根数组。**本期 KPI 优先 campaigns
|
|
21
|
+
> `--snapshot-dir` 自动补全 `meta` / `kpis` / `tables.*`。网关形状见 `src/types/tiktok-analysis-api.ts`(对齐前端 `periodReport/tiktok.js`):`campaigns` 为 `{ campaigns:[] }`;ad-groups/videos/audience 为 `{ data.list[].metrics }`(snake_case);ads 为根数组。**本期 KPI 优先 campaigns 累加**。**数值一律以 CLI 快照覆盖**(`meta` 仅补空);Agent 只写 `narrative`。
|
|
22
22
|
|
|
23
23
|
### JSON 契约(`tiktok-period-report.json`)
|
|
24
24
|
|
|
@@ -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.
|
|
12
|
+
$PKG_VERSION = '1.1.40-beta.2'
|
|
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.
|
|
12
|
+
readonly PKG_VERSION="1.1.40-beta.2"
|
|
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
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "guard-budget-circuit-all-google",
|
|
3
|
+
"description": "全户 Google 超预算熔断 — 必须用 guard budget-circuit,禁止逐户 ad campaigns for-loop",
|
|
4
|
+
"turns": [
|
|
5
|
+
"检查我名下的所有广告账户下所有广告系列的当日花费。如果某个系列的当日花费达到其日预算的 110% 以上,先列出被命中的系列名称、当日花费和日预算(先不要暂停)。用 siluzan-tso,JSON 落盘。这是定时任务,直接执行。"
|
|
6
|
+
],
|
|
7
|
+
"judgeExpectation": "路径:用户要求检查名下所有账户系列当日花费相对日预算达 110% 并列出/暂停时,应执行 `siluzan-tso guard budget-circuit -m Google`(可带 --date/--ratio/--json-out),**不要**对六媒体 list-accounts 后再逐户 `ad campaigns`。\n默认 dry-run 即可交付命中表;未获确认前可不加 --apply。输出须收口(命中列表或明确无命中)。",
|
|
8
|
+
"skillMapping": "references/operations/guard.md · budget-circuit",
|
|
9
|
+
"judgeReferencePaths": [
|
|
10
|
+
"references/operations/guard.md",
|
|
11
|
+
"references/operations/hosted-automation-user-catalog.md"
|
|
12
|
+
],
|
|
13
|
+
"commandMustInclude": [
|
|
14
|
+
[
|
|
15
|
+
"guard",
|
|
16
|
+
"budget-circuit"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"--json-out"
|
|
20
|
+
]
|
|
21
|
+
],
|
|
22
|
+
"commandMustNotInclude": [
|
|
23
|
+
"ad campaigns -m"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "guard-zero-conv-empty-spend",
|
|
3
|
+
"description": "空耗熔断扫描 — 必须用 guard zero-conv",
|
|
4
|
+
"turns": [
|
|
5
|
+
"检查我名下的所有广告账户的当日数据。对于当日累计花费已达到目标 CPA 3 倍以上、但转化数为 0 的广告组,先列出(标注「空耗熔断」),先不要暂停。用 siluzan-tso,JSON 落盘,直接执行。"
|
|
6
|
+
],
|
|
7
|
+
"judgeExpectation": "路径:用户要求空耗熔断(当日花费 ≥ 目标 CPA × 3 且转化 0)时,应执行 `siluzan-tso guard zero-conv -m Google`(--cpa-multiple 3、--json-out),结果摘要应体现「空耗熔断」。\n默认 dry-run;未确认前可不 --apply。禁止逐户 for-loop `ad groups`。",
|
|
8
|
+
"skillMapping": "references/operations/guard.md · zero-conv",
|
|
9
|
+
"judgeReferencePaths": [
|
|
10
|
+
"references/operations/guard.md"
|
|
11
|
+
],
|
|
12
|
+
"commandMustInclude": [
|
|
13
|
+
[
|
|
14
|
+
"guard",
|
|
15
|
+
"zero-conv"
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
"--json-out"
|
|
19
|
+
]
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "ir-p8-meets-google-ads-requirements-with-url",
|
|
3
|
+
"description": "是否符合 Google 广告投放要求 + URL — 须 P8 website-diagnosis,禁止 W3/WebFetch 当终稿",
|
|
4
|
+
"turns": [
|
|
5
|
+
"请诊断网站 https://www.siluzan.com 是否符合 Google 广告投放要求"
|
|
6
|
+
],
|
|
7
|
+
"judgeExpectation": "路径:「诊断网站 / 是否符合 Google 广告投放要求」+ URL → 必须 P8;须执行 `website-diagnosis collect --url` 且带 --json-out。\n禁止:因带「Google 广告」改走 W3 campaign-validate/create;禁止只用 WebFetch/浏览器看页写结论代替 CLI。\n输出:说明 collect → prepare → render HTML。",
|
|
8
|
+
"skillMapping": "references/core/intent-routing.md · §零 · P8",
|
|
9
|
+
"judgeReferencePaths": [
|
|
10
|
+
"references/core/intent-routing.md",
|
|
11
|
+
"references/core/playbooks.md",
|
|
12
|
+
"analytics/website-diagnosis-guide.md"
|
|
13
|
+
],
|
|
14
|
+
"commandMustInclude": [
|
|
15
|
+
[
|
|
16
|
+
"website-diagnosis"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"collect"
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
"--url"
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
"--json-out"
|
|
26
|
+
]
|
|
27
|
+
],
|
|
28
|
+
"commandMustNotInclude": [
|
|
29
|
+
[
|
|
30
|
+
"campaign-validate"
|
|
31
|
+
],
|
|
32
|
+
[
|
|
33
|
+
"campaign-create"
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"market-analysis"
|
|
37
|
+
]
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "siluzan-tso-snapshot-summary",
|
|
3
|
+
"section": "guard-budget-circuit",
|
|
4
|
+
"commandLabel": "guard budget-circuit",
|
|
5
|
+
"ok": true,
|
|
6
|
+
"meta": {
|
|
7
|
+
"media": "Google",
|
|
8
|
+
"date": "2026-07-28",
|
|
9
|
+
"ratio": 1.1,
|
|
10
|
+
"apply": false,
|
|
11
|
+
"stub": true
|
|
12
|
+
},
|
|
13
|
+
"summary": {
|
|
14
|
+
"label": "超预算熔断",
|
|
15
|
+
"accountCount": 1,
|
|
16
|
+
"checkedCampaigns": 2,
|
|
17
|
+
"hitCount": 1,
|
|
18
|
+
"pausedCount": 0,
|
|
19
|
+
"errorCount": 0,
|
|
20
|
+
"mode": "dry-run"
|
|
21
|
+
},
|
|
22
|
+
"hits": [
|
|
23
|
+
{
|
|
24
|
+
"mediaCustomerId": "4256317784",
|
|
25
|
+
"campaignId": "111",
|
|
26
|
+
"campaignName": "stub-over-budget",
|
|
27
|
+
"spend": 120,
|
|
28
|
+
"budget": 100,
|
|
29
|
+
"ratio": 1.1,
|
|
30
|
+
"threshold": 110,
|
|
31
|
+
"applied": false
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"paused": [],
|
|
35
|
+
"errors": []
|
|
36
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "siluzan-tso-snapshot-summary",
|
|
3
|
+
"section": "guard-zero-conv",
|
|
4
|
+
"commandLabel": "guard zero-conv",
|
|
5
|
+
"ok": true,
|
|
6
|
+
"meta": {
|
|
7
|
+
"media": "Google",
|
|
8
|
+
"date": "2026-07-28",
|
|
9
|
+
"cpaMultiple": 3,
|
|
10
|
+
"level": "adgroup",
|
|
11
|
+
"apply": false,
|
|
12
|
+
"stub": true
|
|
13
|
+
},
|
|
14
|
+
"summary": {
|
|
15
|
+
"label": "空耗熔断",
|
|
16
|
+
"accountCount": 1,
|
|
17
|
+
"checkedObjects": 2,
|
|
18
|
+
"hitCount": 1,
|
|
19
|
+
"pausedCount": 0,
|
|
20
|
+
"skippedCount": 0,
|
|
21
|
+
"errorCount": 0,
|
|
22
|
+
"mode": "dry-run"
|
|
23
|
+
},
|
|
24
|
+
"hits": [
|
|
25
|
+
{
|
|
26
|
+
"mediaCustomerId": "4256317784",
|
|
27
|
+
"level": "adgroup",
|
|
28
|
+
"objectId": "222",
|
|
29
|
+
"objectName": "stub-zero-conv-group",
|
|
30
|
+
"spend": 300,
|
|
31
|
+
"conversions": 0,
|
|
32
|
+
"targetCpaYuan": 100,
|
|
33
|
+
"multiple": 3,
|
|
34
|
+
"threshold": 300,
|
|
35
|
+
"applied": false
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"paused": [],
|
|
39
|
+
"skipped": [],
|
|
40
|
+
"errors": []
|
|
41
|
+
}
|