siluzan-tso-cli 1.1.36 → 1.1.37-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.
Files changed (32) hide show
  1. package/README.md +2 -1
  2. package/dist/index.js +2860 -746
  3. package/dist/skill/_meta.json +2 -2
  4. package/dist/skill/assets/google-period-report.schema.json +226 -0
  5. package/dist/skill/assets/pmax-create-template.md +7 -1
  6. package/dist/skill/references/accounts/accounts.md +3 -3
  7. package/dist/skill/references/accounts/finance.md +1 -1
  8. package/dist/skill/references/accounts/open-account-by-media.md +1 -1
  9. package/dist/skill/references/accounts/open-account-google-ui.md +1 -1
  10. package/dist/skill/references/analytics/rag.md +1 -1
  11. package/dist/skill/references/analytics/reporting.md +5 -5
  12. package/dist/skill/references/core/setup.md +5 -5
  13. package/dist/skill/references/misc/tso-home.md +2 -2
  14. package/dist/skill/references/report-templates/README.md +14 -14
  15. package/dist/skill/references/report-templates/REPORT-WORKFLOW.md +23 -15
  16. package/dist/skill/references/report-templates/bing-period-report.md +89 -23
  17. package/dist/skill/references/report-templates/google-period-report.md +55 -5
  18. package/dist/skill/references/report-templates/meta-account-diagnosis-report.md +144 -16
  19. package/dist/skill/references/report-templates/tiktok-period-report.md +112 -7
  20. package/dist/skill/report-templates/README.md +14 -14
  21. package/dist/skill/report-templates/REPORT-WORKFLOW.md +23 -15
  22. package/dist/skill/report-templates/bing-period-report.html +1343 -0
  23. package/dist/skill/report-templates/bing-period-report.md +89 -23
  24. package/dist/skill/report-templates/google-period-report.html +1314 -0
  25. package/dist/skill/report-templates/google-period-report.md +55 -5
  26. package/dist/skill/report-templates/meta-account-diagnosis-report.html +1124 -0
  27. package/dist/skill/report-templates/meta-account-diagnosis-report.md +144 -16
  28. package/dist/skill/report-templates/tiktok-period-report.html +1111 -0
  29. package/dist/skill/report-templates/tiktok-period-report.md +112 -7
  30. package/dist/skill/scripts/install.ps1 +3 -3
  31. package/dist/skill/scripts/install.sh +3 -3
  32. package/package.json +1 -1
@@ -3,7 +3,57 @@
3
3
  > 统计区间:`{startDate}` ~ `{endDate}`
4
4
  > 账户:`{mediaCustomerId}`
5
5
 
6
- > **用户明确要求 Excel / xlsx**(且非 OKKI / 询盘话术)时:在拉数步骤不变的前提下,**另 Read 全文** `report-templates/google-period-report-excel.md`,并**先读齐**各维度 `*.outline.txt` 再写脚本;禁止加载宿主第三方 xlsx Skill。
6
+ > **默认交付物**:一份可打开的、带 ECharts 图表的 **HTML 文件**(`google-period-report.html`)。
7
+ > 用户**未指定格式**时一律走下方 **标准四步流程**;**禁止** Agent 手写/拼接 HTML(语法错误会导致报告无法显示)。
8
+ > **用户明确要求 Excel / xlsx**(且非 OKKI / 询盘话术)时:在拉数步骤不变的前提下,**另 Read 全文** `report-templates/google-period-report-excel.md`,并**先读齐**各维度 `*.outline.txt` 再写脚本;禁止加载宿主第三方 xlsx Skill;**不要**调用 `google-analysis render`。
9
+
10
+ ---
11
+
12
+ ## 标准四步流程(默认 · 交付 HTML)
13
+
14
+ | 步骤 | 执行者 | 动作 |
15
+ | ---------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
16
+ | **1. 拉数** | Agent 调 CLI | `google-analysis -a <id> --start <s> --end <e> --json-out ./snap-google --sections <见下方默认维度对应 CLI>` |
17
+ | **2. 分析** | Agent | 用 **node/python 脚本**读落盘 JSON(勿用 Read 打开业务 `*.json`),完成筛选、聚合、排序与洞察 |
18
+ | **3. 写 JSON** | Agent | 按 `assets/google-period-report.schema.json` 撰写 `google-period-report.json`:仅 `meta` + `narrative`(8 维度叙事)为必填,`kpis`/`charts`/`tables` 可省略由 CLI 自动合并 |
19
+ | **4. 渲染 HTML** | CLI | `google-analysis render` — **校验 narrative 8 维度必含字段**,缺项报错不生成 HTML;**禁止** Agent 手写/拼接 HTML |
20
+
21
+ ```bash
22
+ # 步骤 1
23
+ siluzan-tso google-analysis -a <id> --start <s> --end <e> --json-out ./snap-google \
24
+ --sections overview,daily-metrics,dimension-summary,campaigns,devices,geographic,keywords
25
+
26
+ # 步骤 4(步骤 2~3 完成后)
27
+ siluzan-tso google-analysis render \
28
+ --data ./google-period-report.json \
29
+ --snapshot-dir ./snap-google \
30
+ --out ./google-period-report.html
31
+ ```
32
+
33
+ `google-period-report.json` 顶层结构:
34
+
35
+ - `meta`:`accountId`(必填)/ `accountName` / `currency` / `startDate` / `endDate`;可省略由 `--snapshot-dir` 从 `overview` + manifest 自动合并。
36
+ - `kpis`:账户级 KPI(消耗/展示/点击/转化/CTR/CPC/CPA,含可选 `previousPeriod` 环比);可省略。本期 KPI 由 CLI 优先对 `campaigns` 全系列累加并重算比率(规避 overview/stats 相对 Google API 延迟);无 campaigns 快照时回退 `overview.currentPeriod`。环比仍来自 `overview.previousPeriod`。
37
+ - `charts.dailyTrend`:每日趋势(`dates`/`cost`/`conversions`/`cpa`);可省略由 `daily-metrics` 自动合并。
38
+ - `tables.{dimensionSummary,campaigns,devices,geographic,keywords}`:对应 §3~§7 表格数据;可省略由同名 `google-analysis` section 自动合并。
39
+ - `narrative`(**Agent 必填,唯一由 Agent 撰写的内容**):
40
+ - `executiveSummary[]`:≥1 段执行摘要
41
+ - `sections.{overview,dailyTrend,dimensionSummary,campaigns,devices,geographic,keywords}`:每个维度各 `{analysis[](≥2 条), suggestions[](≥1 条)}`,对应报告 §1~§7
42
+ - `recommendations[]`:≥3 条跨维度优化建议,对应报告 §8
43
+
44
+ 完整字段定义见 `assets/google-period-report.schema.json`。
45
+
46
+ **Excel 分支**(用户明确要 xlsx 时):
47
+
48
+ 1. 步骤 1~2 与 HTML 流程相同(拉数 → 分析)。
49
+ 2. 改为 Agent 执行 node/python 脚本按 `google-period-report-excel.md` 写出 `.xlsx`(先读齐 `*.outline.txt`)。
50
+ 3. **不要**调用 `google-analysis render`(除非用户同时要 HTML + Excel)。
51
+ 4. **禁止**假设存在 `siluzan-tso … excel` 子命令。
52
+
53
+ 模板源码:`report-templates/google-period-report.html`(结构与样式,ECharts 渲染逻辑已内联)。
54
+
55
+ `render` 会向输出目录写入 HTML,并注入 `window.__GOOGLE_PERIOD_REPORT__`。
56
+ 传 `--snapshot-dir` 时 CLI 自动从快照合并 KPI、每日趋势图表、周期汇总/系列/设备/地域/关键词表格(Agent JSON 中已有字段不覆盖)。本期 KPI 优先 `campaigns` 累加,勿用延迟的 `stats`/overview 手工填账户级消耗。
7
57
 
8
58
  ---
9
59
 
@@ -65,9 +115,9 @@ siluzan-tso google-analysis -a <id> --start <s> --end <e> --json-out ./snap-goog
65
115
 
66
116
  `campaigns-*.json` → `items[]` 每行含 CLI 注入的 **`campaignStatusDisplay`**(`投放中` / `已暂停` / `已移除`)。
67
117
 
68
- | 正确 | 错误 |
69
- | ---- | ---- |
70
- | 直接展示 `row.campaignStatusDisplay` | 读 `campaignStatus` 后自行 `MAP[s] \|\| '已移除'`(`Enabled` 未命中键时会全变「已移除」) |
71
- | 需要英文枚举时读 `campaignStatus` 或 `campaignStatusV2`,展示前 `.upper()` 再映射 | 用 `stats` / `list-accounts` 的账户 `status` 充当系列状态 |
118
+ | 正确 | 错误 |
119
+ | --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
120
+ | 直接展示 `row.campaignStatusDisplay` | 读 `campaignStatus` 后自行 `MAP[s] \|\| '已移除'`(`Enabled` 未命中键时会全变「已移除」) |
121
+ | 需要英文枚举时读 `campaignStatus` 或 `campaignStatusV2`,展示前 `.upper()` 再映射 | 用 `stats` / `list-accounts` 的账户 `status` 充当系列状态 |
72
122
 
73
123
  原始枚举为 PascalCase(`Enabled`),与 `ad campaigns` 的 `statusDisplay`(有效/未投放/已结束使用)口径不同;周期报告「状态」列统一用 **`campaignStatusDisplay`**。