siluzan-tso-cli 1.1.60-beta.2 → 1.1.60

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 (54) hide show
  1. package/README.md +1 -2
  2. package/dist/index.js +999 -256
  3. package/dist/skill/_meta.json +2 -2
  4. package/dist/skill/assets/pmax-patch-campaign-template.json +1 -1
  5. package/dist/skill/references/accounts/accounts-list.md +1 -1
  6. package/dist/skill/references/accounts/accounts-permissions.md +2 -2
  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/agent-conventions.md +10 -0
  13. package/dist/skill/references/core/playbooks.md +12 -11
  14. package/dist/skill/references/core/setup.md +5 -5
  15. package/dist/skill/references/core/workflows.md +1 -1
  16. package/dist/skill/references/google-ads/google-ads-write.md +3 -3
  17. package/dist/skill/references/google-ads/pmax-api.md +4 -4
  18. package/dist/skill/references/misc/tso-home.md +2 -2
  19. package/dist/skill/references/report-templates/README.md +2 -0
  20. package/dist/skill/references/report-templates/bing-period-report.md +2 -0
  21. package/dist/skill/references/report-templates/google-ads-diagnosis.md +2 -0
  22. package/dist/skill/references/report-templates/google-inquiry-analysis.md +11 -0
  23. package/dist/skill/references/report-templates/google-period-report-excel.md +2 -0
  24. package/dist/skill/references/report-templates/google-period-report.md +4 -1
  25. package/dist/skill/references/report-templates/google-quarterly-report.md +2 -0
  26. package/dist/skill/references/report-templates/market-analysis-report.md +2 -0
  27. package/dist/skill/references/report-templates/meta-account-diagnosis-report.md +2 -0
  28. package/dist/skill/references/report-templates/meta-period-report.md +2 -0
  29. package/dist/skill/references/report-templates/okki-weekly-google-client.md +21 -0
  30. package/dist/skill/references/report-templates/tiktok-period-report.md +2 -0
  31. package/dist/skill/references/report-templates/website-diagnosis-report.md +2 -0
  32. package/dist/skill/references/report-templates/yandex-period-report.md +2 -0
  33. package/dist/skill/report-templates/README.md +2 -0
  34. package/dist/skill/report-templates/bing-period-report.html +16 -3
  35. package/dist/skill/report-templates/bing-period-report.md +2 -0
  36. package/dist/skill/report-templates/google-ads-diagnosis.md +2 -0
  37. package/dist/skill/report-templates/google-inquiry-analysis.md +11 -0
  38. package/dist/skill/report-templates/google-period-report-excel.md +2 -0
  39. package/dist/skill/report-templates/google-period-report.html +35 -6
  40. package/dist/skill/report-templates/google-period-report.md +4 -1
  41. package/dist/skill/report-templates/google-quarterly-report.html +1 -1
  42. package/dist/skill/report-templates/google-quarterly-report.md +2 -0
  43. package/dist/skill/report-templates/market-analysis-report.md +2 -0
  44. package/dist/skill/report-templates/meta-account-diagnosis-report.md +2 -0
  45. package/dist/skill/report-templates/meta-period-report.md +2 -0
  46. package/dist/skill/report-templates/okki-weekly-google-client.md +21 -0
  47. package/dist/skill/report-templates/tiktok-period-report.html +4 -2
  48. package/dist/skill/report-templates/tiktok-period-report.md +2 -0
  49. package/dist/skill/report-templates/website-diagnosis-report.md +2 -0
  50. package/dist/skill/report-templates/yandex-period-report.html +4 -2
  51. package/dist/skill/report-templates/yandex-period-report.md +2 -0
  52. package/dist/skill/scripts/install.ps1 +3 -3
  53. package/dist/skill/scripts/install.sh +3 -3
  54. package/package.json +1 -1
@@ -1,5 +1,7 @@
1
1
  # Google 账户周期报告 — Excel 交付规格
2
2
 
3
+ > **终稿语言**:Sheet 名和表头跟 `meta.lang`。英文终稿用消耗→Spend、展示→Impressions、点击→Clicks、转化→Conversions,不要另起结构。
4
+ >
3
5
  > **适用场景**:用户明确要求 **Google 账户 + 统计区间 + Excel/xlsx**,且**未**使用 OKKI / 询盘固定话术。
4
6
  > **工作流**:**P4**(与 `google-period-report.md` 共用拉数维度;交付形态不同)。
5
7
  > **禁止**:加载宿主「xlsx / Excel」第三方 Skill 代替本流程;**无** CLI 内置写表子命令,须 Agent 脚本(`exceljs` / `xlsx` / `openpyxl`)读落盘 JSON 写 `.xlsx`。
@@ -658,8 +658,37 @@
658
658
 
659
659
  /** 只读 render 注入的 periodChrome,规则与 report-period.ts 相同。 */
660
660
  function periodWord(data, neutral) {
661
- const unit = data && data.periodChrome && data.periodChrome.unit;
662
- return unit === "季度" || unit === "月度" ? unit : neutral;
661
+ const chrome = data && data.periodChrome;
662
+ if (chrome && chrome.unitLabel) return chrome.unitLabel;
663
+ const unit = chrome && chrome.unit;
664
+ return unit || neutral;
665
+ }
666
+
667
+ function reportLang() {
668
+ const lang = (document.documentElement.getAttribute("lang") || "").toLowerCase();
669
+ return lang.indexOf("en") === 0 ? "en" : "zh";
670
+ }
671
+
672
+ function statusText(row) {
673
+ if (reportLang() !== "en") return (row && row.campaignStatusDisplay) || "—";
674
+ const raw = String((row && (row.campaignStatusV2 || row.campaignStatus)) || "").toUpperCase();
675
+ if (raw === "ENABLED") return "Active";
676
+ if (raw === "PAUSED") return "Paused";
677
+ if (raw === "REMOVED") return "Removed";
678
+ if (!raw) return "—";
679
+ return "Unknown";
680
+ }
681
+
682
+ function placeText(row) {
683
+ if (!row) return "—";
684
+ if (reportLang() === "en") return row.countryOrRegion || row.countryNameZh || "—";
685
+ return row.countryNameZh || row.countryOrRegionZh || row.countryOrRegion || "—";
686
+ }
687
+
688
+ function matchText(row) {
689
+ if (!row) return "—";
690
+ if (reportLang() === "en") return row.keywordMatchType || row.matchType || "—";
691
+ return row.keywordMatchTypeZh || row.keywordMatchType || "—";
663
692
  }
664
693
 
665
694
  const PALETTE = [
@@ -902,7 +931,7 @@
902
931
  (r) => `
903
932
  <tr>
904
933
  <td>${escapeHtml(r.campaignName)}</td>
905
- <td>${escapeHtml(r.campaignStatusDisplay || "—")}</td>
934
+ <td>${escapeHtml(statusText(r))}</td>
906
935
  <td>${escapeHtml(r.channelTypeV2 || "—")}</td>
907
936
  <td class="num">${money(r.spend, currency)}</td>
908
937
  <td class="num">${int(r.impressions)}</td>
@@ -981,7 +1010,7 @@
981
1010
  .map(
982
1011
  (r) => `
983
1012
  <tr>
984
- <td>${escapeHtml(r.countryNameZh || r.countryOrRegionZh || r.countryOrRegion || "—")}</td>
1013
+ <td>${escapeHtml(placeText(r))}</td>
985
1014
  <td class="num">${money(r.spend, currency)}</td>
986
1015
  <td class="num">${int(r.impressions)}</td>
987
1016
  <td class="num">${int(r.clicks)}</td>
@@ -1069,7 +1098,7 @@
1069
1098
  (r) => `
1070
1099
  <tr>
1071
1100
  <td>${escapeHtml(r.keyword)}</td>
1072
- <td>${escapeHtml(r.keywordMatchTypeZh || r.keywordMatchType || "—")}</td>
1101
+ <td>${escapeHtml(matchText(r))}</td>
1073
1102
  <td>${escapeHtml(r.campaignName || "—")}</td>
1074
1103
  <td class="num">${money(r.spend, currency)}</td>
1075
1104
  <td class="num">${pct(r.ctr)}</td>
@@ -1341,7 +1370,7 @@
1341
1370
  yAxis: styleAxis({
1342
1371
  type: "category",
1343
1372
  data: top.map(
1344
- (c) => c.countryNameZh || c.countryOrRegionZh || c.countryOrRegion || "—",
1373
+ (c) => placeText(c),
1345
1374
  ),
1346
1375
  axisLabel: { color: AXIS_COLOR, width: 120, overflow: "truncate" },
1347
1376
  splitLine: { show: false },
@@ -3,6 +3,8 @@
3
3
  > 统计区间:`{startDate}` ~ `{endDate}`
4
4
  > 账户:`{mediaCustomerId}`
5
5
 
6
+ > **终稿语言**:叙事跟 `meta.lang`(`zh` 或 `en`),表头用该语言。`render` 必须带 `--lang`。
7
+ >
6
8
  > **默认交付物**:一份可打开的、带 ECharts 图表的 **HTML 文件**(`google-period-report.html`)。
7
9
  > 用户**未指定格式**时一律走下方 **标准四步流程**;**禁止** Agent 手写/拼接 HTML(语法错误会导致报告无法显示)。
8
10
  > **用户明确要求 Excel / xlsx**(且非 OKKI / 询盘话术)时:在拉数步骤不变的前提下,**另 Read 全文** `report-templates/google-period-report-excel.md`,并**先读齐**各维度 `*.outline.txt` 再写脚本;禁止加载宿主第三方 xlsx Skill;**不要**调用 `google-analysis render`。
@@ -27,7 +29,8 @@ siluzan-tso google-analysis -a <id> --start <s> --end <e> --json-out ./snap-goog
27
29
  siluzan-tso google-analysis render \
28
30
  --data ./google-period-report.json \
29
31
  --snapshot-dir ./snap-google \
30
- --out ./google-period-report.html
32
+ --out ./google-period-report.html \
33
+ --lang <zh|en>
31
34
  ```
32
35
 
33
36
  `google-period-report.json` 顶层结构:
@@ -604,7 +604,7 @@
604
604
  const curQ = chrome.current || "本期";
605
605
  const prevQ = chrome.previous || "上期";
606
606
  const nextQ = chrome.next || "下期";
607
- const unit = chrome.unit || "";
607
+ const unit = chrome.unitLabel || chrome.unit || "";
608
608
  const periodHead = unit ? curQ + " " + unit : curQ;
609
609
  document.title = name + " · " + (chrome.reportTitle || "Google 经营报告");
610
610
  document.getElementById("nav-brand").innerHTML = esc(name) + ' · <span>Google Ads</span>';
@@ -1,5 +1,7 @@
1
1
  # Google 季度经营报告
2
2
 
3
+ > **终稿语言**:叙事跟 `meta.lang`(`zh` 或 `en`),表头用该语言。`render` 必须带 `--lang`。
4
+ >
3
5
  > collect 只出事实;Agent 只写 `narrative`;`render` 注入 `google-quarterly-report.html`(大族分页版式 + ECharts)。
4
6
  > **禁止** Read HTML 模板。行业数据不做。展会 / 蜜月期服务页不自动出。新探索(视频 / PMax / 发现 / 展示)全无量则整章隐藏。
5
7
  >
@@ -1,5 +1,7 @@
1
1
  # 战略市场分析报告(交付模板)
2
2
 
3
+ > **终稿语言**:`htmlContent` 正文和 `<html lang>` 跟 `meta.lang`(中文 `zh-CN`,英文 `en`)。`render` 必须带 `--lang`。
4
+ >
3
5
  > **最终交付物**:可打开的 `market-analysis-report.html`。
4
6
  > **质量门禁**:`render` 按 **TSO getMarketReport 原始业务维度** 校验 HTML,缺项失败(非文件大小)。
5
7
 
@@ -1,5 +1,7 @@
1
1
  # Meta(Facebook)账户 — 诊断报告(模板纲要)
2
2
 
3
+ > **终稿语言**:叙事跟 `meta.lang`(`zh` 或 `en`),表头用该语言。`render` 必须带 `--lang`。
4
+ >
3
5
  > 统计区间:`{startDate}` ~ `{endDate}`
4
6
  > 账户:`{mediaCustomerId}`(`{mediaCustomerName}`)
5
7
 
@@ -1,5 +1,7 @@
1
1
  # Meta(Facebook)账户 — 周期分析报告
2
2
 
3
+ > **终稿语言**:叙事跟 `meta.lang`(`zh` 或 `en`),表头用该语言。`render` 必须带 `--lang`。
4
+ >
3
5
  > 统计区间:`{startDate}` ~ `{endDate}`
4
6
  > 账户:`{mediaCustomerId}`(`{mediaCustomerName}`)
5
7
 
@@ -269,6 +269,27 @@ function deviceKind(deviceType) {
269
269
 
270
270
  换行是骨架的一部分。`1`~`5`、`5.1`、`5.2`、`7` 各占一行,行末用中文分号 `;`。`6、优化建议:` 单独一行,下面 **3~5 条**用 ①②③④⑤,每条一行。日期写成 `2026年4月1日-4月7日`(同年可省略结束年份),须与 `--start` / `--end` 对应。
271
271
 
272
+ `meta.lang` 为 `en` 时改用下面这套行首,仍然只替换尖括号里的数字和对象。`okki-render --lang en` 只翻译 Excel 壳,话术仍由 Agent 按这个代码块填写。
273
+
274
+ ```
275
+ Google Ads update for <date range>:
276
+
277
+ 1. Spend: <amount> in total, <amount> per day;
278
+ 2. Impressions and clicks: <impressions> impressions, <clicks> clicks;
279
+ 3. CTR: <CTR%>, <strong / normal / low> (<pick one benchmark from the rules below>);
280
+ 4. Average CPC: <amount>;
281
+ 5. Conversions: <N> website form and chat leads recorded. Direct email and WhatsApp inquiries are not tracked here — please send back the product and country so we can adjust;
282
+ 5.1 Converting keywords: <keyword (N, CPA amount)>;
283
+ 5.2 Converting countries: <country (N, CPA amount)>;
284
+ 6. Recommendations:
285
+ ① <one action naming the object and this run's number>
286
+ ② <same>
287
+ ③ <same>
288
+ 7. Account balance: <amount> (as of this check).
289
+ ```
290
+
291
+ 英文行首必须是:`Google Ads update for`、`1. Spend:`、`2. Impressions and clicks:`、`3. CTR:`、`4. Average CPC:`、`5. Conversions:`、`5.1 Converting keywords:`、`5.2 Converting countries:`、单独一行 `6. Recommendations:`、`7. Account balance:`。
292
+
272
293
  **发出去之前对一下行首**(用户本轮没换格式时,缺一条或改了一个行首都重写这块,不要解释):
273
294
 
274
295
  | 行首 | 必须长这样 |
@@ -641,8 +641,10 @@
641
641
 
642
642
  /** 只读 render 注入的 periodChrome,规则与 report-period.ts 相同。 */
643
643
  function periodWord(data, neutral) {
644
- const unit = data && data.periodChrome && data.periodChrome.unit;
645
- return unit === "季度" || unit === "月度" ? unit : neutral;
644
+ const chrome = data && data.periodChrome;
645
+ if (chrome && chrome.unitLabel) return chrome.unitLabel;
646
+ const unit = chrome && chrome.unit;
647
+ return unit || neutral;
646
648
  }
647
649
 
648
650
  const PALETTE = [
@@ -1,5 +1,7 @@
1
1
  # TikTok 广告主账户 — 周期分析报告(模板纲要)
2
2
 
3
+ > **终稿语言**:叙事跟 `meta.lang`(`zh` 或 `en`),表头用该语言。`render` 必须带 `--lang`。
4
+ >
3
5
  > 统计区间:`{startDate}` ~ `{endDate}`
4
6
  > 账户:`{mediaCustomerId}`(`{mediaCustomerName}`)
5
7
 
@@ -1,5 +1,7 @@
1
1
  # 网站诊断报告
2
2
 
3
+ > **终稿语言**:叙事跟 `meta.lang`(`zh` 或 `en`),表头用该语言。`render` 必须带 `--lang`。
4
+ >
3
5
  > **最终交付物:一份可打开的、带图表的 HTML 文件**(如 `website-diagnosis-report.html`),不是仅 Markdown 摘要。须含:综合得分环、模块雷达图、风险/模块条形图、Lighthouse 对比图(有数据时)。
4
6
  > 数据:`website-diagnosis collect` 落盘 JSON + Agent 按 `assets/website-diagnosis-rules.md` 生成的诊断 JSON
5
7
 
@@ -447,8 +447,10 @@
447
447
 
448
448
  /** 只读 render 注入的 periodChrome,规则与 report-period.ts 相同。 */
449
449
  function periodWord(data, neutral) {
450
- const unit = data && data.periodChrome && data.periodChrome.unit;
451
- return unit === "季度" || unit === "月度" ? unit : neutral;
450
+ const chrome = data && data.periodChrome;
451
+ if (chrome && chrome.unitLabel) return chrome.unitLabel;
452
+ const unit = chrome && chrome.unit;
453
+ return unit || neutral;
452
454
  }
453
455
 
454
456
  const EMPTY_NOTE = "本节暂无数据";
@@ -1,5 +1,7 @@
1
1
  # Yandex Direct — 账户分析报告(模板纲要)
2
2
 
3
+ > **终稿语言**:叙事跟 `meta.lang`(`zh` 或 `en`),表头用该语言。`render` 必须带 `--lang`。
4
+ >
3
5
  > 统计区间:`{startDate}` ~ `{endDate}`(**不能晚于今天**;省略默认近 7 天含今天)
4
6
  > 账户:`{mediaCustomerId}`(如 `porg-xxx`,与 `list-accounts -m Yandex` 一致)
5
7
  > **默认交付物**:一份可打开的 **HTML 文件**(`yandex-period-report.html`,样式对齐开发样例)。封面按日期写成「季度」或「月度」,对不上仍是「账户分析」。不要打开 HTML 改称呼。
@@ -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.60-beta.2'
12
+ $PKG_VERSION = '1.1.60'
13
13
  $CLI_BIN = 'siluzan-tso'
14
14
  $SKILL_LABEL = 'Siluzan TSO'
15
- $INSTALL_CMD = 'npm install -g siluzan-tso-cli@beta'
16
- $WEB_BASE = 'https://www-ci.siluzan.com'
15
+ $INSTALL_CMD = 'npm install -g siluzan-tso-cli'
16
+ $WEB_BASE = 'https://www.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.60-beta.2"
12
+ readonly PKG_VERSION="1.1.60"
13
13
  readonly CLI_BIN="siluzan-tso"
14
14
  readonly SKILL_LABEL="Siluzan TSO"
15
- readonly INSTALL_CMD="npm install -g siluzan-tso-cli@beta"
16
- readonly WEB_BASE="https://www-ci.siluzan.com"
15
+ readonly INSTALL_CMD="npm install -g siluzan-tso-cli"
16
+ readonly WEB_BASE="https://www.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.60-beta.2",
3
+ "version": "1.1.60",
4
4
  "description": "Siluzan 广告账户管理 CLI — 查询账户、余额、消耗数据,管理绑定关系与充值。",
5
5
  "keywords": [
6
6
  "ad-account",